#include "_tess"
#include <cmath>
Go to the source code of this file.
◆ Dot
#define Dot |
( |
|
u, |
|
|
|
v |
|
) |
| (u[0]*v[0] + u[1]*v[1] + u[2]*v[2]) |
inlined C code : ///////////////////////////////////
Definition at line 18 of file normal.
◆ S_UNIT_X
◆ S_UNIT_Y
◆ tools_glutess_normal
#define tools_glutess_normal |
Definition at line 4 of file normal.
◆ __gl_projectPolygon()
Definition at line 148 of file normal.
155 norm[0] = tess->
normal[0];
156 norm[1] = tess->
normal[1];
157 norm[2] = tess->
normal[2];
158 if( norm[0] == 0 && norm[1] == 0 && norm[2] == 0 ) {
166 #if defined(FOR_TRITE_TEST_PROGRAM) || defined(TRUE_PROJECT)
177 w =
Dot( sUnit, norm );
178 sUnit[0] -= w * norm[0];
179 sUnit[1] -= w * norm[1];
180 sUnit[2] -= w * norm[2];
184 tUnit[0] = norm[1]*sUnit[2] - norm[2]*sUnit[1];
185 tUnit[1] = norm[2]*sUnit[0] - norm[0]*sUnit[2];
186 tUnit[2] = norm[0]*sUnit[1] - norm[1]*sUnit[0];
200 for( v = vHead->
next; v != vHead; v = v->
next ) {
204 if( computedNormal ) {
◆ static_CheckOrientation()
Definition at line 98 of file normal.
109 for( f = fHead->
next; f != fHead; f = f->
next ) {
111 if( e->
winding <= 0 )
continue;
113 area += (e->
Org->
s - e->Dst->s) * (e->
Org->
t + e->Dst->t);
115 }
while( e != f->
anEdge );
119 for( v = vHead->
next; v != vHead; v = v->
next ) {
◆ static_ComputeNormal()
Definition at line 29 of file normal.
33 GLUdouble maxVal[3], minVal[3], d1[3], d2[3], tNorm[3];
41 minVert[0] = 0;minVert[1] = 0;minVert[2] = 0;
42 maxVert[0] = 0;maxVert[1] = 0;maxVert[2] = 0;
44 for( v = vHead->
next; v != vHead; v = v->
next ) {
45 for( i = 0; i < 3; ++i ) {
47 if( c < minVal[i] ) { minVal[i] = c; minVert[i] = v; }
48 if( c > maxVal[i] ) { maxVal[i] = c; maxVert[i] = v; }
56 if( maxVal[1] - minVal[1] > maxVal[0] - minVal[0] ) { i = 1; }
57 if( maxVal[2] - minVal[2] > maxVal[i] - minVal[i] ) { i = 2; }
58 if( minVal[i] >= maxVal[i] ) {
60 norm[0] = 0; norm[1] = 0; norm[2] = 1;
70 if( !v1 || !v2 ) {norm[0] = 0; norm[1] = 0; norm[2] = 1;
return;}
74 for( v = vHead->
next; v != vHead; v = v->
next ) {
78 tNorm[0] = d1[1]*d2[2] - d1[2]*d2[1];
79 tNorm[1] = d1[2]*d2[0] - d1[0]*d2[2];
80 tNorm[2] = d1[0]*d2[1] - d1[1]*d2[0];
81 tLen2 = tNorm[0]*tNorm[0] + tNorm[1]*tNorm[1] + tNorm[2]*tNorm[2];
82 if( tLen2 > maxLen2 ) {
92 norm[0] = norm[1] = norm[2] = 0;
◆ static_LongAxis()