Code
//yay! moon rover...
float p1=0;
float p2=0;
void setup(){
size(400,400);
background(255);
smooth();
}
void draw(){
background(0);
float stars = max(1,0);
float land1 = max(1,350);
float land2 = max(1,200);
stroke(255);
pushMatrix();
for(int i=0;i<width;i++){
strokeWeight(1);
float n=noise((i + millis()/300)/ stars);
point(i,n*height);
}
popMatrix();
for(int i=0;i<width;i++){
strokeWeight(1);
float n=noise((i + millis()/10)/ land1);
float n2=noise((i + millis()/50)/ land2);
stroke(50,50,50);
line(i,400,i,n2*height);
stroke(100,100,100);
line(i,400,i,n*height);
stroke(255);
if(i==190){
p1=n*height;
}else
if(i==210){
p2=n*height;
}
}
strokeWeight(10);
point(190,p1-5);
point(210,p2-5);
strokeWeight(7);
stroke(150,0,255);
quad(185,p1-13,215,p2-13,185,p1-13,215,p2-13);
strokeWeight(4);
line(190,p1-13,190,p1-5);
line(210,p2-13,210,p2-5);
}
030 -- A Generative Landscape: Due 10/11
Statement:Create a program which presents an ever-changing (generative) landscape. Populate your landscape with features that are suitable for your concept: perhaps trees, buildings, people, body parts, etc.
The landscape should move past the 'camera', but you can elect the manner by which it does so; for example, it might appear to scroll by (as if you were looking out the window of a train); or approach from a first-person point of view (as if you were driving), or slide underneath (as if you were looking out of a glass-bottomed airplane).
Give consideration to the depth of variation in your landscape: after how much time does your landscape become predictable? How could you extend this inevitability as much as possible? You may need to make a variety of different elements, and continually change how you clump them. Feel free to experiment with 3D, or mixtures of 2D & 3D.