Author Topic: Manually rotate joints  (Read 1426 times)

Offline Neo

  • byte
  • *
  • Posts: 2
    • View Profile
Manually rotate joints
« on: January 08, 2013, 01:00:56 pm »
What is the simplest way to rotate joints manually with the bones api?

Currently i'm using JointChannel/SkinClip/SkinClipSequence which works fine. But i'm reading the ogre bones.xml manually for this purpose, because i didnt managed to get the correct roations and translations from the binding matrices so far. Where is the joints binding matrix calculated?  While merging the two xml files or does this happens through the other used apis?
« Last Edit: January 08, 2013, 02:32:41 pm by Neo »

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1973
    • View Profile
    • http://www.aptalkarga.com
Re: Manually rotate joints
« Reply #1 on: January 08, 2013, 03:25:17 pm »
have a look at ProceduralAnimationSample, it does manually rotate joints.

Where is the joints binding matrix calculated?  While merging the two xml files or does this happens through the other used apis?
If you are asking bind pose matrices, they come from mesh.xml file and stored in Joint class. animation is applied to SkeletonPose class which in turn deform mesh

Offline Neo

  • byte
  • *
  • Posts: 2
    • View Profile
Re: Manually rotate joints
« Reply #2 on: January 09, 2013, 09:17:53 am »
Thanks for your help and quick response. Now i do it like you did in the ProceduralAnimationSample.targetJoint(...) and calculate my quaternion out of euler angles (because i dont want to set the order of the rotations)  like this:
   http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
it seems that this is not as fast as before but it works and i dont have to load the skeleton.xml manually.

Yes, i ment the bind pose matrices. Are they generated while use the jmeOgre2Bones script or while loading the file?

Cheers and big up for Bones:)

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1973
    • View Profile
    • http://www.aptalkarga.com
Re: Manually rotate joints
« Reply #3 on: January 09, 2013, 02:34:46 pm »
jmeOgre2Bones script is just a wrapper for JMEOgreImporter class. it does not do anythting itself.

bind pose matrices are loaded from file by JME loader and copied to Bones. but why are you asking this, does it make any difference who or what loads them?