49#define Dot(u,v) (u[0]*v[0] + u[1]*v[1] + u[2]*v[2])
65#define ABS(x) ((x) < 0 ? -(x) : (x))
71 if(
ABS(
v[1]) >
ABS(
v[0]) ) { i = 1; }
72 if(
ABS(
v[2]) >
ABS(
v[i]) ) { i = 2; }
80 GLdouble maxVal[3], minVal[3], d1[3], d2[3], tNorm[3];
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; }
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] ) {
104 norm[0] = 0; norm[1] = 0; norm[2] = 1;
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 ) {
135 norm[0] = norm[1] = norm[2] = 0;
154 if(
e->winding <= 0 )
continue;
156 area += (
e->Org->s -
e->Dst->s) * (
e->Org->t +
e->Dst->t);
158 }
while(
e !=
f->anEdge );
171#ifdef FOR_TRITE_TEST_PROGRAM
173extern int RandomSweep;
174#define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0)
175#define S_UNIT_Y (RandomSweep ? (2*drand48()-1) : 0.0)
177#if defined(SLANTED_SWEEP)
187#define S_UNIT_X 0.50941539564955385
188#define S_UNIT_Y 0.86052074622010633
203 int i, computedNormal =
FALSE;
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;
216#if defined(FOR_TRITE_TEST_PROGRAM) || defined(TRUE_PROJECT)
227 w =
Dot( sUnit, norm );
228 sUnit[0] -=
w * norm[0];
229 sUnit[1] -=
w * norm[1];
230 sUnit[2] -=
w * norm[2];
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];
251 v->s =
Dot(
v->coords, sUnit );
252 v->t =
Dot(
v->coords, tUnit );
254 if( computedNormal ) {
#define GLU_TESS_MAX_COORD
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
void __gl_projectPolygon(GLUtesselator *tess)
static void ComputeNormal(GLUtesselator *tess, GLdouble norm[3])
static int LongAxis(GLdouble v[3])
static void CheckOrientation(GLUtesselator *tess)