Sign in to follow this  

most exactly way of compare between Quaternions

Recommended Posts

which function is the most exactly of compare between two Quaternions? compare allowable offset values between each two quaternions. three way compare two quaternions(ref. 3dmax sdk) : q1, q2 1. GetAngAxisFromQ( Quat q, float &fAng, Point3 p3Axis ); ... Point3 AxisP3(1.0f, 1.0f, 1.0f); float fAng1, fAng2; bool bOver = false; GetAngAxisFromQ( q_1, fAng1, p3Axis ); GetAngAxisFromQ( q_2, fAng2, p3Axis ); bOver = IsOffsetOver( fAng1, fAng2, fValueRange ); ... 2. QuatToEuler( Quat q, float& arrf ); float arrfAng_Axis_q1[3], arrfAng_Axis_q2[3]; ... bool bOver = false; QuatToEuler( q1, arrfAng_Axis_q1 ); QuatToEuler( q2, arrfAng_Axis_q2 ); bOver = IsOffsetOver( arrfAng_Axis_q1, arrfAng_Axis_q2, fValueRange ); ... 3. Quat1.x Compare Quat2.x, ... bool bOver = false; bOver = IsOffsetOver( q1, q2, fValueRange ); // bool IsOffsetOver( Quat q1, Quat q2, float fValueRange ) { float fOffset_x = fabs(q2.x - q1.x); float fOffset_y = fabs(q2.y - q1.y); float fOffset_z = fabs(q2.z - q1.z); return (fOffset_x > fValueRange) || (fOffset_y > fValueRange) || (fOffset_z > fValueRange); } // ...

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this