View Full Version : vizard rotations

09-02-2003, 01: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!

09-02-2003, 01:32 PM

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


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)

Hope this helps

09-03-2003, 08: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)


09-03-2003, 09:43 AM

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.

09-03-2003, 02: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.

09-03-2003, 02: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.