PDA

View Full Version : Toggling between 2D and 3D on the fly.


nabrahamson
02-14-2013, 08:27 AM
Is it possible to switch between having the Quadbuffer functionality turned on and off on the fly while running a vizard script?

farshizzo
02-15-2013, 10:09 AM
Yes, you can use the viz.MainWindow.stereo command to change the stereo mode at runtime. Here is a sample script that toggle quad buffer stereo using the spacebar:import viz
import vizact
viz.go(viz.QUAD_BUFFER)

viz.add('gallery.osgb')

def ToggleStereo():
if viz.MainWindow.getStereo() & viz.QUAD_BUFFER:
viz.MainWindow.stereo(0)
else:
viz.MainWindow.stereo(viz.QUAD_BUFFER)

vizact.onkeydown(' ',ToggleStereo)

nabrahamson
02-19-2013, 07:42 AM
Thank you. This saved me a bit of time.