## Friday, May 31, 2013

### Modern OpenGL tutorial Rotation, Scalling and Translation Matrix using GML (OpenGL Mathematics)

In previous article perspective projection I have shown you how to do perspective projection. Now its time to do Scalling, Translation and Rotation which are very important task. In ancient version of OpenGL for these operation opengl provide funcition like glRotate, glScale, glTranslate but in modern opengl this function are not available so we are using GLM (OpenGL Mathematics) for doing such task. From this article I have change the source code with OOP. I have made two reusable classes Program and Shader.

All the code in this series of articles is available from github: https://github.com/smokindinesh/Modern-OpenGL-Series  You can download a zip of all the files from that page, or you can clone the repository if you are familiar with git.

### Setup GTK project in Code::Blocks (windows 7)

Follow the following step to setup GTK project in Code::Blocks (windows 7)
step 2:  Extract it in c drive creating new directory or any other place. In my case C:\GTK is the directory where I extracted the zip file.
My extracted files looks like below.

## Sunday, May 19, 2013

### Modern OpenGL tutorial Perspective Projection using GLM (OpenGL Mathematics)

In my previous article you may notice that in vertex data  for drawing a triangle, I have fixed the co-ordinate of z-axis to 1. If you change the value of z-axis greater than 1 or less than -1 then Image will not render on the screen because we haven't define the perspective projection matrix. In this project we are using GLM ,  in previous article there is no especial use of it so I haven't talk about it before but here we use GLM function for perspective projection .GLM is header only library made by heavy use of C++ templates due to which performance can be reduce but make programming easier. GLM can be use with GLSL easily so we are using GLM.

All the code in this series of articles is available from github: https://github.com/smokindinesh/Modern-OpenGL-Series  You can download a zip of all the files from that page, or you can clone the repository if you are familiar with git.

## Saturday, May 18, 2013

### Modern OpenGL tutorial Drawing the basic shapes

All the code in this series of articles is available from github: https://github.com/smokindinesh/Modern-OpenGL-Series  You can download a zip of all the files from that page, or you can clone the repository if you are familiar with git.

Vertex data for drawing is given below:

```// Put the 18 triangle verticies into the VBO
GLfloat vertexData[] = {
//  X     Y     Z

//Pentagon
0.25f, 0.25f, 1.0f,
0.75f, 0.25f, 1.0f,
0.25f, 0.5f, 1.0f,

0.25f, 0.5f, 1.0f,
0.75f, 0.25f, 1.0f,
0.75f, 0.5f, 1.0f,

0.25f, 0.5f, 1.0f,
0.75f, 0.5f, 1.0f,
0.5f, .75f, 1.0f,

//Triangle
-0.25f, 0.25f, 1.0f,
-0.5f, 0.75f, 1.0f,
-0.75f, 0.25f, 1.0f,
//Trapezoid
-0.2f, -0.25f, 1.0f,
-0.35f, -0.75f, 1.0f,
0.35f, -0.75f, 1.0f,

0.2f, -0.25f, 1.0f,
-0.2f, -0.25f, 1.0f,
0.35f, -0.75f, 1.0f,
};
```

Lets start digging the code and I will explain related theory side by side in short so that you can learn quickly and start to write you own program.You can also download the complete source code of this tutorials.
In this whole tutorials series we are using four library:

• GLFW for creating window,
• GLEW to acess OpenGL API function at run time ,
• GLM for doing some math for us like rotation, translation etc and
All the code in this series of articles is available from github: https://github.com/smokindinesh/Modern-OpenGL-Series  You can download a zip of all the files from that page, or you can clone the repository if you are familiar with git.

## Wednesday, May 8, 2013

### Beginner learning materials for Modern OpenGL API version 3.2

Just copy the code below, compile and run it in Code::Blocks to insure that you have successfully setup Moden OpenGL following instruction given in previous chapter Setup Modern OpenGL in Codeblocks . Also make sure that your pc graphics hardware (GPU) supports OpenGL API version 4.2 or later.