Original Post
How can I get a polygon from a mesh? I thought I take vertexbuffer for it and every 3 vertices make up a polygon:
//FVF is (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1)
//m3dData is of type VERTEX3D {D3DXVECTOR3 position,normal; D3DXVECTOR2 texture;}
//ppData is VOID*
m_pMesh->LockVertexBuffer(0,(BYTE**)&ppData);
memcpy(m3dData,ppData,mMesh->sizeOfVertex);
m_pMesh->UnlockVertexBuffer();
for (DWORD counter=0;counterGetNumVertices();counter+=3)
{
m3dData[counter].position; //first vertex of polygon
m3dData[counter+1].position; //second one
m3dData[counter+2].position; //third one
}
But I''m not sure if this is right. Can anybody validate or refute this? Thanks