ikarus Posted November 8, 2012 Share Posted November 8, 2012 I know quaternions can be generated from euler angles (euler2quat) but I need to convert back to a set of euler angles for torque calculations. I'm having some trouble following online resources on quat to euler, could someone explain this or provide an example file? thanks Quote Link to comment Share on other sites More sharing options...
Macha Posted November 8, 2012 Share Posted November 8, 2012 (edited) You can look here: http://en.wikipedia....nd_Euler_angles First, get your quaternion components, q0, q1, q2, q3 as written there. Then make those 3 equations that look like a matrix (at the bottom) and you get roll, pitch and yaw. If you do that in vopsop nodes it will be quite fiddly and you get radians, so you need to convert them to degrees. Vex or Python will probably be easier for this but either way will work. I've tried that once but forgot if it completely worked. I think there was some flipping if you rotate more than pi, but arctan2 solved that if I remember correctly. I may even have posted it here. Not sure. Edit: Be careful, I think that very last equation on the wiki is confusing, there is a comma what should be a / I think. Edited November 8, 2012 by Macha Quote Link to comment Share on other sites More sharing options...
Marc Posted November 8, 2012 Share Posted November 8, 2012 I've used that method and it worked fine. Quote Link to comment Share on other sites More sharing options...
petz Posted November 8, 2012 Share Posted November 8, 2012 there is also hou.Quaternion.extractEulerRotates() in python petz 1 Quote Link to comment Share on other sites More sharing options...
ikarus Posted November 8, 2012 Author Share Posted November 8, 2012 http://forums.odforc...ler/#entry55634 I've used that method and it worked fine. Good trick, thanks much~ Quote Link to comment Share on other sites More sharing options...
Darric Posted November 15, 2012 Share Posted November 15, 2012 (edited) What I normally do is use VOPs to go Quaternion to Matrix, followed by an Extract Transform VOP to get you the Euler rotations. Edit: Whoops, that's exactly what's in Marc's link. >< Edited November 15, 2012 by Darric Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.