normals directions

Started by
0 comments, last by Jayinmn 14 years, 1 month ago
I have a mesh with defined normals for each its surfaces. I want to know if there is some way(preferably OpenGL function) to know if the normals directions are inside or outside for each surface
Advertisement
It's difficult to say which side of the normal is the inside or the outside depending on your model. I would suggest you create a plane based on the vertices data and check it with your defined normals to see if its above or below the plane.

Below is a function off my library. Not sure if it helps.

int EnginePlane::classifypoint(EngineVector point)
{
float p=this->normal*(point-(this->point*2))+this->distance;

if(p>0.0f)
{
return PLANE_FRONT;
}
else if(p<0.0f)
{
return PLANE_BACK;
}
else
return PLANE_COINCIDE;
}

:)

This topic is closed to new replies.

Advertisement