browse OpenProcessing

Twitter Tree
Ripples in 3D
Variations #2
browse all>

browse the portfolio of Steven Kay

Edinburgh OpenStreetMap history
zebra trails
zx spectrum loading screen
Galaxy Spirals
see more>
Ripples in 3D

Ripples in 3D

uploaded by
Steven Kay
the effect of ripples in 3D.

Starts with 3 ripples of random amplitude and wavelength.
Ripples eventually fade out; when the surface is nearly flat it will start over again.

Mouse Y position controls tilt.

Press any key to add another random ripple (need to click first to give applet 'focus')

Click to start again.
Embed Code
Fave'd by 12 users
Sketch added to your favorites in your portfolio.
You must login/register to add this sketch to your favorites.

comments

source code

Comments

antiplastik
28 Dec 2009, 01:24
Very cool
Owaun Scantlebury
28 Dec 2009, 07:19
I like.
Antoine Bonnin
29 Dec 2009, 17:02
Nice work! Quick question, what does "_" means in "x=_x;"?
Steven Kay
30 Dec 2009, 04:26
thanks all!

@Antoine..

It's just a naming convention I use. The underscore is simply part of a variable name, it's not an operator.

It saves me having to do 'this' :-

public source(float x,float y, float amp,float wave) {
this.x=x;
this.y=y;
this.amp=amp;
wavelength=wave;
}

Because the source class has a few variables with the same name as the parameters (x, y and amp), the "this." is needed to make it clear which one we're referring to.

So it's really just a re-naming convention.

I should really be using "this." to make things clearer.. if you do this...

public source(float x,float y, float amp,float wave) {
x=x;y=y;amp=amp;wavelength=wave;
}

then the values of x,y and amp in the source object are NOT changed, and you get a flat pond with no ripples!
You need to login/register to comment.