Original Post
having real trouble with getting vertex buffers from meshes.
I''m using a LPD3DXMESH and D3DXLoadMeshFromX to load a landscape from a .x file. The file has been converted from a simple landscape in 3ds max.
Having loaded the file I can render it with no problems.
However, I need to get access to all the data in order to do collision detection so I''ve tried using
m_pMesh->GetVertexBuffer( &pVB );
pVB->Lock( 0, 0, (void**)&m_pVertices, 0 );
so I lock the vertex buffer and put it into a vertex array.
I''m not getting the correct data in m_pVertices as I don''t think I have the correct FVF and don''t know how to find it out.
what I really need is an array of vertices(xyz) in an order I can work with. Is there an easy way to do this?
I don''t really want to be locking and unlocking the vertex buffer during run time either...
Please help