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:
bloopies
2025-08-19 04:30:47 -07:00
committed by GitHub
parent caf1510d11
commit 0b9e2bf244

View File

@@ -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)