Search Projects

Sunday, January 31, 2016

Highlights - Demonstrates the use of the GL lighting model

OpenGL always want that students should learn from basics and do their own projects. In our mission of giving you all the possible materials in terms of tutorials, codes, or video instructions, we are coming with this new opengl program.

This is a simple program that will Demonstrates the use of the GL lighting model.


Why we named it Highlights?


This program on execution will shows you the name of the objects when mouse is over it. As you can see the above image, we have three objects of which only one is highlighted (red). The name of the highlighted object us shown below. This program uses the principle of lighting in opengl, hence able to Demonstrates the use of the GL lighting model.

This program demonstrates the use of the GL lighting model. Objects are drawn using a grey material characteristic. A single light source illuminates the objects.

This program is put as it is without any modification to the original code.

Download the Original Code.

We are soon updating this post with some modification to the program while adding some more objects and more interactions.

Monday, January 25, 2016

Torpedo OpenGL Code Example

Torpedo are basically self-propelled weapon cylindrical shaped (more like a cigar-shaped), which can be fired either underwater or above water fired from ship, submarine. It  designed to detonate either on contact with its target or in proximity to it.

Today we are presenting the OpenGL Code Example for Torpedo. We are going to draw Torpedo in Visula Studio C++ using opengl graphics API. This program is an enhancement of torpedo with a texturing of the body and the blades. This Program is written by Sumanta Guha. We are presenting the same version of code with no modification.


Understand the Problem

Every project we do, first we have to analyze the problem. So first we have know the structure of torpedo. After that we have do decide how the design can be drawn using the available objects in OpenGL API. We done with the design of Torpedo, we have give the motion with some keyword functions.

Design the structure of torpedo

Our Torpedo will have the following parts -
  • A cylindrical body with hemi-spherical front face.
  • 3 rotating blades attached to shaft at the back face.
  • 3 curved fins attached in middle of body at equal distance.
There separate functions/routine defines of each of the objects for this OpenGL Code Example program. For draw hemi-sphere we have separate routine, which uses the latitudinal triangle strip, cos and sine function with proper logic. For blades the chessboard structure is used. While the whole body is give stripes with two different colors.

Bezire curves is used for the blades. The Control points for a propeller blade Bezier surface and Control points for the texture co-ordinates Bezier surface is defined. These are used for giving a textures to the blades and the body.

Interaction in the Program

Without having the user interaction in a program, it make the whole experience a dull one. The OpenGL Code Example program for Torpedo have the keyword interactions.

  1. Press space to toggle between animation on and off.
  2. Press the x, X, to rotate the viewpoint in the x-direction both forward and backward.
  3. Press the y, Y, to rotate the viewpoint in the x-direction both forward and backward.
  4. Press the z, Z, to rotate the viewpoint in the x-direction both forward and backward.
This is done by adding animation function to the display and giving the key their role for motion. You can download the whole Torpedo OpenGL Program Code with the link given below.


Sunday, January 24, 2016

Draw Helicopter OpenGL C++

We have seen many object in computer graphics c++ using OpenGL graphics API. Today in this post we are going to learn about Drawing Helicopter using the OpenGL in C++.

We all know Helicopter is an object with a tail, a body and the flying wing at the top. The structure is difficult to draw for a beginner programmer. First there is need to understand the structure. There is proper coordination of vertex on each of the portions of the body of the helicopter. 

Download the Helicopter OpenGL C++ Projects 

Call 7022162923