Monday Mar 16, 2009

Play with Space - JavaFX

Spring season is about to come and one can feel the coldness in air. Last week, I went to my home and that week was quite good for my sample writing. Able to finish some of my pending job. 

Back to JavaFX Samples, last week I saw a nice sample written in flash about the ball motion in 3-D space. I try to implement that idea in JavaFX. Code is little dirty, so I will post it later. 

This is how it looks (animation is important) :

To watch the animation, please launch this JNLP.

I hope, you will enjoy it ! 

1. There are 4 polygon, which covers the space, looks like a cricket net practice place :).

2. Launch button will give motion to ball, since the motion is not restored, pressing it again will not work.

3. var scale = z0 / (z0 + z); Scaling with proper value will provide the Z-Camera.

4. Gaussian Blur for shadow, which translate in 2-D and with same timeline.

-- 

Change in Blog : Adding source code :

1. Main File

2. Ball Throw

 This will allow you to relaunch the animation.

Wednesday Jan 07, 2009

Pendulum Motion with controller in JavaFX

So, here goes one more Motion sample in JavaFX :). I have added Slider to control the value of "g" in Pendulum motion(just a thought, anything can be controlled like mass, length of pendulum). Pendulum do a complex calculation(Square root, Cosine, Sine) and I guess render is great in FX. Sorry again, as I am not able to post the applet. 

But here how it looks : 

The progress bar has been stolen from Chris Blog.

Here is the source code :

Main file, Pendulum.fx, Slider.fx.

Have a look and feel free to share your views.

About

Hi, I am Vaibhav Choudhary working in Sun. This blog is all about simple concept of Java and JavaFX.

Search

Archives
« April 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
   
       
Today