Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > DoxygenbezierPatchMesh.cc
Go to the documentation of this file.
00001 /* 00002 ** License Applicability. Except to the extent portions of this file are 00003 ** made subject to an alternative license as permitted in the SGI Free 00004 ** Software License B, Version 1.1 (the "License"), the contents of this 00005 ** file are subject only to the provisions of the License. You may not use 00006 ** this file except in compliance with the License. You may obtain a copy 00007 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 00008 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: 00009 ** 00010 ** http://oss.sgi.com/projects/FreeB 00011 ** 00012 ** Note that, as provided in the License, the Software is distributed on an 00013 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS 00014 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND 00015 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A 00016 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. 00017 ** 00018 ** Original Code. The Original Code is: OpenGL Sample Implementation, 00019 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, 00020 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. 00021 ** Copyright in any portions created by third parties is as indicated 00022 ** elsewhere herein. All Rights Reserved. 00023 ** 00024 ** Additional Notice Provisions: The application programming interfaces 00025 ** established by SGI in conjunction with the Original Code are The 00026 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released 00027 ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version 00028 ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X 00029 ** Window System(R) (Version 1.3), released October 19, 1998. This software 00030 ** was created using the OpenGL(R) version 1.2.1 Sample Implementation 00031 ** published by SGI, but has not been independently verified as being 00032 ** compliant with the OpenGL(R) version 1.2.1 Specification. 00033 ** 00034 ** $Date: 2009-03-29 13:39:18 +0000 (Sun, 29 Mar 2009) $ $Revision: 1.1 $ 00035 */ 00036 /* 00037 ** $Header: /cygdrive/c/RCVS/CVS/ReactOS/reactos/lib/glu32/libnurbs/interface/bezierPatchMesh.cc,v 1.1 2004/02/02 16:39:08 navaraf Exp $ 00038 */ 00039 00040 #include "gluos.h" 00041 #include <stdlib.h> 00042 #include <stdio.h> 00043 #include <assert.h> 00044 #include <GL/gl.h> 00045 #include "bezierEval.h" 00046 #include "bezierPatchMesh.h" 00047 00048 static int isDegenerate(float A[2], float B[2], float C[2]); 00049 00050 void drawStrips(float *vertex_array, float *normal_array, int *length_array, GLenum *type_array, int num_strips) 00051 { 00052 int i,j,k; 00053 k=0; 00054 /*k is the index of the first component of the current vertex*/ 00055 for(i=0; i<num_strips; i++) 00056 { 00057 glBegin(type_array[i]); 00058 for(j=0; j<length_array[i]; j++) 00059 { 00060 glNormal3fv(normal_array+k); 00061 glVertex3fv(vertex_array+k); 00062 k += 3; 00063 } 00064 glEnd(); 00065 } 00066 } 00067 00068 void bezierPatchMeshListDelDeg(bezierPatchMesh* list) 00069 { 00070 bezierPatchMesh* temp; 00071 for(temp=list; temp != NULL; temp = temp->next) 00072 { 00073 bezierPatchMeshDelDeg(temp); 00074 } 00075 } 00076 00077 void bezierPatchMeshListDelete(bezierPatchMesh *list) 00078 { 00079 if(list == NULL) return; 00080 bezierPatchMeshListDelete(list->next); 00081 bezierPatchMeshDelete(list); 00082 } 00083 00084 00085 00086 00087 bezierPatchMesh* bezierPatchMeshListReverse(bezierPatchMesh* list) 00088 { 00089 bezierPatchMesh* ret=NULL; 00090 bezierPatchMesh* temp; 00091 bezierPatchMesh* nextone; 00092 for(temp = list; temp != NULL; temp = nextone) 00093 { 00094 nextone = temp->next; 00095 ret=bezierPatchMeshListInsert(ret, temp); 00096 } 00097 return ret; 00098 } 00099 00100 /*maptype is either GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4 00101 */ 00102 bezierPatchMesh *bezierPatchMeshMake(int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints, int size_UVarray, int size_length_array) 00103 { 00104 int i,j,k; 00105 int dimension; 00106 int the_ustride; 00107 int the_vstride; 00108 00109 if(maptype == GL_MAP2_VERTEX_3) dimension = 3; 00110 else if (maptype==GL_MAP2_VERTEX_4) dimension = 4; 00111 else { 00112 fprintf(stderr, "error in inMap2f, maptype=%i is wrong, maptype,map is invalid\n", maptype); 00113 return NULL; 00114 } 00115 00116 bezierPatchMesh *ret = (bezierPatchMesh*) malloc(sizeof(bezierPatchMesh)); 00117 assert(ret); 00118 00119 ret->bpatch_normal = NULL; 00120 ret->bpatch_color = NULL; 00121 ret->bpatch_texcoord = NULL; 00122 ret->bpatch = bezierPatchMake(umin, vmin, umax, vmax, uorder, vorder, dimension); 00123 00124 /*copy the control points there*/ 00125 the_ustride = vorder * dimension; 00126 the_vstride = dimension; 00127 for(i=0; i<uorder; i++) 00128 for(j=0; j<vorder; j++) 00129 for(k=0; k<dimension; k++) 00130 ret->bpatch->ctlpoints[i * the_ustride + j*the_vstride+k] = ctlpoints[i*ustride+j*vstride+k]; 00131 00132 00133 ret->size_UVarray = size_UVarray; 00134 ret->size_length_array = size_length_array; 00135 ret->UVarray = (float*) malloc(sizeof(float) * size_UVarray); 00136 assert(ret->UVarray); 00137 ret->length_array = (int *)malloc(sizeof(int) * size_length_array); 00138 assert(ret->length_array); 00139 ret->type_array = (GLenum *)malloc(sizeof(GLenum) * size_length_array); 00140 assert(ret->type_array); 00141 00142 ret->index_UVarray = 0; 00143 ret->index_length_array = 0; 00144 00145 ret->vertex_array = NULL; 00146 ret->normal_array = NULL; 00147 ret->color_array = NULL; 00148 ret->texcoord_array = NULL; 00149 00150 ret->next = NULL; 00151 return ret; 00152 } 00153 00154 bezierPatchMesh *bezierPatchMeshMake2(int size_UVarray, int size_length_array) 00155 { 00156 bezierPatchMesh *ret = (bezierPatchMesh*) malloc(sizeof(bezierPatchMesh)); 00157 assert(ret); 00158 00159 ret->bpatch = NULL; 00160 ret->bpatch_normal = NULL; 00161 ret->bpatch_color = NULL; 00162 ret->bpatch_texcoord = NULL; 00163 00164 ret->size_UVarray = size_UVarray; 00165 ret->size_length_array = size_length_array; 00166 ret->UVarray = (float*) malloc(sizeof(float) * size_UVarray); 00167 assert(ret->UVarray); 00168 ret->length_array = (int *)malloc(sizeof(int) * size_length_array); 00169 assert(ret->length_array); 00170 ret->type_array = (GLenum *)malloc(sizeof(GLenum) * size_length_array); 00171 assert(ret->type_array); 00172 00173 ret->index_UVarray = 0; 00174 ret->index_length_array = 0; 00175 00176 ret->vertex_array = NULL; 00177 ret->normal_array = NULL; 00178 ret->color_array = NULL; 00179 ret->texcoord_array = NULL; 00180 00181 ret->next = NULL; 00182 return ret; 00183 } 00184 00185 void bezierPatchMeshPutPatch(bezierPatchMesh *bpm, int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints) 00186 { 00187 switch(maptype){ 00188 case GL_MAP2_VERTEX_3: 00189 bpm->bpatch = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 3, ustride, vstride, ctlpoints); 00190 break; 00191 case GL_MAP2_VERTEX_4: 00192 bpm->bpatch = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 4,ustride, vstride, ctlpoints ); 00193 break; 00194 case GL_MAP2_NORMAL: 00195 bpm->bpatch_normal = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 3, ustride, vstride, ctlpoints); 00196 break; 00197 case GL_MAP2_INDEX: 00198 bpm->bpatch_color = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 1, ustride, vstride, ctlpoints); 00199 break; 00200 case GL_MAP2_COLOR_4: 00201 bpm->bpatch_color = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 4, ustride, vstride, ctlpoints); 00202 break; 00203 case GL_MAP2_TEXTURE_COORD_1: 00204 bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 1, ustride, vstride, ctlpoints); 00205 break; 00206 case GL_MAP2_TEXTURE_COORD_2: 00207 bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 2, ustride, vstride, ctlpoints); 00208 break; 00209 case GL_MAP2_TEXTURE_COORD_3: 00210 bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 3, ustride, vstride, ctlpoints); 00211 break; 00212 case GL_MAP2_TEXTURE_COORD_4: 00213 bpm->bpatch_texcoord = bezierPatchMake2(umin, vmin, umax, vmax, uorder, vorder, 4, ustride, vstride, ctlpoints); 00214 break; 00215 default: 00216 fprintf(stderr, "error in bezierPatchMeshPutPatch, maptype=%i is wrong, maptype,map is invalid\n", maptype); 00217 } 00218 } 00219 00220 00221 /*delete everything including the arrays. So if you want to output the 00222 *pointers of the arrays, you should not use this function to deallocate space. 00223 *you should dealocate manually 00224 */ 00225 void bezierPatchMeshDelete(bezierPatchMesh *bpm) 00226 { 00227 if(bpm->bpatch != NULL) 00228 bezierPatchDelete(bpm->bpatch); 00229 if(bpm->bpatch_normal != NULL) 00230 bezierPatchDelete(bpm->bpatch_normal); 00231 if(bpm->bpatch_color != NULL) 00232 bezierPatchDelete(bpm->bpatch_color); 00233 if(bpm->bpatch_texcoord != NULL) 00234 bezierPatchDelete(bpm->bpatch_texcoord); 00235 00236 free(bpm->UVarray); 00237 free(bpm->length_array); 00238 free(bpm->vertex_array); 00239 free(bpm->normal_array); 00240 free(bpm->type_array); 00241 free(bpm); 00242 } 00243 00244 /*begin a strip 00245 *type is the primitive type: 00246 */ 00247 void bezierPatchMeshBeginStrip(bezierPatchMesh *bpm, GLenum type) 00248 { 00249 bpm->counter = 0; 00250 bpm->type = type; 00251 } 00252 00253 /*signal the end of the current strip*/ 00254 void bezierPatchMeshEndStrip(bezierPatchMesh *bpm) 00255 { 00256 int i; 00257 00258 /*if there are no vertices in this strip, then nothing needs to be done*/ 00259 if(bpm->counter == 0) return; 00260 00261 /*if the length_array is full, it should be expanded*/ 00262 if(bpm->index_length_array >= bpm->size_length_array) 00263 { 00264 int *temp = (int*) malloc(sizeof(int) * (bpm->size_length_array*2 + 1)); 00265 assert(temp); 00266 GLenum *temp_type = (GLenum*) malloc(sizeof(GLenum) * (bpm->size_length_array*2 + 1)); 00267 assert(temp_type); 00268 /*update the size*/ 00269 bpm->size_length_array = bpm->size_length_array*2 + 1; 00270 00271 /*copy*/ 00272 for(i=0; i<bpm->index_length_array; i++) 00273 { 00274 temp[i] = bpm->length_array[i]; 00275 temp_type[i] = bpm->type_array[i]; 00276 } 00277 00278 /*deallocate old array*/ 00279 free(bpm->length_array); 00280 free(bpm->type_array); 00281 00282 /*point to the new array which is twice as bigger*/ 00283 bpm->length_array = temp; 00284 bpm->type_array = temp_type; 00285 } 00286 bpm->type_array[bpm->index_length_array] = bpm->type; 00287 bpm->length_array[bpm->index_length_array++] = bpm->counter; 00288 00289 } 00290 00291 /*insert (u,v) */ 00292 void bezierPatchMeshInsertUV(bezierPatchMesh *bpm, float u, float v) 00293 { 00294 int i; 00295 /*if the UVarray is full, it should be expanded*/ 00296 if(bpm->index_UVarray+1 >= bpm->size_UVarray) 00297 { 00298 float *temp = (float*) malloc(sizeof(float) * (bpm->size_UVarray * 2 + 2)); 00299 assert(temp); 00300 00301 /*update the size*/ 00302 bpm->size_UVarray = bpm->size_UVarray*2 + 2; 00303 00304 /*copy*/ 00305 for(i=0; i<bpm->index_UVarray; i++) 00306 { 00307 temp[i] = bpm->UVarray[i]; 00308 } 00309 00310 /*deallocate old array*/ 00311 free(bpm->UVarray); 00312 00313 /*pointing to the new arrays*/ 00314 bpm->UVarray = temp; 00315 } 00316 /*insert the new UV*/ 00317 bpm->UVarray[bpm->index_UVarray] = u; 00318 bpm->index_UVarray++; 00319 bpm->UVarray[bpm->index_UVarray] = v; 00320 bpm->index_UVarray++; 00321 00322 /*update counter: one more vertex*/ 00323 bpm->counter++; 00324 00325 00326 } 00327 00328 void bezierPatchMeshPrint(bezierPatchMesh *bpm) 00329 { 00330 int i; 00331 printf("the bezier patch is\n"); 00332 bezierPatchPrint(bpm->bpatch); 00333 printf("index_length_array= %i\n", bpm->index_length_array); 00334 printf("size_length_array =%i\n", bpm->size_length_array); 00335 printf("index_UVarray =%i\n", bpm->index_UVarray); 00336 printf("size_UVarray =%i\n", bpm->size_UVarray); 00337 printf("UVarray is\n"); 00338 for(i=0; i<bpm->index_UVarray; i++) 00339 printf("%f ", bpm->UVarray[i]); 00340 00341 printf("length_array is\n"); 00342 for(i=0; i<bpm->index_length_array; i++) 00343 printf("%i ", bpm->length_array[i]); 00344 printf("\n"); 00345 00346 } 00347 00348 /*insert a new patch in front of the current linked list and return the new list*/ 00349 bezierPatchMesh* bezierPatchMeshListInsert(bezierPatchMesh* list, bezierPatchMesh* bpm) 00350 { 00351 bpm->next=list; 00352 return bpm; 00353 } 00354 00355 /*print all the patches*/ 00356 void bezierPatchMeshListPrint(bezierPatchMesh* list) 00357 { 00358 bezierPatchMesh *temp; 00359 for(temp = list; temp != NULL; temp = temp->next) 00360 { 00361 bezierPatchMeshPrint(temp); 00362 } 00363 } 00364 00365 int bezierPatchMeshListTotalStrips(bezierPatchMesh* list) 00366 { 00367 int sum=0; 00368 bezierPatchMesh *temp; 00369 for(temp=list; temp != NULL; temp = temp->next) 00370 { 00371 sum += temp->index_length_array; 00372 } 00373 return sum; 00374 } 00375 00376 int bezierPatchMeshListTotalVert(bezierPatchMesh* list) 00377 { 00378 int sum=0; 00379 bezierPatchMesh *temp; 00380 for(temp=list; temp != NULL; temp = temp->next) 00381 { 00382 sum += temp->index_UVarray; 00383 } 00384 return sum/2; 00385 } 00386 00387 int bezierPatchMeshListNumTriangles(bezierPatchMesh* list) 00388 { 00389 int sum=0; 00390 bezierPatchMesh* temp; 00391 for(temp=list; temp != NULL; temp = temp->next) 00392 { 00393 sum += bezierPatchMeshNumTriangles(temp); 00394 } 00395 return sum; 00396 } 00397 00398 int bezierPatchMeshNumTriangles(bezierPatchMesh* bpm) 00399 { 00400 int i; 00401 int sum=0; 00402 for(i=0; i<bpm->index_length_array; i++) 00403 { 00404 switch(bpm->type_array[i]) 00405 { 00406 case GL_TRIANGLES: 00407 sum += bpm->length_array[i]/3; 00408 break; 00409 case GL_TRIANGLE_FAN: 00410 if(bpm->length_array[i] > 2) 00411 sum += bpm->length_array[i]-2; 00412 break; 00413 case GL_TRIANGLE_STRIP: 00414 if(bpm->length_array[i] > 2) 00415 sum += bpm->length_array[i]-2; 00416 break; 00417 case GL_QUAD_STRIP: 00418 if(bpm->length_array[i]>2) 00419 sum += (bpm->length_array[i]-2); 00420 break; 00421 default: 00422 fprintf(stderr,"error in bezierPatchMeshListNumTriangles, type invalid\n"); 00423 } 00424 } 00425 return sum; 00426 } 00427 00428 /*delete degenerate triangles*/ 00429 void bezierPatchMeshDelDeg(bezierPatchMesh* bpm) 00430 { 00431 if(bpm == NULL) return; 00432 int i,j,k; 00433 int *new_length_array; 00434 GLenum *new_type_array; 00435 int index_new_length_array; 00436 float *new_UVarray; 00437 int index_new_UVarray; 00438 00439 new_length_array = (int*)malloc(sizeof(int) * bpm->index_length_array); 00440 assert(new_length_array); 00441 new_type_array = (GLenum*)malloc(sizeof(GLenum) * bpm->index_length_array); 00442 assert(new_length_array); 00443 new_UVarray = (float*) malloc(sizeof(float) * bpm->index_UVarray); 00444 assert(new_UVarray); 00445 00446 index_new_length_array = 0; 00447 index_new_UVarray=0; 00448 k=0; 00449 for(i=0; i<bpm->index_length_array; i++){ 00450 00451 /*(if not degenerate, we have to copy*/ 00452 if( (bpm->length_array[i] != 3) || (!isDegenerate(bpm->UVarray+k, bpm->UVarray+k+2, bpm->UVarray+k+4))) 00453 { 00454 for(j=0; j<2* bpm->length_array[i]; j++) 00455 new_UVarray[index_new_UVarray++] = bpm->UVarray[k++]; 00456 00457 new_length_array[index_new_length_array] = bpm->length_array[i]; 00458 new_type_array[index_new_length_array] = bpm->type_array[i]; 00459 index_new_length_array++; 00460 } 00461 else 00462 { 00463 k += 6; 00464 } 00465 } 00466 free(bpm->UVarray); 00467 free(bpm->length_array); 00468 free(bpm->type_array); 00469 bpm->UVarray=new_UVarray; 00470 bpm->length_array=new_length_array; 00471 bpm->type_array=new_type_array; 00472 bpm->index_UVarray = index_new_UVarray; 00473 bpm->index_length_array = index_new_length_array; 00474 00475 } 00476 00477 /*(u,v) to XYZ 00478 *the xyz and normals are stored in vertex_array, 00479 *and normal_array. the spaces of both are allocated here 00480 */ 00481 void bezierPatchMeshEval(bezierPatchMesh* bpm) 00482 { 00483 int i,j,k,l; 00484 float u,v; 00485 float u0 = bpm->bpatch->umin; 00486 float u1 = bpm->bpatch->umax; 00487 int uorder = bpm->bpatch->uorder; 00488 float v0 = bpm->bpatch->vmin; 00489 float v1 = bpm->bpatch->vmax; 00490 int vorder = bpm->bpatch->vorder; 00491 int dimension = bpm->bpatch->dimension; 00492 int ustride = dimension * vorder; 00493 int vstride = dimension; 00494 float *ctlpoints = bpm->bpatch->ctlpoints; 00495 00496 bpm->vertex_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3); 00497 assert(bpm->vertex_array); 00498 bpm->normal_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3); 00499 assert(bpm->normal_array); 00500 00501 k=0; 00502 l=0; 00503 for(i=0; i<bpm->index_length_array; i++) 00504 { 00505 for(j=0; j<bpm->length_array[i]; j++) 00506 { 00507 u = bpm->UVarray[k]; 00508 v = bpm->UVarray[k+1]; 00509 bezierSurfEval(u0,u1,uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u,v, bpm->vertex_array+l); 00510 bezierSurfEvalNormal(u0,u1,uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u,v, bpm->normal_array+l); 00511 k += 2; 00512 l += 3; 00513 } 00514 } 00515 } 00516 00517 void bezierPatchMeshListEval(bezierPatchMesh* list) 00518 { 00519 bezierPatchMesh* temp; 00520 for(temp = list; temp != NULL; temp = temp->next) 00521 { 00522 bezierPatchMeshEval(temp); 00523 } 00524 } 00525 00526 void bezierPatchMeshDraw(bezierPatchMesh* bpm) 00527 { 00528 int i,j,k; 00529 k=0; 00530 /*k is the index of the first component of the current vertex*/ 00531 for(i=0; i<bpm->index_length_array; i++) 00532 { 00533 glBegin(bpm->type_array[i]); 00534 for(j=0; j<bpm->length_array[i]; j++) 00535 { 00536 glNormal3fv(bpm->normal_array+k); 00537 glVertex3fv(bpm->vertex_array+k); 00538 k+= 3; 00539 } 00540 glEnd(); 00541 } 00542 } 00543 00544 void bezierPatchMeshListDraw(bezierPatchMesh* list) 00545 { 00546 bezierPatchMesh* temp; 00547 for(temp = list; temp != NULL; temp = temp->next) 00548 { 00549 bezierPatchMeshDraw(temp); 00550 } 00551 } 00552 00553 void bezierPatchMeshListCollect(bezierPatchMesh* list, float **vertex_array, float **normal_array, int **length_array, GLenum **type_array, int *num_strips) 00554 { 00555 int i,j,k,l; 00556 bezierPatchMesh *temp; 00557 int total_num_vertices = bezierPatchMeshListTotalVert(list); 00558 (*vertex_array) = (float *) malloc(sizeof(float) * total_num_vertices*3); 00559 assert(*vertex_array); 00560 (*normal_array) = (float *) malloc(sizeof(float) * total_num_vertices*3); 00561 assert(*normal_array); 00562 00563 *num_strips = bezierPatchMeshListTotalStrips(list); 00564 00565 *length_array = (int*) malloc(sizeof(int) * (*num_strips)); 00566 assert(*length_array); 00567 00568 *type_array = (GLenum*) malloc(sizeof(GLenum) * (*num_strips)); 00569 assert(*type_array); 00570 00571 k=0; 00572 l=0; 00573 for(temp = list; temp != NULL; temp = temp->next) 00574 { 00575 int x=0; 00576 for(i=0; i<temp->index_length_array; i++) 00577 { 00578 for(j=0; j<temp->length_array[i]; j++) 00579 { 00580 (*vertex_array)[k] = temp->vertex_array[x]; 00581 (*vertex_array)[k+1] = temp->vertex_array[x+1]; 00582 (*vertex_array)[k+2] = temp->vertex_array[x+2]; 00583 00584 (*normal_array)[k] = temp->normal_array[x]; 00585 (*normal_array)[k+1] = temp->normal_array[x+1]; 00586 (*normal_array)[k+2] = temp->normal_array[x+2]; 00587 00588 x += 3; 00589 k += 3; 00590 } 00591 (*type_array)[l] = temp->type_array[i]; 00592 (*length_array)[l++] = temp->length_array[i]; 00593 } 00594 } 00595 } 00596 00597 00598 00599 static int isDegenerate(float A[2], float B[2], float C[2]) 00600 { 00601 if( (A[0] == B[0] && A[1]==B[1]) || 00602 (A[0] == C[0] && A[1]==C[1]) || 00603 (B[0] == C[0] && B[1]==C[1]) 00604 ) 00605 return 1; 00606 else 00607 return 0; 00608 } 00609 00610 00611 00612 Generated on Sun May 27 2012 04:23:37 for ReactOS by
1.7.6.1
|