• Advertisement

Archived

This topic is now archived and is closed to further replies.

extracting a vertex buffer

This topic is 5273 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
m_pMesh->GetFVF();

If you''re using x files and D3DXMeshes, you''ll have to lock the VB to get the data. There''s not much choice there.

I like pie.

Share this post


Link to post
Share on other sites
thanks for the tip,

I''ve used CloneMeshFVF to force the mesh into my FVF format and I seem to have some better data coming from that. There are a lot of mesh functions there to play with

I think I can lock the vertex buffer putting the data in pVertices then unlock the VB and work with pVertices normally.

I''ll get there in the end



Share this post


Link to post
Share on other sites

  • Advertisement