Search Projects

Tuesday, December 30, 2014

Red Blue Stereo Mini Project Computer graphics

Today we are going to see a  Mini Project Computer graphics in OpenGL that is named as Red Blue Stereo.

This is demo of stereo for red/blue filter stereo glasses. In this Mini Project Computer graphics, we are showing the red/blue filter, the effect that can be seen via glasses. Even the people with some defect in their eye able to view some objects in red/blue via their left or right eye.



This mini projects Computer graphics in C consist of mainly these objects -
  1. Dodecahedron
  2. Icosahedron
  3. Teapot
  4. Solar system
These objects can be viewed with switching of either in Mono or Stereo Views. There is right mouse attached to perform the action with menu come out as right mouse button clicked. The solar system consist of only earth and sun. More planets can be added to it if one wish with addition of other object in the code where the earth and sun orbit is defined.

Saturday, December 27, 2014

The Pong game in Computer Graphics Projects

We have seen many game in Computer Graphics Projects using OpenGL graphics library for the VTU 6th Sem  mini project. Many of those game has used the potential of computer graphics. There are still more to add. Today we are going to see another potential game build with the open graphics library. The use of Glut (free glut) has charmed the graphics era taking directly on the Direct X. Use of interaction of user with mouse and keyboard in general is base of any interactive game. Today we are going to see another great interactive arcade game.



The Project is written in the C++ witht good use of OOP Concept.In this project user has the option of interactive with the keyword functionality. There is key for start, moving up and down (different for each side). Most important part of this project is that this game can be played by two people. Both the VTU 6th sem partners can chill out playing the pong game while having their Computer Graphics Projects completed. Isn't it good to have fun while learning.

Rule of the Game : Player have to avoid the ball touching wall or in term of Wikipedia return the ball to other without fail. Score determines the user positions in the game. Player with high score is in winning condition. To win the game player must score 8 points before the opponent.

Keyboard interaction :

 'q' : left up
 'a' : left down
 'z' : left ball releases/speed
 'p' : right up
 'l' :  right down
 'm' : right ball releases/speed

The winning points and keyboard functions can be change via program code.

This is finest premium Computer Graphics Projects, so there is a minimal charge for it. To buy this projects Call 8147656011 or Contact via Contact us Form.

Monday, December 22, 2014

Train Simulator C++ opengl program

Train is important part of Indian transportation system. Today we are going to have simulation of Train in our cg opengl program.

The Train Simulator C++ opengl program is show the trains running over the track. We have already seen the running train project but it was not that much powerful as it should be. Here we have much better version of Computer graphics representation of Trains in OpenGL. We have much improved Train Simulator C++ opengl program where the Train Coach are not so small but big one. The Engine is quite large as well as the wheel and track. Most important we have electric engine simulated.


In the image you can clearly see the Train Simulator C++ opengl program is made of many boxes or rectangles while wheel is circular.The two parallel line have the electricity flow for the train running, we have electric engine here.

Let talk about the code prospective. The code written in c++ is simple, we have functions for all the parts - trains, electric lines, wheels and the track. All the code combined in the display to  have the Train Simulator C++ opengl program.

Tuesday, December 16, 2014

Opengl Source Code Ship Iceberg Collision

There were many interesting events happened in past. One of them was tragedy of Titanic. The Ship Iceberg Collision led to shrink of huge big ship along with many crew members and passengers. Based on this we are providing the Opengl Source Code for Ship Iceberg Collision. This mini projects in computer graphics,  will demo the accident of collision of ship with iceberg.


In Previous posts we have shown opengl programs for Solar System, Taj Mahal, Traffic Signals, Networking base projects, some study based projects.There were Opengl Source Code for robots but for moving trains, nuclear power plants, Zoo etc. We have shown story related program like - story of hare and tortoise in computer graphics. But is something related to a real life event which was not shown earlier.

The Titanic Ship (RMS Titanic) was a large ship on 15 April 1912 Shrink due to collision with iceberg. This 269 m ship weighing 52,310 tons on it's maiden voyage scheduled to go from Southampton to New York City. The Ship shrink and around 70% of people we lost. This opengl programs shows how collision of ship with iceberg lead to shrinking.

In this graphics project there is simple ship and a large iceberg. The ship move forward automatically, collides with iceberg and shrink stateway. Though it should contain some passenger in it but for simplicity, it was avoided. There is no functionality added to it with either keyboard or mouse but you can edit Opengl Source Code to adjust a according to your's. 

The only interaction added to the project is the front page where, HTML button is placed, clicking on it will open next screen. It is similar to the opening of a web page clicking on a button. Try Modify it and make more complicate as well as interactive, tell us and publish it with your name.

Download the Opengl Source Code for this project.


Tuesday, November 25, 2014

How to install opengl in linux ubuntu

Executing the OpenGL Programs in Windows is quite easy as compare executing it with the Linux OS. You just need to install the Visual studio in windows machine and paste the right file in proper folder. But in Linux (Ubuntu) that not as easy, this is thought of many students.While this wrong assumption, Linux may be little hard to execute as it need more a programmatic approach rather than a simple use of GUI. There are many of students feel difficult to install the OpenGL/Glut libraries in Ubuntu or any Linux. Here we are going to learn how to install the OpenGL/Glut libraries in your Desktop or PC to execute the OpenGL Programs in C/C++ Computer graphics.

How to Install OpenGL/Glut libraries in Ubuntu/Linux

Download OpenGL/Glut in Ubuntu/Linux:


1. The first step is to open terminal using CTRL+ALT+T command.
2. Now install the development libraries of OpenGL/Glut in Ubuntu (paste the below command on terminal):
 sudo apt-get install freeglut3 freeglut3-dev

System will automatically install the necessary files which you need to run the OpenGL programs in Ubuntu.

3. For newer versions of Ubuntu (>= 11.10) you have to install another package because the linker does not link anymore(paste the below command on terminal):

sudo apt-get install binutils-gold

Note: If you are not administrator then, you need to ask for sudo permission.

Note:
 we are running any openGL code using simple command

4. Now create any c file(for example test.c) and compile :

gcc -lGL -lglut test.c -o test

5. Run the program :

Use the following command and create the file, as done with usual C/C++ program in Linux.

./test 
gcc -lGL -lglut test.c

than run using this command 
./a.out 

If you have any difficulty in installing opengl in linux ubuntu kindly comments in the commention section below. We will let you solve the all the issues related to installation of  opengl in linux ubuntu .

3D City Model Computer Graphics Project for VTU

Computer graphics has vast applications, one of them is creating the 3D model of objects. Keeping that in mind we presenting this mini projects for VTU students. The 3D City Model in Computer Graphics using c++ is great Project for VTU students seeking for a good mini projects submission in their course.


This projects simulates the 3D art of a city. The city is big so only a small portion has being created in the form of various 3D objects using computer graphics. You can clearly see the 3D objects in the image above - the buildings, trees, flagpole, roads and small houses. These objects together comes to form a real like society. There are many things can be added to this which is left for students to do in their own ways.

Do some additional modification with your own creative ideas like boundary covering whole society, few cars,moving peoples and so. Do add your creative to this  3D City Model Computer Graphics Project for VTU and comments below.


Monday, November 24, 2014

Egg Game Computer graphics with OpenGL

Computer Graphics has core importance in the development of games. We have seen so many game on this site. Today also we are going to see the interesting loving game. It is simple, easy to play as well quite easy to code it, present to you the Egg Game Computer graphics with OpenGL. As name suggest, game is related to egg. We are going to discuss the whole things about it in details.

Suggested Games Projects - Computer graphics with OpenGL

Ludo Board Game
Hawk Eye Cricket
Path Finding Game
Crab Pong Game
Minesweeper Game


As You can see in above image, the Egg Game has a bird, egg and a basket. The bird will lays the eggs and which need to be catch by basket. Simply, catch the egg or let it hatch.

Objective -  Catch the egg in basket before it fall and get hatched

How to Play - Use the S/s to start the game or Click Right mouse button then click 'Start Game'. As game stated birds(3 in number) will lay the eggs in certain speed depends on level. Move the basket with the Left mouse button  and catch the egg in it. Score by catching the eggs and go to next level. The level changes automatically as you score cross the mark set for the particular level. Speed of the egg going down doubles as level changes.

To quit the game press the Q/q  or Click Right mouse button then click 'Quit'.



Scoring -  There are different score for collecting different eggs.

White Egg = 01 point
Green Egg = 10 points
Orange Egg= 05 points
Pink Egg = 15 points

Special Collections

Bonus Points - Yellow egg = 100 points
Negative Points - Gray Egg = -50 points

Hope you liked the Egg Game Computer graphics with OpenGL. Post your comment about it and say anything you like or give suggestion to us.

Buy this amazing project by calling 8147656011.

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

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. 

Wednesday, August 6, 2014

Tetris game projects in Opengl computer graphics

There are many computer graphics games projects in the opengl. We have discussed many of them like ludo, snake xenia, mancala etc. Here are we have a new game projects in computer graphics. You may remember the childhood video game where we play the game of tetris. Here we are going ti implements the game of tetris in Opengl computer graphics.

The project is some what complex but not long. It has fewer lines of code. Logic is to have the function that define a random change of blocks or the shapes when key is press . With key press the angles are changes and hence the shape of the blocks are determines in each key press. The change is also selective and act on chosen shapes, means a shape of of long line may have four block in horizontal and vertices and no other shapes. The color is also randomly selected while for shapes changes it remain same. 

Tetris game projects in Opengl computer graphics


Keyboard Interaction -

Up arrow key - changes the shape in positive direction of angle
Down arrow key -  changes the shape in negative direction of angle
Right arrow key - move the blocks to right
Left arrow key - move the blocks to right
Esc - Closed the program

The important feature that this project lac is the disappearance of blocks as the line get filled. While timers and scores can be added in future to this projects along with sounds in the Opengl computer graphics.

I hope this computer graphics games projects would helped you in CG course or other ways. Download the source code Tetris game projects in Opengl computer graphics and comments for any query, problem, suggestion or alteration.

Tuesday, July 15, 2014

OpenGL Project on Binary Tree

In C/C++ Binary Tree is one of the tree data structure in which each node has at most two children. These data structure has two child -right node (right child) and left node(left child). In a binary tree, the degree of each node can be at most two. You can read more about binary tree on wikipedia.

As we have different operation with binary tree in c/c++, same operations can be done as demo in this projects. This OpenGL Project on Binary Tree, the elements are taken as input from the user which then form the Binary Tree according to the rule. See the image below which show how the a binary tree formed with sample input.

OpenGL Project on Binary Tree

How the Project works? It's the big question for all. It used the structures with 3 nodes input -left, right and parent. The structure also has data as the element for that very node. The input is taken from the user using the primary cin function in the console. The input is recorded and it is arranged in the order of the rules of binary tree. One condition put in this project to determine the termination is that last input should be 0.

The OpenGL Project on Binary Tree

Download the Project

Wednesday, July 2, 2014

New graphics editor Opengl mini Projects

We came across with graphics editor Opengl mini Projects in our earlier post. In this post we are going to see new graphics editor project. It is similar to in work with the previous project but an advance version. It is also a replica of MS paint provides many options that are not in the previous projects like - Triangle, Square, Circle, Parallelepiped, Pencil, Ellipse etc. These extra option like Triangle standalone draw the figure so you need not to work on the line most of the time, one click figure, thus saving the time.

New graphics editor Opengl mini Projects


Before we go on to the functionality let's clear about the few feature of this Opengl mini Projects.

1. The whole application has three user interface block - first the figures selectors (tools), second draw panel, third and last the color panel for selecting the specific color.

2. There are range of figures or tools to choose - LINE, TRIANGLE, SQUARE, ERASER, CIRCLE, EXIT, CCTRIANGLE, CCSQUARE, CYLINDER, BULLET, PARALLELEPIPED, SPRAY, MESH, TEXT, PENCIL, BRUSH, ELLIPSE, CLEAR. All these tools are having functionality as per their name.

3. The TEXT tool allows to have text typed rather than drawing it. There is no option for font family and sizes.

4. The color option having many shades to choose for the drawing. The only thing that lack is the color eavesdropping.

5. In the Draw panel we can see different shapes that can be drawn there by moving the mouse with the tools selected in appropriated color.

6. The last Exit button in the tools allows to close the program.

This Opengl mini Projects uses the important glut functions, that I am going to discuss here. The function are - glutMotionFunc() and glutPassiveMotionFunc(). These functions provides for the motion detection of mouse.It is similar like we detect the mouse click with glutMouseFunc(). The glutMotionFunc() detects the active motion (mouse is moved and button is pressed) while the glutPassiveMotionFunc() detects passive motion (mouse is moved but button is not pressed).

The signatures for the GLUT functions are as follows: 

void glutMotionFunc(void (*func) (int x,int y)); 
void glutPassiveMotionFunc(void (*func) (int x, int y)); 

Parameters: func - the function that will be responsible for the respective type of motion. 

The parameters for the motion processing function are the (x,y) coordinates of the mouse relatively to the upper left corner of the window's client area.

The Mouse click and motion are the major functionality of the project while we have figure predefined with primitive calls. Color selection and display uses the array. Keyboard function for entering the text when text tool is selected. There are whole bunch of things there. 

How you like this project? Download the source code of the project and do comments about it in the comment box.

Advance graphics editor Opengl mini Projects Source Code -

Friday, June 27, 2014

Getting Started with OpenGL ES for Android

Earlier we were focusing on small application based on OpenGL, Now we will go for the OpenGL ES. It is industry used graphics library. Today we would Getting Started with OpenGL ES for Android. As we all know Android is getting more and more importance day by day, as we see new Android L from Google I/O. Graphics is very much important for Android as we have so many apps running with much of graphic in it. Let get started with OpenGL ES graphics library learn how to use it in Android.

Prerequisites

Before we go with the setup of OpenGL ES for Android we must have an integrated development environment (IDE) installed on your computer. Choose from the two mentioned.
  • Android Studio -  Google now had made Android Studio as the official IDE for Android application development, which is based on Jetbrains's IntelliJ IDEA.
  • The Eclipse IDE
    1. Android SDK - Download it from Android.com for your Machine (depend on your OS), it comes in two version - with Android Studio and as Standalone tool, get the later one .
    2. Eclipse -  If you are not getting Android Studio or want to work with Eclipse Download it from here
    3. ADT Plugin for Eclipse - The ADT plugin for eclipse helps development of Android apps faster.
We are hoping that reader must have knowledge in Java and has used the Airndroid for programming. Keeping this on ground we are proceeding.

Setting up OpenGL ES For Android

First create a new project and name it "OPENGLES4ME" and set the minimum required SDK to API level 10(don't go further down).

You can also make sure no one install the application from Google Play on a device not supporting OpenGL ES 2.0 by adding a uses-feature in the AndroidManifest.xml.

<uses-feature android:glEsVersion="0x00020000"  android:required="true" />

Updating Soon

Monday, June 9, 2014

Computer Graphics Projects On Moving Ship

Have you ever think about the Voyage? Get the Computer Graphics Projects On Moving Ship and sail one yourself.

In this post we are going to talk about the new project that simple easier as well little tricky. It's about the ship, the moving ship. Earlier post we had already have so many project that was based on principles motion. Most likely and closely was the traffic signal where everything was just about motion of vehicles. But the most important Computer Graphics Projects was on running train. Why recalling it? Because it resembles this very project. In running train there was movement of train and here it's about the Ship.

Features of  Computer Graphics Projects On Moving Ship

  • This Opengl Project is simple, easy to code and understand
  • The important part of the project that is tricky is the water and the ship drawing.
  • Next Difficult is moving the entire ship from one direction to another.
  • It has keyboard functionality of right and left arrow key which move front and back respectively. 
  • No mouse function as it not required.

What extra be added to Moving Ship Project?

Student can add many good feature to this project and make it more interesting and interactive. Since we have only keyboard function for right and left arrow, other keyboard functionality can be added to make it funnier like up and down arrow (move in air not in water).

Add keyword function to change the colors of the ships. Also add sound as ship moves. Sound of water can also be added. Adding crew and passenger also make it more realistic. On this Computer Graphics Projects On Moving Ship, Mouse function can be added to move the ship in the direction of mouse when the cursor is move in some particular direction. The ship follows the cursor like this it can be made. 

There are many creative things that can be added to this project. You students can make it more useful and interesting. Try apply you mind, create new project with it, share with us publish in your own name. Put Your comment and let how you like this.


Download Moving Ship Computer graphics Source code free.

Sunday, May 25, 2014

Formula One Racing Car Opengl Projects

One of the best thing to do in the Computer Graphics to develop a game, Formula One Racing Car is one to start. Everybody had heard about the Formula One Racing, it has high impact on people's entertainment. Most of the people like to see the fast running sports car. Michael Schumacher is one of the famous person in the Formula One, all of you may know him.

We need to learn Computer graphics to show some good graphics applications as well as some utilities for animation, games etc. Opengl computer graphics as per we read in VTU  6th sem syllabus, is very key to get in the touch with these things. It is starting step, so one need to go beyond it to become a graphics developer it would be key to start here. As we are talking today about the Car Racing games in OpenGL Projects, it not easy to go. I found some one had it built it in his own way.This may not be so complex or user friendly but quite good to start at this stage. If you go further OpenGL ES, which used in Android/iOS app development helps you alot. So my idea from this very project is to keep on learning and may be in future this could be a better achievement in your career to get you a high over others.

Coming to the project, this is a good car racing game like Formula one. Here you will see the car like of Formula one car with cylinder, the racing track of formula one. This project has few different view to look on the race.



Wednesday, May 14, 2014

Scaling in OpenGL

In this post I am going to show a simple way to learn how to do Scaling in OpenGL. Scaling is a property of transformation which helps increasing and decreasing the size of an object in computer graphics. The alteration in the size of object is done in each of the axis - X,Y and Z.

For Scaling in OpenGL we have inbuilt function which can be used easily on any 2d or 3d objects. The function  is -

Prototype :

void glScaled (GLdouble x,GLdouble  y,GLdouble  z);
void glScalef (GLfloat  x,GLfloat  y, GLfloat  z);

Sample :

glScalef (GLfloat  1.0f,GLfloat 0.5f , GLfloat  2.0f);

Here, in above sample code we see the function will scale the object into half in y direction, twice in z axis while remain same in x.

One thing is to be note is that - the matrix mode should be either GL_MODELVIEW or GL_PROJECTION, for object to be scaled.

Here is a sample program Which helps you understand the how the scaling works in perspective of  Opengl  computer graphics. This is simple c program, use x,y,z to scale down and X,Y,Z to increase scale factor in respective axis.

#include <gl/glut.h>

int x1 = 20.0f;
int y1 = 30.0f;
int x2 = 40.0f;
int y2 = 50.0f;
int x3 = 60.0f;
int y3 = 10.0f;

void Display()
{
 glClear(GL_COLOR_BUFFER_BIT);
 glPushMatrix();

    glBegin(GL_TRIANGLES);
    glColor3f(0.0f,0.0f,1.0f);

    glVertex3f(x1, y1, 0.0f);
    glVertex3f(x2, y2, 0.0f);
    glVertex3f(x3, y3, 0.0f);


    glEnd( );
    glPopMatrix();
    glFlush();
}
void MyKeyboard(unsigned char key,int mouseX,int mouseY)
{
    if (key == 'x')
    {
        glScaled (0.5f ,1.0f ,1.0f);
        glutPostRedisplay();
        return;
    }
else if (key == 'y')
{
glScaled (1.0f ,0.5f ,1.0f);
        glutPostRedisplay();
        return;
}
else if (key == 'z')
{
glScaled (1.0f ,1.0f ,0.5f);
        glutPostRedisplay();
        return;
}
else if (key == 'X')
    {
        glScaled (1.5f ,1.0f ,1.0f);
        glutPostRedisplay();
        return;
    }
else if (key == 'Y')
{
glScaled (1.0f ,1.5f ,1.0f);
        glutPostRedisplay();
        return;
}
else if (key == 'Z')
{
glScaled (1.0f ,1.0f ,1.5f);
        glutPostRedisplay();
        return;
}
else
{
glScaled (1.0f ,1.0f ,1.0f);
        glutPostRedisplay();
        return;
}

}

void main(int argc,char** argr)
{
 glutInit(&argc,argr);
 glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
 glutInitWindowSize(1000,600);
 glutInitWindowPosition(50,50);
 glutCreateWindow("The Scaling");
 glutDisplayFunc(Display);
 glutKeyboardFunc(MyKeyboard);

 glClearColor(0.0f,0.0f,0.0f,0.0f);
 gluOrtho2D(0.0,1000.0,0.0,600.0);
 glutMainLoop();
}

I think you get to know about the scaling transformation in OpenGL. For any question, query or suggestion put you comments.

Wednesday, April 30, 2014

Flowing Fountain OpenGL Projects using c++

Everyone likes the fountains, so today I am going to present OpenGL Projects using c++ on it. In the perspective of computer graphics creating the fountain is a uphill task. There is need of many items in the project design either it's holding the water, the flow of water and the water reservoir. Rendering these is tough task to make fountain look real. Most important point is to take care of rise of water upward, it's angle of falling in parabolic fashion. 

Use of OOP

This Computer graphics project for VTU 6th sem students on fountains has used the concept of OOP  (Object Oriented Programming) principle in some aspect. It is C++ project rather a normal cproject. The use of Class and the object in only used for the fountain's water fallings, while rest was under normal functions. The OOP principle is basically used in the water drops, steps of fountain, speed of fountain etc.  A fountain has several steps, each with its own height.

Some Great Features

Seeking for a great OpenGL Projects using c++, then CG Project on Flowing Fountain is one stop for you. Apart from the design and functionality that make the fountain looks real there are many additional features in this computer graphics project. Some of the extensive feature are - 
  • There are 3 Page with callback for each - Front Screen, Help Page and the Project Page.
  • View Defined in the Project - Top and Front.
  • Random Color of water can be there in fountains.
  • Both Keyboard and Mouse Control for Users is added to this Project.
Keyboard Control (Mentioned in Help Page) - 
KeyFunction
nMove Near
aMove Away
uMove Up
dMove Down
tTop View
fFront View
hOpen HELP
bOpen MENU
Menu Key Functions -
KeyFunction
1Project
2Help
3Exit
4Front
Mouse Interaction (Act in Project Page)-
Right click to gain the menu.
  • Color
    • Random - Random color of water
    • Blue - Green Color water
    • Green - Yeah Water color is blue
  • Help
    • KEYBOARD CONTROLS
    • Move Near: n
    • Move Away: a
    • Move Down: d
    • Move Up: u
    • Vertical 360: x
    • EXIT
If you liked the Flowing Fountain OpenGL Projects using c++, kindly put comments. Also suggest some changes that need to be added to this project. You can submit modified version of this project to us(Publish it with your name). Download the free opengl source code from below.

Watch the Video Demo

Monday, April 21, 2014

Client Server VTU 6th Sem Project

The Client Server Projects on computer graphics is a networking based project. This vtu 6th sem project indicates the working of client and server request and response. This Project is submitted to us by two students who has presented this as their  CG Lab Project in College.  In similar way if you have projects you can submit it us via our project submit page. They don't want to have the name but you can have project published with your name. Became either author or just get a coutsery.



What we have in this projects?


We have a client  and a server. The client give the command to server, it then get the response of that command from server. As the response is received by the client it then send the data to server. This is the main function of this project.

There are another function of the server - storing the data which we seen earlier and giving the data on request. So we can retrieve the stored data with retrieve menu. Store the data with store menu. List is another function. Major interactions for the VTU 6th Sem Project are listed below.

Mouse Interaction

There are 5 major Menu added to this project via mouse click. You can get the menu via right clicking!

1. START - Simply proceed the data with request and response.
2. START 1:RETRIVE - It helps retrieve the stored data from the server.
3. START 2:STORE -  It store the data to the server.
4. START 3:LIST - Listed the data to and from the server.
5. EXIT - Quit from the server.

VTU 6th Sem Project Source code download 

Before you download the source code read a bit about it. First of all what ever this project work, it is a good Networking Based Project. This good computer graphics project has designed well the Computer CPU, Monitor and the Server. It has good interaction as well. Hats off to those student who submitted it.


Thursday, April 17, 2014

CG Mini Project on Flying Ball

Inspite of having many projects listed here, many students were asking about bouncing ball  project. With regards to that presenting you the CG Mini Project on Flying Ball. This project is some what different from the bouncing ball because it the ball is not bouncing up down rather it stays in air due to fan. This project can help people in coding the bouncing ball on the same platform.

Features of the Flying Ball Project
  1. There are 3 components involved in this project - Ball, 4 bladed fan and the big net covering them.
  2. The big net is like funnel and is beautifully rise from the bottom to top covering both the ball and the fan.
  3. The fan is in the middle which mean to give air so ball can fly at the top.There is option to stop running the fan. As the fan stops the ball also stop spinning in the air. 
  4. As describe in the previous Ceiling Fan CG Mini Projects, we have added the 4 different background for the front screen and more can added easily.
CG Mini Project on Flying Ball

Keyboard Interactions:
KeyAction
1Default Front Screen
2Front Screen - White
3Front Screen - Brown
4Front Screen - Green
bFlying Ball
BStop Flying Ball
q/QExit Project
Mouse Interaction : 

Right Click and Choose from the menu
1. Flying ball - Take to the page with ball flying in air
2. Quit - Exit from the project

Learn How to add Front Page to your Project  for better interaction.

Improvement in the Project - Well I like to say you can turn this as a game play. Add a timer which will start the game, so on clock tick to 0 player start accelerating the fan in air. For Every minute 10 key press to accelerate allowed to player. As ball fall down player finished the game. Calculate the score with the time the ball remain in air.

Video for the Project -


Download the full source code.

Monday, April 14, 2014

VTU CG Lab Projects on Ceiling Fan

VTU CG Lab Projects on Ceiling Fan is created and designed as a part of B.E 6th Semester. As mentioned in Solar System Project this is in course under VTU for Computer Graphics Laboratory. It is great to develop this project by 6th sem vtu students for submitting in their college. Below We can have different features that this CG Lab Projects shows -

Front Page of CG Lab Projects on Ceiling Fan



The front Page for this VTU CG Lab Project is quite simple and have many options in itself. The picture above told you much about the project. At the place of  "Your Names Here" the projects co-ordinate names should be there. Capital letter "C" when pressed will lead to running, continue pressing the same cause speed variation of the running Ceiling Fan. The small letter "c" will let to static Ceiling Fan. 

Also Try Downloading these -

OpenGL Taj Mahal Project
Cg projects on Sorting
Origami Computer graphics Projects

The background this projects are in 4 different colors, these can be accessed by press the numeric key from 1-4. Detailed of color and the key is mentioned in the front page. Additional colors can be added to project as well which you can see in the video, how to add it.


Functionality of the Project

In this VTU CG Lab Projects there are many things being used. First is the use of vsprintf,  glutStrokeCharacter and buffer techniques to display the fonts. The design and coding of fan is not that easy but the is use of glutSolidSphere make it easily.

Other functionality is easy just simple logic to increment the speed of fan blades and stop it. Same procedure to add the keyword and the mouse function. You may remember how to add menu in opengl - same here it is used in this project.

Improvement in the Project

There are minor and major improvement can be done in this project as well.

  • Improve the front page.
  • Add additional interaction through keyboard and mouse.
  • More backgrounds in the ceiling fan with rooms and so.

Download the Source code.

Monday, April 7, 2014

Computer graphics Projects Selective Repeat Arq

In this Networking based Computer graphics Projects, we introducing again the Selective Repeat Arq. It is the modified version of the earlier Networking based OpenGL Mini-Project : Selective Repeat ARQ.



Selective Repeat Arq is good project based on the networking algorithm. It has the functionality shown in  manner to show case how the data transmission occurs in network.It deals with all the aspects, conditions that actually happens to transfer of data from the source to destination.

Ask for the Source code in Comments. Don't put your email directly there, I will not take responsible of misuse of emails for spamming purpose(we, the OpenGL Projects Team members, do not share spam emails to you but others can).  I will share to you though the admin panel. Also kindly comment with good working email address. Hotmail is not allowed? If possible signed with Facebook, Twitter or Google plus. Don't repeat the comments for asking the code. You can modify and share this like we have now the other projects as well. Thanks

Tuesday, April 1, 2014

Running Train Opengl Projects Example

Creating a Train in Computer graphics is not that much hard but logical. In this post we are going to see an OpenGL Projects Example on trains. Our objective is to develop a simple cg projects for running train. Here we need to draw the following things -
  • Train - the bogies and the engine
  • Train Tracks
  • Sky with surrounds (Environment)
After we finish the drawing our next aim would be to give motion to the train. As we are going to draw a simple train so our track will be a straight not in zigzag manner.

Running Train Opengl Projects Example

Design and Implementation


For developing the train - it's bogies and engine we have defined a simple function. In this simple opengl projects example we are coding this function so we can make any no trains, by just calling it. The following is sample code for drawing train -

void TRAINS(int x1,int y1,int a,int b) 
{
int i=0; glBegin(GL_QUADS); 
glColor3f(0,0.0,1.0); //ENGINE 
glVertex2f(x1,y1); //lengh of engine=60;height of engine=30; 
glColor3f(0,0.0,1.0); 
glVertex2f(x1+60,y1); 
glColor3f(1.0,0.0,0.0); 
glVertex2f(x1+60,y1-30); 
glColor3f(0,0.0,0.0); 
glVertex2f(x1,y1-30); 
glEnd();
while(i<3)
glBegin(GL_QUADS); //BOGIES 
glColor3f(1.0,0.0,0.0); //For right train a=795,b=510 
glVertex2f(a,b); 
glColor3f(1.0,0.0,0.0); 
glVertex2f(a+60,b); 
glColor3f(1.0,0.0,0.0); 
glVertex2f(a+60,b-20); 
glColor3f(1.0,0.0,0.0); 
glVertex2f(a,b-20); 
glEnd(); 
a+=65; i++; 
}
}

This function can be called any where hence easy to create the sample trains. In similar fashion we have different functions for Sky, Environments and Tracks.  You can download the free cg source code below. All the things made in the opengl projects example have used primitive opengl objects.

Next level of difficulty  is to move the whole Train - bogies and engine. For the motion of train we have logically used the call-list, push-pop matrix and the most important  Clock() function. The clock() is defined in <time.h> header so you need to include it as well in the project.

clock_t goal = mseconds + clock(); while (goal > clock());

Our new function will help the train runs according a time level else we may go so fast or so slow. We have fixed a goal and add  certain time for it to move the objects. The above code is called in a function and we give the parameter mseconds according to our requirement of speed we want.

That's all we finished the things up. I have just summarised the Running Train Opengl Projects Example while you can easily understand the things when you start running the program.

You can improve Opengl Projects Example


How you can improve the running train projects -
  • Make the trains more attractive with your creative mind.
  • Add smokes coming from the engines while it runs
  • Use Keyword or Mouse function to make it more interactive for start, stop and other functions
How you Liked this simple cg projects example on trains please let me know through the comments. 

Download free cg source code

Sunday, March 23, 2014

How to Draw Circle in OpenGL

In the OpenGL Computer graphics there major problem in drawing circle. In this post we are going to study How to Draw Circle in OpenGL. There is no primitive functions like of lines, points, triangles and other polygons for circle, hence drawing a circle need some new method/function from our side. we are going to learn that today.

There are many methods of Drawing circle in OpenGL, we going to discuss one by one each of them. 

First Method - using the indefinite points 

This method used the no of of point to draw a circle. The problem with this method is you need more precession as we use the sine and cosine function with the value of pie as 3.14159, So little error may in the round circle. Put the following code in a simple display function and run the program for your circle. See the Image it's output - 

glBegin(GL_POINTS);
 for(int i=0;i<1000;++i)
  {
  glVertex3f(cos(2*3.14159*i/1000.0),sin(2*3.14159*i/1000.0),0);
  }
 glEnd();

draw circle opengl - using points

Second Method - using the lines 

As Like above program circles can be created using the small sets of lines.We used the bunch of lines, which are closed together to go round forming a circle. For drawing circle in opengl, this method also used the simple sine and cosine maths functions, but we have not used pie instead go for degree for angles.

typedef struct
{
float x;
float y;
}CIRCLE;

CIRCLE circle;

void createcircle (int k, int r, int h) {
    glBegin(GL_LINES);
    for (int i = 0; i < 180; i++)
    {
    circle.x = r * cos(i) - h;
    circle.y = r * sin(i) + k;
    glVertex3f(circle.x + k,circle.y - h,0);
    
    circle.x = r * cos(i + 0.1) - h;
    circle.y = r * sin(i + 0.1) + k;
    glVertex3f(circle.x + k,circle.y - h,0);
    }
    glEnd();
}

If you know about the structures in C then fine you understand the typedef else we have more object oriented approach making use of classes for C++. Same program above in classes.

class circle{
public : float x,y,rot;

public:
void createcircle (int k, int r, int h);

};
void circle::createcircle (int k, int r, int h) {
  glBegin(GL_LINES);
    for (int i = 0; i < 180; i++)
    {
    x = r * cos(i) - h;
    y = r * sin(i) + k;
    glVertex3f(x + k,y - h,0);
    
    x = r * cos(i + 0.1) - h;
    y = r * sin(i + 0.1) + k;
    glVertex3f(x + k,y - h,0);
    }
    glEnd();
}


Friday, March 21, 2014

Tower of Hanoi Computer Graphics Project

Solving Puzzles all of us like to play in our leisure. To day on the same note I am presenting the Tower of Hanoi Computer Graphics Project using OpenGL. This very simple puzzles based on the no of discs and the towers. The objects, rule were discussed in the previous Tower of Hanoi OpenGL project, in which used CONE and TORUS. Similarly in this Computer Graphics Project we are using these same primitive 3d objects.


This has following feature -
  • It has better shaped disc, look more realistic.
  • The options in this Computer graphics Project in C allows to set different backgrounds.
  • The Tower of Hanoi Project has more interaction than previous one as it's allows to have step by step solving the problem. First at the beginning you need to input no of disc. Right Click to Get the options menu - Click on Solve to start solving. Continues to till the problem automatically get solved. 

Also Try These Projects -


Future scope - It can allow to changes the disc from one to other by human's choice and not though some algorithm. Also put levels with no of disc as the base. As the level increases the disc count also need to get increment. We may start level 1 or 0 with 3 discs.

I think your gone like this projects as well, put your comment and let what more need to be added in this. Also help by contributing your projects either modified or new, your project your name.

Monday, March 17, 2014

First Come First Serve Algorithm

First Come First Serve Algorithm is OS based Computer graphics Project. This Project as name suggest demonstrate the working of First Come First Serve Algorithm or FCFS Algorithm.

About First Come First Serve Algorithm

The first come first serve (fcfs) algorithm is one of the scheduling algorithms for Process in Operating System. It has the following algorithm - 
  • In FCFS the process is executed on first come, first serve basis.
  • This algorithm is easy to learn, understand and implement.
  • The performance of this scheduling algorithm is poor as average wait time is high.
Terminology

Arrival Time : Time of Arrival for Process.
Execute Time :  Time taken for execution. 
Waiting Time : Time to wait for process it’s execution.
Average Wait Time : Total waiting time/No of Processes.

Instruction to execute Program

To execute this program - run the program with CTR+F5(in windows). First page will have instruction written on it. Press E or e to run the computer graphics project with default values. To run with your own values, give the inputs. Like in our case - press 4 first to give no of process. Then input 2, 3, 6, 7 for arrival time. Next input the execution time 2, 4, 5, 5. 

We have wait times for each as in the table  -

ProcessWait TimeExecution Time
102
214
325
465
Average Wait time = 0+1+2+6/4=9/4=2.25

You easily understand and demonstrate the concept in OS - First Come First Serve Algorithm. With learning from this project do your own the other scheduling algorithms projects on OpenGL. Download the free source and put your comments with respect to this projects.

Note: If You enhanced modify this project plz share your code with, it is a humble request as I single can't help student reach that much of projects. Your Code Will be publish as your with your name only! Thanks !