Jump to content
  • Advertisement
Sign in to follow this  
axelfr74

Skinned mesh and shadow volume

This topic is 5099 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm tying to generate a shadow volume of a skinned animated mesh. I have no problems generating the shadow volume from a LPD3DXMESH and no problems to generate and render a skinned mesh with animations. BUT..how do it put these parts together? I thought of catching the LPD3DXMESH of my skinned mesh after drawing the subsets like shown here:
void D3DSkinnedMesh::SkinnedMeshContainerClass::DrawMeshContainer(LPD3DXMESHCONTAINER pMeshContainerBase, LPD3DXFRAME pFrameBase)
{
	D3DXMESHCONTAINER_DERIVED *pMeshContainer = (D3DXMESHCONTAINER_DERIVED*)pMeshContainerBase;
	D3DXFRAME_DERIVED *pFrame = (D3DXFRAME_DERIVED*)pFrameBase;
	UINT iMaterial;
	UINT NumBlend;
	UINT iAttrib;
	DWORD AttribIdPrev;
	LPD3DXBONECOMBINATION pBoneComb;

	UINT iMatrixIndex;
	UINT iPaletteEntry;
	D3DXMATRIXA16 matTemp;

	shadowMesh = pMeshContainer->MeshData.pMesh;
	D3DXComputeNormals(shadowMesh, NULL);

	m_pd3dDevice->SetTransform(D3DTS_WORLD, &pFrame->CombinedTransformationMatrix);

	

	for (iMaterial = 0; iMaterial < pMeshContainer->NumMaterials; iMaterial++)
	{
		m_pd3dDevice->SetMaterial( &pMeshContainer->pMaterials[iMaterial].MatD3D );
		m_pd3dDevice->SetTexture( 0, pMeshContainer->ppTextures[iMaterial] );
		pMeshContainer->MeshData.pMesh->DrawSubset(iMaterial);
	}

}
After doing this there is something in my shadowMesh..but far away from the mesh I need. What can I do? Where do I have to fetch the needed LPD3DXMESH? Thanks for any help. AXel

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!