Monkanim: new animation system in the works

Great, thx!

Update:
I worked on keyframe interpolation recently and somehow refactored the system so that users could plug their own interpolators into the system.
All this is inspired by David Rosen’s 2014 GDC talk on procedural animation in Wolffire (if you never watch it you should).
The idea is to have animations based on very few keyframe and to fill the gaps by interpolating between them in a clever way.
So … I tried that :
Here is a run animation made of 8 key frames.

Now we do a standard interpolation :
Linear for translation, linear normalized for rotation (nlerp), linear for time

It already looks ok imo… but we’d like more natural interpolation:
Catmull-rom for translation, linear normalized for rotation (nlerp), linear for time

mhh see any difference? yeah not easy the up and down motion should be a bit smoother…
There is not much translation in bone animations, most of the movement are governed by joints rotation.
And here if you slow down the anim you can see clearly that we linearly interpolate between rotations:

So I tried to use some cubic interpolation for rotation. There is a quite widespread interpolation called squad for quaternion that does this, here is the result.
Catmull-rom for translation, squad for rotation, linear for time:

Ho boy… something went wrong…
So I tried to fix this for a fair amount of time… and decided to give up on it…
IMO this is a nice system, but you lack a lot of artistic control.
One reason is that we don’t use control bones (we’d need a lot of work to be able to use them like in blender), so we will lack some constraints.
The other reason is that… well blender does it for us… and better… Ok the resulting animation are heavier, but IMO they look a lot better.
At any rate… the system now allows users to plug in their own interpolators for translation, rotation, scale and time, and it provide some default ones, if some Math savvy monkey wants to give a try to smoother interpolations, it’s very easy to add your own to the system.

For fun here is a try with an easeOutElastic time interpolator

15 Likes

The third animation looks pretty darn sweet.

1 Like

The forums couldn’t handle the awesomeness of monkanim

Nice!

Now halve the keyframes by mirroring along the middle axis to get the ‘other half’ :wink:

Interpolating rotations is probably the key, since bipedal animation is all about rotations. Aside from nlerp and squad, have you tried any other options for interpolating rotations?

Nope. The only other way I know is circular interpolation. Didn’t try the math were not clear to me

1 Like

I found this article, which goes as far as splines:

hm I don’t fully understand the problem but whats with dual quaternions? They contain rotation and translation and they can interpolate between transforms as far as I know.

AnimControl uses Nlerp to interpolate between quaternions, which is OK provided you have dozens of keyframes in every animation. Nlerp for quaternions is analogous to linear interpolation for vectors; its first derivative generally isn’t continuous at sample points. In an animation with 4 keyframes, these discontinuities result in “jerky” motion. Splines have continuous first derivatives, which should (I believe) result in smooth animation, even with just a few keyframes per animation.

Does it still work?

it should.
It’s been a while since I didn’t work on this, but it should still work

SOryy I don’ t understand this. I tried the monkanim but seems have problem with jme version. i got report something like this…

* What went wrong:
Could not resolve all dependencies for configuration ':compileClasspath'.
> Could not find any version that matches org.jmonkeyengine:jme3-core:[3.2,).
  Versions that do not match:
      3.1.0-stable
      3.1.0-beta4
      3.1.0-beta3
      3.1.0-beta2
      3.1.0-beta1
      + 4 more 
...

and I change to jmeVersion = “[3.1,)”
I got this report…

K:\project\jmonkey\monkanim-master\monkanim-master\src\main\java\com\jme3\animation\Bone.java:527: error: cannot find symbol
                && targetGeometry.getLocalTransform().isIdentity()) {
                                                     ^
  symbol:   method isIdentity()
  location: class Transform
K:\project\jmonkey\monkanim-master\monkanim-master\src\main\java\com\jme3\animation\Bone.java:717: error: cannot find symbol
            if (mesh != null && mesh.isAnimatedByBone(boneIndex)) {
                                    ^
  symbol:   method isAnimatedByBone(int)
  location: variable mesh of type Mesh
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
:compileJava FAILED

I do something wrong?

1 Like

MonkAnim doesn’t work with JME 3.1, and there’s no 3.2 release yet. Before you can build MonkAnim, you have to build your own 3.2 libraries by checking out the ‘master’ branch JME source-code and performing a

./gradlew install
1 Like

yep what Steve says

Aaaaand we have a wiki page :stuck_out_tongue:
https://jmonkeyengine.github.io/wiki/jme3/build_from_sources.html#build-jmonkeyengine-from-github-source

2 Likes

ookay.