THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/11/2008 at 21:16, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R10+
Platform: Windows ;
Language(s) : C++ ;
---------
I'm trying to convert some local matrices (of null/bone/joint objects) into Angle/Axis pairs, but I'm having a problem of those Axis/Angle pairs not reproducing the original matrix...
// --------- S N I P ---------
Matrix ml1 = op->GetMln();
Vector pos = ml1.off;
Real angle;
Vector axis;
MatrixDump(ml1, "Before"); // (debug print of matrix)
// Convert Euler matrix to angle/axis
MatrixToRotAxis(ml1,&axis,&angle);
// re-create matrix, using angle/axis
Matrix ml2 = RotAxisToMatrix(axis, angle);
ml2.off = ml1.off;
MatrixDump(ml2, "After"); // (debug print of matrix)
// --------- S N I P ---------
...ml2 only ends up the same as ml1 if ml1 was an Identity Matrix. Should I expect the above to reproduce the original Matrix? Or is it expected that the various matrix values get transposed in the new Matrix?
As far as I can tell from some other code, the RotAxisToMatrix() part is working as expected, so the problem is happening with MatrixToRotAxis() , but I'm willing to listen to any help in accomplishing the desired results.
Thanks,
Keith