WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Toggling between 2D and 3D on the fly. (https://forum.worldviz.com/showthread.php?t=4492)

nabrahamson 02-14-2013 08:27 AM

Toggling between 2D and 3D on the fly.
 
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:
Code:

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.


All times are GMT -7. The time now is 08:32 AM.

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