/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://ccworkshop.sketchpad.cc/sp/pad/view/ro.3el$1IIn1lT/rev.2
*
* authors:
* Reem El-Maghraby
* Youssef Faltas
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
/**
* Noise1D.
*
* Using 1D Perlin Noise to assign location.
*/
float xoff = 0.0001;
float xincrement = 0.01;
void setup() {
size(440, 440);
background(2000);
//noStroke();
}
void draw()
{
// Create an alpha blended background
fill(10, 10);
rect(100,100,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);
ellipse(n,height/3,60,30);
ellipse(n,random(0,width),16,16);
}