Problem with Rotation Matrices and Axes

Started by Jarz, October 13, 2014, 11:03:49 AM

Previous topic - Next topic

Jarz

Hello,

I'm currently coding an Android App, it's my first time with JPCT. I have a very simple scenario, the 3D model of an IMU sensor and I want to rotate it with the rotation matrix that the sensor gives to me.

Ok, my problem is that the reference axes are always the same. This is, when I rotate the sensor around it's X axis (e.g.) the model rotates around the JPCT X Axis (Logically). But in order to get a good representation I need to rotate around my own X Axis. I've Read something about parent and child rotation, can I use this to apply a rotation over different axes each time? or there is another solution?

EDIT: I will try to explain it better,

Imagine this scenario, I have my sensor completely horizontal with the X axis pointing to right, Y positive is vertical (points up), and Z points to the front.

Mi model representation looks exacly the same.

Now I rotate the z axis of the  sensor 90ยบ, so the X axis now is vertical. I want to get the X axis of the app vertical too!  instead of the original one of jpct. Because if now I rotate one more time over a different axis, the representation won't be real.

Sorry for my english and thank you so much!

EgonOlsen