i will try my best 2 explain my problem
sorry my English
i try to load new models to IRR and
all models have this way +-
Code: Select all
for(int i = 0; i < g_3DModel.numOfObjects; i++)
{
t3DObject *pObject = &g_3DModel.pObject[i];
glBegin(GLTriangles);
// Go through all of the faces (polygons) of the object and draw them
for(int j = 0; j < pObject->numOfFaces; j++)
{
// Go through each corner of the triangle and draw it.
for(int whichVertex = 0; whichVertex < 3; whichVertex++)
{
// Get the vertex index for each point of the face
int vertIndex = pObject->pFaces[j].vertIndex[whichVertex];
// Pass in the current vertex of the object (Corner of current face)
glVertex3f(pObject->pVerts[ vertIndex ].x, pObject->pVerts[ vertIndex ].y, pObject->pVerts[ vertIndex ].z);
}
}
glEnd();
// End the drawing
}
int vertIndex = pObject->pFaces[j].vertIndex[whichVertex];
pObject->pVerts[ vertIndex ]//vertex
we have all triangles .
on IRR we draw by index (drawIndexedTriangleList)
in this code we get the triangle by index
my problem is how i pass the triangles and index
Vertices[0] = video::S3DVertex(
pObject->pVerts[ vertIndex ].x, pObject->pVerts[ vertIndex ].y, pObject->pVerts[ vertIndex ].z,
pObject->pNormals[ vertIndex ].x, pObject->pNormals[ vertIndex ].y, pObject->pNormals[ vertIndex ].z,
video::SColor(255,255,255,255),
pObject->pTexVerts[ coordIndex ].x, pObject->pTexVerts[ coordIndex ].y);
driver->drawIndexedTriangleList(&Vertices[0], 3, ?????, 3);
i next irr version irr must have drawTringleList