Skip to content

Instantly share code, notes, and snippets.

@radames
Created November 4, 2015 18:21
Show Gist options
  • Save radames/f9370a33a5c389d48d97 to your computer and use it in GitHub Desktop.
Save radames/f9370a33a5c389d48d97 to your computer and use it in GitHub Desktop.
Just a sketch template with function
void setup() {
size(800, 500);
frameRate(24);
}
void draw() {
background(255);
drawRobot(1, 50,50); //calling the function with fixed parameters
}
//function to draw my shape
void drawRobot(int blink, float posx, float posy) {
pushMatrix();
//translate to given parameters
translate(posx, posy);
ellipse(0,0,50,50);
ellipse(-10,0,10,10);
ellipse(-10,0,3,3);
ellipse(10,0,10,10);
ellipse(10,0,3,3);
arc(0, 10, 20, 20, radians(30),radians(150)); //randians convert degrees
popMatrix();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment