#include <MilkShapeObject.h>
Inherits OpenGLObject.
Inheritance diagram for MilkShapeObject:
Public Member Functions | |
MilkShapeObject (const char *path, const char *filename) | |
virtual | ~MilkShapeObject () |
Private Attributes | |
int | m_nNumVertices |
Vertex * | m_pVertices |
int | m_nNumindices |
short * | m_pIndices |
Author: Petter Alstermark, petter@alstermark.com
Definition at line 14 of file MilkShapeObject.h.
|
Author: Petter Alstermark, petter@alstermark.com MilkShape obj; obj.loadFromAsciiFile(path, filename); this->m_pIndices = NULL; this->m_pVertices = NULL; this->m_nNumVertices = 0; this->m_nNumindices = 0; int k, i, j; MS_Mesh *pMeshes = NULL; MS_Tri *pTri = NULL; MS_Vec *pVec = NULL; MS_Normal *pN = NULL; float v[3]; int numMeshes = obj.getNumMeshes(); int numTriangles; int numVertices; pMeshes = obj.getMeshes(); for (k=0; k<numMeshes; k++) { numTriangles = pMeshes[k].getNumTriangles(); for each triangle for (i=0; i<pMeshes[k].numTriangles; i++) { pTri = pMeshes[k].triangles + i; for each vertex for (j=0; j<3; j++) { normal pN = pMeshes[k].normals + pTri->n[j]; glNormal3f(pN->x, pN->y, pN->z); texture coordinate pVec = pMeshes[k].vertices + pTri->v[j]; glMultiTexCoord2fARB(GL_TEXTURE0_ARB, pVec->u, pVec->v); glVertex3f(pVec->x, pVec->y, pVec->z); } } } obj.clear(); Definition at line 12 of file MilkShapeObject.cpp. |
|
Definition at line 63 of file MilkShapeObject.cpp. |
|
Definition at line 22 of file MilkShapeObject.h. |
|
Definition at line 20 of file MilkShapeObject.h. |
|
Definition at line 23 of file MilkShapeObject.h. |
|
Definition at line 21 of file MilkShapeObject.h. |