PDA

View Full Version : vizard rotations


duda
09-02-2003, 02:21 PM
Is there a command in Vizard that allows you rotate with respect to an inertial frame? e.g. if viz.rotate(0, 10, 0) is performed, and then viz.rotate(0, 15, 0) is performed, the end result is a 25-degree pitch. However, I'd like the end result to be a 15-degree pitch.

I'd like to take head-tracker sensor data, perform some operations on it, and then use the viz.rotate command to update the view. Currently, there is an instability because rotations are performed on top of rotations.

Thanks for your help!

farshizzo
09-02-2003, 02:32 PM
Hi,

The viz.rotate command rotates the BODY_ORI by the given amount, relative to its current rotation. If you want to rotate the BODY_ORI with an absolute rotation there are two ways of doing it.

Method 1
Reset the body ori to zero and perform the rotation

viz.reset(viz.BODY_ORI)
viz.rotate(0,15,0)


Method 2
Get access to the main viewpoint object and call its rotate function which performs the rotation in absolute space.

view = viz.get(viz.MAIN_VIEWPOINT)
view.rotate(0,15,0,'',viz.BODY_ORI)


Hope this helps

duda
09-03-2003, 09:12 AM
When I use the view.rotate() command as you listed in Method 2, I get the following error:

TypeError: rotate() takes at most 5 arguments (6 given)


:confused:

farshizzo
09-03-2003, 10:43 AM
Hi,

I believe you have an older version of Vizard, the latest version is 2.10. Go to the Help menu and click "About Vizard", the version number should be in the upper left corner. The latest version is available for download from the website. Sorry about the inconvenience.

duda
09-03-2003, 03:16 PM
Yes, I was using v1.097 when I got that previous error. The commands do work in v2.10, however, to get a pitch I need to use viz.rotate(0, 0, x, ' ', viz.BODY_ORI). It appears that the order is Yaw, Roll, Pitch, not the Y-P-R that is defined in the Vizard Euler rotations.

farshizzo
09-03-2003, 03:31 PM
:confused: That's strange...

Over here it's working fine. I know we've fixed a few problems with rotations recently, but that should have always been working. We will be releasing 2.11 soon, so if you're still having this problem then downloading that will most likely fix it.