Skip to content

Instantly share code, notes, and snippets.

@learningjs
Created January 6, 2014 21:08
Show Gist options
  • Save learningjs/8289859 to your computer and use it in GitHub Desktop.
Save learningjs/8289859 to your computer and use it in GitHub Desktop.
Original Image - “Originality depends only on the character of the drawing and the vision peculiar to each artist.” – Georges Seurat
// Draws a Mickey
void setup() {
// Sets sketch size
size(600, 600);
// Translates origin point (now "0, 0" are placed at "width / 2, height / 2" and not at upper left corner anymore)
translate(width / 2, height / 2);
// Sets background color
background(200);
// Disables all smoothing
noSmooth();
// Draws Mickey
drawMickey(300, 200);
}
void drawMickey(int dFace, int dEars) {
// Sets color
stroke(235, 235, 45, 125);
// Sets face diameter
strokeWeight(dFace);
// Draws face
point(0, 0);
// Sets ears diameter
strokeWeight(dEars);
// Draws ears
point(-130, -130);
point(130, -130);
// Draws nose
stroke(235, 235, 45);
strokeWeight(dEars * .3);
point(0, 20);
}
// Utilities
// Needed for key use
void draw() {}
// Saves a screenshot
void keyPressed() {
if (key == 's' || key == 'S') {
saveFrame("screenshot_##.png");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment