Sign in to follow this  

Skinned mesh and shadow volume

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. 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)
	UINT iMaterial;
	UINT NumBlend;
	UINT iAttrib;
	DWORD AttribIdPrev;

	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] );

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

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