Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Malnad College of Engineering

(An Autonomous Institution under Visvesvaraya Technological University, Belagavi)


Hassan – 573 202

ACTIVITY REPORT

ON

“TRAFFIC SIGNALS”

Submitted by,

Name USN
PRIYANKA .R 4MC18CS100
SARA AZIZ 4MC18CS121
SAYEDA FATHIMA AIMANN 4MC18CS123
SHAKUNTALA KOUJALAGI 4MC18CS124
SHILPA B.H 4MC18CS127

Under the guidance of,

Mrs. Nithyashree. R
Assistant Professor,
Dept. of CS&E

Department of Computer Science and Engineering


Malnad College of Engineering
Hassan - 573 202
JULY - 2021
OBJECTIVE

The main aim of the Traffic Signal Mini Project is to illustrate the concepts and usage of pre-
built functions in OpenGL. Simulation of a traffic signal is being done using computer
graphics. The car built can be moved using keys and based on traffic signal light the user can
obey the traffic rules. When a vehicle is moving on a road and comes near the traffic signal
the vehicle can be stopped by left click on mouse, that is traffic signal becomes red. The
vehicle starts moving again when signal changes to green, that is when we press right click
on the mouse signal changes to green colour. We have used input devices like mouse and
keyboard to interact with the program.

IMPLEMENTATION
Functions

 glColor3f (float, float, float):


This function will set the current drawing color

 gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top):


This function defines a two dimensional viewing rectangle in the plane z=0.

 glClear( ):
Takes a single argument that is bitwise OR of several values indicating which buffer
is to be cleared.

 glClearColor():
Specifies the red, green, blue, alpha values used by glClear to clear the color buffers.

 GlLoadIdentity( ):
To load the current matrix with the identity matrix.

 glMatrixMode(mode):
Sets the current matrix mode, modes can be GL_MODELVIEW, GL_PROJECTION.

 Void glutInit (int *argc, char**argv):


Initializes GLUT, the arguments from main are passed in and can be used by the
application.

 Void glutInitDisplayMode (unsigned int mode):


Requests a display with the properties in mode.

 Void glutInitWindowSize (int width, int height):


Specifies the initial position of the top and left corner of the window in pixels.
 Int glutCreateWindow (char *title):
A window on the display. The string title can be used to label the window.
 Void glutMouseFunc(void *f(int button, int state, int x, int y):
Register the mouse callback function f. The callback function returns the button, the
state of button after the event and the position of the mouse relative to the top-left
corner of the window.

 Void glutDisplayFunc (void (*func) (void)):


Register the display function func that is executed when the window needs to be
redrawn.

 glut PostRedisplay( ) :
This call requests that the display callback be executed after the current callback
returns.

 Void glutMainLoop():
This function causes the program to enter an event-processing loop.

 glTranslatef():
This is used to translate or move the rotation centre from one point to another in three
dimensions.

 glRotatef():
This is used to rotate an object through a specified rotation angle

You might also like