0% found this document useful (2 votes)
4K views11 pages

Traffic Signal CG Mini Project Using OpenGL Report

This document describes a traffic signal simulation project created using OpenGL. It includes an abstract, specifications, introduction to OpenGL, implementation details, interaction methods, screenshots, and conclusions. The project uses OpenGL functions to create 3D objects like cars and a traffic signal that can be interacted with using keyboard controls. When the rules of the traffic signal are not followed, an accident scene is displayed. The document outlines the software and hardware requirements and provides a bibliography of references used.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (2 votes)
4K views11 pages

Traffic Signal CG Mini Project Using OpenGL Report

This document describes a traffic signal simulation project created using OpenGL. It includes an abstract, specifications, introduction to OpenGL, implementation details, interaction methods, screenshots, and conclusions. The project uses OpenGL functions to create 3D objects like cars and a traffic signal that can be interacted with using keyboard controls. When the rules of the traffic signal are not followed, an accident scene is displayed. The document outlines the software and hardware requirements and provides a bibliography of references used.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Traffic Signal

CONTENTS

particulars PAGE.NO
1 Abstract 2
2 System Specifications 3
3 Introduction to openGL 4
5 Implementation 7
6 Interaction 9
7 Screen shot 10
8. Conclusion 12
9 Bibliography 13

1 Dept. of Computer Science & Engineering.


Traffic Signal

Abstract

 Main aim of this 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 using cubes can be moved using arrow keys and based on
traffic signal light the user can obey the traffic rules.

 If the car hits other car then accident scene is shown.


 We have used input devices like mouse and key board to interact with
program

System specifications

2 Dept. of Computer Science & Engineering.


Traffic Signal

 SOFTWARE REQUIREMENTS :

 MICROSOFT VISUAL C++


 OPENGL

 HARDWARE REQUIREMENT :

 GRAPHICS SYSTEM,
 Pentium P4 with 256 of Ram(Min)

Introduction to openGL
As a software interface for graphics hardware, OpenGL's main purpose is to render
two- and three-dimensional objects into a frame buffer.
These objects are described as sequences of vertices or pixels.
3 Dept. of Computer Science & Engineering.
Traffic Signal

OpenGL performs several processing steps on this data to convert it to pixels to


form the final desired image in the frame buffer.

OpenGL Fundamentals
This section explains some of the concepts inherent in OpenGL.

Primitives and Commands


OpenGL draws primitives—points, line segments, or polygons—subject to several
selectable modes.
You can control modes independently of each other; that is, setting one mode
doesn't affect whether other modes are set .Primitives are specified, modes are
set, and other OpenGL operations are described by issuing commands in the form
of function calls.
Primitives are defined by a group of one or more vertices. A vertex defines a point,
an endpoint of a line, or a corner of a polygon where two edges meet. Data is
associated with a vertex, and each vertex and its associated data are processed
independently, in order, and in the same way. The type of clipping depends on
which primitive the group of vertices represents.
Commands are always processed in the order in which they are received, although
there may be an indeterminate delay before a command takes effect. This means
that each primitive is drawn completely before any subsequent command takes
effect. It also means that state-querying commands return data that's consistent
with complete execution of all previously issued OpenGL commands.

Basic OpenGL Operation


The figure shown below gives an abstract, high-level block diagram of how OpenGL
processes data. In the diagram, commands enter from the left and proceed through
what can be thought of as a processing pipeline. Some commands specify
geometric objects to be drawn, and others control how the objects are handled
during the various processing stages.
4 Dept. of Computer Science & Engineering.
Traffic Signal

Figure . OpenGL Block Diagram

As shown by the first block in the diagram, rather than having all commands
proceed immediately through the pipeline, you can choose to accumulate some of
them in a display list for processing at a later time.

Rasterization produces a series of frame buffer addresses and associated values


using a two-dimensional description of a point, line segment, or polygon.
Each fragment so produced is fed into the last stage,
per-fragment operations, which performs the final operations on the data before
it's stored as pixels in the frame buffer. These operations include conditional
updates to the frame buffer based on incoming and previously stored z-value s (for
z-buffering) and blending of incoming pixel colors with stored colors, as well as
masking and other logical operations on pixel values.
All elements of OpenGL state, including the contents of the texture memory and
even of the frame buffer, can be obtained by an OpenGL application.

5 Dept. of Computer Science & Engineering.


Traffic Signal

Implementation
6 Dept. of Computer Science & Engineering.
Traffic Signal

This program is implemented using various openGL functions which are

shown below.

Various functions used in this program.


 glutInit() : interaction between the windowing system and OPENGL is
initiated

 glutInitDisplayMode() : used when double buffering is required and depth


information is required

 glutCreateWindow() : this opens the OPENGL window and displays the title
at top of the window

 glutInitWindowSize() : specifies the size of the window

 glutInitWindowPosition() : specifies the position of the window in screen co-


ordinates

 glutKeyboardFunc() : handles normal ascii symbols

 glutSpecialFunc() : handles special keyboard keys

 glutReshapeFunc() : sets up the callback function for reshaping the window

 glutIdleFunc() : this handles the processing of the background

 glutDisplayFunc() : this handles redrawing of the window


7 Dept. of Computer Science & Engineering.
Traffic Signal

 glutMainLoop() : this starts the main loop, it never returns

 glViewport() : used to set up the viewport

 glVertex3fv() : used to set up the points or vertices in three dimensions

 glColor3fv() : used to render color to faces

 glFlush() : used to flush the pipeline

 glutPostRedisplay() : used to trigger an automatic redrawal of the object

 glMatrixMode() : used to set up the required mode of the matrix

 glLoadIdentity() : used to load or initialize to the identity matrix

 glTranslatef() : used to translate or move the rotation centre from one point
to another in three dimensions

 glRotatef() : used to rotate an object through a specified rotation angle

8 Dept. of Computer Science & Engineering.


Traffic Signal

Interaction with program


 This program includes interaction through keyboard.

 i  Student Information

 c -> Keyboard interaction.

 P -> Start the project

 Car Controls using A,W,S,D

 Q-> Quit

9 Dept. of Computer Science & Engineering.


Traffic Signal

Conclusions

The project “Traffic Signal” clearly demonstrates the simulation of traffic signal
using OpenGL.

Finally we conclude that this program clearly illustrate the traffic signal using
openGL and has been completed successfully and is ready to be demonstrated.

Bibliography
10 Dept. of Computer Science & Engineering.
Traffic Signal

WE HAVE OBTAINED INFORMATION FROM MANY RESOURCES TO DESIGN AND


IMPLEMENT OUR PROJECT SUCCESSIVELY. WE HAVE ACQUIRED MOST OF THE
KNOWLEDGE FROM RELATED WEBSITES. THE FOLLOWING ARE SOME OF THE
RESOURCES :

 TEXT BOOKS :
INTERACTIVE COMPUTER GRAPHICS A TOP-DOWN APPROACH
-By Edward Angel.

 COMPUTER GRAPHICS,PRINCIPLES & PRACTICES

- Foley van dam

- Feiner hughes

 WEB REFERENCES:
http://jerome.jouvie.free.fr/OpenGl/Lessons/Lesson3.php
http://google.com
http://opengl.org

11 Dept. of Computer Science & Engineering.

You might also like