Added a new call of InterpolationParameters with infers the Normal by the Triangle itself

This commit is contained in:
Nico Pietroni 2010-10-01 13:47:16 +00:00
parent d4786a1702
commit 8370978230
1 changed files with 8 additions and 1 deletions

View File

@ -204,7 +204,14 @@ bool InterpolationParameters(const TriangleType t, const Point3<ScalarType> & N,
}
}
/// Handy Wrapper of the above one that calculate the normal on the triangle
template<class TriangleType, class ScalarType>
bool InterpolationParameters(const TriangleType t, const Point3<ScalarType> & P, Point3<ScalarType> & L)
{
Point3<ScalarType> N=vcg::Normal<TriangleType>(t);
return (InterpolationParameters<TriangleType,ScalarType>(t,N,P,L));
}
// Function that computes the barycentric coords of a 2D triangle. Used by the above function.
// Algorithm: simply find a base for the frame of the triangle, assuming v3 as origin (matrix T) invert it and apply to P-v3.