From 894ffdbdfee7d9066a7d7b7cbcf45b67418c3098 Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 20 May 2011 23:20:33 +0000 Subject: [PATCH] Added trivial WedgeTexFromVertexTex --- vcg/complex/algorithms/update/texture.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vcg/complex/algorithms/update/texture.h b/vcg/complex/algorithms/update/texture.h index 0afe8aec..df554394 100644 --- a/vcg/complex/algorithms/update/texture.h +++ b/vcg/complex/algorithms/update/texture.h @@ -98,6 +98,19 @@ static void WedgeTexFromCamera(ComputeMeshType &m, Plane3 &pl) } +static void WedgeTexFromVertexTex(ComputeMeshType &m) +{ + for(FaceIterator fi=m.face.begin();fi!=m.face.end();++fi) + if(!(*fi).IsD()) + { + for(int i=0;i<3;++i) + { + (*fi).WT(i).U() = (*fi).V(i)->T().U(); + (*fi).WT(i).V() = (*fi).V(i)->T().V(); + } + } +} + /// Currently texture coords are kept for ALL the triangles of a mesh. The texture id is stored with each face. /// if a given face should not have tex coord it has the default -1 value for texture ID.