WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   default start position (https://forum.worldviz.com/showthread.php?t=1538)

erchrastil 06-20-2008 10:56 AM

default start position
 
we're using keyboard commands to get around our environment. the default starting location is (0,0,0), but that location interferes with some things we have in the environment. we would like to be able to shift the starting position to another position we have defined.

here is the code we have tried so far. it will move the start position view, but then keyboard commands don't move. it also clearly thinks that it is the position (0,0,0) based on some sound commands that we have going. it doesn't give any error message.

Code:

elif keyControl == 2:
        headTrack = viztracker.Keyboard6DOF(forward=viz.KEY_UP,backward=viz.KEY_DOWN,turnRight=viz.KEY_RIGHT,turnLeft=viz.KEY_LEFT)
        link = viz.link(headTrack, view)
        viz.eyeheight(1.5) #sets the eyeheight for keyboard control to 1.5 m
        link.setPos(targets['home']['position'])
        link.setEuler(targets['home']['rotation'])


farshizzo 06-20-2008 07:17 PM

Try replacing the following lines:
Code:

link.setPos(targets['home']['position'])
link.setEuler(targets['home']['rotation'])

with:
Code:

link.setOffset(targets['home']['position'])
link.postEuler(targets['home']['rotation'],target=viz.LINK_ORI_OP)

The setPos and setEuler operators will overwrite the source data with the specified value. The setOffset and postEuler operators will offset the source data instead.

erchrastil 06-23-2008 08:15 AM

thanks, that worked well.


All times are GMT -7. The time now is 07:04 AM.

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