Skip to main content

Interactive splined animation: first example

Posted by pepe on March 2, 2008 at 9:45 PM PST

the new demo tabSplines project now has its first incarnation within swash and the example chosen is the perfect one.

In a previous blog, Tim Bourdreau asked for the difference between splines project and java.awt.GeneralPath. Here i show some of the main reasons why generalPath could not be used:

  • Path can be changed anytime and displayers update themselves upon modification. No hassle.
  • Modifications on paths are very simple to operate
  • Having seperate splines for each ordinate makes it easy to change direction of the thrown gear. Using GeneralPath would have been a nightmare.
  • Sections of the splines are independent on each ordinate.
  • Velocity of the gear can easily be set and changed.

Demo consists of a gear that can be thrown to the wall when pressing a button. Gear bounces on bottom of the zone then on the wall and bounces back. Wall position can be changed anytime (even when animation is running, which can be funny on some cases when the gear bounces two times on wall :) ) and you will see splines being adapted in realtime.

There are two goals in this demo; show why splines project is done like that and show how to animate within swash.

Kudos go to the java2D and swing teams. While the animation runs at 50fps, there are no hiccups and cpu used is at 0%. Antialias is at max, and the gear rotates so it ought to take power from my old prescott and my even older ATI 9600.

the hit logo
WebStart the demo !
Check the project page for swash
Check the project page for splines

Related Topics >>

Comments

Hi Frederic, It is great to see your code. Is it any thing helpfull to me to display network view, where it depicts netowrk elements connected with edges with full fledged animations. Can you please help me out. thanks seetaram

it's here:
https://swash.dev.java.net/servlets/ProjectForumView

I could not open the forums... wht is the way to that?

Hello Seetaram.

i would be happy to discuss this with you.
Please meet at the project forums.