Changeset 3548 in orxonox.OLD for orxonox/trunk/src/lib/graphics/importer/model.cc
- Timestamp:
- Mar 14, 2005, 8:57:25 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/importer/model.cc
r3495 r3548 80 80 Model::~Model(void) 81 81 { 82 PRINTF( 3)("Deleting Model ");82 PRINTF(4)("Deleting Model "); 83 83 if (this->name) 84 84 { 85 PRINT( 3)("%s\n", this->name);85 PRINT(4)("%s\n", this->name); 86 86 delete []this->name; 87 87 } 88 88 else 89 PRINT( 3)("\n");90 91 PRINTF( 3)("Deleting display Lists.\n");89 PRINT(4)("\n"); 90 91 PRINTF(4)("Deleting display Lists.\n"); 92 92 Group* walker = this->firstGroup; 93 93 while (walker != NULL) … … 99 99 } 100 100 101 PRINTF( 3)("Deleting Materials.\n");101 PRINTF(4)("Deleting Materials.\n"); 102 102 if (this->material) 103 103 delete this->material; … … 122 122 void Model::draw (void) const 123 123 { 124 PRINTF( 2)("drawing the 3D-Models\n");124 PRINTF(4)("drawing the 3D-Models\n"); 125 125 Group* walker = this->firstGroup; 126 126 while (walker != NULL) 127 127 { 128 PRINTF( 3)("Drawing model %s\n", walker->name);128 PRINTF(5)("Drawing model %s\n", walker->name); 129 129 glCallList (walker->listNumber); 130 130 walker = walker->next; … … 142 142 if (groupNumber >= this->groupCount) 143 143 { 144 PRINTF( 1)("You requested model number %i, but this File only contains of %i Models.\n", groupNumber-1, this->groupCount);144 PRINTF(2)("You requested model number %i, but this File only contains of %i Models.\n", groupNumber-1, this->groupCount); 145 145 return; 146 146 } 147 PRINTF( 2)("drawing the requested 3D-Models if found.\n");147 PRINTF(4)("drawing the requested 3D-Models if found.\n"); 148 148 Group* walker = this->firstGroup; 149 149 int counter = 0; … … 152 152 if (counter == groupNumber) 153 153 { 154 PRINTF( 2)("Drawing model number %i named %s\n", counter, walker->name);154 PRINTF(4)("Drawing model number %i named %s\n", counter, walker->name); 155 155 glCallList (walker->listNumber); 156 156 return; … … 159 159 walker = walker->next; 160 160 } 161 PRINTF( 1)("Model number %i in %s not Found.\n", groupNumber, this->name);161 PRINTF(2)("Model number %i in %s not Found.\n", groupNumber, this->name); 162 162 return; 163 163 … … 172 172 void Model::draw (char* groupName) const 173 173 { 174 PRINTF( 2)("drawing the requested 3D-Models if found.\n");174 PRINTF(4)("drawing the requested 3D-Models if found.\n"); 175 175 Group* walker = this->firstGroup; 176 176 while (walker != NULL) … … 178 178 if (!strcmp(walker->name, groupName)) 179 179 { 180 PRINTF( 2)("Drawing model %s\n", walker->name);180 PRINTF(4)("Drawing model %s\n", walker->name); 181 181 glCallList (walker->listNumber); 182 182 return; … … 184 184 walker = walker->next; 185 185 } 186 PRINTF( 1)("Model Named %s in %s not Found.\n", groupName, this->name);186 PRINTF(2)("Model Named %s in %s not Found.\n", groupName, this->name); 187 187 return; 188 188 } … … 204 204 bool Model::initialize (void) 205 205 { 206 PRINTF( 2)("new 3D-Model is being created\n");206 PRINTF(4)("new 3D-Model is being created\n"); 207 207 208 208 this->name = NULL; … … 243 243 bool Model::initGroup(Group* group) 244 244 { 245 PRINTF( 3)("Adding new Group\n");245 PRINTF(4)("Adding new Group\n"); 246 246 group->name = ""; 247 247 group->faceMode = -1; … … 277 277 bool Model::cleanup(void) 278 278 { 279 PRINTF( 3)("cleaning up the 3D-Model to save Memory.\n");279 PRINTF(4)("cleaning up the 3D-Model to save Memory.\n"); 280 280 281 281 if (this->vertices) … … 296 296 bool Model::cleanupGroup (Group* group) 297 297 { 298 PRINTF( 3)("Cleaning up group\n");298 PRINTF(5)("Cleaning up group\n"); 299 299 if (group->firstFace != NULL) 300 300 { … … 314 314 bool Model::cleanupFace (Face* face) 315 315 { 316 PRINTF( 3)("Cleaning up Face\n");316 PRINTF(5)("Cleaning up Face\n"); 317 317 318 318 if (face->materialString != NULL) … … 355 355 bool Model::addGroup (char* groupString) 356 356 { 357 PRINTF( 3)("Read Group: %s.\n", groupString);357 PRINTF(5)("Read Group: %s.\n", groupString); 358 358 if (this->groupCount != 0 && this->currentGroup->faceCount>0) 359 359 { … … 384 384 float subbuffer3; 385 385 sscanf (vertexString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3); 386 PRINTF( 3)("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3);386 PRINTF(5)("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3); 387 387 this->vertices->addEntry(subbuffer1*scaleFactor, subbuffer2*scaleFactor, subbuffer3*scaleFactor); 388 388 return true; … … 398 398 bool Model::addVertex(const float x, const float y, const float z) 399 399 { 400 PRINTF( 4)("reading in a vertex: %f %f %f\n", x, y, z);400 PRINTF(5)("reading in a vertex: %f %f %f\n", x, y, z); 401 401 this->vertices->addEntry(x*scaleFactor, y*scaleFactor, z*scaleFactor); 402 402 return true; … … 513 513 float subbuffer3; 514 514 sscanf (normalString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3); 515 PRINTF( 3)("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3);515 PRINTF(5)("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3); 516 516 this->normals->addEntry(subbuffer1, subbuffer2, subbuffer3); 517 517 return true; … … 544 544 float subbuffer2; 545 545 sscanf (vTextureString, "%f %f", &subbuffer1, &subbuffer2); 546 PRINTF( 3)("found vertex-Texture %f, %f\n", &subbuffer1, &subbuffer2);546 PRINTF(5)("found vertex-Texture %f, %f\n", &subbuffer1, &subbuffer2); 547 547 this->vTexture->addEntry(subbuffer1); 548 548 this->vTexture->addEntry(subbuffer2); … … 610 610 if ((this->currentGroup->listNumber = glGenLists(1)) == 0) 611 611 { 612 PRINTF( 1)("list could not be created for this Model\n");612 PRINTF(2)("glList could not be created for this Model\n"); 613 613 return false; 614 614 } … … 628 628 { 629 629 tmpMat->select(); 630 PRINTF( 2)("using material %s for coming Faces.\n", tmpFace->materialString);630 PRINTF(5)("using material %s for coming Faces.\n", tmpFace->materialString); 631 631 } 632 632 else 633 PRINTF( 1)("material %s not found.\n", tmpFace->materialString);633 PRINTF(2)("material %s not found.\n", tmpFace->materialString); 634 634 635 635 … … 646 646 647 647 this->currentGroup->faceMode = 3; 648 PRINTF( 3)("found triag.\n");648 PRINTF(5)("found triag.\n"); 649 649 } 650 650 … … 658 658 } 659 659 this->currentGroup->faceMode = 4; 660 PRINTF( 3)("found quad.\n");660 PRINTF(5)("found quad.\n"); 661 661 } 662 662 … … 666 666 glEnd(); 667 667 glBegin(GL_POLYGON); 668 PRINTF( 3)("Polygon with %i faces found.", tmpFace->vertexCount);668 PRINTF(5)("Polygon with %i faces found.", tmpFace->vertexCount); 669 669 this->currentGroup->faceMode = tmpFace->vertexCount; 670 670 } … … 698 698 bool Model::addGLElement (FaceElement* elem) 699 699 { 700 PRINTF( 3)("importing grafical Element to openGL.\n");700 PRINTF(5)("importing grafical Element to openGL.\n"); 701 701 702 702 if (elem->texCoordNumber != -1) … … 721 721 { 722 722 723 PRINTF( 2)("Normals are being calculated.\n");723 PRINTF(4)("Normals are being calculated.\n"); 724 724 725 725 Vector* normArray = new Vector [vertices->getCount()/3]; … … 778 778 { 779 779 normArray[i].normalize(); 780 PRINTF( 3)("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z);780 PRINTF(5)("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z); 781 781 782 782 this->normals->addEntry(normArray[i].x, normArray[i].y, normArray[i].z); … … 881 881 //printf ("%f %f\n", vz, sin (vz)); 882 882 if (i==0.0) 883 printf("%f, %f\n", j/df*2.0*PI, cos(j/df*PI));883 PRINTF(0)("%f, %f\n", j/df*2.0*PI, cos(j/df*PI)); 884 884 } 885 885 }
Note: See TracChangeset
for help on using the changeset viewer.