Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

When a mesh is declared as static.....

This topic is 2355 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

Since the skinned mesh is declared as static, it just has one hierarchy.
I have a trouble that when I spawn a couple of copies of identical "Objects" attaching to this single copy of mesh, although I can set their world positions correctly, I can't get the unique combined transformations of their hands.

I tried

f = D3DXFrameFind(mesh->GetFrameRoot(),"Hand");
HandTransform = &f->matCombined; // Same copy no matter how many objects are generated

where mesh is a static copy of the skinnedmesh
After a 2nd copy is created, the hierarchy is still pointing to the first hierarchy structure. When I try to attach an object to the hand of this 2nd object, it will "jump" to the hand of the 1st object rather than going to the 2nd one.

My first attempt was not to use static Skinned mesh, that means each object would get its own copy of mesh. This method yields the correct result. But i'd like to create once and use everywhere. What is your opinion?
Thanks
Jack

Share this post


Link to post
Share on other sites
Advertisement
I can do it. But the problem is I am having to load the mesh 3 times when i need 3 objects. So each hierarchy and matrix are separate and unique.
When I just have one mesh object and dishing out to several game objects, I can just keep one matrix which is the original one that I load in.


f = D3DXFrameFind(root, "Hand");
matrix = &f->matCombined;

root comes from the single hierarchy, So f will be the same each time.
I don't know why. local transformations should be relative to its world counterparts.
But from the above code, what I've got is the same "matrix"? Anyway that i can be resolved, either on Direct3D or C++ level?
Thanks
Jack

Share this post


Link to post
Share on other sites
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!