ソースを参照

SIGN CHANGE: use right hand rule, -1 on inside of CCW polygons

Former-commit-id: 4843b1088656bf137e4d8f573712d5d3369b2905
Alec Jacobson 8 年 前
コミット
6baa0bef57
1 ファイル変更2 行追加2 行削除
  1. 2 2
      include/igl/signed_distance.cpp

+ 2 - 2
include/igl/signed_distance.cpp

@@ -93,8 +93,8 @@ IGL_INLINE void igl::signed_distance(
           for(int e = 0;e<F.rows();e++)
           for(int e = 0;e<F.rows();e++)
           {
           {
             // rotate edge vector
             // rotate edge vector
-            FN(e,0) = -(V(F(e,1),1)-V(F(e,0),1));
-            FN(e,1) =  (V(F(e,1),0)-V(F(e,0),0));
+            FN(e,0) =  (V(F(e,1),1)-V(F(e,0),1));
+            FN(e,1) = -(V(F(e,1),0)-V(F(e,0),0));
             FN.row(e).normalize();
             FN.row(e).normalize();
             // add to vertex normal
             // add to vertex normal
             VN.row(F(e,1)) += FN.row(e);
             VN.row(F(e,1)) += FN.row(e);