199{
203 int i, computedNormal =
FALSE;
204
205 norm[0] = tess->
normal[0];
206 norm[1] = tess->
normal[1];
207 norm[2] = tess->
normal[2];
208 if( norm[0] == 0 && norm[1] == 0 && norm[2] == 0 ) {
210 computedNormal =
TRUE;
211 }
215
216#if defined(FOR_TRITE_TEST_PROGRAM) || defined(TRUE_PROJECT)
217
218
219
220 Normalize( norm );
221
222 sUnit[i] = 0;
225
226
227 w =
Dot( sUnit, norm );
228 sUnit[0] -= w * norm[0];
229 sUnit[1] -= w * norm[1];
230 sUnit[2] -= w * norm[2];
231 Normalize( sUnit );
232
233
234 tUnit[0] = norm[1]*sUnit[2] - norm[2]*sUnit[1];
235 tUnit[1] = norm[2]*sUnit[0] - norm[0]*sUnit[2];
236 tUnit[2] = norm[0]*sUnit[1] - norm[1]*sUnit[0];
237 Normalize( tUnit );
238#else
239
240 sUnit[i] = 0;
243
244 tUnit[i] = 0;
247#endif
248
249
250 for( v = vHead->
next; v != vHead; v = v->
next ) {
253 }
254 if( computedNormal ) {
256 }
257}
double GLdouble
Definition glu-libtess.h:65
GLUvertex vHead
Definition mesh.h:164
GLdouble t
Definition mesh.h:122
GLdouble coords[3]
Definition mesh.h:121
GLdouble s
Definition mesh.h:122
GLUvertex * next
Definition mesh.h:115
static void ComputeNormal(GLUtesselator *tess, GLdouble norm[3])
Definition normal.c:76
#define S_UNIT_X
Definition normal.c:190
static int LongAxis(GLdouble v[3])
Definition normal.c:67
#define TRUE
Definition normal.c:43
#define FALSE
Definition normal.c:46
static void CheckOrientation(GLUtesselator *tess)
Definition normal.c:141
#define Dot(u, v)
Definition normal.c:49
#define S_UNIT_Y
Definition normal.c:191
GLdouble tUnit[3]
Definition tess.h:75
GLdouble sUnit[3]
Definition tess.h:74
GLdouble normal[3]
Definition tess.h:73
GLUmesh * mesh
Definition tess.h:66
References CheckOrientation(), ComputeNormal(), GLUvertex::coords, Dot, FALSE, LongAxis(), GLUtesselator::mesh, GLUvertex::next, GLUtesselator::normal, GLUvertex::s, S_UNIT_X, S_UNIT_Y, GLUtesselator::sUnit, GLUvertex::t, TRUE, GLUtesselator::tUnit, and GLUmesh::vHead.
Referenced by gluTessEndPolygon().