In the above figure we have four triangles and twelve vertices. In OpenGL terminology, a vertex can be seen as a collection of attributes like position, color, texture coordinates etc … For now, let's try to draw the four triangles from the next figure:įrom a geometrical point of view, a triangle is completely defined by the position in space of his three corners or vertices. The basic geometrical primitives that the core OpenGL profile provide to us are points, lines and triangles.įor simplicity, we are going to use only two dimensional drawings in this article, but keep in mind that OpenGL allows us to represent three dimensional objects, more on this in a future article. It is the programmer's job to combine the geometrical primitives from OpenGL in complex shapes and bodies. It is time to actually draw something using OpenGL.įirst, let me mention that OpenGL is a low level API, this means that it has no support for drawing complex geometrical objects.
GL_POINTSIZE OPENGL 4.1 HOW TO
In the first article we've seen how to open a window for our OpenGL application with the GLFW library and how to compile and run the code on Windows, OS X and Linux. This is the second article from my OpenGL 101 series. Solarian Programmer My programming ramblings OpenGL 101: Drawing primitives - points, lines and triangles Posted on by Paul