• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Skeleton World Rotation to Local Rotation conversion

mbeytekin

Member
I'm searching for this for a while but I couldn't do yet. In original Spine Runtime there are some functions to do this.But I can't do with gamemaker.
I want to make some procedural animations like exploding bodies etc. I have a standart human skeleton. I calculate virtual points for each bone , x y positions and rotations in screen but I can't convert this values to skeletons local transforms. They're working depends to their parents and results are weird.
Is there any way to calculate world rotations or positions to local bone positions and rotations?


Here is information from Spine Runtime Web Documantation;
"
  • x and y
  • rotation
  • scaleX and scaleY
  • shearX and shearY
Starting at the root and proceeding with parent bones first, the local transform is used to compute a world transform for each bone. The world transform consists of:

  • a, b, c, and d This is a 2x2 matrix which encodes the combined rotation, scale and shear of the bone and all parent bones back to the root. a and c are the X axis, b and d are the Y axis.
  • worldX and worldY This is the world position of the bone, where the world coordinate system is the coordinate system the root bone is positioned in.
The world transform can transform any point from the bone's local coordinates to world coordinates. For example, the vertices for a mesh attached to a bone are transformed by the bone's world transform. The resulting vertices are affected by the bone and all its parent bones. This mechanism is at the core of Spine's skeletal animation system.


The world transform can also do the reverse, transform any point from world coordinates to the bone's local coordinates
."
 
Top