From 75243d1cc22bc415ac231a33316621d6fb3609f0 Mon Sep 17 00:00:00 2001 From: nico Date: Sun, 22 Mar 2020 12:09:40 +1100 Subject: [PATCH] corrected some visualisation issue --- wrap/gl/gl_field.h | 61 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/wrap/gl/gl_field.h b/wrap/gl/gl_field.h index b887801e..a1011584 100644 --- a/wrap/gl/gl_field.h +++ b/wrap/gl/gl_field.h @@ -75,8 +75,10 @@ public: const bool oneside, const bool onlyPD1, const ScalarType maxN, - const ScalarType minN) + const ScalarType minN, + const bool UseK) { + assert(maxN>=minN); CoordType center=(f.cP(0)+f.cP(1)+f.cP(2))/3; //CoordType normal=f.cN(); CoordType dir[4]; @@ -88,15 +90,59 @@ public: { ScalarType Norm0=dir[0].Norm(); ScalarType Norm1=dir[1].Norm(); + if (UseK) + { + Norm0=f.cK1(); + Norm1=f.cK2(); + } ScalarType MaxW=6; ScalarType MinW=0.5; ScalarType IntervW=MaxW-MinW; if (Norm0>maxN)Norm0=maxN; if (Norm1>maxN)Norm1=maxN; - vcg::Color4b Col0=vcg::Color4b::ColorRamp(minN,maxN,Norm0); - vcg::Color4b Col1=vcg::Color4b::ColorRamp(minN,maxN,Norm1); - ScalarType W0=(Norm0/(maxN-minN))*IntervW+MinW; - ScalarType W1=(Norm1/(maxN-minN))*IntervW+MinW; + if (Norm0