#1
|
|||
|
|||
Translate Head Pos to Starting Pos via Key
Hi there,
I'm trying to make a key function to reset the user's HEAD_POS to a starting position in the world. The code I have is like the following: def mykeyboard(key): if key == 'a': viz.translate(viz.HEAD_POS, -0.1439, -.0095, -4.4603, viz.ABSOLUTE_WORLD) [where (-.1439, .0095, -4.4603) is the exact position I want the user's head to be in when I press the 'a' key] However, when I do press the 'a' key when I run the script, it ends up translating the head_pos relatively each time (in this case, back a few coordinates on the z-axis). How do I fix this? Thanks! |
#2
|
|||
|
|||
Hi,
The viz.translate function will only translate the viewpoint relatively. To translate the viewpoint to an absolute location, use the translate command of the main viewpoint: Code:
view = viz.get(viz.MAIN_VIEWPOINT) view.translate(-0.1439, -.0095, -4.4603) |
|
|