Sign in to follow this  
JakeM

Loading DirectX files with D3DXLoadSkinMeshFromXof()

Recommended Posts

When D3DXLoadSkinMeshFromXof() is called for DX9, it returns several parameters including pSkinInfo and pSkinMesh. Question is, if pSkinMesh is changed in anyway afterwards, such as calling CloneMeshFVF, and changing the FVF parameters, and if I plan to replace pSkinMesh with a new mesh by justing releasing the old one, does anything need to be done to pSkinInfo? Are there are any 'internal associations' between these two structures that can be broken or need to be updated? [Edited by - JakeM on November 27, 2006 3:56:22 PM]

Share this post


Link to post
Share on other sites
If you call any function that alters the vertex buffer, you gotta save the buffer that gets returned and pass it into the pSkinInfo::Remap method. Since the pSkinInfo interface maps each bone to the vertices (the vertice's offset in the vertex buffer) each bone influences, you gotta keep them in sync.

Share this post


Link to post
Share on other sites
Thanks, I stumbled across two interesting points, one you mentioned. ID3DXSkinInfo has
two functions called SetFVF() and Remap(). The SDK docs say to use Remap() after the
function Optimize() is called. And I also noticed that both pSkinInfo and pSkinMesh
have the same FVF flags after D3DXLoadSkinMeshFromXof() is called. However, if I use
CloneMeshFVF() on pSkinMesh, pSkinInfo's FVF flags remain the same. I haven't seen
any docs mentioning FVF flags, but I also set pSkinInfo so it's the same too.

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