Category Archives: OpenGL

We’ve decided to do a bit of a ‘spring clean’ in the OpenGL tutorials department. We swapped from Visual Studio 2013 to Visual Studio 2015, updated to the newest versions of FreeGLUT, GLEW, and SOIL2, and we’ll be giving you a swift walkthrough to get the old code up and running in OpenGL 4.5 core.…

Last time we created a First Person Shooter (FPS) camera style using rotation matrices for orientation. In this tutorial we will create the same camera but instead of using rotation matrices we will use quaternions. Small introduction to quaternions First Person Camera implement I Gimbal lock with quaternions First Person Camera implement II Conclusions …

Welcome back to our 3rd chapter in this OpenGL tutorial series. If you followed our tutorials up to this point I’m pretty sure you asked yourself when are we going to move around in our virtual scene. In this tutorial we will learn how to do a basic FPS (First Person Shooter) camera style. Here are the…

The previous tutorial introduced the foundation of texture mapping in OpenGL, and focused on illustrating how a .BMP texture file is correctly mapped to a cube mesh. This is a great starting point, and during the current tutorial we will take it one step further by introducing texture loading libraries, the notion of multitexturing, and UV…

In previous tutorials we began constructing objects in our virtual space and assigning colors to their vertices, thus obtaining multicolored cubes which we could admire. However, in most, if not all cases, whenever you generate an object to use inside a game, a simulation, etc. the object might require more visually complex coating than a…

Last time we saw how we can draw a cube in OpenGL, however there is another technique used to do this called indexed drawing which is a bit more efficient in some cases. If you were paying attention in the last tutorial, you would have noticed that we used 6 vertices for every face of the cube.…

Before we move on to the next tutorial, we want to modify the project a little bit. At the moment, we add new classes in our engine for every new tutorial. We have a class for triangle, a class for quad, a class for cube etc. This is fine but it will be overwhelming for us…

Moving on from 2D to 3D in our drawing process, we arrive at the easiest geometric form one could draw with an extra dimension added: the humble cube. Because we are moving step by step in our learning process, we will be drawing a cube in the most inconvenient way possible: by creating the vertex…

In the previous tutorial we saw how hard and painful it is to work with glGetError. Luckily in OpenGL 4.3 a new feature was introduced called Debug Output that makes OpenGL error checking much more easier. Prior to version OpenGL 4.3 this feature was just an extension that can be found under the following names: AMD_debug_output (was first…

Before we go further with our tutorials, we have to create a debugging system for our architecture (presented in Chapter I) to catch possible errors or warnings from the OpenGL API. At the moment we can only defend our program from shader errors when we try to read and compile them (check this tutorial on reading…