From 8370978230e0e85c5e306f84eddb271f5d6a655a Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Fri, 1 Oct 2010 13:47:16 +0000 Subject: [PATCH] Added a new call of InterpolationParameters with infers the Normal by the Triangle itself --- vcg/space/triangle3.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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.