Computer Graphic project
Topic : Scene Recreation model
-> Car on a track
Concepts used:
- Solid surface drawing(sphere , cylinder and cone)
- Ray tracing
- Illumination
- Shading
- Specular reflection
- Diffused reflection
- Ambient illumination
- Observer and light’s effects
- Surface interaction of light
- Reshaping with different perspective
Working
Note : The code was properly commented to show the functioning of the project.
First we took 21 different points for modelling the car. There are 4 different views:
- The top view
- The side view
- The Front view
- The back view.
Given the illustration of different views, we have used a light source for shading and illumination to give an illusion of sun or a single light source.
We made some basic functions for drawing circles , cones, cylinders, spheres, rectangles and triangles.
For the scenery:
We made the background with the light blue colour and gave it a cylindrical shape for the source of light at the top.
The ground was made using a circle which was later translated and rotated according to the car .
The track was a combination of concentric circles of different colour to give them the perspective of a track with the width.
For trees:
We made two kinds of trees, conical and spherical and assigned different places at different angles.
For driver:
We made two legs and two hands with cylindrical shape and had the solid sphere for the face and gave them skin colour and some shading according to the position.
For the car :
We made the axle and gave it red colour and wheels the black colour. Later view was rotated, translated and scaled according to the position which we chose.
The chassis was made with different material having ambient, specular, diffusion and shining surfaces .
The colour scheme is red and yellow for the chassis and was made using the points declared earlier.
The car was rotated along the track and translated according to the given position .
We assigned different keys for the start, stop, top view, back view, side view and front view through which we can navigate in the scenery.
Screenshots:
Menu:
Top View:
Side view:
Back view:
Front view: