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:

Interesting. Thanks for the demonstration. Pure FX is much better. I'm really excited about this; I don't think many people know about FX. I have refused to pay for Flash IDE and I am confident now that I have a satisfying alternative to Flash. I only need some simple animations (screen-wipe/transition type stuff) that should run quite smoothly.

I didn't take a look at the code; FX is definitely better than the swing-timer method, but I'd wonder if this app couldn't be made more efficient to handle more balls, like having a single representation of each colored ball and keeping coordinates of them, painting with on a buffer...

Posted by wikiBuddha on November 24, 2009 at 06:18 PM IST #

Thanks buddy quite intelligent animation .. great

Posted by web design template on January 07, 2010 at 08:36 AM IST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

mohanpraveen

Search

Categories
Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today