Changeset 6033 in orxonox.OLD for trunk/src/lib/graphics/importer/model.cc
- Timestamp:
- Dec 10, 2005, 11:31:12 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/model.cc
r6022 r6033 17 17 18 18 #include "model.h" 19 20 #include "glincl.h" 19 21 20 22 using namespace std; … … 45 47 // delete what has to be deleted here 46 48 } 49 50 51 52 void Model::draw() const 53 { 54 const GLfloat* pVertices = NULL; 55 const GLfloat* pNorm = NULL; 56 57 glBegin(GL_TRIANGLES); 58 for( int i = 0; i < this->pModelInfo.numTriangles; ++i) 59 { 60 //printf("int i = %i\n", i); 61 pNorm = &this->pModelInfo.pNormals[this->pModelInfo.pTriangles[i].indexToNormals[0]]; 62 pVertices = &this->pModelInfo.pVertices[this->pModelInfo.pTriangles[i].indexToVertices[0]]; 63 glNormal3f(pNorm[0], pNorm[1], pNorm[2]); 64 glVertex3f(pVertices[0], pVertices[1], pVertices[2]); 65 66 pNorm = &this->pModelInfo.pNormals[this->pModelInfo.pTriangles[i].indexToNormals[1]]; 67 pVertices = &this->pModelInfo.pVertices[this->pModelInfo.pTriangles[i].indexToVertices[1]]; 68 glNormal3f(pNorm[0], pNorm[1], pNorm[2]); 69 glVertex3f(pVertices[0], pVertices[1], pVertices[2]); 70 71 pNorm = &this->pModelInfo.pNormals[this->pModelInfo.pTriangles[i].indexToNormals[2]]; 72 pVertices = &this->pModelInfo.pVertices[this->pModelInfo.pTriangles[i].indexToVertices[2]]; 73 glNormal3f(pNorm[0], pNorm[1], pNorm[2]); 74 glVertex3f(pVertices[0], pVertices[1], pVertices[2]); 75 76 } 77 glEnd(); 78 }
Note: See TracChangeset
for help on using the changeset viewer.