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…

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 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…

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”…

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…

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…

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.…

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…

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…

In this part we are going to create the Triangle class which inherits the Model class discussed in the previous tutorial. We will have a Create method where we copy all the code required to create the triangle from this tutorial. Of course we need to adjust a few things to work. I won’t explain VBOs…