From 108943db73d5583097a6ee06eb187d17f2557035 Mon Sep 17 00:00:00 2001 From: Patrick Beeson Date: Wed, 28 Mar 2018 08:15:33 -0500 Subject: [PATCH] Keep 0 normals and just don't use them --- src/shapes.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shapes.cpp b/src/shapes.cpp index 1c04ebfc..7156f11e 100644 --- a/src/shapes.cpp +++ b/src/shapes.cpp @@ -661,10 +661,10 @@ void Mesh::computeVertexNormals(bool debug) { if (avg_normals[i].squaredNorm () > 0.0) { avg_normals[i].normalize(); - } else { - //if( debug ) { printf("Had to use Patrick trick!!!! [%d] avg normal: %f %f %f \n", i, avg_normals[i][0], avg_normals[i][1], avg_normals[i][2] ); } - avg_normals[i][0]=avg_normals[i][1]=avg_normals[i][2]=std::sqrt(1.0/3); } + else + avg_normals[i][0]=avg_normals[i][1]=avg_normals[i][2]=0; + unsigned int i3 = i * 3; vertex_normals[i3] = avg_normals[i][0]; vertex_normals[i3 + 1] = avg_normals[i][1]; @@ -708,7 +708,7 @@ void shapes::Mesh::computeVertexNormals_original() if (avg_normals[i].squaredNorm() > 0.0) avg_normals[i].normalize(); else - avg_normals[i][0]=avg_normals[i][1]=avg_normals[i][2]=std::sqrt(1.0/3); + avg_normals[i][0]=avg_normals[i][1]=avg_normals[i][2]=0; unsigned int i3 = i * 3; vertex_normals[i3] = avg_normals[i][0];