View Single Post
  #2  
Old 11-04-2014, 12:12 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,467
In the script that imports the vizconnect config you'll want to get a handle to the display (which includes the viewpoint) and whatever trackers/transports you'll want to set as the parent of the display. Then you can change the display's parent through the code. Here's a simple example:

Code:
import viz
import vizact
import vizconnect

vizconnect.go('vizconnect_config.py')
viz.addChild('piazza.osgb')

keyTracker = vizconnect.getTracker('keyboard')
mouseKeyTracker = vizconnect.getTracker('mouse_and_keyboard_walking')

display = vizconnect.getDisplay()

vizact.onkeydown('1',display.setParent,keyTracker)
vizact.onkeydown('2',display.setParent,mouseKeyTracker)
Reply With Quote