Face Normal Direction Calculation seems backwards
Posted: Tue Aug 09, 2005 6:10 am
Hi there. I have a question about the way blender calculates face normals. If you're not a math guru please take a second or third look at this question before answering...
Here's a C++ized version of what blender currently does (from arithb.c):
The thing I'd like to bring to your attention is the direction of the second vector: C-->B. The first is B-->A.
The common vertex is B, but only the first vector is relative to B. The second is relative to C. What this does is negate the direction of the BC vector, hence negating the direction of the face normal. In other words, the function should read:
Was this done on purpose? If so, why?
Thanks for any illumination you can provide.
Here's a C++ized version of what blender currently does (from arithb.c):
Code: Select all
point CalcNormXXX( point A, point B, point C, point &result )
{
result = point( A -B ).cross( B -C );
return result.normalize();
}
The common vertex is B, but only the first vector is relative to B. The second is relative to C. What this does is negate the direction of the BC vector, hence negating the direction of the face normal. In other words, the function should read:
Code: Select all
point CalcNormXXX( point A, point B, point C, point &result )
{
result = point( A -B ).cross( C -B );
return result.normalize();
}
Thanks for any illumination you can provide.