You are on page 1of 15

WIREFRAME SNOWMAN

CHAPTER-1
INTRODUCTION
1.1 Computer Graphics
Computers have become a powerful tool for the rapid and economical production
of pictures. There is virtually no area in which graphical displays cannot be used to some
advantage, and so it is not surprising to find the use of computer graphics so widespread.
Although early applications in engineering and science had to rely on expensive and
cumbersome equipment, advances in computer technology have made interactive computer
graphics a practical tool. Today, we find computer graphics used routinely in such diverse
areas as science, engineering, medicine, business, industry, government, art, entertainment,
advertising, education, and training. Computer graphics is concerned with all aspects of
synthesizing and manipulating images.

1.1.1 APPLICATIONS OF COMPUTER GRAPHICS:

It is always difficult to try to categorize endeavors in any field, but some of the major
fields that computer graphics has an impact on can be summarized as follows:
Mechanical designer, architects, cartographers to display information.

Medical imaging: helps in analyzing human body.

E.g.: Computer Tomography (CT), Magnetic Resonance Tomography (MRI),


Ultrasound and Positron-emission Tomography (PET).

Helps Mechanical Engineers, Architects in designing. E.g.: CAD.

Helps in Simulation. i.e. creating a virtual environment of a real environment. E.g.:


Flight Simulator
It is also being used for animations.

It is used for creating user interface like menus, windows, icons and pointing devices.

Dept of CSE, GEC MAJALI, KARWAR Page


WIREFRAME SNOWMAN

1.2 COMPUTER GRAPHICS USING OpenGL:


OpenGL stands for Open Source Graphics Library. Graphics Library is a
collection of APIs (Application Programming Interface). Graphics Library functions are
divided in three libraries:

i. GL Library ( OpenGL in Windows )


ii. GLU ( OpenGL Utility Library )
iii. GLUT ( OpenGL Utility Toolkit )

Functions in main GL library name function names that begin with the letter ‘gl’.
GLU library uses only GL functions but contains code for creating objects and simplify
viewing.
To interface with the window system and to get input from external devices GLUT
library is used, which is a combination of three libraries GLX for X windows, ‘wgl’ for
Windows and ‘agl’ for Macintosh.
These libraries are included in the application program using preprocessor directives.
E.g.: #include<GL/glut.h>
The following figure shows the library organization in OpenGL.

Figure 1.1 OpenGL Graphics Library Organization

Dept of CSE, GEC MAJALI, KARWAR Page


WIREFRAME SNOWMAN

1.3 GRAPHICS SYSTEM AND FUNCTIONS:

Graphics system and functions can be considered as a black box, a term used to denote a
system whose properties are only described by its inputs and output without knowing the
internal working.
Inputs to graphics system are functions calls from application program, measurements
from input devices such as mouse and keyboard.
Outputs are primarily the graphics sent to output devices.

Fig: Graphics System as a Black Box

API’s are described through functions in its library. These functions are divided
into seven major groups.

1) Primitive Functions:
Primitive functions define the low level objects or atomic entities that a system can
display, the primitives include line segments, polygons, pixels, points, text and various types
of curves and surfaces.

2) Attribute Functions:
Attribute Functions allow us to perform operations ranging from choosing the color
to display a line segment, to packing a pattern to fill inside any solid figure.

3) Viewing Functions:
Viewing functions allow us to specify various views.

4) Transformation Functions:
Transformation functions allow us to carry out transformation of objects such as
rotation,translation and scaling.

Dept of CSE, GEC MAJALI, KARWAR Page


WIREFRAME SNOWMAN

5) Input Functions:
Input functions allow us to deal with the diverse forms of input that characterize
modern graphics system. It deals with devices such as keyboard, mouse and data tablets.

6) Control Functions:
Functions enable us to communicate with the window system, to initialize the
programs, and to deal with any errors that occur during the execution of the program.

7) Query Functions:
Query Functions provides information about the API.

Dept of CSE, GEC MAJALI, KARWAR Page


WIREFRAME SNOWMAN

CHAPTER-2

SYSTEM SPECIFICATION

System requirements are intended to communicate in precise way, the functions that
the system must provide. To reduce ambiguity, they may be written in a structured form of
natural language supplemented by tables and system models.

2.1 Software Requirements

The software used in building this program are as specified:-

 Operating system – Windows XP


 The Glut version is 3.7.6.
 Compiler – C++ Compiler.
 Graphics Library – glut.h
 OpenGL 2.0

2.2 Hardware Requirements

The physical components required are:

 Processor - Pentium Pro


 Memory - 128MB RAM
 40GB Hard Disk Drive
 Mouse or other pointing device
 Keyboard

Dept of CSE, GEC MAJALI, KARWAR Page


WIREFRAME SNOWMAN

CHAPTER-3
SYSTEM DESIGN
3.1 EXISTING SYSTEM
Existing system for a graphics is the TC++. This system will support only the 2D
graphics. 2D graphics package being designed should be easy to use and understand. It
should provide various options such as free hand drawing, line drawing, polygon drawing,
filled polygons, flood fill, translation, rotation, scaling, clipping etc. Even though these
properties were supported, it was difficult to render 2D graphics cannot be very difficult to
get a 3 Dimensional object. Even the effects like lighting, shading cannot be provided. So we
go for Microsoft Visual Studio software.

3.2 PROPOSED SYSTEM

To achieve three dimensional effects, openGL software is proposed. It is software


which provides a graphical interface. It is a interface between application program and
graphics hardware.

The advantages are:

1. Open GL is designed as a streamlined.

2. It’s a hardware independent interface i.e it can be implemented on many different

hardware platforms.

3. With openGL we can draw a small set of geometric primitives such as points,
lines and polygons etc.
4. It provides double buffering which is vital in providing transformations.

5. It is event driven software.

6. It provides call back function.

Dept of CSE, GEC MAJALI, KARWAR Page


WIREFRAME SNOWMAN

CHAPTER-4
DESIGN
4.1 Design-Flow Diagram

Start

First

page

Keyboard

function

Key 'a' for creating Continue key Quit


pump 'b','c','d','e','f'','g,'
'i' for pump
operation

4.2 Description of Flow Diagram

The flow diagram explains the flow of the moving bus. The start symbol
indicates the start of execution. Once we start execution the welcome screen appears.
There are options in the screen for move the bus. IF we select first option using

Dept of CSE, GEC MAJALI, KARWAR Page


WIREFRAME SNOWMAN

CHAPTER-5

IMPLEMENTATION

5.1 Built-in Functions

5.1.1 voidglBegin(glEnum mode);

Initiates a new primitive of type mode and starts the collection of vertices. Values of
mode include GL_POINTS, GL_LINES and GL_POLYGON.

5.1.2 voidglEnd( );

Terminates a list of vertices.

5.1.3 void glColor3f[ i f d ] (TYPE r, TYPE g, TYPE b);

Sets the present RGB colors. Valid types are int(i ), float ( f ) and double ( d ). The
maximum and minimum values of the floating-point types are 1.0 and 0.0, respectively.

5.1.4 voidglClearColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a);

Sets the present RGBA clear color used when clearing the color buffer. Variables of
GLclampf are floating-point numbers between 0.0 and 1.0.

5.1.5 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 where there are
multiple windows.

5.1.6 voidglutInitWindowSize(int width, int height);

Specifies the initial height and width of the window in pixels.

5.1.7 voidglutInitWindowPosition(int x, int y);

Specifies the initial position of the top-left corner of the window in pixels.

Dept of CSE, GEC MAJALI, KARWAR Page


WIREFRAME SNOWMAN

5.1.8 voidglutInitDisplayMode(unsigned int mode);

Request a display with the properties in mode. The value of mode is determined by
the logical OR of operation including the color model (GLUT_RGB, GLUT_INDEX) and
buffering (GLUT_SINGLE, GLUT_DOUBLE);

5.1.9 voidglFlush( );

Forces any buffered any OpenGL commands to execute.

5.1.10 void glutInit (intargc, char **argv);

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

5.1.11 void glutMainLoop( );

Cause the program to enter an event processing loop. It should be the last statement in
main.

5.1.12 void glutDisplayFunc(void (*func) (void));

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

5.1.13 gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);

Defines a two-dimensional viewing rectangle in the plane Z=0;

5.1.14 void glClear(GL_COLOR_BUFFER_BIT);

To make the screen solid and white.

Dept of CSE, GEC MAJALI, KARWAR Page


WIREFRAME SNOWMAN

CHAPTER-6
TESTING

 Unit Testing
 Individual components are tested to ensure that they operate correctly. Each component is
tested independently, without other system components.

 Module Testing
 A module is a collection of dependent components such as a object class, an abstract
datatype or some looser collection of procedures and functions. A module related
components, so can be tested without other system modules.

 System Testing
 This is concerned with finding errors that result from unanticipated interaction between
sub-system interface problems.

 Acceptance Testing
 The system is tested with data supplied by the system customer rather than simulated test
data.

Dept of CSE, GEC MAJALI, KARWAR Page


WIREFRAME SNOWMAN

CHAPTER-7

SNAPSHOTS
In this chapter the results of the project are described. The snapshot of the project showing
various functionalities like start animation, stop animation and retrieval are showcased.

 Create a new project under Visual C++ .

Fig 1: Introduction of the project

Fig 2: Viewing steps of the project

Fig 2 : Viewing steps of the project

Dept of CSE, GEC MAJALI, KARWAR Page


WIREFRAME SNOWMAN

Fig 3: Press 'b' to view the pump

Fig 4: Press 'c' draw water from underground

Dept of CSE, GEC MAJALI, KARWAR Page


WIREFRAME SNOWMAN

Fig 5: Press 'd' to push water till mid of pump

Dept of CSE, GEC MAJALI, KARWAR Page


WIREFRAME SNOWMAN

CONCLUSION

The wireframe snowman has been tested under Windows 10 and has been found to
provide ease of use and manipulation to the user. The Automated lift pump created for the
Windows 7 operating system can be used to draw lines, boxes, circles, and polygons. It has
a very simple and aesthetic user interface.

We found designing and developing this Automated lift pump as a very interesting
and learning experience. It helped us to learn about computer graphics, design of Graphical
User Interfaces, interface to the user, user interaction handling and screen management.
The graphics editor provides all and more than the features that have been detailed in the
university syllabus.

Dept of CSE, GEC MAJALI, KARWAR Page


WIREFRAME SNOWMAN

REFERENCES

1. Edward Angel: Interactive Computer Graphics A Top-Down Approach with


OpenGL, 2nd Edition, Addison-Wesley, 2000.

2. Donald Hearn and Pauline Baker: Computer Graphics- OpenGL Version.

3. https://www.microsoft.com/en-in/download

4. https://www.stackoverflow.com/questions/

Dept of CSE, GEC MAJALI, KARWAR Page

You might also like