mirror of
https://github.com/dyne/FreeJ.git
synced 2026-02-05 12:39:15 +01:00
processing-js 0.4 has been merged in some relevant parts basic and topic scripts added for test color handling fixed, more scripts show up now
30 lines
591 B
Plaintext
30 lines
591 B
Plaintext
float xoff = 0.0;
|
|
float xincrement = 0.01;
|
|
|
|
void setup() {
|
|
size(200,200);
|
|
background(0);
|
|
frameRate(30);
|
|
smooth();
|
|
noStroke();
|
|
}
|
|
|
|
void draw()
|
|
{
|
|
// Create an alpha blended background
|
|
fill(0, 10);
|
|
rect(0,0,width,height);
|
|
|
|
//float n = random(0,width); // Try this line instead of noise
|
|
|
|
// Get a noise value based on xoff and scale it according to the window's width
|
|
float n = noise(xoff)*width;
|
|
|
|
// With each cycle, increment xoff
|
|
xoff += xincrement;
|
|
|
|
// Draw the ellipse at the value produced by perlin noise
|
|
fill(200);
|
|
ellipse(n,height/2,16,16);
|
|
}
|