|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NLMISC::CTriangle Class ReferenceA simple triangles of 3 points.
More...
#include <triangle.h>
Inheritance diagram for NLMISC::CTriangle:
List of all members.
Detailed Description
A simple triangles of 3 points.
-
Author:
-
Lionel Berenguier , Nevrax France
-
Date:
-
2000
Definition at line 51 of file triangle.h.
Constructor & Destructor Documentation
NLMISC::CTriangle::CTriangle |
( |
|
) |
[inline] |
|
Member Function Documentation
void NLMISC::CTriangle::computeGradient |
( |
float |
c0, |
|
|
float |
c1, |
|
|
float |
c2, |
|
|
CVector & |
grad |
|
) |
const |
|
|
3D Gradient computation.
Given 3 values at the 3 corners 'ci' (gouraud, uv....), this method compute the gradients Grad. The formula to compute the interpolated value according to a 3d position 'v' in space is then simply:
c(v)= c0 + grad*(v-V0)
Definition at line 67 of file triangle.cpp.
References CTriangle, V0, V1, and V2. |
|
Intersection detection with a segment.
You must pass the normalized plane of the triangle as parameter. -
Parameters:
-
p0 |
is the first point of the segment. |
p1 |
is the second point of the segment. |
hit |
will receive the coordinate of the intersection if the method returns true. |
plane |
is the plane of the triangle. Build it like this: CPlane plane;
plane.make (triangle.V0, triangle.V1, triangle.V2);
|
-
Returns:
-
true if the segement [p0,p1] intersects the triangle else false.
|
Member Data Documentation
The documentation for this class was generated from the following files:
|
|