Calculating Binormal Vector

Calculating Binormal Vector

Is Binormal vector a cross product of normalized tangent vector and normalized normal vector or vice versa?

Binormal_vector = cross(normalize(tangent_vector), normalize(normal_vector))

or

Binormal_vector = cross(normalize(normal_vector), normalize(tangent_vector))

Many resources like this () define Binormal vector as

B = T X N

But in most of the shader codes Binormal vector is defined as

Binormal_vector = cross(normalize(normal_vector), normalize(tangent_vector)) * handedness 

i.e.

B = N X T

1 Answer

In an Right-Handed Coordinate System (see further Right-hand rule)

the Binormal Vector is calcualted by:

B = N x T

while in an Left-Handed Coordinate System

the Binormal Vector is calcualted by:

B = T x N


In OpenGL is commonly used a Right-Handed Coordinate System, but this depends on the specification and definitions which are chosen by the user.


Further if a system is mirrored it changes from one system to the other. This may occur if a texture is mirrored or looked at from the backface. Note in your above code this is compensated by handedness, which is the "sign" of the binormal vector and either 1.0 or -1.0.

Binormal_vector = cross(normalize(normal_vector), normalize(tangent_vector)) * handedness 
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.