|
|
"Grassblade" <nomail@nomail> wrote:
> "chrissounette" <nomail@nomail> wrote:
>
> Hmm, you want to have a conversion between the two? If A1 is the matrix of
> the first object, and A2 is the second, you are looking for X such that:
> A1*X=A2 sooo X= A1^(-1)*A2. I think.
Thanks, but it is not so simple. In fact, let consider two orthogonal triads
of unit vectors I = [Forward_1, Right_1, Up_1] and J = [Forward_2, Right_2,
Up_2] with same origin O. Determining the ZYX angles, also known as
Roll-Pitch-Yaw angles, to denote the rotational relationship between the
vectors of these two triads requires to compute first the rotation matrix R
as follow:
[Forward_2 | Right_2 | Up_2] = R * [Forward_1 | Right_1 | Up_1].
-> R = [Forward_2 | Right_2 | Up_2] * [Forward_1 | Right_1 | Up_1]^(-1).
Then the inverse solution to a given rotation matrix R [r11,r12,r13;
r21,r22,r23; r31,r32,r33] can be obtained by:
Roll = Atan2(r21,r11)
Pitch = Atan2(-r31,sqrt(r32^2+r33^2));
Yaw = Atan2 (r32,r33);
I'm not expert in Povray yet, and I was wondering if there is a macro
available to do implement this solution ??? If not, I would appreciate if
somobody could help me writing such macro :-)
Thanks,
Chris
Post a reply to this message
|
|