Commit edcf25fa authored by Christopher Tenter's avatar Christopher Tenter
Browse files

Correct normals for faces that are not coplanar.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12154 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4e6f3a3a
......@@ -793,18 +793,8 @@ DrawMeshT<Mesh>::createVBO()
{
for (unsigned int i = 0; i < numTris_; ++i)
{
// calculate face normal
ACG::Vec3f V[3];
for (unsigned int k = 0; k < 3; ++k)
{
Vertex* p = verticesTmp_ + indices_[i * 3 + k];
V[k] = ACG::Vec3f(p->pos[0], p->pos[1], p->pos[2]);
}
ACG::Vec3f u = V[1] - V[0];
ACG::Vec3f v = V[2] - V[0];
ACG::Vec3f n = OpenMesh::cross(u, v).normalize_cond();
// get face normal
ACG::Vec3d n = mesh_.normal(mesh_.face_handle(triToFaceMap_[i]));
// store face normal in last tri vertex
for (unsigned int k = 0; k < 3; ++k)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment