Drawing your weapons
It's time for us to learn how to draw things in OpenGL. Whether you are drawing your weapons, an alien spacecraft, or a blade of grass, it all starts by with very simple shapes that are combined to make more complex shapes.
Getting primitive
The most basic shapes that can be drawn in OpenGL are known as primitives. The primitives that can be drawn by OpenGL include:
Points: As the name suggests, a point renders a single point and is defined by a single vertex.
Lines: A line is rendered as a line drawn between two vertices.
Triangles: A triangle is defined by three vertices and the three lines that pass from one vertex to the other.
Quads: A quad is defined by four vertices and the four lines that pass from one vertex to the other. Technically, a quad is actually two triangles that have been joined together at the hypotenuse.
That's it, folks! Everything known to exist can be created from these four primitives. Extrapolating into 3D, there are these 3D primitives:
A plane...