diff --git a/vcg/space/triangle3.h b/vcg/space/triangle3.h index 8d24fb6a..b8ad2166 100644 --- a/vcg/space/triangle3.h +++ b/vcg/space/triangle3.h @@ -204,7 +204,14 @@ bool InterpolationParameters(const TriangleType t, const Point3 & N, } } - +/// Handy Wrapper of the above one that calculate the normal on the triangle +template +bool InterpolationParameters(const TriangleType t, const Point3 & P, Point3 & L) +{ + Point3 N=vcg::Normal(t); + return (InterpolationParameters(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.