Search Projects

Saturday, November 26, 2016

Multiplex - C++ graphics program

Multiplex is a place where you have multi screen to show various movies in different languages. Today we are going to have Multiplex - C++ graphics program. We have seen so many graphic programs in our website but this one something different from others. This program have so many features which we are going to explain below. This C++ graphics program has been developed using opengl graphics library in microsoft visual c++. You can use the same source code with some modification in the program like in linux or code blocks IDE.

Two Displays

This Multiplex - C++ graphics program divided into mainly to two different displays. First screen shows the entrance of multiples. In this display the multiplex theatre building with hoarding is shown in output of the program. In addition to the building a person, a car, trees and road is also displayed. To go inside the multiplex or enter the new display of execution left mouse button can be used.

Multiplex - C++ graphics program Theater View


In the second the ticket counter along with different screen of the theater is displayed. There is also a popcorn counter. This program is very interactive and takes input from user to display. As you enter the multiplex theater by pressing left mouse button you will have choice to choose you movies. Here to simplify things the movies or screen are named on the language- Hindi, English, Tamil and Kannada. Each screen has been give a specific key so when user press that key the person will enter the theater of assigned key. More user interactions are shown in below section of reading.

Multiplex - C++ graphics program - Screen View

Coding of C++/C graphics program

As already described above code of this c++ program used opengl graphics library. The code has been executed in windows platform using MS Visual studio. You can port this in different platform using some modification. This program is written in c++ opengl, hence it utilized the power of opengl primitive functions.
In this program a method name "box" is created. The snippet of same is shown below. These lines of code are very simple and easy to understand.

void box(int a,int b,int c,int d,int e,int f,int g,int h)

{
glBegin(GL_POLYGON);
glVertex2f(a,b);
glVertex2f(c,d);
glVertex2f(e,f);
glVertex2f(g,h);
glEnd();
}


If you know opengl then you might be aware of GL_POLYGON, it creates polygon of desired sides. The a,b,c,d,e,f,g,h are variable of coordinate can be used while calling the method.  Each object can be individually coded but using this method, you can save time as well reduce the length of program. This method saved many lines of codes.  In similar ways other objects like building, cars, trees etc has been coded.

User interaction

There are two way interaction in this program. This C++ graphics program used both Mouse and Keyboard to take  input from the user. Function for each keys and mouse is described below.

Mouse Interaction 

Left Mouse Button  - Press to go and view inside the multiplex theater.
Right Mouse Button - Press to exit from the multiplex anytime.

Keyboard Interaction

'm' to get inside theatre and go to ticket counter
'h' to go to hindi movie
'k' to go to kannada movie
't' to go to tamil movie
'e' to go to english movie
'p' to go to popcorn counter

Multiplex - C++ graphics program


Future Enhancement   

This program can be improved by converting this in 3D version. Also we can add many people instead of just a single person. Motion of person moving can also be added in future. Addition of sounds will also make this program fare improvement.

VIDEO DEMO

Source Code

To get the source code of this multiplex C++ graphics program shoot an email to openglprojects@gmail.com

Kindly Share your view about the program  via comments, or you can email us as well.

Saturday, November 5, 2016

“The Voyage”- Opengl Projects with source code and Report

We have seen so many c graphics projects on ship including the screen saver , the moving ship and opengl project on shrinking of ship due to iceberg collision. In this post you will get the opengl projects with source code and report on “Voyage".


“The Voyage”- Opengl Projects with source code and Report


Voyage is journey to other place using the sea routes. So in this c/c++ graphics project, has been aimed of showing a simple journey of people on a large ship over the sea. There is not much evolvement of too many parts of the journey, but only the movement of ship in the sea from one point to another. The simple journey over the sea has been shown.

Components in the c graphics projects

This opengl projects with source code and report has various components to display on the screen and demonstrate the voyage some of them are explained below with their coding samples.

1.       SKY : One of the prime component that has to be display on screen is sky,it has been shown in cyan color and used very simple coding. To make it realistic the horizon has been colored in white. 

Mountain : Another useful and distinguish component of this c graphics projects is mountain. With appropriate coordinate combination the hills of mountain has been designed and displayed. You need to point the correct x and y coordinate to draw the mountain on screen. Color of the mountain is selected to have a little brownish shade.

3.       Sea  : Without sea there is no meaning of Voyage, hence it is one of the important part of the c graphics projects. Off course the color of the sea is blue, and we have used many dots which make the sea seems flowing. The dots is along the rows with many rows.

4.       Ship : One of the important and integral component of this opengl projects with source code and report is ship. The have ship have three stores and each stores have their own compartments which is in decreasing order from bottom of the sea. Three air exhaust is also there at the top.

The only component in this project that shows motion is ship. The ship in this  c graphics projects moves from left part of the screen toward right, again it enter to some other parts of mountain region and travelling goes on.

Future scope

There are many thing you can add in this project few of them are mentioned below. If you have some idea that we are missing you can suggest us via comment to us.

  •  You can add sound of engines of ship
  •  Can control the ship with user interaction to start and stop the ship at certain time.
  •  Place trees along the mountains.
  • You can place small boats around the ship.
  • Fish or other sea animals can also be shown inside the sea.
The Voyage is one of finest opengl projects with source code and report available with us. To get this projects  with full source code along with the report including the ppt, shoot an email to openglprojects @gmail.com.