CG Report
CG Report
Graphics is created using computers and, more generally, the representation and
manipulation of pictorial data by a computer. The development of computer
graphics has made computers easier to interact with and better for understanding
and interpreting many types of data. Developments in computer graphics have had a
profound impact on many types of media and have revolutionized the animation and
video game industry. The phrase “Computer Graphics” was coined in 1960 by
William Fetter, a graphic designer for Boeing. In today’s world advanced technology,
interactive computer graphics has become a powerful tool for the production of
realistic features. Today’s we find computer graphics used in various areas that
include science, engineering, medicine, business, industry, art, entertainment etc.
The main reason for effectiveness of the interactive computer graphics is the speed
with which the user can understand the displayed information.
The graphics in OpenGL provides a wide variety of built-in function. The computer
graphics remains one of the most exciting and rapidly growing computer fields. It
has become a common element in user interface, data visualization, TV
commercials, motion picture and many other applications. The current trend of
computer graphics is to incorporate more physics principles into 3D graphics
algorithm to better simulate the complex interactions between objects and lighting
environment.
1
1.2 OPEN-GL: HISTORY
OpenGL was developed by ‘Silicon Graphics Inc ‘(SGI) on 1992 and is popular in the
gaming industry where it competes with the Direct3D in the Microsoft Windows
platform. OpenGL is broadly used in CAD (Computer Aided Design), virtual reality,
scientific visualization, information visualization, flight simulation and video games
development.
CHARECTERISTICS
2
OpenGL is a better documented API.
OpenGL is also a cleaner API and much easier to learn and program.
OpenGL has the best demonstrated 3D performance for any API.
i. Hardware Requirements:
• Processor- Intel or AMD (Advanced Micro Devices)
• RAM- 1 GB (minimum)
• Hard Disk- 40MB (minimum) Graphics Memory- 128MB
OpenGL APIs: If we want to have a control on the flow of program and if we want to
interact with the window system then we use OpenGL API’S. Vertices are
represented in the same manner internally, whether they are specified as two-
dimensional or three-dimensional entities, everything that we do are here will be
equally valid in three dimensions. Although OpenGL is easy to learn, compared with
other APIs, it is nevertheless powerful. It supports the simple three-dimensional
programs and also supports the advanced rendering techniques.
GL/glut.h: We use a readily available library called the OpenGL Utility Toolkit (GLUT),
which provides the minimum functionality that should be expected in any modern
windowing system. The application program uses only GLUT functions and can be
3
recompiled with the GLUT library for other window system. OpenGL makes a heavy
use of macros to increase code readability and avoid the use of magic numbers. In
most implementation, one of the include lines.
CHAPTER 3 IMPLEMENTATION
3.1 FUNCTIONS IN OPEN-GL
• void glClear(glEnum mode); Clears the buffers namely color buffer and depth
buffer.
mode refers to GL_COLOR_BUFFER_BIT or DEPTH_BUFFER_BIT.
• void glPushMatrix(); void glPopMatrix(); Pushes to and pops from the matrix
stack corresponding to the current matrix mode.
4
• void glutInit(int *argc, char **argv); Initializes GLUT; the arguments from main
are passed in and can be used by the application.
• void glutMouseFunc(void *f(int button, int state, int x, int y) Registers the
mouse callback function f. The callback function returns the button
(GLUT_LEFT_BUTTON,etc., the state of the button after the event
(GLUT_DOWN), and the position of the mouse relative to the top-left corner of
the window.
• void glutKeyboardFunc(void *f(char key, int width, int height)) Registers the
keyboard callback function f. The callback function returns the ASCII code of
the key pressed and the position of the mouse.
• void glutInitWindowSize(int width, int height); Specifies the initial height and
width of the window in pixels.
5
callback function f. the callback function returns the height and width of the
new window. The reshape callback invokes the display callback.
• void createMenu(void); This function is used to create menus which are used
as options in program.
CHAPTER 4 TESTING
4.1 TESTING PROCESS
Testing process started with the testing of individual program units such
as functions or objects. These were then integrated into sub-systems
and systems, and interactions of these units were tested. Testing
involves verification and validation.
• Validation: “Are we building right product?”
• Verification: “Are we building the product right?”
The ultimate goal of the verification and validation process is to
establish confidence that the software system is ‘fit for purpose’. The
level of required confidence depends on the system’s purpose, the
expectations of the system users and the current marketing
environment for the system.
With the verification and validation process, there are two
complementary approaches to the system checking and analysis:
Software inspections or peer reviews analyses and check system
representations such as the requirements document, design diagrams,
and the program source code. Software testing involves running an
implementation of the software with test data.
6
CHAPTER 5 EXPERIMENTAL RESULTS AND ANALYSIS
This computer graphics sphere game is sphere catching game.and here one bucket
is given to catch the balls coming from upside and then the levels go on
increasing.the bucket is colored with red in color and ball is colored with any
color.You can move the mouse to move the bucket left and right continuously .to
start the game you can use the mouse right button to display and there are two
options in the menus i.e..quit and exit from the game and start to start the game.If
you gone loosing the balls then the game ends.
INSTRUCTIONS
Use mouse to move the basket from left to right and press “S” or “s” .To start
the game and use mouse right button to show the menu.
SCORING
Scoring depends on the number of balls collected by the user .score
increased if the ball is collected in the basket.score is not increased if the ball is
missed to collect in the basket .
LEVELS
There are levels in this game and each level is just go on increasing the
speed of coming balls from upside .
The designed project has been tested for errors and has been found to be meeting
all the requirements of design with which it was started. Thus, the project is declared
to be working properly.
7
5.1 SNAPSHOT
8
9
CONCLUSION
After the completion of this project, we came to know how we can implement
a project using an Open-source OpenGL tool kit. By implementing a project using
Open GL we came to know how to use the functions like menu ‘s, rotation,
translation and scaling. With the completion of this project, we have achieved a
sense of happiness and we want to thank all those who helped us directly or
indirectly to make this idea come true.
10
REFERENCES
[2]. F.S. Hill,Jr, Computer Graphics Using OpenGL. 2nd Edition, Pearson Education,
2001.
[3]. James D Foley, Andries Van Dam, Steven K Feiner, John F Hughes, Computer
Graphics –Addison-Wesley 1997.
[4]. Donald Hearn and Pauline Baker, Computer Graphics - OpenGL Version –2nd
Edition, Pearson Education, 2003.
11
12