fix: Flipped normals
* normalization fix normalizes normal vector instead of component tangents, fixes problem with flipped normals * Update GLMesh.cpp
This commit is contained in:
@@ -89,10 +89,8 @@ void GLMesh::setPosBuffer(enzo::geo::Geometry& geometry)
|
|||||||
enzo::bt::Vector3 tang1 = (pos2-pos1);
|
enzo::bt::Vector3 tang1 = (pos2-pos1);
|
||||||
enzo::bt::Vector3 tang2 = (pos3-pos1);
|
enzo::bt::Vector3 tang2 = (pos3-pos1);
|
||||||
|
|
||||||
tang1.normalize();
|
|
||||||
tang2.normalize();
|
|
||||||
|
|
||||||
Normal = tang1.cross(tang2);
|
Normal = tang1.cross(tang2);
|
||||||
|
Normal.normalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i=0; i< faceVertCnt; ++i)
|
for(int i=0; i< faceVertCnt; ++i)
|
||||||
|
|||||||
Reference in New Issue
Block a user