Skinning and Bones need help
Hi there, in the mesh loading function from most tut's there this bit of code
// Bones for skining
if(m_frameRoot)
{
//MessageBox(NULL,"We HAve Frames", "Test", MB_OK);
TCHAR msg[MAX_PATH];
sprintf_s(msg,MAX_PATH, "We have frames number bones = %d",m_maxBones);
MessageBox(NULL,msg,"Error Code Area 1", MB_OK);
// Set the bones up
SetupBoneMatrices(device,(D3DXFRAME_EXTENDED*)m_frameRoot, NULL);
// Create the bone matrices array for use during FrameMove to hold the final transform
m_boneMatrices = new D3DXMATRIX[m_maxBones];
ZeroMemory(m_boneMatrices, sizeof(D3DXMATRIX)*m_maxBones);
// Calculate the Bounding Sphere for this model (used later to position camera correctly)
D3DXFrameCalculateBoundingSphere(m_frameRoot, &m_sphereCentre, &m_sphereRadius);
}
Question:
Now if m_maxBones = 0 is this going to be a problem.
Because in the one Im using it crashes on this mesh object with no bones or animation
Quote:Original post by ankhd
Question:
Now if m_maxBones = 0 is this going to be a problem.
Because in the one Im using it crashes on this mesh object with no bones or animation
What is your question? You seem to know what's going on - if m_maxBones is zero, just don't do the matrix allocations.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement