WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-14-2013, 08:27 AM
nabrahamson nabrahamson is offline
Member
 
Join Date: Sep 2011
Posts: 36
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?
__________________
Reply With Quote
  #2  
Old 02-15-2013, 10:09 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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)
Reply With Quote
  #3  
Old 02-19-2013, 07:42 AM
nabrahamson nabrahamson is offline
Member
 
Join Date: Sep 2011
Posts: 36
Thank you. This saved me a bit of time.
__________________
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:11 AM.


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