Changeset 2821 in orxonox.OLD for orxonox/trunk/importer
- Timestamp:
- Nov 12, 2004, 1:20:47 AM (20 years ago)
- Location:
- orxonox/trunk/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/importer/object.cc
r2820 r2821 39 39 return false; 40 40 } 41 vertices = new Array(); 42 normals = new Array(); 43 vTexture = new Array(); 44 41 45 glNewList (listNumber, GL_COMPILE); 42 46 glEnableClientState (GL_VERTEX_ARRAY); … … 51 55 if (verbose >=3) 52 56 printf("finalizing the 3D-Object\n"); 57 OBJ_FILE->close(); 58 glEnd(); 53 59 glEndList(); 54 60 return true; … … 69 75 { 70 76 if (verbose >=1) 71 printf ("unable to open .OBJ file: %s\n", fileName); 77 printf ("unable to open .OBJ file: %s\n Loading Box Object instead.\n", fileName); 78 BoxObject(); 72 79 return false; 73 80 } 74 81 objFileName = fileName; 75 82 char Buffer[500]; 76 vertices = new Array();77 normals = new Array();78 vTexture = new Array();79 83 while(!OBJ_FILE->eof()) 80 84 { … … 123 127 124 128 125 OBJ_FILE->close();126 glEnd();127 129 128 130 } … … 307 309 308 310 311 void Object::BoxObject(void) 312 { 313 readVertex ("-0.500000 -0.500000 0.500000"); 314 readVertex ("0.500000 -0.500000 0.500000"); 315 readVertex ("-0.500000 0.500000 0.500000"); 316 readVertex ("0.500000 0.500000 0.500000"); 317 readVertex ("-0.500000 0.500000 -0.500000"); 318 readVertex ("0.500000 0.500000 -0.500000"); 319 readVertex ("-0.500000 -0.500000 -0.500000"); 320 readVertex ("0.500000 -0.500000 -0.500000"); 321 readVertexTexture ("0.000000 0.000000"); 322 readVertexTexture ("1.000000 0.000000"); 323 readVertexTexture ("0.000000 1.000000"); 324 readVertexTexture ("1.000000 1.000000"); 325 readVertexTexture ("0.000000 2.000000"); 326 readVertexTexture ("1.000000 2.000000"); 327 readVertexTexture ("0.000000 3.000000"); 328 readVertexTexture ("1.000000 3.000000"); 329 readVertexTexture ("0.000000 4.000000"); 330 readVertexTexture ("1.000000 4.000000"); 331 readVertexTexture ("2.000000 0.000000"); 332 readVertexTexture ("2.000000 1.000000"); 333 readVertexTexture ("-1.000000 0.000000"); 334 readVertexTexture ("-1.000000 1.000000"); 335 336 readVertexNormal ("0.000000 0.000000 1.000000"); 337 readVertexNormal ("0.000000 0.000000 1.000000"); 338 readVertexNormal ("0.000000 0.000000 1.000000"); 339 readVertexNormal ("0.000000 0.000000 1.000000"); 340 readVertexNormal ("0.000000 1.000000 0.000000"); 341 readVertexNormal ("0.000000 1.000000 0.000000"); 342 readVertexNormal ("0.000000 1.000000 0.000000"); 343 readVertexNormal ("0.000000 1.000000 0.000000"); 344 readVertexNormal ("0.000000 0.000000 -1.000000"); 345 readVertexNormal ("0.000000 0.000000 -1.000000"); 346 readVertexNormal ("0.000000 0.000000 -1.000000"); 347 readVertexNormal ("0.000000 0.000000 -1.000000"); 348 readVertexNormal ("0.000000 -1.000000 0.000000"); 349 readVertexNormal ("0.000000 -1.000000 0.000000"); 350 readVertexNormal ("0.000000 -1.000000 0.000000"); 351 readVertexNormal ("0.000000 -1.000000 0.000000"); 352 readVertexNormal ("1.000000 0.000000 0.000000"); 353 readVertexNormal ("1.000000 0.000000 0.000000"); 354 readVertexNormal ("1.000000 0.000000 0.000000"); 355 readVertexNormal ("1.000000 0.000000 0.000000"); 356 readVertexNormal ("-1.000000 0.000000 0.000000"); 357 readVertexNormal ("-1.000000 0.000000 0.000000"); 358 readVertexNormal ("-1.000000 0.000000 0.000000"); 359 readVertexNormal ("-1.000000 0.000000 0.000000"); 360 361 readFace ("1/1/1 2/2/2 4/4/3 3/3/4"); 362 readFace ("3/3/5 4/4/6 6/6/7 5/5/8"); 363 readFace ("5/5/9 6/6/10 8/8/11 7/7/12"); 364 readFace ("7/7/13 8/8/14 2/10/15 1/9/16"); 365 readFace ("2/2/17 8/11/18 6/12/19 4/4/20"); 366 readFace ("7/13/21 1/1/22 3/3/23 5/14/24"); 367 } -
orxonox/trunk/importer/object.h
r2820 r2821 51 51 52 52 bool addGLElement (char* elementString); 53 54 void BoxObject (void); 53 55 }; 54 56
Note: See TracChangeset
for help on using the changeset viewer.