Jump to content


wierd animation controller problem


  • You cannot reply to this topic
No replies to this topic

#1 Anddos

    Valued Member

  • Members
  • PipPipPip
  • 177 posts

Posted 21 November 2008 - 09:02 PM

every single time the animation controller is NULL , but the frames render fine the model animations work in the directx sdk viewer...
what can the prob be

// this is the function that puts the 3D models into video RAM

void init_graphics(void)

{

    D3DXCreateTeapot(d3ddev, &meshTeapot, NULL);    // create the teapot


	CMeshHierarchy *memoryAllocator=new CMeshHierarchy;

	


    HRESULT hr = D3DXLoadMeshHierarchyFromX("bones_all.x", 

		                                    D3DXMESH_MANAGED, 

											d3ddev, 

	                                        memoryAllocator, 

											NULL, 

											&m_frameRoot, 

											&m_animController);




	if(SUCCEEDED(hr))

	{

		sprintf(buffer,"%s\n" , "bones_all.x loaded"); 

        WriteConsole(Console , buffer, strlen(buffer),NULL,NULL); 

	}


	if(m_animController)

	{

		int m_numAnimationSets = m_animController->GetMaxNumAnimationSets();

		sprintf(buffer,"%s %d\n" , "m_numAnimationSets",m_numAnimationSets); 

        WriteConsole(Console , buffer, strlen(buffer),NULL,NULL); 

	}

	else

	{

		sprintf(buffer,"%s\n" , "m_animController failed"); 

        WriteConsole(Console , buffer, strlen(buffer),NULL,NULL); 

	}

	

/*

	if(m_frameRoot)

	{

        SetupBoneMatrices((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 in CalculateInitialViewMatrix to position camera correctly)

	    D3DXFrameCalculateBoundingSphere(m_frameRoot, &m_sphereCentre, &m_sphereRadius);

	}

*/

    return;

}







1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users