Skip to content

Instantly share code, notes, and snippets.

@bzgeb
Created October 30, 2014 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bzgeb/72f7b1a5a40ec144e37d to your computer and use it in GitHub Desktop.
Save bzgeb/72f7b1a5a40ec144e37d to your computer and use it in GitHub Desktop.
Draw a head in processing
////////////////////////Draw a head//////////////////////////////
fill(100 + random(150), 100 + random(150), 100 + random(150));
for ( int i = 0; i < numLines; ++i ) {
beginShape();
for ( float angle = 0; angle < 360; angle += step ) {
float radian = radians( angle );
x = xCenter + ( headXRadius * cos( radian ) ) + random(15);
y = yCenter - ( headYRadius * sin( radian ) ) + random(20);
if ( lastx > -999 ) {
strokeSize += 0.05;
strokeWeight( strokeSize );
vertex( x, y );
}
lastx = x;
lasty = y;
}
endShape();
strokeSize = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment