WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   teleport users location (https://forum.worldviz.com/showthread.php?t=1474)

joeymax 05-05-2008 05:17 AM

teleport users location
 
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…
Code:

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.
Code:

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


All times are GMT -7. The time now is 06:34 PM.

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