/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://uclaspring12.sketchpad.cc/sp/pad/view/ro.5DSmP5tcWEA/rev.195
*
* authors:
* Mika
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
// This sketch builds on a prior work, "Workshop 4", created by Mika
// http://uclaspring12.sketchpad.cc/sp/pad/view/ro.6qt0ydJ$R3cb8k/rev.195
// these images are inspired by Joseph Cornell's physical collages, in which he boxed cardboard and faux figurine objects into a wooden case with a glass lid. I wanted to generate something like his collages, which looks random, but still conveys a concrete aesthetic through various renditions.
/* @pjs preload="/static/uploaded_resources/p.4540/marble_blue.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/marble_red.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/marble_yellow.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/marble_green.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/marble_white.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/flower_blue.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/flower_red.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/flower_yellow.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/flower_green.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/flower_white.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/bird_blue.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/bird_red.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/bird_yellow.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/bird_green.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/bird_white.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/fruit_blue.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/fruit_red.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/fruit_yellow.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/fruit_green.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/fruit_white.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/woodtexture.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/woodbox.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/white.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/jar_outline.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/jar_clear.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/boxpartition.png"; */
/* @pjs preload="/static/uploaded_resources/p.4540/boxpartition.png"; */
PImage bg, wbox, white, part, twig, jar, jwhite;
PImage [] marble = new PImage[5];
PImage [] flower = new PImage[5];
PImage [] bird = new PImage[5];
PImage [] fruit = new PImage[5];
void setup() {
size(600, 300);
marble[0] = loadImage("/static/uploaded_resources/p.4540/marble_blue.png");
marble[1] = loadImage("/static/uploaded_resources/p.4540/marble_red.png");
marble[2] = loadImage("/static/uploaded_resources/p.4540/wkshp_images/marble_yellow.png");
marble[3] = loadImage("/static/uploaded_resources/p.4540/marble_green.png");
marble[4] = loadImage("/static/uploaded_resources/p.4540/marble_white.png");
flower[0] = loadImage("/static/uploaded_resources/p.4540/flower_blue.png");
flower[1] = loadImage("/static/uploaded_resources/p.4540/flower_red.png");
flower[2] = loadImage("/static/uploaded_resources/p.4540/flower_yellow.png");
flower[3] = loadImage("/static/uploaded_resources/p.4540/flower_green.png");
flower[4] = loadImage("/static/uploaded_resources/p.4540/flower_white.png");
bird[0] = loadImage("/static/uploaded_resources/p.4540/bird_blue.png");
bird[1] = loadImage("/static/uploaded_resources/p.4540/bird_red.png");
bird[2] = loadImage("/static/uploaded_resources/p.4540/bird_yellow.png");
bird[3] = loadImage("/static/uploaded_resources/p.4540/bird_green.png");
bird[4] = loadImage("/static/uploaded_resources/p.4540/bird_white.png");
fruit[0] = loadImage("/static/uploaded_resources/p.4540/fruit_blue.png");
fruit[1] = loadImage("/static/uploaded_resources/p.4540/fruit_red.png");
fruit[2] = loadImage("/static/uploaded_resources/p.4540/fruit_yellow.png");
fruit[3] = loadImage("/static/uploaded_resources/p.4540/fruit_green.png");
fruit[4] = loadImage("/static/uploaded_resources/p.4540/fruit_white.png");
bg = loadImage("/static/uploaded_resources/p.4540/woodtexture.png");
wbox = loadImage("/static/uploaded_resources/p.4540/woodbox.png");
white = loadImage("/static/uploaded_resources/p.4540/white.png");
part= loadImage("/static/uploaded_resources/p.4540/boxpartition.png");
twig= loadImage("/static/uploaded_resources/p.4540/twig.png");
jar= loadImage("/static/uploaded_resources/p.4540/jar_outline.png");
jwhite= loadImage("/static/uploaded_resources/p.4540/jar_clear.png");
frameRate(1);
colorMode(HSB,360,100,100,100);
imageMode(CENTER);
smooth();
}
void draw() {
image(bg, 300, 150, 600, 300);
image(part, 300, 150, 600, 300);
image(twig, 300, 150, 600, 300);
float x= random (140, 400);
float y= (-0.233*x)+280;
float xm = random(20,150);
float ym = random(30,250);
float dm = random(30, 140);
float xf = random (150,400);
float yf= random (20,200);
float df;
if (dm<= 65) {
df= random (75,200);
} else {
df= random (20,75);
}
int i =(int) random(5);
image(bird[i], x, y, 200, 200);
image(marble[i], xm, ym, dm, dm);
image(flower[i], xf, yf, df, df);
tint(0,26);
image(jwhite, 520, 95, 100, 138);
noTint();
image(fruit[i], 520, 110, 90, 90);
tint(0, 19);
image(jwhite, 520, 95, 100, 138);
noTint();
image(jar, 520, 95, 100, 138);
noTint();
fill(32,60,49,26);
quad (0,0, 600,0, 600,300, 0,300);
image(white, 300, 150, 600, 300);
image(wbox, 300, 150, 600, 300);
}