WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Stereo Setting Example Code (https://forum.worldviz.com/showthread.php?t=4963)

Gladsomebeast 02-27-2014 10:29 AM

Stereo Setting Example Code
 
Just a script exposing stereo settings with slider bars.

Code:

import viz
import vizconfig
import vizdragdrop
import vizshape

viz.go(viz.FULLSCREEN | viz.QUAD_BUFFER) #to enable quad buffer, must be in the start
viz.MainWindow.stereo(viz.ANAGLYPHIC)

#viz.MainWindow.ipd(.06)
#viz.MainWindow.screenDistance(1)
#viz.MainWindow.fov(40)
#viz.MainWindow.fusionDistance(2.5)

#Create a configurable object for stereo settings
bc= vizconfig.BasicConfigurable('stereo')
bc.addChoiceRadioItem('Stereo Format',[('Quad buffer',viz.QUAD_BUFFER), \
                                                                                ('Anaglyphic',viz.ANAGLYPHIC), \
                                                                                ('Side by Side TV',viz.STEREO_3DTV_SIDE_BY_SIDE), \
                                                                                ('Top Bottom TV',viz.STEREO_3DTV_TOP_AND_BOTTOM),\
                                                                                ('Horizontal Stereo for 2 channels',viz.STEREO_HORZ)],\
                                                                                viz.MainWindow.stereo,viz.MainWindow.getStereo)
bc.addFloatRangeItem('Inter-pulilary Distance',[-.5,.5],fset=viz.MainWindow.ipd,fget=viz.MainWindow.getIPD)
bc.addFloatRangeItem('Screen Distance',[0,5],fset=viz.MainWindow.screenDistance,fget=viz.MainWindow.getScreenDistance)
bc.addFloatRangeItem('Field of View Vertical',[10,150],fset=viz.MainWindow.fov,fget=viz.MainWindow.getVerticalFOV)
bc.addFloatRangeItem('Fusion Distance',[.2,10],fset=viz.MainWindow.fusionDistance,fget=viz.MainWindow.getFusionDistance)
vizconfig.register(bc)
vizconfig.getConfigWindow().setWindowVisible(True)

gallery = viz.add('gallery.osgb')

f = viz.add('vcc_female.cfg', pos=[0, 0, 2])
f.state(5)


import vizcam
tracker = vizcam.addPivotNavigate()
tracker.setPosition([0,1.5,0])
viz.link(tracker,viz.MainView)

#load files dropped on me
vizdragdrop.enable()
dropedModel = None
def onDropModelFile(e):
        global dropedModel
        if dropedModel:
                dropedModel.remove()
        else:
                gallery.remove()
                f.remove()
                vizshape.addGrid()
        dropedModel = viz.add(e.filenames[0])
       
vizdragdrop.onDropFile(None,onDropModelFile)



All times are GMT -7. The time now is 09:44 PM.

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