From 135951fd27170e6d54bf71e54ee0874b4ccaba47 Mon Sep 17 00:00:00 2001 From: ganovelli Date: Tue, 31 Jul 2007 12:21:50 +0000 Subject: [PATCH] added gltetra, added normal gltriangle --- wrap/gl/space.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wrap/gl/space.h b/wrap/gl/space.h index 7fa82867..6ad80a5e 100644 --- a/wrap/gl/space.h +++ b/wrap/gl/space.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.9 2007/05/08 18:55:38 ganovelli +glTriangle added + Revision 1.8 2007/01/18 01:26:23 cignoni Added cast for mac compiling @@ -256,12 +259,22 @@ inline void glBoxClip(const Box3 & b) template inline void glTriangle3( TriangleType & c ) { + vcg::Point3 n = vcg::Normal(c); glBegin(GL_TRIANGLES); + glNormal(n); glVertex(c.P(0)); glVertex(c.P(1)); glVertex(c.P(2)); glEnd(); } +template + inline void glTetra3( TetraType & c ) { + glTriangle3(Triangle3(c.P(0),c.P(1),c.P(2))); + glTriangle3(Triangle3(c.P(1),c.P(3),c.P(2))); + glTriangle3(Triangle3(c.P(0),c.P(2),c.P(3))); + glTriangle3(Triangle3(c.P(1),c.P(0),c.P(3))); + } + }//namespace #endif