Changeset 4158 in orxonox.OLD for orxonox/branches/md2_loader/src/lib
- Timestamp:
- May 11, 2005, 12:32:36 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/abstract_model.h
r4157 r4158 77 77 char strName[255]; // The name of the object 78 78 CVector3 *pVerts; // The object's vertices 79 CVector3 *pNormals; // The object's normals80 CVector2 *pTexVerts; // The texture's UV coordinates79 CVector3 *pNormals; // The object's normals 80 CVector2 *pTexVerts; // The texture's UV coordinates 81 81 tFace *pFaces; // The faces information of the object 82 82 }; … … 203 203 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); 204 204 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR_MIPMAP_LINEAR); 205 gluBuild2DMipmaps(GL_TEXTURE_2D, 3, image->w, image->h, GL_RGB A, GL_UNSIGNED_BYTE, image->pixels);205 gluBuild2DMipmaps(GL_TEXTURE_2D, 3, image->w, image->h, GL_RGB, GL_UNSIGNED_BYTE, image->pixels); 206 206 207 207 SDL_FreeSurface(image); -
orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.cc
r4157 r4158 56 56 { 57 57 if( pModel->objectList.size() <= 0) return; 58 59 glEnable(GL_TEXTURE_2D); 60 //glBindTexture(GL_TEXTURE_2D, this->diffuseTexture->getTexture()); 58 61 59 62 t3DObject *pObject = &pModel->objectList[0]; … … 69 72 glNormal3f(-pObject->pNormals[index].x, -pObject->pNormals[index].y, -pObject->pNormals[index].z); 70 73 71 if( pObject->pTexVerts)74 if( likely(pObject->pTexVerts != NULL)) 72 75 { 73 glTexCoord2f(pObject->pTexVerts[ index2 ].x, pObject->pTexVerts[ index2].y);76 glTexCoord2f(pObject->pTexVerts[index2].x, pObject->pTexVerts[index2].y); 74 77 } 75 glVertex3f(pObject->pVerts[ index ].x, pObject->pVerts[ index ].y, pObject->pVerts[ index].z);78 glVertex3f(pObject->pVerts[index].x, pObject->pVerts[index].y, pObject->pVerts[index].z); 76 79 } 77 80 } 78 81 glEnd(); 82 83 glDisable(GL_TEXTURE_2D); 79 84 } 80 85
Note: See TracChangeset
for help on using the changeset viewer.