#include "gluos.h"
#include "tess.h"
Go to the source code of this file.
◆ ABS
◆ Dot
◆ FALSE
◆ S_UNIT_X
◆ S_UNIT_Y
◆ TRUE
◆ __gl_projectPolygon()
Definition at line 198 of file normal.c.
199{
203 int i, computedNormal =
FALSE;
204
210 computedNormal =
TRUE;
211 }
215
216#if defined(FOR_TRITE_TEST_PROGRAM) || defined(TRUE_PROJECT)
217
218
219
221
225
226
228 sUnit[0] -=
w *
norm[0];
229 sUnit[1] -=
w *
norm[1];
230 sUnit[2] -=
w *
norm[2];
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];
238#else
239
243
247#endif
248
249
251 v->s =
Dot(
v->coords, sUnit );
252 v->t =
Dot(
v->coords, tUnit );
253 }
254 if( computedNormal ) {
256 }
257}
_Tp _STLP_CALL norm(const complex< _Tp > &__z)
static BOOL Normalize(PFILE_TYPE_ENTRY Entry)
GLubyte GLubyte GLubyte GLubyte w
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static void ComputeNormal(GLUtesselator *tess, GLdouble norm[3])
static int LongAxis(GLdouble v[3])
static void CheckOrientation(GLUtesselator *tess)
Referenced by gluTessEndPolygon().
◆ CheckOrientation()
Definition at line 141 of file normal.c.
142{
147
148
149
150
154 if(
e->winding <= 0 )
continue;
155 do {
156 area += (
e->Org->s -
e->Dst->s) * (
e->Org->t +
e->Dst->t);
158 }
while(
e !=
f->anEdge );
159 }
161
164 }
168 }
169}
static Real area(Real A[2], Real B[2], Real C[2])
Referenced by __gl_projectPolygon().
◆ ComputeNormal()
Definition at line 76 of file normal.c.
77{
80 GLdouble maxVal[3], minVal[3], d1[3], d2[3], tNorm[3];
84
87
89 for(
i = 0;
i < 3; ++
i ) {
91 if(
c < minVal[
i] ) { minVal[
i] =
c; minVert[
i] =
v; }
92 if(
c > maxVal[
i] ) { maxVal[
i] =
c; maxVert[
i] =
v; }
93 }
94 }
95
96
97
98
100 if( maxVal[1] - minVal[1] > maxVal[0] - minVal[0] ) {
i = 1; }
101 if( maxVal[2] - minVal[2] > maxVal[
i] - minVal[
i] ) {
i = 2; }
102 if( minVal[
i] >= maxVal[
i] ) {
103
105 return;
106 }
107
108
109
110
111 maxLen2 = 0;
115 d1[1] =
v1->coords[1] -
v2->coords[1];
116 d1[2] =
v1->coords[2] -
v2->coords[2];
118 d2[0] =
v->coords[0] -
v2->coords[0];
119 d2[1] =
v->coords[1] -
v2->coords[1];
120 d2[2] =
v->coords[2] -
v2->coords[2];
121 tNorm[0] = d1[1]*d2[2] - d1[2]*d2[1];
122 tNorm[1] = d1[2]*d2[0] - d1[0]*d2[2];
123 tNorm[2] = d1[0]*d2[1] - d1[1]*d2[0];
124 tLen2 = tNorm[0]*tNorm[0] + tNorm[1]*tNorm[1] + tNorm[2]*tNorm[2];
125 if( tLen2 > maxLen2 ) {
126 maxLen2 = tLen2;
130 }
131 }
132
133 if( maxLen2 <= 0 ) {
134
137 }
138}
#define GLU_TESS_MAX_COORD
GLfloat GLfloat GLfloat v2
Referenced by __gl_projectPolygon().
◆ LongAxis()