Changeset 4232 in orxonox.OLD for orxonox/branches/md2_loader
- Timestamp:
- May 20, 2005, 12:47:26 AM (20 years ago)
- Location:
- orxonox/branches/md2_loader/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.cc
r4229 r4232 529 529 530 530 531 bool MD2Model2::loadModel(const char *fileName)531 bool MD2Model2::loadModel(const char* fileName) 532 532 { 533 533 FILE *pFile; //file stream … … 543 543 return false; 544 544 } 545 this->header = new tMd2Header; 545 546 fread(this->header, 1, sizeof(tMd2Header), pFile); 546 547 /* check for the header version: make sure its a md2 file :) */ … … 551 552 } 552 553 554 this->fileName = new char[strlen(fileName)+1]; 555 strcpy(this->fileName, fileName); 553 556 /* got the data: map it to locals */ 554 557 this->numFrames = this->header->numFrames; … … 644 647 645 648 //printf(" pVertices %f, %f, %f\n", pVertices[i][0], pVertices[i][1], pVertices[i][2]); 646 printf(" list: %f, %f, %f \n", verticesList[i][0], verticesList[i][1], verticesList[i][2]);649 //printf(" list: %f, %f, %f \n", verticesList[i][0], verticesList[i][1], verticesList[i][2]); 647 650 } 648 651 } … … 783 786 glVertex3fv(verticesList[pCommands[2]]); 784 787 785 printf("draw vert: %f, %f, %f\n", verticesList[pCommands[2]][0], verticesList[pCommands[2]][1], verticesList[pCommands[2]][2] );788 //printf("draw vert: %f, %f, %f\n", verticesLit[pCommands[2]][0], verticesList[pCommands[2]][1], verticesList[pCommands[2]][2] ); 786 789 } 787 790 glEnd(); … … 794 797 void MD2Model2::debug() 795 798 { 796 PRINT(0)("==========================| MD2Model2::debug() |==="); 797 //PRINT(0)("= Model Name: %s", this->header->); 798 PRINT(0)("= "); 799 } 800 /* 801 802 int ident; //!< This is used to identify the file 803 int version; //!< The version number of the file (Must be 8) 804 805 int skinWidth; //!< The skin width in pixels 806 int skinHeight; //!< The skin height in pixels 807 int frameSize; //!< The size in bytes the frames are 808 809 int numSkins; //!< The number of skins associated with the model 810 int numVertices; //!< The number of vertices (constant for each frame) 811 int numTexCoords; //!< The number of texture coordinates 812 int numTriangles; //!< The number of faces (polygons) 813 int numGlCommands; //!< The number of gl commands 814 int numFrames; //!< The number of animation frames 815 816 int offsetSkins; //!< The offset in the file for the skin data 817 int offsetTexCoords; //!< The offset in the file for the texture data 818 int offsetTriangles; //!< The offset in the file for the face data 819 int offsetFrames; //!< The offset in the file for the frames data 820 int offsetGlCommands; //!< The offset in the file for the gl commands data 821 int offsetEnd; //!< The end of the file offset 822 */ 799 PRINT(0)("==========================| MD2Model2::debug() |===\n"); 800 PRINT(0)("= Model FileName:\t%s\n", this->fileName); 801 PRINT(0)("= Size in Memory:\t%i Bytes\n", this->header->frameSize * this->header->numFrames + 64); // 64bytes is the header size 802 PRINT(0)("= Number of Vertices:\t%i\n", this->header->numVertices); 803 PRINT(0)("= Number of Frames: \t%i\n", this->header->numFrames); 804 PRINT(0)("= Height, Width\t\t%i, %i\n", this->header->skinHeight, this->header->skinWidth); 805 PRINT(0)("===================================================\n\n"); 806 } -
orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.h
r4227 r4232 237 237 int numTriangles; 238 238 int numGLCommands; 239 char* fileName; 240 tMd2Header* header; 239 241 240 242 sVec3D* pVertices; … … 246 248 sAnimState animationState; 247 249 float scaleFactor; 248 tMd2Header* header;249 250 }; 250 251 -
orxonox/branches/md2_loader/src/world_entities/test_entity.cc
r4224 r4232 33 33 this->md2Model2->loadModel("../data/models/tris.md2"); 34 34 this->md2Model2->loadSkin("../data/models/tris.pcx"); 35 36 this->md2Model2->debug(); 35 37 } 36 38
Note: See TracChangeset
for help on using the changeset viewer.