Sign in to follow this  

Collada controller data sorting

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

Hello.

 

I am trying to implement animation in my engine and I`ve noticed that if controller contained ordered bones (like they present in skeleton) then, animation work fine, but if boned unordered, then I receive kust a mess of polygons.

So, I decided that I need to sort controller bones, but I after that I still doesnt received satisfying result - model is still becomes a mess of triangles.

 

So, I think I must do something else - may be I need to sort joint-weights pairs?

And do I need to do something with mesh, attach to this controller?

 

Could someone, please, point me on the right way?

Share this post


Link to post
Share on other sites
Your controller contains weights, etc, and joint names:
 <library_controllers>
    <controller id="am00_variation6Shape-skin" name="skinCluster1">
      <skin source="#am00_variation6Shape">
        <bind_shape_matrix>1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1</bind_shape_matrix>
        <source id="am00_variation6Shape-skin-joints">
          <Name_array id="am00_variation6Shape-skin-joints-array" count="16">bone0 bone1.....</Name_array>
...
        <source id="am00_variation6Shape-skin-weights">
          <float_array id="am00_variation6Shape-skin-weights-array" count="835">1 0.946 0.051 0.003 0.4 0.3 0.3 0.085 .....</float_array>
...
Your scene contains joint names:
  <library_visual_scenes>
    <visual_scene id="VisualSceneNode" name="crowd">
      <node id="WorldRoot" name="WorldRoot" type="JOINT">
        <node id="Hips" name="Hips" sid="bone0" type="JOINT">
...
The scene is saying that the node named "Hips" is affected by the controller's "bone0" joint.

Your animation data will also contain joint names. You need to link together all the different pieces by matching up their names.

Share this post


Link to post
Share on other sites

Hm, so, you think that I dont need to sort joint-weights, but just match bone names and thta should do the trick?

 

In my case I already did that, but I am asking should I sort bones like they situated in skeleton (because in my case sid and bone names are the same)

 

for ex in skeleton i have bone1 bone 2 bone3 and in controller bone3 bone1 bone2.

Need I sort bones to make them be as bone1 bone 2 bone3?

 

I want to sort bones because I want to optimize animation algorithm and simplify it a little. If I have sorted bones, I could just multiply current animation matrix * parent.

If I have not sorted bones, I need to multiply them in hierarachy till the first level each time.

 

Do you understand what I mean?

Edited by BlackJoker

Share this post


Link to post
Share on other sites

This topic is 1055 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.

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