azerion / phaser-spine

A plugin for Phaser 2 that adds Spine support
MIT License
121 stars 58 forks source link

Problem with Local Nonuniform Scaling? #21

Open shibekin69 opened 8 years ago

shibekin69 commented 8 years ago

Yeah, I'm using the latest Spine ESS right now (3.4.0.2). I can see nested scales on bones transforming properly on the editor, but I noticed that it doesn't work in the current runtime. Is this because of the old runtime?

shibekin69 commented 8 years ago

Hey @AleBles , do you know which version of spinejs is in use here? I think I may need to use an older version of the editor to make compatible spine animations..

AleBles commented 8 years ago

This library uses the latest version of spine-js, which is stuck at 3.1.08

shibekin69 commented 8 years ago

Ok! I'm trying to dig into the code to see what the heck's going on with the scaling issue. Here's what I've found so far:

When I do a uniform scale of a bone, it looks fine.

When I do a non-uniform scale of a bone of just the X or Y axis, it doesn't look fine. I do see some kind of transform, like it's trying to shrink both X and Y axes where it's only supposed to scale down one of them.

When I get rid of the scale, it looks fine (but without the scaling :( )

I've set Phaser.AUTO and double checked that Phaser is running with WebGL enabled.

EDIT: I've done a minimal sample to see what's going on.

It seems local scaling isn't working. The scale X and Y is locked to the world's X and Y (X being horizontal, and Y being vertical on the screen). This is what happens when we have an object like so lined up downwards and we animate Bone B to scale only its X axis:


-Bone A
 -Bone B
  -Bone C
  1. Bone ABC are standing like a pole (0 degree rotation): Scaling OK
  2. Bone ABC are lined up diagonally (rotated 45 degrees) Scaling NOT OK
  3. Bone ABC are lined up horizontally (rotated 90 degrees) Scaling NOT OK

I've attached a minimal demo and a spine project showing this problem. The animation in the editor is the correct one.

testphaserspine.zip

NatMonney commented 8 years ago

Hi there,

I just started to use this extension today, and I saw the same issue. Is there a work arround ?

Thanks !

pieshop commented 8 years ago

I've also run into this problem with the plugin - anyone made any progress with it?