Praveen's Blog

Wednesday Aug 08, 2007

Animation through FX and Java

With reference to what I have said in my earlier posting, I have made little progress over doing animations using FX syntax. I have tried this with another app before actually changing the PingPong code. Here also, I initially started with a Swing Timer but later replaced it with the FX's animation syntax - '[..] dur xx linear' and I have created a trigger for the above property that keeps changing at regular intervals.

Bouncing Balls (Click on it to launch)

(Click the left mouse button to add more balls and Click the right mouse button to quit)


 
Here is the script that use the Swing Timer

BouncingBalls.fx

I will have to tune the performance since the app slows down when I add more balls. Perhaps, I need to see if I can use different threads one for each ball, to animate it or I will have to increase the delta by which the balls move.

Bouncing Balls using FX animation loop (Click on it to launch)

(Click the left mouse button to add more balls and Click the right mouse button to quit)

Bouncing Balls using FX animation loop

Here is the script that use FX animation loop

FXBouncingBalls.fx

It is pretty simple indeed but one has to get the values right inside the FX animation syntax to get notification at correct intervals - especially the distribution of range of values over the given duration.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

Calendar

Feeds

Search

Links

Navigation

Referrers