gldraw.py:init()
)
aw.py:draw()
)
gldraw.py:init()
, enable shading via
glShadeModel(GL_FLAT)
gldraw.py:init()
, set up some lights using this
pattern
glLightfv(GL_LIGHT0, GL_POSITION, light0_pos)
glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_col)
where light0_pos
and light0_col
are the light position and color, respectively, e.g.,
light0_pos = [-50.0, 0.0, 0.0, 0.0]
light0_col = [ 0.1, 0.1, 0.7, 0.25]
gldraw.py:init()
, turn on lighting
glEnable(GL_LIGHT0)
glEnable(GL_LIGHTING)
aw.py:draw()
, provide the face normal to OpenGL when
drawing
glNormal3f(self.normals[f][0],
self.normals[f][1],
self.normals[f][2])
glBegin(GL_POLYGON)
for vin in xrange(len(face)):
glVertex3f(self.points[face[vin]-1][0],
self.points[face[vin]-1][1],
self.points[face[vin]-1][2])
glEnd()
n = np.cross(B,A)
instead of
n = np.cross(A,B)
tar.gz
archive of your asg##/ directory, including:
README
file containing
.py
source)
handin
web page