WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-21-2015, 11:59 AM
BSUGeek BSUGeek is offline
Member
 
Join Date: Oct 2014
Posts: 23
Question Changing scenes with proximity sensors

Hi is there a way to change your viewpoint position when changing from one scene to another? also I'm trying to change a scene once the viewpoint goes into a proximity sensor. How would I go about doing that?
Reply With Quote
  #2  
Old 03-24-2015, 01:10 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Orientation selective (Viewing Vector) Proximity Sensor lmGehrke Vizard 2 03-17-2015 12:31 PM
Changing parent without changing absolute global position? The SundanceKid Vizard 2 05-23-2014 02:43 PM
CompositeShape proximity sensor mhtong Vizard 1 09-24-2012 11:18 AM
Phase Space and Proximity Sensors snovob93 Vizard 3 06-13-2012 12:32 PM
Adding Objects to all Scenes jassel41 Vizard 1 11-29-2010 02:35 AM


All times are GMT -7. The time now is 04:14 PM.


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