added globally rotation per vertex UV coordinates

This commit is contained in:
nico 2020-12-11 14:36:13 +11:00
parent 4b2455fad4
commit 0a0a06268f
1 changed files with 17 additions and 0 deletions

View File

@ -174,6 +174,23 @@ public:
}
}
static void GloballyRotatePerVert(MeshType &m,ScalarType Angle)
{
vcg::Box2<ScalarType> BB=PerVertUVBox(m);
UVCoordType Origin=BB.Center();
typename MeshType::VertexIterator vi;
for (vi=m.vert.begin();vi!=m.vert.end();vi++)
{
if ((*vi).IsD()) continue;
(*vi).T().P()-=Origin;
ScalarType X1=(*vi).T().P().X()*cos(Angle)-(*vi).T().P().Y()*sin(Angle);
ScalarType Y1=(*vi).T().P().X()*cos(Angle)+(*vi).T().P().Y()*sin(Angle);
(*vi).T().P().X()=X1;
(*vi).T().P().Y()=Y1;
(*vi).T().P()+=Origin;
}
}
static void LaplacianUVVert(MeshType &m,bool fix_borders=false,int steps=3)
{
FaceIterator fi;