Jump to content
  • Advertisement
Sign in to follow this  

most exactly way of compare between Quaternions

This topic is 4158 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!