Jump to content
  • Advertisement
Sign in to follow this  
coderwu

How To Create a ID3DXPMesh [DirectX9.0 & C++] ?

This topic is 4589 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

I have 4 variable: ID3DXMesh* m_pD3DMesh; ID3DXPMesh* m_pLODMesh; LPDIRECT3DVERTEXBUFFER9 m_pVertexBuffer; LPDIRECT3DINDEXBUFFER9 m_pIndexBuffer; I Create the m_pD3DMesh by m_pVertexBuffer and m_pIndexBuffer. And The m_pD3DMesh was created. It's ok that draw the m_pD3DMesh. Now I want to create the m_pLODMesh by m_pD3DMesh. How to do? How to use the fuction that D3DXGeneratePMesh()? Thanks, very much!

Share this post


Link to post
Share on other sites
Advertisement
Some of My Code:

D3DXCreateMeshFVF( ..., ..., ..., ..., ..., m_pD3DMesh );

...
...

m_pD3DMesh->LockVertexBuffer( 0, (void**)&pVertices );
...
...
m_pD3DMesh->UnlockVertexBuffer();

m_pD3DMesh->LockIndexBuffer( 0, (void**)&pIndices );
...
...
m_pD3DMesh->UnlockIndexBuffer();


DWORD* attributeBuffer = 0;
m_pD3DMesh->LockAttributeBuffer(0, &attributeBuffer);

for ( DWORD dwFacetIdx = 0; dwFacetIdx < m_dwNumFacet; dwFacetIdx++ )
{
attributeBuffer[dwFacetIdx] = dwFacetIdx;
}

// Now the ID3DXMesh was created.
// Then, I want to create the ID3DXPMesh from the ID3DXMesh.

How to do?

Thanks!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!