# Tag Archives: opengl

## OpenGL FPS Camera

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…

## Drawing Cube with indices

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

## Custom Library Engine

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…

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

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

## Create a Game Engine: Part V Rendering

In the previous tutorial we set our Scene Manager but unfortunately we didn’t have any models to render. In this part we continue our journey by creating a basic Model class which will be inherited by specific models like Triangle for example. Beside Model, maybe at some point in time we will have Model2 and Model3 required…

## Create a Game Engine: Part I Shader Manager

In the first chapters of this series I told you that we somehow want to create a basic Game Engine and keep our architecture as decoupled as we can. I know that this might sound a little crazy to begin working on a Game Engine or to an architecture knowing how to render just a triangle in NDC…

## CREATE A TRIANGLE IN OPENGL PART III Attributes

Go to OpenGL Home Last time we talked about VBO and VAO which are required to set our vertices in the GPU memory. Finally it’s time to see how to connect these vertex attributes (positions, normals, colors) with vertex shader inputs. In this tutorial we will cover the following topics: Connect vertex attributes (position) with attributes from vertex…

## Creating a Triangle in OpenGL In-Shader

Go to OpenGL Home As a prerequisite to this tutorial, I suggest you read the previous one which can be found here, because it contains a class which will read and compile shaders. Last time we started to delve into shaders and how to set them up in the main program. This time we will create…