PDA

View Full Version : "Dim lights" on scene


kmkm
06-11-2013, 07:44 AM
Hello,

I'm pretty new to both vizard, python, and programming in general, so any help is greatly appreciated.

I'm creating a task in which the user starts in the center of an invisible torus and had to walk until he collides with the inside edge. On this collision, I need the lights in the scene to dim and text to come up across the screen. Is there a way to do this? Let me know if what I'm asking is unclear.

Thanks!

Jeff
06-11-2013, 10:11 AM
You can change the intensity of lights added in Vizard. In terms of detecting the collision with the torus, are you using desktop navigation or real tracking to move the viewpoint?

The introductory tutorials in the Vizard help are a good place to start if you're new to Python and Vizard. I would also recommend looking at Teacher in a Book, available from our downloads (http://www.worldviz.com/support/download) page. It includes a good example related to lighting a scene and a light demo which allows you to modify the different parameters of lights and immediately see the results.

kmkm
06-11-2013, 12:33 PM
Hi Jeff,

Thanks for the reply.

To answer your first question, I'm using desktop navigation to move the viewpoint. In this task, the view point will start in a random location each time, and the user will be instructed to navigate forward. By placing the viewpoint at the center of the invisible torus, the idea is to allow the user to walk the same distance each time, no matter what direction he/she walks in.

I looked at the Teacher in a Book, looks like there's a lot of helpful stuff. However, the section on lighting doesn't seem to give me what I need - the objects in the scene change lighting, but I need the entire window to dim - as if a semi-transparent screen has dropped over the whole window. Changing the mainview headlamp just adjusts how light falls on the objects, but doesnt't effect the ground or sky.

Does that help clarify what I'm looking for at all?

Thanks!

kmkm
06-12-2013, 08:52 AM
Hi Jeff,

Thanks for the reply. To answer your first question, I am using desktop navigation (mouse or control pad) to move the viewpoint.

In this scenario, the viewpoint starts at a random location each time. I want the viewpoint to be centered inside an invisible torus, so that when the user is instructed to walk forward, he/she will only be able to walk the same distance no matter which direction.

I downloaded the "Teacher in a Book" and although the lighting tutorial was helpful, I'm not sure it gives me what I'm looking for. Turning off the headlamp just changes how light falls on the objects in the view, but doesn't affect the appearance of the ground or sky. When the user collides with the torus, I want the whole window to dim, as if a semi-transparent screen has dropped over everything. I thought about trying to have a wall pop up right in front of the user, but I'm afraid that wont look smooth. Any ideas?

Thanks!

Jeff
06-13-2013, 11:05 AM
You could try fading a quad placed on the screen:
import viz
viz.go()

viz.add('gallery.osgb')

blackScreen = viz.addTexQuad(parent=viz.SCREEN,scale=[100.0]*3,color=viz.BLACK)
blackScreen.alpha(0.0)

vizact.onkeydown(' ',blackScreen.runAction,vizact.fadeTo(0.7,time=2.0 ))

Also take a look at the post process section in the Vizard help. Post process effects are applied to the whole window. You can experiment with built-in effects using the PostProcess.py example script( File -> Quick Open: type 'PostProcess')