WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   translating viewpoint along body orientation (https://forum.worldviz.com/showthread.php?t=707)

cade_mccall 08-28-2006 10:12 AM

translating viewpoint along body orientation
 
Peeps-

Is there a way in 2.53 to translate the viewpoint in absolute coordinates of the BODY_ORI reference frame (I believe you can do this with setPosition in R3)? "Move" allows you to set BODY_ORI as the mask, but I want to translate the viewpoint absolutely, not relatively to my current position.

Thanks.

farshizzo 08-28-2006 04:32 PM

I don't understand exactly what you mean by absolutely in the BODY_ORI reference frame. Translating a view absolutely is always in the world reference frame. Can you explain exactly what you are trying to accomplish?

cade_mccall 08-29-2006 12:16 AM

I'm using ppt data to translate the viewpoint but I'm changing the orientation of the body of the viewpoint. I'd like to translate the viewpoint according to the new orientation of the body, not according to the world axes. So, if I rotate the body 90 degrees I still want movement along the z axis of the room to result in forward movement. That only works if I use movement along the body's axes-- if I use world axes then moving forward in the room will move me sideways in the world since my body is now facing to the right. Right now I'm using the "move" function because it allows for a BODY ORI mask although then I have to calculate the relative changes in the ppt data instead of using the raw data since "move" translates relative to the current position. This works but I was wondering if I could skip the step of calculating relative changes by using something that just translates the viewpoint to absolute points within a rotated reference frame.

farshizzo 08-29-2006 09:35 AM

Ok, I see. Then simply translate the viewpoint absolutely to (0,0,0) then apply the ppt position relatively to the BODY_ORI:
Code:

view.translate(0,0,0)
view.move(ppt[0],ppt[1],ppt[2],viz.BODY_ORI)



All times are GMT -7. The time now is 02:55 PM.

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