Skip to content

Commit

Permalink
some fixes to Gui and LoadModels
Browse files Browse the repository at this point in the history
  • Loading branch information
paddywwoof committed Jan 13, 2016
1 parent 7c8783c commit 54ca934
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Gui.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/python
from __future__ import absolute_import, division, print_function, unicode_literals
from six import unichr
import math, random, time, traceback, os
import sys
import demo
import pi3d
# use tab for backspace and carriage return for delete
CHARS = {'space':' ', 'BackSpace':'\t', 'DEL':'\r', 'Return':'\n',
chr(263):'\t', chr(330):'\r'}
unichr(263):'\t', unichr(330):'\r'}
"""for some reason these last two are the codes returned by this keyboard
using curses on the raspberry pi (for BackSpace and DEL - you might need
to fine tune this look-up dictionary system
Expand Down
5 changes: 2 additions & 3 deletions LoadModelObj.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
#========================================
# this is a bit of a one off because the texture has transparent parts
# comment out and google to see why it's included here.
from pi3d import opengles, GL_CULL_FACE
opengles.glDisable(GL_CULL_FACE)
pi3d.opengles.glDisable(pi3d.GL_CULL_FACE)
#========================================
# load bump and reflection textures
bumptex = pi3d.Texture("textures/floor_nm.jpg")
shinetex = pi3d.Texture("textures/stars.jpg")
# load model_loadmodel
mymodel = pi3d.Model(file_string='models/teapot.obj', name='teapot', z=4)
mymodel = pi3d.Model(file_string='models/teapot.obj', name='teapot', z=4.0)
mymodel.set_shader(shader)
mymodel.set_normal_shine(bumptex, 16.0, shinetex, 0.5)
# Fetch key presses
Expand Down
9 changes: 3 additions & 6 deletions LoadModelPickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
#========================================
# this is a bit of a one off because the texture has transparent parts
# comment out and google to see why it's included here.
#from pi3d import opengles, GL_CULL_FACE
#opengles.glDisable(GL_CULL_FACE)
from pi3d import opengles, GL_ALPHA_TEST
opengles.glDisable(GL_ALPHA_TEST)
pi3d.opengles.glDisable(pi3d.GL_CULL_FACE)
#========================================

# load model
Expand All @@ -35,10 +32,10 @@
print("exception was {}".format(e))
""" could be IOError for missing file or various errors from trying to
load a file pickled with a different version of python or pickle etc"""
mymodel = pi3d.Model(file_string='models/teapot.obj', name='teapot', z=4.0)
# load bump and reflection textures
# load bump and reflection textures
bumptex = pi3d.Texture("textures/floor_nm.jpg")
shinetex = pi3d.Texture("textures/stars.jpg")
mymodel = pi3d.Model(file_string='models/teapot.obj', name='teapot', z=4.0)
mymodel.set_normal_shine(bumptex, 16.0, shinetex, 0.5)
mymodel.set_shader(shader)

Expand Down
2 changes: 1 addition & 1 deletion demo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import sys
sys.path.insert(1, '/home/pi/pi3d')
sys.path.insert(1, '/home/patrick/pi3d')

0 comments on commit 54ca934

Please sign in to comment.