mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-17 01:54:42 +00:00
added management of failure of computation of baricentric coords during rasterization of textures
This commit is contained in:
parent
a6b5b09ecc
commit
a6a1ddb5ec
@ -281,12 +281,9 @@ public:
|
||||
|
||||
// Convert point to barycentric coords
|
||||
vcg::Point3f interp;
|
||||
int axis = 0;
|
||||
float tmp = -1;
|
||||
for (int i=0; i<3; ++i)
|
||||
if (fabs(nearestF->cN()[i]) > tmp) {tmp = fabs(nearestF->cN()[i]); axis = i;}
|
||||
bool ret = InterpolationParameters(*nearestF, axis, closestPt, interp);
|
||||
assert(ret);
|
||||
bool ret = InterpolationParameters(*nearestF, nearestF->cN(), closestPt, interp);
|
||||
if(!ret) return;
|
||||
assert(ret);
|
||||
interp[2]=1.0-interp[1]-interp[0];
|
||||
|
||||
if (alpha==255 || qAlpha(trgImg.pixel(tp.X(), trgImg.height() - tp.Y())) < alpha)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user