Results 1 to 3 of 3

Thread: Rotate/RotateAxis/JointOrientation

  1. #1
    mawww
    Guest

    Rotate/RotateAxis/JointOrientation

    hello, well I'm currently writing a converter from collada to my own format, and I have some problems with skinning.
    First I did not find in the docs precises explanation on how the skinning is to be done with collada, for example, can I be sure that I will find a node with the same name as the joint to get the rotations / translations ?
    With some experiment I managed to get a nearly good looking skeleton, but I have some questions on the rotate.
    I use the Seymour.da file for testing, and in it, (sorry Iim not on my computer and cannot post part of the file) some joints nodes have rotates with sid beginning by "rotate", others beginning by "rotateAxis" and others beginning by "jointOrientation". From what I discovered, I should ignore jointOrientation (my point for the moment is to get a skeleton which looks to be the adapted to the skin, then I will try to convert animations), but I did not found anything about it in the doc. Can someone clarify this ?

    (sorry for my poor english, it is not my main language)

  2. #2
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: Rotate/RotateAxis/JointOrientation

    Quote Originally Posted by mawww
    First I did not find in the docs precises explanation on how the skinning is to be done with collada, for example, can I be sure that I will find a node with the same name as the joint to get the rotations / translations ?
    No. The name attribute is not part of the formal binding..
    Quote Originally Posted by mawww
    I use the Seymour.dae file for testing, and in it, (sorry Iim not on my computer and cannot post part of the file) some joints nodes have rotates with sid beginning by "rotate", others beginning by "rotateAxis" and others beginning by "jointOrientation".
    The sid values are not relevent. The order of transformations are what's important.
    Quote Originally Posted by mawww
    From what I discovered, I should ignore jointOrientation (my point for the moment is to get a skeleton which looks to be the adapted to the skin, then I will try to convert animations), but I did not found anything about it in the doc. Can someone clarify this ?
    You should include all the supplied transformations in the order they are given. The COLLADA transform stack is defined as-if the transforms are column-order matrices that are concatenated using post-multiplication.

  3. #3
    Senior Member
    Join Date
    Aug 2005
    Location
    California
    Posts
    165

    Re: Rotate/RotateAxis/JointOrientation

    Quote Originally Posted by mawww
    ... can I be sure that I will find a node with the same name as the joint to get the rotations / translations ?
    No the joint names in the controller do not need to be the same as the joint node ID's in the visual scene.
    The joint names will correspond to an sid in the node heirarchy pointed to be the <skeleton> element when the skin controller is instanciated. There is a good example of this in the spec which I will repost here.
    Code :
    <library_controllers>
      <controller id="skin">
        <skin source="#base_mesh">
          <source id="Joints">
            <Name_array count="4"> Root Spine1 Spine2 Head </Name_array>
          ...
          </source>
          <source id="Weights"/>
          <source id="Inv_bind_mats"/>
          <joints>
            <input source="#Joints" semantic="JOINT"/>
          </joints>
          <vertex_weights/>
        </skin>
      </controller>
    </library_controllers>
    <library_nodes>
      <node id="Skeleton1" sid="Root">
        <node sid="Spine1">
          <node sid="Spine2">
            <node sid="Head"/>
          </node>
        </node>
      </node>
    </library_nodes>
    <library_visual_scenes>
      <visual_scene id="scene">
        <node id="skel01">
          <instance_node url="#Skeleton1"/>
        </node>
        <node id="skel02">
          <instance_node url="#Skeleton1"/>
        </node>
        <node>
          <instance_controller url="#skin"/>
            <skeleton>#skel01</skeleton>
          </instance_controller>
        </node>
        <node>
          <instance_controller url="#skin"/>
            <skeleton>#skel02</skeleton>
          </instance_controller>
        </node>
      </visual_scene>
    </library_visual_scenes>
    Lets take the first <instance_controller>. The skin needs a joint named "Head". The <skeleton> element tells that controller it should start looking for its joints at the "skel01" node. The "skel01" node instances the node hierarchy "Skeleton1" in which one of the nodes has an sid of "Head".

    You need to do that kind of sid lookup for each joint name in the skin. I believe some tools export a single <skeleton> element for each joint in the skin so all they have to do is search through the nodes that <skeleton> points to. If you are exporting from one of those tools then you can take that shortcut but I wouldn't recommend it since you may want to load data from another tool which doesn't do that and your code wouldn't import correctly.

    -Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •