Преглед изворни кода

Changed texture such that singularities are not n-edge faces but valence-n nodes.

Former-commit-id: 3d503152fa7405bda8b844cdb266de1c4de85cc5
wkevin пре 10 година
родитељ
комит
931954fc7c
1 измењених фајлова са 11 додато и 5 уклоњено
  1. 11 5
      tutorial/505_MIQ/main.cpp

+ 11 - 5
tutorial/505_MIQ/main.cpp

@@ -62,15 +62,21 @@ void line_texture(Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic> &te
                   Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic> &texture_B)
   {
     unsigned size = 128;
-    unsigned size2 = size/2;
     unsigned lineWidth = 3;
     texture_R.setConstant(size, size, 255);
-    for (unsigned i=0; i<size; ++i)
-      for (unsigned j=size2-lineWidth; j<=size2+lineWidth; ++j)
+    for (unsigned i=0; i<size; ++i){
+      for (unsigned j=0; j<lineWidth; ++j)
         texture_R(i,j) = 0;
-    for (unsigned i=size2-lineWidth; i<=size2+lineWidth; ++i)
-      for (unsigned j=0; j<size; ++j)
+      for (unsigned j=size-lineWidth; j<size; ++j)
         texture_R(i,j) = 0;
+    }
+
+    for (unsigned j=0; j<size; ++j){
+      for (unsigned i=0; i<lineWidth; ++i)
+        texture_R(i,j) = 0;
+      for (unsigned i=size-lineWidth; i<size; ++i)
+        texture_R(i,j) = 0;
+    }
 
     texture_G = texture_R;
     texture_B = texture_R;