Re: [G3D] Matrix3::toEulerAnglesZYX fix

17 views
Skip to first unread message

Morgan McGuire

unread,
Mar 31, 2013, 12:45:41 PM3/31/13
to g3d-...@googlegroups.com
Thanks, I'll look into it.

-m

Prof. Morgan McGuire
Computer Science Department
Williams College
http://cs.williams.edu/~morgan


On Sun, Mar 31, 2013 at 11:57 AM, Jaromír Pufler <jaromir...@gmail.com> wrote:
This method computes wrong.
There is patch for fix:

diff --git a/G3D9/G3D.lib/source/Matrix3.cpp b/G3D9/G3D.lib/source/Matrix3.cpp
index 7e4de99..09b3613 100644
--- a/G3D9/G3D.lib/source/Matrix3.cpp
+++ b/G3D9/G3D.lib/source/Matrix3.cpp
@@ -1525,7 +1525,7 @@ bool Matrix3::toEulerAnglesZYX (float& rfZAngle, float& rfYAngle,
     if ( elt[2][0] < 1.0 ) {
         if ( elt[2][0] > -1.0 ) {
             rfZAngle = atan2f(elt[1][0], elt[0][0]);
-            rfYAngle = asinf(-(double)elt[2][1]);
+            rfYAngle = asinf(-(double)elt[2][0]);
             rfXAngle = atan2f(elt[2][1], elt[2][2]);
             return true;
         } else {

--
You received this message because you are subscribed to the Google Groups "G3D Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to g3d-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Morgan McGuire

unread,
Apr 17, 2013, 11:47:44 AM4/17/13
to g3d-...@googlegroups.com
Committed.

-m
Reply all
Reply to author
Forward
0 new messages