Interactive splined animation: first example
Posted by pepe on March 02, 2008 at 09:45 PM | Comments (4)
Splines 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.

WebStart the demo !
Check the project page for swash
Check the project page for splines
Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
-
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
Posted by: seetaram on June 01, 2008 at 11:23 PM
-
Hello Seetaram.
i would be happy to discuss this with you.
Please meet at the project forums.
Posted by: pepe on June 03, 2008 at 10:06 PM
-
I could not open the forums...
wht is the way to that?
Posted by: seetaram on June 09, 2008 at 05:05 AM
-
it's here:
https://swash.dev.java.net/servlets/ProjectForumView
Posted by: pepe on June 09, 2008 at 12:30 PM
|