Showing posts with label cse mini project. Show all posts
Showing posts with label cse mini project. Show all posts

Monday, 28 March 2016

Constructive Solid Geometry using OpenGL


 Constructive Solid Geometry using OpenGL

Program to demonstrate basic use of 3D shapes and transformations. Uses calls to glut to draw the shapes. Click on the right mouse button which displays the menu, left button selects the option. Also illustrates the rotation of CSG in 3dimensional space. The program uses variable angle of rotation for different objects. The objects are in the shape of cone and sphere.

This is a simple interactive graphics program. It is extremely user friendly and has the features, which makes an OpenGL application. It mainly helps in demonstrating the basic use of 3D shaped and transformations.

It has an open source code and no security features have been included. The user is free to alter the code for further enhancements to either the front end or the back end. The basic minimal features such as built-in functions have been included in this simple graphics program.

Screen Shots

  • Object A only(Cone) with Menu








  •  Object B only(Sphere).


  • A or B


  • A and B



  • A Sub B


  • B sub A


  • CSG representations Changing Positions of Objects.

  1. A or B

2.   A and B




3.  A sub B


4.  B sub A



Download Program Source Source Code here
Download Full Project Report here 

OpenGL Mini Project For CS/IS/IT Students With Full Report

OpenGL Mini Projects With Source Code And Report

Here is a list of OpenGL mini projects (Computer Graphics) that includes source codes and full reports. The students belonging to third year computer science and information science can use these projects as mini projects.

3D Car - Animation

3D Car - Animation

This is a simple view of a car. It can be moved front and back using arrow keys. A road can be made to appear optionally.

Screen Shots :

With Road :


Download Program Source Code here
Download Report here

Aquarium

Aquarium


Description:
The Program demonstrate a simple illustration of how an Aquarium looks like, with option of providing foods, assembling the fishes as well as the poison food to decrease the population of fish inside. It is little bit complex project and may appear blur in some of the screen or even not fit. Change according to Screen resolution is required.

Usages: Left click and choose the options.

Food: Supply the different colored food.

Play: To resume play.

Assemble: To check the assembly of fish.

Poison Food: Poison food to make fish dies.

Exit: Quit from the program.

Screen Shot :





Download Program Source Code here
Download Report here

Brick Breaker - A Game

Brick Breaker - A Game

This is another of my game which is very primitive and unfinished. Anyone interested to develop the game further is welcome.

Here is how the UI looks like...


As you can see after running the code the game is partially complete and there is no end. If you want to show this as your computer graphics project you are free but you need to complete it.
This is a list of problems that need to be overcome.


  1. The bullets seem to pass through the bricks and the brick vanishes a little late. 
  2.  There are ten bullets used here and they are recycled. That is a bullet which passes through or which blasts a brick, its position is reinitialized to the muzzle of the shooter from where it is shot again. The problem is two bullets have a tendency to be shot together or close to each other. This looks so much uncool. We would want distance between bullets to be equal. 
  3. Even if a single brick comes near to the shooter region the game should end. I have deliberately left it unfinished. If you can write code to finish the game then it is a great thing. You can claim a little credit for having worked on this project. If you are able to solve the problems i mentioned earlier then you are a pro. If you manage to do so and if you are magnanimous enough you can get me the code and i will share it with everyone after giving you the credit.
Download Program Source Code here
Download Report here

Leaping Lizards/ Dinosaur

Leaping Lizards/ Dinosaur

This is not a game. It is an animation to draw a dinosaur and move it. The entire scene can be rotated by using the mouse as a trackball over the window. Modification of this program may include moving the arm/tail or the mouth to indicate mastication.


Here is how leaping lizards or dino looks like...





Download Program Source Code here


Download Report here

PacMan Game

PacMan Game

The two games are not my own creation and these are regularly submitted by students of every batch. I have modified some portions of the code where, in leaping lizards i have made it to rotate and in the pacman version that i got initially the pacman was not turning at turns.

In pac-man(in light blue/aqua) even though it looks like a 2D image it is actually a 3D pacman. It is drawn as a sphere and even the ghosts are spheres.

Thebugs in the code include the following:
  1. in level 2 if pacman dies the lives counter starts decrementing and never stops. It shoulddecrement by one and a new game started.
  2. Pacman should look like eating the food. This may be difficult with a 3D sphere so modifying the pac-man drawing code to 2D image of a circle may help.
  3.  In power mode when the pacman can eat a ghost it does not kill it but just passes through 
Here is how pac-man looks like...






Download Program Source Code here
Download Report here

Racer Game

Racer Game

In this project the cars are moving as earlier in the old racer car project posted before. Only extra thing that is added is that the black meter line on the road is made to translate down so that it gives an impression that the cars are moving.

Here are a few snaps:



The problem with this project is that after some points a few cars block the road and player compulsorily loses.



Download Program Source Code here


Download Report here

Racing Car

Racing Car

As the name suggests this racing car is going on a racing track which glows...



Will turn out as an excellent professional though i would like to advise him to slow down his typing speed while writing programs and devote more time to designing and analysis. I mean with paper and pencil before actually typing code. I know no programmer gets it right the first time but trial and error is not the right way to code.

Needless to say i hate spaghetti code. Code which is not indented properly, Code which does not have comments. Code which has lots of debugging statements and code with lots of lines commented. Code with warnings while compiling and which runs anyway. Last thing that a programmer does after writing code which does the job is to beautify the code. Optimize the code. Make it look better. Write as many comments. Even if it’s just a hundred or two hundred line program it should be "delivered" properly even if its going to be an open source software.(NOTE: I FOLLOW NONE OF THE ABOVE. WHAT IS WRITTEN HERE IS CHARACTERISTICS OF AN IDEAL PROGRAMMER)

Screen Shots:




Download Program Source Code here
Download Report here

Sinking Ship

Sinking Ship



Namratha and sweekruthi worked on this existing project. The modification done to the sinking ship project that has been done is the ice berg becomes two pieces... both the pieces move down and sink.

Here are the snaps:

Moving....




Collison... 




Pieces of iceberg and ship sinking....




Download Program Source Code here
Download Report here


Simple Light

Simple Light

Description: 

Example program illustrating a simple use of lighting.  Creates six spheres of different fully saturated colors. Adds a white light that slow rotates around the spheres.


USAGE:

Press "r" key to toggle (off and on) running the animation
Press "s" key to single-step animation.
The up arrow key and down array key control the time step used in the animation rate.
This will speed up or slow down the rate at which the light revolves around the spheres.
Press ESCAPE to exit.
This lighting model is build on the basis of phong model,Which supports three types of light material interactions namely Specular, ambient, diffuse. The ambient source color represents the interaction of a light source with surface whereas the specular source color is designed to produce the desired color of a specular highlights.

Lighting model is built by summing the contributions for all the light sources at each point we wish to light. For each light source, have to compute the amount of light reflected for each of the nine terms in the illumination array. The contribution can be computed for each color source by adding the ambient, diffuse, specular components.

There are four vector parameters that can set, the position of light source and amount of ambient, diffuse, specular Light associated with the source.  Both lighting should be enabled and particular source. When small amount of white light is needed, even when all light sources are turned off or disabled  following code can be used.


Glfloat global_ambient[]={0.1,0.1,0.1,0.1};

glLightModelfv(GL_LIGHT_MODEL_AMBIENT,global_ambient);


Future scope

  1. It is the basic model of Simple Move Light.
  2.  It will be used in the fields of animation. 
  3. In future this program can be improved by using of new opengl functions.
Screen Shot:



Download Program Source Code here
Download Report here

Solar System


 Solar System

Description: Program to demonstrate how to use a local  coordinate method to position parts of a  model in relation to other model parts. Draws a simple solar system, with a sun, planet and  a moon. Based on sample code from the OpenGL programming guide by Woo, Neider, Davis.  Addison-Wesley.

Software accompanying the book:  3D Computer Graphics: A Mathematical Introduction with OpenGL, by S. Buss, Cambridge University Press, 2003.

                                               

USAGE: Press "r" key to toggle (off and on) running the animation.

Press "s" key to single-step animation.

The up arrow key and down array key control the time step used in the animation rate.

Each key  press multiplies or divides the times by a factor of two (2).

Press ESCAPE to exit.


Screen Shot: 



Download Program Source Code here
Download Report here



Spot Light Swing

Spot Light Swing

Description:  

A simple light show where different lights are falling on different area and creating a very good scene the Spot Light Swing. This Program demos the use of swing and the different lightning functions. As Shown in the image this is light show coming from a point source. Just like in disco where lights fall from a point on the floor, also the changes the color.



Usages: 

Just run the program and you will get the light show running, lights with different colors on the floor. No interaction, if any one add in it please comment the code you added. 



Future Improvement in the Projects:


  1. Add front end where all details are there and then enter this light show.
  2. In light show there should be start and stop options.
  3. Along with start and stop there should be option of increasing and decreasing the light.
  4. Basic color red, blue, green is used, other colors should also be included.


Screen Shot:


Download Program Source Code here
Download Report here

Taj Mahal


Taj Mahal

Taj Mahal is the symbol of love. It  is a white Marble mausoleum located in Agra, INDIA. It was built by Mughal emperor Shah Jahan in memory of his third wife, Mumtaz Mahal. For more info read Wikipedia 

Here, we are going to develop basic structure of Taj Mahal in computer graphics. In this tutorial I will tell how to make Taj like structure using the OpenGL. We will develop simple structure, not exactly same as it looks in real but some what idealistic. This project is mainly mean for the VTU Computer Graphics mini-projects.




Taj Mahal is basically a structure with many minars and gumbazz. We will use the simple objects like spheres and cubes to build these units. First for the main part we use box or a large cube and then point small sphere over them. Thereafter, we place a small cubical structure with very low height, a egg like sphere is also placed over it. Similarly,we going to place four long minars over each four corners.

We are also developing the wired framed structure of the Taj as well. In the wired framed Taj, the large cube block will go transparent and the two tombs will be place in the middle with small cubes.



Download Program Source Code here
Download Report here


Traffic Signal


Traffic Signal
Descriptions : As we know, the traffic signals direct the flow of traffic with the exemption of signals with turning arrows which should be compulsory in accord with each other.Traffic signals helps us to drive our vehicles in a safer manner lowering the risk of accidents, if properly followed.

In this Project simulation, we are implementing  Traffic Signal. We have three lights in the signal Red , Green and Orange. Each light have some meaning . Red means stop , Green means go, Orange means ready to go.
Same method we implemented in our project which used in real life .We have used this traffic signal in a cross road to avoid misshapening. When there is green signal it means vehicle can move or run on the road but if this green signal turnoff  and the red signal is turn on then its indicate the driver to stop his vehicle and same time signal allows some other side vehicle to cross the road. But if the vehicle is in the middle of cross or vehicle have cross the signal then there is no meaning of red light for the driver. When we press button R then red light will glow and all vehicles are stop n when we press Y button then  yellow light will glow and all vehicles ready to go .When  we press button G  green light will glow and then vehicle start  moving.  
Screenshot:






Download Program Source Code here
Download Report here