Showing posts with label cg mini project source code. Show all posts
Showing posts with label cg mini project source code. Show all posts

Monday, 28 March 2016

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

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

Simulation of Train

Simulation of Train

Kudos to Kusuma V(1CE11CS025)... This is her original creation. I have been trying to get adsense work on this blog but they have issues with plagiarized content. So am trying to post original projects of our students.

There are three trains which move on a track. The wheels rotate and they all move one after the other out of view.

Screenshots:



Download Program Source Code here
Download Report here

Wind Energy - An animation

Wind Energy - An animation

This is a project on wind energy. Wind mills have blades which rotate in clockwise or anti-clockwise manner after giving mouse input. If you choose no wind the rotors stop turning. Electricity generated lights up the villages and homes can be seen glowing.

Snapshots:






Download Program Source Code here
Download Report here



Flowing Fountain OpenGL Projects using c++

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) - 

    Menu Key Functions - 
    Key
    Function
    1
    Project
    2
    Help
    3
    Exit
    4
    Front

    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
    Download Program Source Code here
    Download Report here
     

Lift-Over Bridge


Lift-Over Bridge

 

picture is worth a thousand words’ goes the ancient Chinese proverb.This has become a cliché in our society after the advent of inexpensive and simple techniques for producing pictures.

             Computers have become a powerful medium for the rapid and economical production of pictures. There is virtually no area in which graphical displays cannot be used to some advantage. Graphics provide a so natural means of communicating with a computer that they have become widespread. The fields in which Computer Graphics find their uses are many. Some of them being  User Interfaces, Computer Aided Design, Office automation, Desktop Publishing, Plotting of mathematical, scientific or industrial data, Simulation, Art, Presentations, Cartography, to name a few…Here, We have tried to incorporate and present the working environment of a Lift-Over Bridge which is also known as Bascule Bridge in 2D.

            The bascule bridge works with a counterweight that balances the span (leaf) while the upward swing provides clearance for boat traffic. Here, we have created a scene consisting of the bascule bridge which operates to allow a boat to pass under it while a bus waits for the leaf of the bridge to swing back into its position and then passes along the bridge after the boat has sailed across. We have provided mouse interface to start and stop animation and to exit the window. We have also included the keyboard input function to change the color of the boat.
Screenshots:
Snap shot of Initial stage of the Lift over bridge



  Snap Shot Showing Main Menu (mouse interface)


Snapshot shows the lifting up the bascules
 Snap Shot Shows the changing the colors of boat
Snap Shot Shows the Bridge moving down
Snap Shot Shows the Vehicle Crossing Over the Bridge
Download Program Source Code here
Download Full Project Report here

Racing Car in a Race Track

Racing Car in a Race Track


Computer Graphics has grown into a very important topic in the branch of Computer Science. This is due to an effective and rapid communication formed between man and the machine. Human eye can absorb the information in a displayed diagram or perspective diagram much faster than it can scan a page or a table of contents.



     This project demonstrates the creation of a moving racing car along with a circular race track and scenery.The user is also given the option to see the car from different views.OpenGL is used to make this possible by virtue of its various functionalities.


    We make use of simple geometric figures like triangle, circle and polygons to construct the parts of racing car and the track .Cones, spheres and cylinders are used to generate the trees. We also include lighting and material properties.

     The code implemented makes use of various OpenGL functions for translation, rotation and keyboard callback function, built-in functions for solids and many more.

      The concepts of computer graphics stand a backbone to achieve the aforementioned idea. Primitive drawing, event driven interactions and basic animation have been the important concepts brought out by this application.

      The report is chalked out into sections describing the basic requirements superseded by the briefing on functions used. Following this, the detailed description of how the implementation is done effectively using these functions and C language is presented. The source code is provided along with necessary comments to enhance readability of code. The screenshots have been provided for amelioration of our little effort. The conclusion and the future enhancements proposed conclude the report.The maximum efforts are been made to ensure that the view is aesthetically pleasing and eye-catching.

Screenshots:


Back side view:


 Front View:


Helicopter View: 


Side View: 




Download Program Source Code here
Download Full Project Report here

Rocket Launching


 Rocket Launching

The rocket launching project is a 2D animation of a satellite launching process.
In our project rocket will be static prior to launching. When a launch is performed through interactions, the countdown begins for the launch. The countdown is 10 to 0, once the countdown is finished rocket is launched. Once the rocket is launched, actual animation starts here. Rocket starts moving into the sky, after sometime it reaches the space. The next phase of the rocket launch is dismantling stage1, in this stage the first fuel supplier will be dismantled. Now rocket starts moving with the help of second fuel supplier. The next stage will be dismantling stage2, here the fuel supplier 2 will be dismantled. The next phase is forced dismantling stage, where the unwanted parts are expelled. After this phase satellite is launched.

Screenshots:



 
Starting stage of rocket





 Snap shot showing intermediate stage and fume of rocket changing


 
Rocket entering in outer phase




 Rocket entering into the last phase


Download Program Source Code here
Download Full Project Report here