Mismatching rotation API between Windows, Linux and Mac

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
fbertel
Posts: 2
Joined: Wed Aug 26, 2009 12:23 pm

Mismatching rotation API between Windows, Linux and Mac

Post by fbertel »

Hello,

I'm working on a multiplatform project (Linux, Windows, Mac) using 3DConnexion devices. Right now, I'm testing it with the SpaceNavigator.

The documentation of the Windows SDK states that the value returned regarding the rotation is a 4-component data consisting of an angle and a vector representation the axis of rotation. Great.

Due to missing documentation, I don't know how to interpret data on Linux or Mac:

First of all, I already read the following threads:

* angleAxisToEuler():
http://3dconnexion.com/forum/viewtopic. ... aee559f176

* Interpreting data on Linux:
viewtopic.php?t=2484


The Linux/X11 API returns a 3 component data (MagellanA, MagellanB MagellanC) but there is no documentation explaining the meaning of those data. Actually, for X11, there is no documentation at all.

On Mac, the data returned is also a 3-component data. The documentation does not explain what the 3 values are either. The sample code provided with the Mac SDK has a 3DxCubeCarbon example that shows how the 3 values are interpreted: main.c has a d3glComputeRotationMatrix building a matrix R_z(a)R_y(b)R_x(c), a=motion[5],b=motion[4],c=motion[3], with motion[3]=inputValue[3], motion[4]=-inputValue[4], motion[5]=-inputValue[5]. (note the minus sign in front of inputValue[4] and inputValue[5], by the way...)

At the same time, the old Windows SDK contradicts the Mac example, it states that the input data (at this time) was 3 values: vx,vy,vz representing an axis of rotation where the norm is the angle of rotation. Is it the case for Linux and Mac? If so, the 3DxCubeCarbon example is wrong.
ref: "Why ArbitraryAxisToMatrix" section of the DevInfo.htm of the doc of the old Windows SDK. It gives a rotation matrix from the book Robot Manipulators by Richard P. Paul, used in the SPW_ArbitraryAxisToMatrix() function of the old SDK.


Also, in the 3 documents, old Windows SDK, new Windows SDK and Mac SDK, in the "How Data Should be used" section, the translation controls table and Rotation control tables don't match:

For the translations,
* on the old Window SDK and Mac SDK, the Z-axis sign is reversed compared to the new Windows SDK.
* on the Mac SDK, the Y-axis sign is reversed compared to the old and new Windows SDK.

However all 3 documents state "The home position for the device is with the negative Z-axis pointing towards the screen."

For the rotations,
* on the old Window SDK and Mac SDK, the Z-angle sign is reversed compared to the new Windows SDK.
* on the Mac SDK, the Y-angle sign is reversed compared to the old and new Windows SDK.

To sum up, my questions are:
1. What's the correct way to interpret values from the device on Linux and Mac? The way the old Windows SDK describes it or the way the Mac example do it, or something else?
2. Which doc/code is wrong, which doc/code is right?

Regards.
François Bertel, PhD | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
| Clifton Park NY 12065, USA
Post Reply