slade Posted November 19, 2005 Share Posted November 19, 2005 Hello to all houdini masters. I have a retarded question.. I have a bunch of rotation data in the form of a chan file. All the rotation is in quaternion space. my question is how can i convert the quaternion rotation to Euler rotation is there a way in chops or vops to do this sort of stuff. I know theres a Euler to quaternion vop, but I am lost , Please help... Quote Link to comment Share on other sites More sharing options...
edward Posted November 19, 2005 Share Posted November 19, 2005 Unless you do the math yourself, you'll have to use VOPs. The problem though is that there's no VOP (or VEX) context for CHOPs. So you'll need to translate the data from CHOPs into SOPs, run it through your VOPnet, and then push back into CHOPs. Quote Link to comment Share on other sites More sharing options...
digitallysane Posted November 19, 2005 Share Posted November 19, 2005 The problem though is that there's no VOP (or VEX) context for CHOPs. So you'll need to translate the data from CHOPs into SOPs, run it through your VOPnet, and then push back into CHOPs. 22710[/snapback] Of course there is a CHOP context. Both plain VEX and also in VOPs. Dragos Quote Link to comment Share on other sites More sharing options...
edward Posted November 19, 2005 Share Posted November 19, 2005 Ah of course, it's called "VEX Motion And Audio" instead of "VEX Channel" ... Sorry about that. Quote Link to comment Share on other sites More sharing options...
sanostol Posted January 16, 2009 Share Posted January 16, 2009 (edited) for me there is still the question open, is there a vex function to convert a quaternion into a euler vector, considering the order of rotation. I searched for it but without luck. thanks Ah of course, it's called "VEX Motion And Audio" instead of "VEX Channel" ... Sorry about that. Edited January 16, 2009 by sanostol Quote Link to comment Share on other sites More sharing options...
jacob clark Posted January 16, 2009 Share Posted January 16, 2009 Hi Sanostol, Try converting your Quaternion to a Matrix3 and then to a Matrix 4 (I don't think there's a way to convert it directly...) Then you can put the Matrix4 into the Extract Transform VOP. Hope this helps! cheers, -j 3 Quote Link to comment Share on other sites More sharing options...
sanostol Posted January 16, 2009 Share Posted January 16, 2009 thank You very much Hi Sanostol, Try converting your Quaternion to a Matrix3 and then to a Matrix 4 (I don't think there's a way to convert it directly...) Then you can put the Matrix4 into the Extract Transform VOP. Hope this helps! cheers, -j Quote Link to comment Share on other sites More sharing options...
djbyun Posted August 23, 2017 Share Posted August 23, 2017 vector qToE(vector4 q_value){ float q_0 = q_value.w ; float q_1 = q_value.x ; float q_2 = q_value.y ; float q_3 = q_value.z ; vector out = {0,0,0} ; out.x = atan2(2*(q_0*q_1+q_2*q_3), (1-2*(q_1*q_1+q_2*q_2))) ; out.y = asin(2*(q_0*q_2-q_3*q_1)) ; out.z = atan2(2*(q_0*q_3+q_1*q_2), (1-2*(q_2*q_2+q_3*q_3))) ; return out ; } 3 Quote Link to comment Share on other sites More sharing options...
ikoon Posted March 18, 2018 Share Posted March 18, 2018 I was using DJs code, but in some rotations (for example 90° x, 90° y, 0° z) it is not evaluating right. So I ended with this: matrix m = qconvert(@orient); v@rot = cracktransform(0, 0, 1, {0,0,0}, m); Note: Rotation angles are returned in degrees. 1 Quote Link to comment Share on other sites More sharing options...
San-San-San Posted November 8, 2019 Share Posted November 8, 2019 On 3/18/2018 at 3:08 AM, ikoon said: I was using DJs code, but in some rotations (for example 90° x, 90° y, 0° z) it is not evaluating right. So I ended with this: matrix m = qconvert(@orient); v@rot = cracktransform(0, 0, 1, {0,0,0}, m); Note: Rotation angles are returned in degrees. Perfect! Thanks! Quote Link to comment Share on other sites More sharing options...
anim Posted November 8, 2019 Share Posted November 8, 2019 nowadays you can use quaterniontoeuler() VEX function, which returns radians however 1 1 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.