xxxxxxxxxx
size (225, 300); // size of the display are
//--------- CENTER ORIENTATION : Draws stuff using the ellipse's center
/*
The default mode is ellipseMode(CENTER), which interprets the first two
parameters of ellipse() as the shape's center point, while the third and
fourth parameters are its width and height.
*/
ellipseMode(RADIUS); // Set ellipseMode to RADIUS
fill (102, 66, 124); // Set fill to purple
ellipse(50, 50, 30, 30); // Draw white ellipse using RADIUS mode
/*
ellipseMode(RADIUS) also uses the first two parameters of ellipse()
as the shape's center point, but uses the third and fourth parameters
to specify half of the shapes's width and height.
*/
ellipseMode(CENTER); // Set ellipseMode to CENTER
fill(184, 255, 7); // Set fill to green
ellipse(50, 50, 30, 30); // Draw gray ellipse using CENTER mode
//---------- CORNER(S) ORIENTATION, Draws stuff from the corner
/*
ellipseMode(CORNER) interprets the first two parameters of ellipse()
as the upper-left corner of the shape, while the third and fourth
parameters are its width and height.
*/
ellipseMode(CORNER); // Set ellipseMode is CORNER
fill(255, 7, 114); // Set fill to pink
ellipse(25, 125, 50, 50); // Draw ellipse using CORNER mode
/*
ellipseMode(CORNERS) interprets the first two parameters of ellipse()
as the location of one corner of the ellipse's bounding box, and the third
and fourth parameters as the location of the opposite corner.
*/
ellipseMode(CORNERS); // Set ellipseMode to CORNERS
fill(255, 209, 7); // Set fill to yellow
ellipse(25, 125, 50, 150); // Draw ellipse using CORNERS mode