shapes
v0.0.6circle(x, y, d);
Draw a circle to the opengl context
Arguments
x
The x position of the circley
The y position of the circled
The diameter of the circlerect(x, y, w, h);
Draw a rectangle to the opengl context
Arguments
x
The x position of the reactangley
The y position of the reactanglew
The widthh
The heightsquare(x, y, s);
Draw a square to the opengl context
Arguments
x
The x position of the squarey
The y position of the squares
The size of the squareline(x1, y1, x2, y2);
Draw a line to the opengl context
Arguments
x1
The x position of the first pointy1
The y position of the first pointx2
The x position of the second pointy2
The y position of the second pointquad(x1, y1, x2, y2, x3, y3, x4, y4);
Draw a quad on the screen
Arguments
x1
The x position of the first pointy1
The y position of the first pointx2
The x position of the second pointy2
The y position of the second pointx3
The x position of the third pointy3
The y position of the third pointx4
The x position of the fourth pointy4
The y position of the fourth pointpoint();
Draw a point on the screen
arc();
Draw an arc on the screen
ellipse();
Draw an ellipse on the screen
triangle();
Draw a triangle on the screen
beginShape(mode);
Begin adding vertices to a custom shape
Arguments
mode
The opengl shape mode LINES
, POINTS
, QUADS
, TRIANGLES
, TRIANGLE_FAN
The following would draw a 100 by 100 square at position 100, 100 The following would draw a 100 by 100 square at position 100, 100
beginShape(QUADS);
vertex(100, 100);
vertex(100, 200);
vertex(200, 200);
vertex(200, 100);
endShape();
vertex(x, y);
beginShape
must be called prior
Adding a vertex to a custom shape
Arguments
x
The x positiony
The y positionendShape();
beginShape
must be called prior
Close the custom shape