UpdateSkinnedMesh() issue
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 = (*m_RootMesh->pSkinInfo->GetBoneOffsetMatrix(i));
if(m_RootMesh->ppFrameMatrices)
m_RootMesh->pBoneMatrices *= (*m_RootMesh->ppFrameMatrices);
}
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();
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement