• Advertisement
Sign in to follow this  

What is the CloneMesh used for when loading a mesh

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

Hi all, I'm trying to learn how to load a X file into d3d and I was woundering why in the tutorials for loading a .X file using the D3DXLoadMeshHierarchyFromX function that it uses the CloneMesh to copy the mesh data into the new mesh container. why can't you just do this newMeshContainer->MeshData.pMesh = pMeshData->pMesh; here is some of the code. With DIRECTX latest D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]; if (FAILED(pMeshData->pMesh->GetDeclaration(Declaration))) return E_FAIL; //pMeshData->pMesh->CloneMeshFVF(D3DXMESH_MANAGED, // pMeshData->pMesh->GetFVF(), pd3dDevice, // &newMeshContainer->MeshData.pMesh); pMeshData->pMesh->CloneMesh(D3DXMESH_MANAGED, Declaration, pd3dDevice, &newMeshContainer->MeshData.pMesh); And also this code fails to load a mesh that the SDK's MView can load [Edited by - ankhd on March 22, 2007 11:22:07 PM]

Share this post


Link to post
Share on other sites
Advertisement
The most common purpose is to allow the mesh to use different vertex formats.

Share this post


Link to post
Share on other sites
Hi again, Does any body know if there is any Tut's Like the MView(From the SDK)
for loading mesh and with out all the complex stuff in the SDK's mview

Share this post


Link to post
Share on other sites
newMeshContainer->MeshData.pMesh = pMeshData->pMesh;

That line of code will just copy the pointer. They will still point to the same piece of data. If you actually need 2 copies of the mesh, you need to use the CloneMesh functions.

According to google, MView was removed from the DirectX SDK in late 2005. You might want to consider getting the newest DirectX SDK from Microsoft.com.

Share this post


Link to post
Share on other sites
Hi, the MView came from the Extra data down load

Share this post


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

  • Advertisement