Saturday, November 15, 2014

Blockshooting Game OpenGL Projects in Visual Studio

Today I am going to present a great game project in computer graphic. The Blockshooting Game OpenGL Projects in Visual Studio C++.

We have written so many projects with graphics in c++ programs - the real time implementation of concept learned. These graphics programs in c++ teaches us to play with surrounding objects in our computer. Games we play based on computer graphics, we all love them. Let make our self a great game projects in computer graphics. Let Create a interactive Blockshooting game in OpenGL Computer graphics.


GameBlockshooting Game
About :  The game is a very simple shooting game. With number of available arrow the target is to be shoot down. The speed and no. of arrow and the target is fixed (which can be alter in the code). There are 15 arrows and 10 boxes by default.
Objective : Hit the box with the arrow before the allocated arrows ends.
How to play : Press 'r' to as arrows go upward, to hit the target.
Result : If you get arrows left with you before all the target box ends, you win else you declared losers i.e. You loose the game if the arrow count exceeds the blocks count.


Click to Download button for the sourcecode of BlockShooting Game

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;
 }