Last week I had to stay sick at home for a couple of days. On the positive side, I finally found some time to look into my old library for inverse kinematics. I wrote it a couple of years ago for JavaFX 1.x. And I decided to port it to JavaFX 2. The initial version is ready for download.

Screenshot Caterpillar

Fig. 1: Screenshot Caterpillar

The original library was written in JavaFX Script and looking at the code created some cozy nostalgic feelings. :) What a beautiful language! Doing the port was pretty interesting, because even though Java and JavaFX Script had many similarities, some of the concepts were extremely different. Definitely it was a fun exercise.

An initial version is ready and can be used. I plan to add more features later, which means the API may change at some point. There is no documentation ready right now except for some basic comments in the source code. But I added two examples, which are probably a good starting point. JavaFX veterans might remember these samples, because they are direct ports from the samples of the first version of the library.

Screenshot Dummy

Fig. 2: Screenshot Dummy

First there is the Caterpillar Demo. You can click anywhere in the window and the caterpillar will move there. Only the head is actually animated directly, the rest of the body is moved automatically using inverse kinematics.

The second example is a little dummy figure. You can drag the parts of its body and the rest will follow.

I also found the text of a tutorial I had written. Rewriting it to match the new Java API should not be a problem, but unfortunately I could not find the images that belong to the tutorial yet. I keep searching! :)

And finally, the most important part: the link. You can find the sources of the library including the code of the two samples on GitHub. Sources of javafx-ik.

Share

4 Comments on JavaFX Library for Inverse Kinematics 2.0

  1. Peter Levart says:

    Nice library!

    I had to modify the pom.xml a bit to compile it with JDK7 which has javafx already included…

    diff –git a/pom.xml b/pom.xml
    index 647418c..5a42031 100644
    — a/pom.xml
    +++ b/pom.xml
    @@ -30,6 +30,24 @@
    UTF-8

    +
    +
    +
    +
    + org.apache.maven.plugins
    + maven-compiler-plugin
    +
    + 7
    + 7
    +
    + ${java.home}/lib/jfxrt.jar
    +
    +
    +
    +
    +
    +
    +

    junit

    Regards, Peter

  2. Peter Levart says:

    Sorry, the XML content of pom.xml is gone… I don’t know how to “escape” it though.

    Regards, Peter

  3. [...] Heinrichs has updated his inverse kinematics library to work with JavaFX 2.x. You can find the sources of the library including the code of the two [...]

  4. Mike says:

    Thanks! I will take a look and try to fix it. Unfortunately I am not really a Maven expert and usually have to rely on whatever the tools are producing. :) Let’s see how it goes. Definitely a great chance to learn more about pom.xml!