Wednesday, October 15, 2014

Gravity Simulation in OpenGL C++

Are you looking for something great?
Yes this Program in C++ is something like that. You will feel the gravity with your computer. See how gravity works with simulation of gravity using c++ and OpenGL. In Video you find the demo for the simulation project in OpenGL Computer graphics c++.


Kindly share this post and spread our blog reach many students. We are here to helps you with any things regarding OpenGL. Since this is external program you can edit and submit any additional work or may ask us for that. Tell in comments how you like this Gravity Simulation in OpenGL C++.

Thursday, September 4, 2014

Draw Fishes in OpenGL Computer graphics

In this so simple project  we are going to draw fishes. Yeah we are drawing fishes in OpenGL Computer graphics. It's not the project that shows the aquarium opengl project rather it draw the bitmap of fishes. The c/c++ program will helps in learning how to use the bitmap in OpenGL graphics.

Draw Fishes in OpenGL Computer graphics


Here we are going to draw many fishes namely - 20 instance of the bitmap fishes. This program is taken from LMU computer science Division, the CS department of Loyola Marymount University. All the Copyright is owned by them. This is Program is distributed for the purpose of education only.

Feature of the Program -

  • The program is used to show trivial use of OpenGL bitmaps
  • In this program we have the plotting of  about 20 bitmaps fishes in different colors.
  • The color of the fishes are random as well as the position on the screen.
  • No Keyboard and Mouse Interaction
What more can be added to this OpenGL Computer graphics Program are mentioned below - 
  • To make program more interesting, let all fish swim in a direction.
  • Make keyboard or mouse interaction to play and stop the flow of fishes.
Download the OpenGL Computer graphics Program on Fishes.

Sunday, August 31, 2014

Phases of Moon - VTU 6th sem mini project

We have seen many OpenGL Projects for vtu 6th sem mini project, but this is quite as simple as of others. Today we are going to talk about the project related to moon. There are many phase of moon , it is define as - The lunar phase or phase of the moon is the shape of the illuminated portion of the Moon as seen by an observer, usually on Earth

phase of moon vtu mini project

Today for VTU 6th sem mini project in the computer graphics lab we are going to have the phases of moon. In the this program we showcase the camera orbits a lit moon to simulate the phases of the moon. This program used the OOP used in C++, the use of the classes and the methods.

First we create a class for the moon.  In the class moon we create an OpenGL display list, which is  created with create(), and the draw() method calls it.We have use the sphere to feature the moon, which has radius 1 centered at the origin. Another class which we have created is orbiter, this is an object that flies on a circle of a certain radius on the xz plane. The radius to it is supplied at the time construction. Since there is one one moon so it must be static, hence we declared the moon to be static variable. 

How we are showing the phase? It's easy by using the lightning property of OpenGL. We have used the GL_LIGHT0 to focus the light on the moon, making the all phase visible as it go. Pointing in the direction of vertex 1,1,1 it's is possible to show all the moon phases.

Future Addition to phase of moon vtu mini project

  • Add the name of the phases of moon as it's go.
  • Add interaction to the project.
  • In this, adding the zoom option is wonderful thought.

Sunday, August 24, 2014

How to Draw Different Types of Triangles in OpenGL

To draw a triangle in opengl  we just need to use simple primitive functions. There are many ways you can draw but using primitive function is one of easy method. In this post we are going to draw few triangles using the different primitive functions defined in OpenGL graphics Library.

One of the blog reader requested to have the code for Triangle. Hence to help and all other reader in this post we going to see many types of triangles. We are going to have full source code with explanation. So get the code and spread the knowledge, don't forget to tell other and share the post.

Draw First Type of Triangle in OpenGL

Here we are going to use the GL_TRINAGLES and glVertex() to draw our triangle in a simple manner. Her we have drawn two triangles -red and white, both as right angled triangle. You can change the vertexes to make others varities of Triangle. 

#include "glut.h"

void Display(void)
 {
 glClear(GL_COLOR_BUFFER_BIT);

 glBegin(GL_TRIANGLES);
  glColor3f(1,1,1);
  glVertex3f(0,0,0);
  glVertex3f(-1,0,0);
  glVertex3f(0,1,0);

  glColor3f(1,0,0);
  glVertex3f(0,0,0);
  glVertex3f(1,0,0);
  glVertex3f(0,-1,0);
 glEnd();

 glFlush();
 }

int main(void)
 {
 glutCreateWindow("MY Triangle");
 glutDisplayFunc(Display);
 glutMainLoop();
 return 0;
 }

Draw Striped Triangle in OpenGL C++

You may have heard about the Strip triangles, now we are going to see it. Just as in above are using glVertex() but this time GL_TRIANGLE_STRIP.

#include "glut.h"

void Display(void)
 {
 glClear(GL_COLOR_BUFFER_BIT);

 glBegin(GL_TRIANGLE_STRIP);
 glVertex3f(0,0,0);
 glVertex3f(1,0,0);
 glVertex3f(0,1,0);
 glVertex3f(0.9,0.9,0);
 glVertex3f(1,-1,0);
 glEnd();

 glFlush();
 }

int main(void)
 {
 glutCreateWindow("MY STRIP TRIANGLE");
 glutDisplayFunc(Display);
 glutMainLoop();
 return 0;
 }

Draw Triangle Fan in OpenGL

Now its time to Draw a Triangle Fan. You might have seen this as used in our Nuclear Power Plant Project in OpenGL, where the turbine have it.

#include "glut.h"

void Display(void)
 {
 glClear(GL_COLOR_BUFFER_BIT);

 glBegin(GL_TRIANGLE_STRIP);
 glVertex3f(0,0,0);
 glVertex3f(1,0,0);
 glVertex3f(0,1,0);
 glVertex3f(-1,0,0);
 glVertex3f(-1,-1,0);
 glEnd();

 glFlush();
 }

int main(void)
 {
 glutCreateWindow("Triangle Fans");
 glutDisplayFunc(Display);
 glutMainLoop();
 return 0;
 }

Tuesday, August 19, 2014

Noof : the external - opengl projects using visual c++

Today we are going to see Opengl projects using visual c++ that is quite interesting. This computer graphics project is something different from all other we have mentioned in this blog. You can see the pic below.


You must have not noted much about it viewing the image and determined it as simple project to submit for your VTU but it is not. It is one of the good project that has a lot of potential to show, how much you know about the OpenGL. As in the image you see nothing that attract, but there more in this than simple solar system project. When you execute this projects in using visual c++ (MS visual studio) you will got to see the real potential. 


Noof the external is the name of this opengl project. We have coded opengl projects using visual c++. On execution the leafs will move, turn and twist from different part of screen. It likes the rocket when leaves the cloud in the sky. You got see like same as it fill the entire screen with cloud of leaves twisted motion. As the petals of flowers twist to form a beautiful object we are going to see same here. We have paired object shapes that form foam of cloud in the screen. Watch the video at vine to see how it actually works. 

This opengl projects using visual c++ has used many things like using the colors vectors, motion vectors to control how the object form and have it's motion with it. The use of glShadeModel and glBlendFunc is also crucial.