0% found this document useful (0 votes)
8 views4 pages

Interactive Graphics with Processing Code

The document contains code snippets for creating various shapes using a graphics programming environment. It demonstrates the use of functions like ellipse, line, quad, triangle, arc, and rect to draw shapes with different properties. The code also illustrates layering of shapes and the effect of stroke weight on the appearance of ellipses.

Uploaded by

lehuynhminhthi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views4 pages

Interactive Graphics with Processing Code

The document contains code snippets for creating various shapes using a graphics programming environment. It demonstrates the use of functions like ellipse, line, quad, triangle, arc, and rect to draw shapes with different properties. The code also illustrates layering of shapes and the effect of stroke weight on the appearance of ellipses.

Uploaded by

lehuynhminhthi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

void setup()

{ size(1000,1000); }
void draw()
{ if(mousePressed){fill(0);} else{fill(255);} ellipse(mouseX, mouseY, 80,80);}

size(480,120);
line(20,50,420,110);

size(480,120);
quad(158,55,199,14,392,66,351,107);
triangle(347,54,392,9,392,66);
triangle(158,55,290,91,290,112);
size(480,120);
arc(90,60,80,80,0, HALF_PI);
arc(190,60,80,80,0, PI+HALF_PI);
arc(290,60,80,80, PI, TWO_PI+HALF_PI);
arc(390,60,80,80, QUARTER_PI, PI+QUARTER_PI);

size(480,120);
rect(180,60,220,40);

size(480,120);
ellipse(278,-100,400,400);
ellipse(120,100,110,110);
ellipse(412,60,18,18);
size(480,120);
arc(90,60,80,80,0, radians(90));
arc(190,60,80,80,0, radians(270));
arc(290,60,80,80, radians(180), radians(450));
arc(390,60,80,80, radians(45),radians(225));

size(480,120);
ellipse(140,0,190,190);
//The rectangle draws on top of the ellipse
//because it comes after in the code
rect(160,30,260,20);

size(480,120);
rect(160,30,260,20);
//The ellipse draws on top of the rectangle
//because it comes after in the code ellipse(140,0,190,190);
size(480,120);
ellipse(75,60,90,90);
strokeWeight(8);//Stroke weight to 8 pixels
ellipse(175,60,90,90);
ellipse(279,60,90,90);
strokeWeight(20);//Stroke weight to 20 pixels
ellipse(389,60,90,90);

You might also like