Changeset 4138 in orxonox.OLD for orxonox/branches/md2_loader/src/lib
- Timestamp:
- May 10, 2005, 10:15:57 AM (20 years ago)
- Location:
- orxonox/branches/md2_loader/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.cc
r4126 r4138 49 49 } 50 50 51 /** 52 \brief draw function 53 54 these function will take NO argument in the final version, just for testing 55 */ 56 void MD2Model::draw(t3DModel *pModel) 57 { 58 if( pModel->objectList->getSize() <= 0) return; 59 60 t3DObject *pObject = pModel->objectList->firstElement(); 61 glBegin(GL_TRIANGLES); 62 for(int j = 0; j < pObject->numOfFaces; j++) 63 { 64 for(int whichVertex = 0; whichVertex < 3; whichVertex++) 65 { 66 int index = pObject->pFaces[j].vertIndex[whichVertex]; 67 int index2 = pObject->pFaces[j].coordIndex[whichVertex]; 68 /* we invert the normals since the md2 file format uses different style */ 69 glNormal3f(-pObject->pNormals[ index ].x, -pObject->pNormals[ index ].y, -pObject->pNormals[ index ].z); 70 if(pObject->pTexVerts) 71 { 72 glTexCoord2f(pObject->pTexVerts[ index2 ].x, pObject->pTexVerts[ index2 ].y); 73 } 74 glVertex3f(pObject->pVerts[ index ].x, pObject->pVerts[ index ].y, pObject->pVerts[ index ].z); 75 } 76 } 77 glEnd(); 78 } 51 79 52 80 /******************************************************************************** -
orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.h
r4079 r4138 118 118 void drawFrame(int frame); 119 119 120 void draw(t3DModel *pModel); 121 120 122 void setAnim(int type); 121 123 void scaleModel(float s);
Note: See TracChangeset
for help on using the changeset viewer.