3

Ive been able to load static geometry using my own loader for collada that I wrote. However the next step is to add animation. The problem I am having is what do when an instance_controller has multiple skeletons. In my current model I am trying to load every node that is rigged is referencing every joint. For example

<instance_controller url="#geom-Cylinder018-skin1">
<skeleton>#node-Bone024</skeleton>
<skeleton>#node-Bone020</skeleton>
<skeleton>#node-Bone016</skeleton>
<skeleton>#node-Bone009</skeleton>
<skeleton>#node-Bone005</skeleton>
<skeleton>#node-Bone001</skeleton>
<skeleton>#node-Bone025</skeleton>

I am not sure what I am suppose to do with this? At the moment I am linking them all to the correct nodes in the visual_scene. However every node in the model does what you see above! Ive loaded it using AssimpView just to see that it actual is rendered and that works fine. Can anybody explain to me what I am suppose to do in the above situation. Thanks

Chris Condy
  • 626
  • 2
  • 9
  • 25

1 Answers1

6

In the COLLADA spec, it says that the <skeleton> underneath <instance_controller>:

Indicates where a skin controller is to start to search for the joint nodes it needs

So, having multiple skeleton pointers inside the instance_controller just means that the nodes pointed to should all be searched for the correct joint nodes. The <controller> itself tells you which nodes should be used for the joints. It will have a source that looks something like this:

<library_controllers>
  <controller id="skin">
    <skin source="#base_mesh">
      <source id="Joints">
        <Name_array count="4"> Root Spine1 Spine2 Head </Name_array>
        ...
      </source>
      ...
  </controller>
</library_controllers>

The <node> that <skeleton> points to should be searched for a node with the sid of each joint name. For example, for the above controller, the node pointed to looks like this:

<node id="Skeleton1" sid="Root">
  <node sid="Spine1">
    <node sid="Spine2">
      <node sid="Head"/>
    </node>
  </node>
</node>

Each joint name in the controller corresponds to the node with that sid value. If you have multiple skeleton tags, it just means you need to search more nodes for the given sid.

jterrace
  • 64,866
  • 22
  • 157
  • 202