PDA

View Full Version : Simulated video monitor


SuzyQ
05-05-2009, 12:16 PM
I am trying to simulate a monitor in the Vizard 3D environment which includes a portion of the screen which simulates a real-time video of a specific location in the scene. Is this possible? Note that this is not the same as a creating a subwindow since the video must remain on the simulated monitor while the user navigates to various locations within the scene.

farshizzo
05-05-2009, 12:38 PM
Yes, you can use a render node to render the scene to a texture from any arbitrary viewpoint. Then you just apply the texture to any object in the scene. Here is a sample script showing how to do this:import viz
viz.go()

#Create render texture
renderTexture = viz.addRenderTexture()

#Create render node to render texture
renderNode = viz.addRenderNode()
renderNode.attachTexture(renderTexture)
renderNode.setInheritView(False)

#Set position/rotation of render node camera
renderNode.setPosition([0,10,0])
renderNode.setEuler([0,90,0])

#Apply render texture to object in scene
model = viz.add('gallery.ive')
model.texture(renderTexture,node='art04-FACES')

#Link an object to the viewpoint
arrow = viz.add('marker.wrl',scale=(2,2,2))
viewLink = viz.link(viz.MainView,arrow)
viewLink.setPos([None,0,None])
viewLink.setEuler([None,0,0])

#Get the party started
avatar = viz.add('vcc_female.cfg',pos=(0,0,2),euler=(180,0, 0))
avatar.state(5)

SuzyQ
05-05-2009, 12:56 PM
That's exactly what I wanted to do - Thank you.