0% found this document useful (0 votes)
122 views14 pages

Page Index: Chapter No. Topic 1 2 Grid 3 Requirement Specifications

This document provides an overview of a computer graphics project. It includes chapters on the introduction to computer graphics, OpenGL, system requirements specifications, system design, and implementation. The system design chapter describes the user interface consisting of an object editor, properties editor, and object list to create and modify 3D objects. The implementation chapter covers setting up OpenGL functions for window creation, display callbacks, and user-defined functions. It indicates key features such as dynamic object appearance and background color changes. An accompanying flowchart outlines the overall process.

Uploaded by

sgs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
122 views14 pages

Page Index: Chapter No. Topic 1 2 Grid 3 Requirement Specifications

This document provides an overview of a computer graphics project. It includes chapters on the introduction to computer graphics, OpenGL, system requirements specifications, system design, and implementation. The system design chapter describes the user interface consisting of an object editor, properties editor, and object list to create and modify 3D objects. The implementation chapter covers setting up OpenGL functions for window creation, display callbacks, and user-defined functions. It indicates key features such as dynamic object appearance and background color changes. An accompanying flowchart outlines the overall process.

Uploaded by

sgs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 14

PAGE INDEX

CHAPTER NO.

TOPIC

INTRODUCTION

GRID

REQUIREMENT SPECIFICATIONS
2.1 Hardware Requirements
2.2 Software Requirements

SYSTEM DESIGN

IMPLEMENTATION
4.1 Inbuilt Functions
4.2 Working with the window system
4.3 User Defined Functions

SNAPSHOTS

CONCLUSION

Chapter 1

INTRODUCTION
Computer Graphics
Computer Graphics concerns the pictorial synthesis of real or imaginary objects from
their computer-based models or in other words it may be the collection, combination and
representation of imaginary objects from their computer-based models. The term computer
graphics has been used in a broad sense to describe almost everything on computers that is not
text or sound. It is one of the most rapidly advancing fields of computer science and is used in
almost all fields including medical and military. It is also an effective media for communication
between man and the computer; the human can understand the information content of a display
diagram or perspective view much faster than he can understand a table of numbers. Graphical
interfaces have replaced textual interfaces as the standard means of computer interaction.
Computer Graphics has matured over the years as a discipline. Both hardware and
software are available that facilitate the production of graphical images as diverse as line
drawings in 2D to realistic renderings of natural objects in 3D. Nowadays Computer Graphics is
also making deep inroads into the business, advertising, communication medium and
entertainment industries. Today, no scientist or engineer should be without a basic understanding
of underlying principles of Computer Graphics.
Computers have become a powerful tool for rapid and economical production of
pictures, animation, games and simulation. Computer graphics is one of the most powerful and
interesting part of a computer. There is a lot that can be done in graphics apart from drawing
figures. There is virtually no area in which graphics display cannot be used to some advantage
and so it is not surprising to find the use of computer graphics so widely accepted.

OpenGL
OpenGL or Open Graphics Library is a cross language, multi-platform API for rendering
2D and 3D computer graphics. The API is typically used to interact with a GPU, to achieve
hardware-accelerated rendering. OpenGL was developed by Silicon Graphics Inc. from 1991 and
released in January 1992. It provides the actual drawing tools through a collection of functions
that are called within an application. It is easy to install and learn, and its longevity as a standard
API is being nurtured and overseen by the OpenGL Architecture Review Board (ARB), an
industry consortium responsible for guiding its evolution. It is widely used in CAD, virtual
reality, scientific visualization, information visualization, flight simulation and video games.
The OpenGL specification describes an abstract API for drawing 2D and 3D graphics.
Although its possible for the API to be implemented entirely in software, its designed to be
implemented mostly or entirely in hardware. Although the function definitions are superficially
similar to those of the C programming, they are language independent. In addition to being
language independent, it is also platform-independent. One aspect of OpenGL that suits it so well
for use in computer graphics course is its device independence or portability. A student can
develop and run a program on any available computer. OpenGL offers a rich and highly usable
API for 2D graphics and image manipulation, but its real power emerges with 3D graphics.

Characteristics of OpenGL

Platform independent: can run on consumer electronics, PCs, workstations, etc.

Backward compatibility required in new versions.

Supported by many hardware accelerators => fast.

Chapter 2

GRID
GRID consists of user interface (GUI) which is separated into three sections:
Object Editor - Individual objects are stored and edited within the object
editor. Objects may be composed of primitives such as spheres, or more
complex shapes made by extruding polygons and adjusting the vertexes.
Materials are then applied
Properties Editor Each object created in Object Editor will have its own
properties such as width & height of cube. When object is selected, it is
highlighted & its properties are shown in the Properties Editor. User is
allowed to modify the properties.
Object List Each object in the Object editor will be listed with their
unique name. Currently selected object will be highlighted.
FEATURES

Support for a variety of geometric primitives, including


polygon meshes, spheres, cubes, Bezier curves etc.
Properties of objects can be adjusted interactively and
results appear immediately.
Allows rotations in three dimensions, allowing viewing of a
designed object from any desired angle using camera .

Chapter 3

REQUIREMENT SPECIFICATIONS
The basic purpose of software requirement specification (SRS) is to bridge the
communication between the parties involved in the development project.SRS is the medium
through which the users needs are accurately specified; indeed SRS forms the basis of software
development. Another important purpose of developing an SRS is helping the users understand
their own needs.
Now we will be discussing the requirement analysis of the project. This report gives the
description of the roles of users, the functional overviews of the project, input and output
characteristics and also the hardware and software for the project.

2.1 Software Requirements:


Microsoft Visual Studio 6.0
OpenGL Graphics software system.
Header files used:
glut32.dll, glut32.lib, glut.h, gl.h, glu.h.

2.2 Hardware Requirements:

Processor :

133-MHz Intel Pentium-class processor.

Hard Disk :

5 GB recommended.

Memory :

128 MB of RAM, 256 MB recommended

Display

1152 x 864 or higher-resolution display with 256 colors

Keyboard :

Standard QWERTY keyboard for interface

Why C++ Language for this project?


C++ is a minimalist programming language. Among its design goal were that it could be
compiled in a straight forward manner using a relatively simple compiler, provided low-level
access to memory, generated only a few machine language instructions for each of its core
language elements and did not require extensive run time process. As a result, C++ code is
suitable for many system programming applications that had traditionally been implemented in
assembly language. Despite its low level capabilities, the language was designed to encourage
machine independent programming. A standard compliant and portably written C++ program can
be compiled for a very wide variety of computer platform and operating systems with minimal
change to its source code.
Graphics in C++
C++ itself doesnt support any graphics library. In order for C++ to be completely
portable from platform to platform it has focused on providing platform independent functions,
such as file access, text string manipulation, mathematical functions, etc. So in order to get
graphics in C++, one needs to do one of four things:

Write a 16 bit DOS program and use assembly language for graphics.

Make calls to Windows API

Make calls to the OpenGL subsystem

Use a graphics library

OpenGL subsystems
OpenGL provides a powerful but primitive set of rendering commands, and all higherlevel drawing must be done in terms of these commands. Also, OpenGL programs have to use
the underlying mechanisms of the windowing system. A number of libraries exist to simplify the
programming tasks, including the following:
The OpenGL Utility Library(GLU)contains several routines that use lower-level OpenGL
commands to perform such tasks as setting up matrices for specific viewing orientations and
projections, performing polygon tessellation, and rendering surfaces. The library is provided as
part of every OpenGL implementation.

Chapter 4

SYSTEM DESIGN
The role of the user is limited in our project. User can do the following operations:

The user has to simply click on debug option then everything is automatic

3.1 Key Features

Provided with text to understand our concept.

Sudden appearance of object in the screen.

Changing of background color based on situation.

FLOWCHART:
A flowchart is a common type of chart that represents an algorithm or process
showing the steps as boxes of various kinds and their order by connecting these with arrows.
Flowcharts are used in analyzing, designing, managing a process or program in various
fields.
Flowcharts used to be a popular means for describing computer algorithms. They are still
used for the purpose, modern techniques such as UML activity diagram can be considered to
be extensions of the flowchart.

Please draw flow chart

Chapter 5

IMPLEMENTATION
The implementation stage of the model involves the following phases.

Implementation of OpenGL built in function.

User defined function Implementation.

4.1 Implementation of OpenGL Built In Functions:


1. glutCreateWindow (char *name)
Creates a window on the display. The string name can be used to label the
window. The return value provides a reference to the window that can be used when there are
multiple windows.
2. glutDisplayFunc (void (*func)(void))
Registers the display function func that is executed when the window needs to be
redrawn.
3. glutInitWindowSize(int width,int height)
It specifies the initial height and width of the window in pixels.
4. glutInitWindowPosition (int x, int y)
It specifies the initial position of the top-left corner of the window.
5. glutKeyboardFunc(void(*func)(unsigned char key, int x, int y))
This function sets the keyboard callback for the current window.
6. glutMainLoop()
This function enters the glut event processing loop. The routine should be
called at most once in a glut program.It should be the last statement in main.
7. glutIdleFunc(void (*f)(void))
This function registers the display callback function f that is executed
when there are no other events to be handled.
8. glTranslate[i d] (TYPE x, TYPE y, TPYE z)

This function is used to move objects from one position to another. It


alters the current matrix by a displacement of

(x, y, z).Type is either GLfloat or

GLdouble.
9. glPushMatrix ( )
It pushes to the matrix stack corresponding to the current matrix mode.
10. glPopMatrix ( )
Pops from the matrix stack corresponding to the current matrix mode.
11. glColor3[i f ] (TYPE r, TYPE g, TYPE b)
It sets the present RGB colors. Valid types are byte (b), int (i), float (f),
double (d) and many more. The maximum and minimum values of the floating point
types are 1.0 and 0.0.
12. glBegin (glEnum mode)
It initiates a new primitive of type mode and starts the collection of
vertices. Values of mode include GL_POINTS, GL_LINES, and GL_POLYGON.
13. glVertex[2 3][s i d f]( TYPE xcoordinate, TYPE ycoordinate,)
It specifies the position of a vertex in 2 or 3 dimensions. The coordinates
can be specified as shorts s, int i, floats f or doubles d.
14. glEnd ( )
It terminates a list of vertices.
15. glMatrixMode(GLenum mode)
Specifies which matrix will be affected by subsequent transformations. Mode
can be GL_MODELVIEW,GL_PROJECTION.
16. void glLoadIdentity()
This function sets the current transformation matrix to an identity matrix.
17. void glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble
top, GLdouble near,GLdouble far)
glOrtho defines an 3 dimensional orthographic viewing volume with
parameters left, right, bottom, top, near, far measured from the center of the projection plane.
18. glFlush()
It flushes the color buffer and depth buffer.
19. void glutPostRedisplay ()

Request that the display call back be executed after the current call back returns.
20. glRasterPos2f()
This function specifies raster postion. Parameters are the same for glVertex().

4.2 Working with the window system


void GLflush()
Forces any buffered OpenGL command to execute.
void glutInit(int argc,char **argv)
glutInit() should be called before any other glut routine, because it initializes the GLUT library.
glutInit() will also process command line options, but he specific options are window system
dependent.
intglutCreateWindow(char *title);
Creates a window on the display. The string title can be used to label the window. The return
value provides a reference to the window that can be used when there are multiple windows

4.3: User Defined Functions:


.

Chapter 6

SNAPSHOTS

Chapter 7

CONCLUSION
Computer Graphics plays a major role in todays world where visualization takes
the upper hand as compared to text based interactions. This is largely true as we can see
user interfaces more attractive. All thanks to the major leaps in the field of Computer
Graphics.
Working with computer graphics and exploring its new features is really interesting.
In conclusion, it can be said that OOP's concept along with the use of graphics has a very
deep impact in programming. The usage of input device along with these makes the work
easier though the usage of mouse has been restricted to some parts in the software. But, in
spite of this limitation, it is seen that a user can handle the software without much
difficulty.
This is being my first project using an Open GL implementation. It was an effort
to demonstrate the basic Open GL functions which will help the user to gain some
knowledge about Computer Graphics. I hope this will be a stepping stone to my next such
projects.

BIBLIOGRAPHY
[1]

Edward Angel - Interactive Computer Graphics A Top Down Approach with OpenGL
5th Edition, Addison-Wesley, 2008.

[2]

F.S.Hill, Jr. - Computer Graphics Using OpenGL 2nd Edition, Pearson Education, 2001.

[3]

Donald Hearn and Pauline Baker - Computer Graphics OpenGL Version 2nd Edition,
Pearson Education, 2003.

You might also like