You could create a function that sets a new viewpoint position when the scene changes:
Code:
'''
Press 1 for scene1
Press 2 for scene2
'''
import viz
import vizact
import vizinfo
vizinfo.InfoPanel()
viz.go()
viz.addChild('piazza.osgb')
viz.addChild('dojo.osgb',scene=viz.Scene2)
def changeScene(scene):
viz.MainWindow.setScene(scene)
if scene == viz.Scene1:
viz.MainView.setPosition([0,1.8,0])
else:
viz.MainView.setPosition([0,4,0])
vizact.onkeydown('1',changeScene,viz.Scene1)
vizact.onkeydown('2',changeScene,viz.Scene2)
If you want to change the scene when the viewpoint enters a proximity sensor, you'll need to register a callback function for the
proximity enter event.