Can't Clone FVF

Started by
3 comments, last by lucky6969b 12 years, 4 months ago

LPD3DXMESH mesh = NULL;

HRESULT hr = cb_->m_pMesh->GetMesh()->CloneMeshFVF(D3DXMESH_MANAGED, cb_->m_pMesh->GetMesh()->GetFVF(), g_pDevice, &mesh);


Looks really obvious, how come it is not successful in this case?
Thanks
Jack
Advertisement
According to the documentation, this is used to make changes to a mesh, not reproduce the same mesh.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Hi Spiro, I am wondering what way is the correct way of cloning a static mesh. Because I just have one copy of the mesh, but have several copies of "objects" "attached" to it if I use something like this to iterate many objects of the same kind root = m_pObject->m_pMesh->GetFrameRoot(); f = D3DXFrameFind (root, "Hand"); someMatrix = &f->matCombined; m_pObject will be dintinct each iteration. However m_pMesh will be the same mesh. Therefore, it will retreive the same mesh, several picked-up object will be "attaching" to the same hand. I want "someMatrix" to be different hence "root" to be different over each iteration. Anyways this can be done? Thanks Jack
Hi Spiro,
I am wondering what way is the correct way of cloning a static mesh.
Because I just have one copy of the mesh, but have several copies of "objects" "attached" to it
if I use something like this to iterate many objects of the same kind

root = m_pObject->m_pMesh->GetFrameRoot();
f = D3DXFrameFind (root, "Hand");
someMatrix = &f->matCombined;


m_pObject will be dintinct on each iteration. However m_pMesh will be the same mesh. Therefore, it will
retreive the same mesh, several picked-up object will be "attaching" to the same hand. I want "someMatrix" to be different hence "root" to be different over each iteration. Anyways this can be done?
Thanks
Jack
Why don’t you have each object use the same mesh with different matrices?


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Hmmm... The cornerstone is I have to retrieve the matrix I am after from the static mesh.... Otherwise, they will be different.

XX <- Mesh Hierarchy
/ | \
object a b c


Actually, I am looking for the hand of the humanoid mesh, it comes from the combined transformation matrix of a single mesh.
There is not a second matrix that I can manipulate which can be used to control the hand. The point is retrieval.
Any help is greatly appreciated!
Thanks
Jack

This topic is closed to new replies.

Advertisement