06-30-2017, 12:49 PM
(This post was last modified: 06-30-2017, 12:55 PM by gdkchan.
Edit Reason: just use the standard gfycat link because it loops automatically
)
(06-28-2017, 06:24 PM)TehSe7en Wrote: Ohana's animations are a bit on the alzheimer's sideI think you meant Parkinson?
(06-28-2017, 08:10 PM)sum1 Wrote: None of these problems occur in Unity.I tried loading an animated model on Blender, and found two issues with the exported DAE that was preventing Blender to load the model properly. I already fixed both issues (well, I fixed one and added a workaround for the other one). Anyway, animations should work in blender now, so try the lastest version of SPICA.
---
For those interested in the overworld animation from Pokémon X/Y (and maybe OR/AS too, but mainly X/Y), you probably noticed that they have... issues.
So on the old version it looked like this:
[spoiler]
![[Image: bxioJH3.png]](http://i.imgur.com/bxioJH3.png)
[/spoiler]
not very good. I used to call this issue the feet issue because it only seems to affect the characters feet.
[spoiler="Some technical talk you may find boring"]
I decided to look closely into this issue recently, and by analysing the animation key frames, I noticed that the affected bones had some weird values on the translation, even through they still seemed to be valid values, and not just garbage. After some time thinking I concluded that they were most likely absolute (or world) positions of the animated bone, without rotation. Bones are usually represented in local space (that is, the position and rotation are relative to the parent bone). But it turns out that the old animation format used on Pokémon actually supports both!
So, the problem seemed to be something easy to fix. Just transform from world to local space and it should work. It ended being not that simple through. For all bones that had the "world space position" flag set, I had to build a transformation matrix up to the parent bone. By calculating the inverse of this matrix, I was able to transform the position from world to local space (relative to the parent bone). This kind of worked, but also kind of didn't, because rotations were still missing, so I still had stuff moving to weird positions, but it was already better. So the only thing missing was calculating the euler rotation of the new bone, and doing that was just a matter of finding the rotation between the bone and it's parent. Finding said rotation can be easily archieved by doing the cross product between the vectors to find the rotation axis, and an dot product with an arccos to find the angle. With this we can easily build a quaternion, and by transforming our bone position with the inverse of this quaternion, is possible to "unrotate" it and keep only the translation, that is what we want. The last step is attaching the rotation we just calculated to the parent bone, and we should have a working animation!
[/spoiler]
So after the above fixes the animation looks much better:
[spoiler]
A video tag that work with direct video urls would be nice

https://gfycat.com/EvergreenCraftyAlligatorgar
[/spoiler]
I think they are correct now. But if anyone find issues just let me know.

