WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Lighting for a new Scene (https://forum.worldviz.com/showthread.php?t=3073)

jassel41 11-10-2010 10:03 AM

Lighting for a new Scene
 
Hi,

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

Code:


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:

Code:

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?


All times are GMT -7. The time now is 04:09 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC