Friday, June 21, 2013

Modern OpenGL tutorial Texture Mapping Example source code

Texture mapping technique haven't change in Modern OpenGL. If you are experience in ancient version of OpenGL you might have done Texture mapping which is similar to here.Only difference is adding the extra variable to the vertex shader and fragment shader. Texture memory lie in video memory similar to VBO which is uploaded to OpenGL. Two things we have to pass in vertex shader and fragment shader. One is texture co-ordinate to define how to map on vertex and another texture color data to define the color of every pixel.Many article are there in internet about texture.Some of the great article are below.

  1. Texture Maping and Bitmap  This example use the OpenGL version 1.5 where VBO and VAO are absent.
  2. Texture is not Picture Article presents whats the texture is about.
  3. Texure This is the blog form where I learn about Modern OpenGL. 
Download
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.

Modern OpenGL tutorial Playing with color example

At first have a look screen shot of our program what we have going to build.

You have seen a triangle having different color at each vertex. In previous tutorials series we are just drawing the white triangle without color.

Download
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, June 1, 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.

Download
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 1: Download gtk+-bundle_2.24.10-20120208_win32.zip (all-in-one bundle) from http://www.gtk.org/download/win32.php
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.