Changeset 6033 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Dec 10, 2005, 11:31:12 PM (19 years ago)
- Location:
- trunk/src/lib/graphics/importer
- Files:
-
- 3 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 } -
trunk/src/lib/graphics/importer/model.h
r6022 r6033 132 132 virtual ~Model(); 133 133 134 virtual void draw() const { }134 virtual void draw() const; 135 135 136 136 inline const modelInfo* getModelInfo() const { return &this->pModelInfo; } -
trunk/src/lib/graphics/importer/static_model.cc
r6031 r6033 220 220 ////////// 221 221 /** 222 * Draws the Models of all Groups. 223 It does this by just calling the Lists that must have been created earlier. 224 */ 222 * @brief Draws the Models of all Groups. 223 * 224 * It does this by just calling the Lists that must have been created earlier. 225 */ 225 226 void StaticModel::draw () const 226 227 { … … 233 234 tmpGroup = tmpGroup->next; 234 235 } 235 236 /*237 const GLfloat* pVertices = NULL;238 const GLfloat* pNorm = NULL;239 240 glBegin(GL_TRIANGLES);241 for( int i = 0; i < this->triangleCount; ++i)242 {243 //printf("int i = %i\n", i);244 pNorm = &this->normals->getArray()[this->triangles[i].indexToNormals[0]];245 pVertices = &this->vertices->getArray()[this->triangles[i].indexToVertices[0]];246 glNormal3f(pNorm[0], pNorm[1], pNorm[2]);247 glVertex3f(pVertices[0], pVertices[1], pVertices[2]);248 249 pNorm = &this->normals->getArray()[this->triangles[i].indexToNormals[1]];250 pVertices = &this->vertices->getArray()[this->triangles[i].indexToVertices[1]];251 glNormal3f(pNorm[0], pNorm[1], pNorm[2]);252 glVertex3f(pVertices[0], pVertices[1], pVertices[2]);253 254 pNorm = &this->normals->getArray()[this->triangles[i].indexToNormals[2]];255 pVertices = &this->vertices->getArray()[this->triangles[i].indexToVertices[2]];256 glNormal3f(pNorm[0], pNorm[1], pNorm[2]);257 glVertex3f(pVertices[0], pVertices[1], pVertices[2]);258 259 }260 glEnd();261 */262 236 } 263 237
Note: See TracChangeset
for help on using the changeset viewer.