Results 1 to 5 of 5

Thread: Joint transforms in Collada

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    2

    Joint transforms in Collada

    At the moment I'm working on a collada importer for xna. So far I am able to import models and draw their mesh(s) on screen. I have created a method to make the bones visable but I'm having a few problems with some models. The first model I used was a goblin which used matrices for its joints. The bones for this render no problem. The second model I tested was a model of mario whos Joints were made up of Trasnlates and rotates. From looking at the collada spec and the posts on here I have determined that to create transforms for each joint I need to make the Translates and rotates into matrices and then multiply them by each other in the order they were stored like so :

    JointT = TranslateM * RotateXM * RotateYM * RotateZM

    When do this and Draw the bones their positions don't even come close to making a mario shape.
    When I create the matrices for each Translate and rotate should they look like this :

    X Y Z
    <translate sid="translate">-0.010548 6.91145 0</translate> =

    1,0,0,0
    0,1,0,0
    0,0,1,0
    X,Y,Z,1
    A B C D
    <rotate sid="jointOrientZ">0 0 1 -87.7094</rotate> =
    1,0,A,0
    0,1,B,0
    0,0,C,0
    0,0,D,1

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

    Re: Joint transforms in Collada

    COLLADA is column-major order so for translate it makes an equivalent matrix like this:
    Code :
    <matrix>
     1,0,0,X
     0,1,0,Y
     0,0,1,Z
     0,0,0,1
    </matrix>

    The <rotate> is an axis normal vector and an Euler angle so you can just drop the values into a matrix column like that.

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

    Re: Joint transforms in Collada

    Also see this thread matrix and glRotate

  4. #4
    Junior Member
    Join Date
    Dec 2010
    Posts
    2

    Re: Joint transforms in Collada

    Took long enough to get "approved", which is a surprise considering the lack of activity on this site. Fixed it myself. For anyone looking for a straight answer like me.

    Collada stores transforms in row major order. C/C++, C# uses column major order.
    So what I had in my first post is the correct way to store them.
    But to get the right rotation you have to take the rotation value convert it to degrees, and then into radians. Then create a rotation matrix for that specific axis using radians and that's it.

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

    Re: Joint transforms in Collada

    Quote Originally Posted by Christicles
    Collada stores transforms in row major order. C/C++, C# uses column major order.
    So what I had in my first post is the correct way to store them.
    That is incorrect. Why do you think it is correct?

Posting Permissions

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