Archived

This topic is now archived and is closed to further replies.

adriano_usp

ConvertToBlendedMesh: from DX8 to DX9

Recommended Posts

adriano_usp    396
Hello for All, I''m trying to compile Sarmad Kh. Abdulla code (about skinned meshes) using DirectX9. I only have a problem with the ConvertToBlendedMesh method: In DX8 it has 8 parameters and in DX9 it has 10. Anybody knows to fix it? Thanks.

Share this post


Link to post
Share on other sites
RenderTarget    398
The first thing you should realize is that the old SkinMesh, which used to contain the source mesh within it, has turned into SkinInfo, which doesn''t retain any mesh data itself and sort acts like a vertex filter. That said, the first parameter to ConvertToBlendedMesh is the source mesh whose vertices you want converted to blended vertices. The other new parameter is pMaxFaceInfl. Pass the address of a DWORD to receive the maximum number of bones required for any face (up to four, in the case of CTBM).

Note also that the order of parameters has changed from DX8.1 to DX9, so pay attention to that.

I like pie.

Share this post


Link to post
Share on other sites
adriano_usp    396
Thank you for your reply.

I did what you said, but I''m having a Access Violation error here:

aBoneOffsetMatrix = new D3DXMATRIX[pD3DXSkinMesh->GetNumBones()];
SAFEPOINTER( aBoneOffsetMatrix );
CopyMemory( aBoneOffsetMatrix, pboneoffsetbuf->GetBufferPointer(),sizeof(D3DXMATRIX)*pD3DXSkinMesh->GetNumBones() );

The error is in the last line of the code above.

Do you know what is the possible cause?

Share this post


Link to post
Share on other sites