Below is my final code:
import processing.pdf.*;
PImage img;
float cameraX,cameraY;
void setup(){
size(500,1000,P2D);
img = loadImage("http://fc01.deviantart.net/fs42/f/2009/165/5/f/Purple_Pink_Sunset_by_boaz_rbg.jpg");
beginRecord(PDF, "wallpaper_4.pdf");
background(0);
}
void draw (){
camera(-100, 50, random(-500,800), width, height, 1, 1, 1, 1);
println(cos(cameraX));
int x=floor(random(0,img.width));
int y= floor(random(0,img.height));
color myColor = img.get(x,y);
stroke(0,5); //Decided to include a thin outline to the triangles to define them and reference the shape used.
fill(myColor,10); //Transparency is 10 in order to build up the picture over time and blend the triangles, creating a soft look.
triangle(x,y,x,random(50,950),random(-200,0),random(50,950)); //Triangles have been told to be drawn within the middle section of the sketch.
}
void keyPressed(){
endRecord();
}
Final Wallpaper:
No comments:
Post a Comment