View Single Post
  #1  
Old 08-19-2008, 01:53 PM
michaelrepucci michaelrepucci is offline
Member
 
Join Date: Jul 2008
Posts: 53
lighting and on-the-fly objects

I'm not understanding how to get the correct lighting effects for my on-the-fly objects.

First of all, there are only three types of lights - directional, point, and spot - none of which seem to have an ambient light component. So is ambient light only specified by the material property <node3d>.ambient as set for each on-the-fly object?

Secondly, I can't seem to shut off all lights. If I have the code:
Code:
viz.startlayer(viz.QUADS)
viz.vertexcolor(0.7,0.5,0.5)
viz.vertex([x,y,0])
viz.vertex([-x,y,0])
viz.vertex([-x,-y,0])
viz.vertex([x,-y,0])
square = viz.endlayer()
square.enable(viz.LIGHTING)

headLight = viz.MainView.getHeadLight()
headLight.disable()
I can still see my square, albeit darker than without lighting enabled.

Finally, if I check the various lighting properties of the node:
Code:
print 'square.getAmbient() =', square.getAmbient()
print 'square.getColor() =', square.getColor()
print 'square.getEmissive() =', square.getEmissive()
print 'square.getShininess() =', square.getShininess()
print 'square.getSpecular() =', square.getSpecular()
they're all the same as the vertexcolor I originally set. And if I set any one of these properties (square.ambient, square.color, square.emissive, square.shininess, or square.specular) to something else, it changes them all to the new value. This doesn't make sense to me. Please can somebody explain this?
Reply With Quote