View Full Version : Center window & stereo vision
kovitch
02-15-2011, 06:56 AM
Hi, I'm trying to do something like this:
http://i54.tinypic.com/2rfvkgx.png
I'm using the following code to draw the center window:
CenterWindow = viz.addWindow(pos=(0.25,0.75),size=(0.5,0.5))
CenterWindow .visible(0,viz.SCREEN)
However, when I apply the viz.STEREO the stereo is only applied to the viz.MainView. What is the best way to accomplish something like you see in the image?
Regards.
farshizzo
02-15-2011, 09:51 AM
Are you just wanting to display a separate image to each eye? If so, here is a sample script showing how to accomplish this:import viz
viz.go(viz.STEREO_HORZ|viz.FULLSCREEN)
# Create texture quads for each eye
left_quad = viz.addTexQuad(parent=viz.ORTHO)
left_quad.disable(viz.RENDER_RIGHT)
viz.link(viz.CenterCenter,left_quad)
right_quad = viz.addTexQuad(parent=viz.ORTHO)
right_quad.disable(viz.RENDER_LEFT)
viz.link(viz.CenterCenter,right_quad)
# Create texture for each eye
left_texture = viz.addTexture('townhall_L_posz.JPG')
right_texture = viz.addTexture('townhall_R_posz.JPG')
# Apply textures to quads
left_quad.texture(left_texture)
left_quad.setScale(left_texture.getSize())
right_quad.texture(right_texture)
right_quad.setScale(right_texture.getSize())
kovitch
02-15-2011, 10:13 AM
Thanks for your reply! Instead of the image I want to use a camera window, not a static image.
kovitch
02-15-2011, 11:21 AM
All I want to do is something like this:
LeftWindow = viz.addWindow(pos=(0.125,0.75),size=(0.25,0.5))
RightWindow = viz.addWindow(pos=(0.625,0.75),size=(0.25,0.5))
And then disable the MainView. I know that this is impossible, so I'm looking for another way to do this.
It has to work as the image I posted before: A black area and two Viewports. The left view is meant to be shown to the left eye and the right view only to the right eye. The content of these two viewports is meant to be different.
Any tip?
farshizzo
02-15-2011, 11:27 AM
Try the following script:import viz
viz.go()
viz.MainWindow.setView( viz.addView(scene=viz.addScene()) )
LeftWindow = viz.addWindow(pos=(0.125,0.75),size=(0.25,0.5))
LeftWindow.stereo(viz.STEREO_LEFT)
RightWindow = viz.addWindow(pos=(0.625,0.75),size=(0.25,0.5))
RightWindow.stereo(viz.STEREO_RIGHT)
viz.add('gallery.ive')
kovitch
02-15-2011, 11:33 AM
Exactly want I wanted! Thanks very much. :)
vBulletin® v3.8.7, Copyright ©2000-2025, vBulletin Solutions, Inc.