소스 검색

Fixed initialization of N matrix

Former-commit-id: 4a7c6743bceee532204b18b59f2a56ad420e524c
schuellc 12 년 전
부모
커밋
2f5daa0888
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      include/igl/per_vertex_normals.cpp

+ 3 - 2
include/igl/per_vertex_normals.cpp

@@ -37,8 +37,8 @@ IGL_INLINE void igl::per_vertex_normals(
   Eigen::PlainObjectBase<DerivedV> & N)
 {
   // Resize for output
-  N.resize(V.rows(),3);
-  
+  N.setZero(V.rows(),3);
+
   // loop over faces
   int Frows = F.rows();
 #pragma omp parallel for
@@ -50,6 +50,7 @@ IGL_INLINE void igl::per_vertex_normals(
       N.row(F(i,j)) += FN.row(i);
     }
   }
+  cout << "N.row()" << N.row(0) << endl;
   // normalize each row
   igl::normalize_row_lengths(N,N);
 }