# Category Archives: Game Development

## Debugging OpenGL Part I

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…

## Projection Into the Matrix

We finish off our tutorials covering different matrix operations with the final matrix in the transformation chain featured in the picture below, which will result in either an orthographic or a perspective view on the scene. Orthographic and perspective projections The last usage of matrices we will cover in this tutorial series is translating the…

## View Matrix

In the previous article we saw that our input mesh data (all vertices) requires 7 main stages of transformations to finally reach the window space coordinates. The first 4 stages are represented by matrix multiplications. You may still wonder why do we need three matrices and why we multiply them. Well, we use matrices to…

## The Model Matrix

The transformation pipeline – a “Spatial Odyssey” In OpenGL geometric transformations are required in order to describe how the scene looks like. This involves converting from one coordinate system to another (since mesh data is introduced in 3D notation and has to be converted to 2D screen space). The previous tutorials built a mathematical foundation…

## Geometric Transformations Part III

Matrix representation of 3D transformations As discussed in the previous tutorial, a 3 x 3 matrix defines a 2D transformation through the use of homogeneous coordinates. In a similar manner 3D transformations can be described though 4 x 4 matrices which is the topic of the current tutorial (and last part of the “Geometric Transformations”…

## Geometric Transformations Part II

Homogeneous coordinates & matrix representation of 2D transformations The previous tutorial offered an introduction to 2D-space coordinates, and how to express an object in a coordinate system via matrices. The present tutorial will build on this information and introduce affine transformations by expressing 2D coordinates using 3 x 3 matrices, and as we will see…

## Geometric Transformations

Vertex Transformation – A Spacial Odyssey After going through the novice “initiation” part of this tutorial series, you now possess a better grasp on the elemental aspects of real-time 3D rendering in modern OpenGL. There’s a lot of ground to cover still, and at this point it’s time to set a solid foundation in basic…

## Create a game Engine: Part VIII Performance

Finally let’s talk a little about this engine that we created so far. The main advantage is that we have a modular architecture and is very easy for us to add a new modules into our scene. It’s like plug and play. I think that this architecture is super easy to follow and should give you a good start.…

## Create a Game Engine: Part VII Square

In this part we are going to add a quad/ square (still in NDC space) in our engine. This should be an easy task. Basically we have to create another class which inherits the Model class, just like we did with the triangle. Also we will talk a bit about Triangle Strip primitive use to draw…

## Iterating over STL map, STL vector, STL list and Array

Update: The post has been updated based on  feedback from reddit users: http://www.reddit.com/r/gamedev/comments/2ykhpg/iterating_over_stl_containers/  In computer games speed is always crucial so you really have to know what are the advantages or disadvantages of containers you want to use. I’m writing this article as a small parenthesis of a larger article where I presented the render loop…