PDA

View Full Version : teleport users location


joeymax
05-05-2008, 05:17 AM
Hi there,

Is there a way to teleport your location to a different part of your scene at the touch of a button:

For example…

theview = viz.get(viz.MAIN_VIEWPOINT)
theview.translate(0,5,0)

POSITION = 0

def mytimer(num):
global POSITION
if POSITION == 1:
theview.translate(1,0,1)

if viz.iskeydown('e'):
POSITION = 1



..now I know this code doesn’t really work, but hopefully you can see what ive tried to do.

Any help would be much appreciated :rolleyes:

farshizzo
05-05-2008, 12:22 PM
What you have should work. If you have collision enabled, then you will need to temporarily disable collisions when teleporting the viewpoint.viz.collision(0)
viz.MainView.translate(1,0,1)
viz.collision(1)
If you have linked a sensor to the viewpoint, then you will need to apply an offset to the link, instead of translating the viewpoint.

joeymax
05-05-2008, 03:49 PM
thankyou!! it works perfect now