Skip to content

Instantly share code, notes, and snippets.

@clavis-magna
Last active August 29, 2015 14:18
Show Gist options
  • Save clavis-magna/42fe43e5f7ef0291596b to your computer and use it in GitHub Desktop.
Save clavis-magna/42fe43e5f7ef0291596b to your computer and use it in GitHub Desktop.
draw a raindrop shape in processing
void setup(){
size(500,500);
}
void draw(){
//draw a drop at 120, 120 size 8
drawRaindrop(120,120,8);
}
//draw raindrop x = x position, y = y positiom, size = size
void drawRaindrop(int x,int y,int size){
noStroke();
for (int i = 2; i < size; i++ ) {
ellipse(x,y + i*4,i*2,i*2);
}
}
@clavis-magna
Copy link
Author

This uses the technique from the example linked below to draw a raindrop shape using a series of ellipses that increase slightly in size and are positioned overlapping but slightly below one another.
http://www.learningprocessing.com/examples/chapter-10/example-10-10/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment