PDA

View Full Version : Link vizconnect display to Viz.mainview


Rob
03-07-2017, 08:29 AM
Hey,

I want to link vizconnect display to viz.mainview so it inherits the same actions as whats being done for the mainview.

However, I cannot figure out how to do this.

vizconnect.go('vizconnect_config.py') ## Vizconnect movement
movement = vizconnect.getTransport('main_transport') ## links movement to the walking transport in viz connect
movement.setMovementSpeed(0) ## set movement speed to 0 for main menu scene
newobject = viz.add('beachball.osgb',scene=viz.Scene2)
newobject.setPosition([.5,50,0])
#viz.link(movement.getNode3d,newobject) ## this links movement but I cannot set a new Y position for the object at all.
#viz.link(vizconnect.getDisplay,viz.MainView) ## does not work either

How would i get it to link to the mainview without messing up anything thats been done?

Jeff
03-07-2017, 08:16 PM
The display has a view associated with it, which is the mainview by default. If you parent the display to a tracker or transport the view will move with that tracker or transport. If you don't need to change the hierarchy on the fly then you can set the display's parent in the scenegraph of the vizconnect GUI.