Rotation about alternate axis

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

Moderator: Moderators

Post Reply
tomkirk
Posts: 7
Joined: Wed Mar 19, 2008 7:34 am

Rotation about alternate axis

Post by tomkirk »

I have rotation in our new application working well. Moving the puck causes rotation in the corresponding axis. Now, I want to provide an option so that rotation mimics our Catia. That is, rotation of the puck causes rotation of the models about the axis that are aligned with the screen. ie. rotation of the puck about its Z axis will cause the model to rotate about a vector coming out perpendicular to the screen. Right now, this rotation causes the model to rotate about its Z axis. Which is just as it supposed to. I have tried multiplying the accumulated rotation matrix by a matrix aligned with the screen but with no success. I'm probably going down the wrong path with this. Any help would be appreciated.

Thanks,

Tom :?:
ngomes
Moderator
Moderator
Posts: 3347
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: Rotation about alternate axis

Post by ngomes »

Hi tomkirk,

Apologises for taking so long to reply.
by a matrix aligned with the screen but with no success.
Actually, that sounds about right. Perhaps all you need to do is to multiply by the transpose of that matrix.
Nuno Gomes
Manicat
Posts: 3
Joined: Fri Mar 06, 2009 3:13 am

Post by Manicat »

This has to do with the order of matrix multiplication.

The correct way to implement is:

accumMatrix = accumMatrix * m3dxNew

I guess you have implemented it as

accumMatrix = m3dxNew * accumMatrix
Post Reply