latest version v1.9 - last update 10 Apr 2010 |
Triangle is the base for all other polygons. More...
#include <ltiDraw3D.h>
Public Member Functions | |
triangle () | |
dpoint3D & | operator[] (const int idx) |
const dpoint3D & | operator[] (const int idx) const |
dpoint3D | getNormal () const |
bool | visible (const hmatrix &cam) const |
Protected Attributes | |
dpoint3D | pts [3] |
Triangle is the base for all other polygons.
It is assumed, that the points are given in a "right system", to define the normal of the triangle. The color of the hidden face of the triangle can be specified at construct time.
lti::draw3D< T >::triangle::triangle | ( | ) | [inline] |
default constructor
dpoint3D lti::draw3D< T >::triangle::getNormal | ( | ) | const [inline] |
compute the normal of the triangle.
It will NOT be normalized
References lti::draw3D< T >::triangle::pts, lti::tpoint3D< T >::subtract(), lti::tpoint3D< T >::x, lti::tpoint3D< T >::y, and lti::tpoint3D< T >::z.
Referenced by lti::draw3D< T >::triangle::visible().
const dpoint3D& lti::draw3D< T >::triangle::operator[] | ( | const int | idx | ) | const [inline] |
Access operator to the three points.
References lti::draw3D< T >::triangle::pts.
dpoint3D& lti::draw3D< T >::triangle::operator[] | ( | const int | idx | ) | [inline] |
Access operator to the three points.
References lti::draw3D< T >::triangle::pts.
bool lti::draw3D< T >::triangle::visible | ( | const hmatrix & | cam | ) | const [inline] |
returns true if the triangle "positive" face is visible for the given camera configuration
References lti::draw3D< T >::hmatrix::at(), lti::draw3D< T >::triangle::getNormal(), lti::tpoint3D< T >::x, lti::tpoint3D< T >::y, and lti::tpoint3D< T >::z.
dpoint3D lti::draw3D< T >::triangle::pts[3] [protected] |
data
Referenced by lti::draw3D< T >::triangle::getNormal(), and lti::draw3D< T >::triangle::operator[]().