Sign in to follow this  
Hotshot5000

UpdateSkinnedMesh() issue

Recommended Posts

I have a problem using skinned meshes. When I load tiny.x not using skinned mesh everything works just fine and I get tiny with her arms streched. When I activate skinned mesh and thus I call UpdateSkinnedMesh() it completely messes up tiny and all I get is an unknown alien shape with something that doesn't even resemble a human being. Any ideas what could have gone wrong?? for(DWORD i = 0; i < NumBones; ++i) { m_RootMesh->pBoneMatrices[i] = (*m_RootMesh->pSkinInfo->GetBoneOffsetMatrix(i)); if(m_RootMesh->ppFrameMatrices[i]) m_RootMesh->pBoneMatrices[i] *= (*m_RootMesh->ppFrameMatrices[i]); } void *SrcPtr, *DestPtr; m_RootMesh->pSkinMesh->LockVertexBuffer(D3DLOCK_READONLY, (void**)&SrcPtr); m_RootMesh->MeshData.pMesh->LockVertexBuffer(0, (void**)&DestPtr); m_RootMesh->pSkinInfo->UpdateSkinnedMesh(m_RootMesh->pBoneMatrices, NULL, SrcPtr, DestPtr); m_RootMesh->MeshData.pMesh->UnlockVertexBuffer(); m_RootMesh->pSkinMesh->UnlockVertexBuffer();

Share this post


Link to post
Share on other sites

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