Sign in to follow this  
ankhd

Skinning and Bones need help

Recommended Posts

ankhd    2304
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

Share this post


Link to post
Share on other sites
circlesoft    1178
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.

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