Jump to content
  • Advertisement
Sign in to follow this  
noooooon

Normal To Tangents

This topic is 3893 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

The PhysX SDK has a function that build the normal and binormal (tangent and bitangent) from a vector : void NxNormalToTangents(const NxVec3& axis, NxVec3& binormal, NxVec3& normal); Its usefull to build a Matrix3 from a Vector : NxVec3 axis, binormal, normal; axis.normalize(); NxNormalToTangents(axis, binormal, normal); NxMat33 orient(normal, axis, binormal); How do you think this function is implemented ? Usualy what I use is 2 cross products, - one bewteen the axis and an arbitrary vector, usualy (0, 1, 0). - one bewteen the calculated normal and the axis again. I don't like this code because I need to check if the axis has not the same direction has the choosen vector. any idea ? Thanks. [Edited by - noooooon on January 16, 2008 3:06:17 AM]

Share this post


Link to post
Share on other sites
Advertisement

Hi,

Try to look for orthonormal basis. I couldn't find any implementation, but it should give you the vectors you are looking for (though there is infinite amount of solutions).

Cheers!

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!