PDA

View Full Version : Lighting for a new Scene


jassel41
11-10-2010, 10:03 AM
Hi,

Can anyone help me set up the lighting for a different scene number? Below is what I have originially.



viz.disable(viz.LIGHTING) # Disables the lighting of the world
viz.collision(viz.ON)
viz.phys.enable() # Needed to catch collision events

# Adding object
obj = viz.add(object, viz.WORLD);
obj2 = viz.add(object, viz.WORLD);

headLight = viz.MainView.getHeadLight()

mylight = viz.addLight(viz.WORLD)
mylight.enable()
mylight.position(0, 100, 0)
mylight.intensity(0.85)



The above code runs fine and the lighting is right, but if I make it so obj and obj 2 get added to scene 2, then they show up dark. I tried putting mylight in scene 2, but no change.

Any suggestions?

Thank you in advance,
Jassel41

farshizzo
11-10-2010, 07:11 PM
Try adding another light to scene 2.

jassel41
11-10-2010, 09:14 PM
I tried that, any other thoughts on why I can't get it to light correctly in scene 2? This is what I tried:


viz.disable(viz.LIGHTING, 2) # Disables the lighting of the world
viz.collision(viz.ON)
viz.phys.enable() # Needed to catch collision events

# Adding object
obj = viz.add(object, viz.WORLD, 2);
obj2 = viz.add(object, viz.WORLD, 2);

headLight = viz.MainView.getHeadLight()

mylight = viz.addLight(viz.WORLD, 2)
mylight.enable()
mylight.position(0, 100, 0)
mylight.intensity(0.85)


Is there any other way to approach setting up the lighting?