Sign in to follow this  

Fail to clone a mesh using CloneMeshFVF()

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

The book I'm studying tells that A secondary Mesh container is needed because the original interface ID3DXMesh that D3DXLoadSkinMeshFromXof() loads into is the base Mesh that we refer to and we should not change the original vertex coordinates. Then my book tries to use CloneMeshFVF() to create a secondary Mesh object. I've tried its sample and then I failed to clone a mesh with it. The following is the way the example codes call this function. -- DWORD fvftype = pMesh->MeshData.pMesh->GetFVF(); DWORD options = pMesh->MeshData.pMesh->GetOptions(); if(pMesh->pSkinInfo) pMesh->MeshData.pMesh->CloneMeshFVF( options, //D3DXMESH_MANAGED, fvftype, pDevice, &pMesh->pSkinMesh); -- The code fails to assign pMesh->pSkinMesh an address (the fvftype == 0 and return NULL). Then I've tried to change the 2nd argument to (fvftype | D3DFVF_NORMAL). It succeeded. But then pMesh->pSkinMesh->DrawSubset() can't render anything. Could anyone tell me why? Thanx.

Share this post


Link to post
Share on other sites
So you're saying the incoming FVF, fvftype, is zero? Which would indicate that its not in a vertex format expressable via the FVF system (e.g. it includes tangents/bitangents). Try using the regular CloneMesh() and use GetDeclaration() instead of GetFVF().

Alternatively, run it against the debug runtimes and see what output you get - if a function fails then the debug runtimes will almost always tell you why [wink]

hth
Jack

Share this post


Link to post
Share on other sites
I've debuged the sample code with my VC6.0 debuger program and when I ran step-by-step debugging under this code section, the context window showed that zero value. So, I kinda don't know what you mean by your 2nd setence. Doesn't the debug runtime only tell you the problems on the avaiable source code files that have kept debugging infomation in the debug-mode compilation? Therefore, how can I easily know what's wrong with the execution of interfaces like CloneMeshFVF which are provided by the library?

I've tried the CloneMesh() and it works! Thanx a lot!

Share this post


Link to post
Share on other sites

This topic is 4200 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this