Documente Academic
Documente Profesional
Documente Cultură
CHAPTER NO. CHAPTER 1 1.2 TITLE INTRODUCTION 1.1 Introduction Computer Graphics Open GL 1.3 1.4 1.5 1.6 CHAPTER 2 Problem Section Statement Existing System Proposed System Objectives Of The Project 4 5 5 6 6 7 PAGE NO. 3-6 3
SPECIFICATION REQUIREMENTS 2.1 USER REQUIREMENTS 2.2 SOFTWARE REQUIREMENTS 2.3 HARDWARE REQUIREMENTS 2.4 DEVELOPMENT PLATFORM DESIGN IMPLEMENTATION TESTING 8
CHAPTER 15 CHAPTER 7
SNAPSHORTS
CONCLUSION
LIST OF FIGURES
Figure 1.1 : : Library Organization of OpenGL Figure 1.2 : : Graphics system as black box Figure 3.1 : : Flowchart Figure 6.1 : : Water image in Red color Figure 6.2 : : Water image in Blue color Figure 6.3 : : Ripple formations in water Figure 6.4 : : Water pool with ripple at some angle Figure 6.5 : : Perspective viewing of waterpool from a distance
Dept of CSE,SCE
Page 2
CHAPTER 1
INTRODUCTION
1.1 INTODUCTION TO COMPUTER GRAPHICS:
Computer Graphics is concerned with all aspect of producing pictures or image using computer. The field began humble almost 50 years ago, with the display of few lines on the cathoderay tube(CRT); now, we can create image using computer that are indistinguishable from photographs from the real objects. We routinely train pilots with simulated airplane, generating graphical display of the virtual environment in the real time. Feature length movies made entirely by computer have been successful, both critically and financially; massive multiplayer game can involve tens of thousands of concurrent participants. 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 todays world advanced technology, interactive computer graphics has become a powerful tool for the production of realistic features. Todays 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.
Dept of CSE,SCE
Page 3
Dept of CSE,SCE
Page 4
GLU
OpenGl Applicati on
GL Xlib,Xtk
Frame Buffer
GLUT
GLX
OpenGL is a software interface to graphics hardware. This interface consists of about 150 distinct commands that you use to specify the objects and operations needed to produce interaction.
1.3
EXISTING SYSTEM
OpenGL can be used to draw 3D objects like sphere, cube and lines using homogeneous coordinate system. We use these representations to create our project, also using various Interactive computer graphics is the most important means of producing pictures since the invention of photography and television existing functions for the various other features that are added to the project Dept of CSE,SCE Page 5
Application Program
Graphics system
Ip/op devices
Dept of CSE,SCE
Page 6
CHAPTER 2
SPECIFICATION REQUIREMENTS
Dept of CSE,SCE
Page 8
START
MAIN
Blue Color
Red Color
Green Color
Other Function
Zoom In
Zoom Out
Angle Of View
Full Screen
Small Screen
Keyboard func
STOP
Dept of CSE,SCE
Page 9
Quit
CHAPTER 4
IMPLEMENTATION
In this project we have used some of the built in functions and library functions defined in glut header files. Description of <GL/glut.h> header file The header file <GL/glut.h> includes the standard commands that help us in
executing the OpenGL codes. It supports inbuilt functions. Below listed are some of the standard commands that are included in this project.
BUILT IN FUNCTIONS
1. voidglutInit ( intargc, char **argv) The interaction between the windowing system and OpenGL is initiated. The two arguments allow the user to pass command-line arguments, as in the standard C main function.
Dept of CSE,SCE
Page 10
2. voidglutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB|GLUT_DEPTH) It specifies RGB color, a depth buffer for hidden-surface removal, and double buffering.
3. voidglutInitWindowSize(intwidth,int height) It specifies the initial height and width of the window in pixels.
4. voidglutReshapeFunc(void *f(intwidth,int height)) It registers the callback function f. The callback function returns the height and width of the window. The reshape callback invokes a display callback.
5. voidglutDisplayFunc(void (*func)(void)) It registers the display function func that is executed when the window needs to be redrawn.
6. voidglViewport(intx,inty,GLsizei width, GLsizei height) It specifies a widthheight viewport in pixels whose lower-left corner is at (x,y) measured from the origin of the window.
7. voidglutSwapBuffers( ) Swaps the front and back buffers. The front buffer is always the one displayed, whereas the back buffer is the one into which we draw.
8. voidglPushMatrix() void glPopMatrix( ) It pushes to and pops from the matrix stack corresponding to the current matrix mode.
9. voidglRotate[fd](TYPE angle,TYPE dx, TYPE dy, TYPE dz) It alters the current matrix by a rotation of angle degrees about the axis(dx,dy,dz). TYPE is either GLfloat or GLdouble. Dept of CSE,SCE Page 11
10. voidglTranslate[fd] (TYPE x, TYPE y, TYPE z) It alters the current matrix by a displacement of (x,y,z). TYPE is either GLfloat or GLdouble.
12. voidglMatrixMode(GLenum mode) specifies which matrix will be affected by subsequent transformations mode can be GL_MODELVIEW,GL_PROJECTION,or GL_TEXTURE.
14. voidglortho(GLdoubleleft,GLdoubleright,GLdoublebottom,GLdoubletop,GLdoublen ear,GLdouble far) Defines an orthographic viewing volume with all parameters measured from the center of the projection Plane.
15. void glOrtho2D(GLdoubleleft,GLdoubleright,GLdoublebottom,GLdouble top) defines a two-dimensional viewing rectangle in the plane z=0.
16. voidglBegin(glEnum mode) Initiates ia new primitive of type mode and starts collection of vertices.Values of mode include GL_POINTS,GL_LINES,GL_POLYGON.
18. voidglutMouseFunc(void *f(intbutton,intstate,intx,int y) registers the mouse callback function f.thecallback function returns the button (GLUT_LEFT_BUTTON,GLUT_MIDDLE_BUTTON,GLUT_RIGHT_BUTTON),the state of the button after the event(GLUT_UP,GLUT_DOWN),and the position of the mouse relative to the top-left corner of the window.
19. void key(unsigned char key,int x ,int y) This function is used assign various key to function.
Dept of CSE,SCE
Page 13
CHAPTER 5
TESTING
The general testing process that started with the testing of individual program units such as functions or objects. The model of testing process is appropriate for large systems, or for systems that are developed through reuse. The fundamental testing activities are Component testing: Testing the parts of system. System testing: Testing the system as whole.
GOALS OF TESTING:
The general aim of testing is to affirm the quality of software systems by systematically exercising the software in carefully controlled circumstances.
Dept of CSE,SCE
Page 14
Serial no 1.
Actual result Menu with Green Red Blue Shape Change Quit Is displayed
Remarks Pass
mouse button on Green Red Blue Shape Change Quit Should be displayed
Serial no 2.
Expected result The Color of the image of water on the display screen is changed to Green. Should happen.
Actual result The Color of the image of water on the display screen is changed to Green. Happens.
Remark Pass
3 4
The Color of the The Color of the image of water on the image of water on the display screen is display screen is changed to Red. changed to Blue. Should happen. Should happen. A submenu with options to change the shape of water image. Must be displayed
The Color of the The Color of the image of water on the image of water on the display screen is display screen is changed to Red. changed to Blue. Happens. Happens. A submenu with options to change the shape of water image Is displayed
Pass Pass
Pass
Dept of CSE,SCE
Page 15
CHAPTER 6
SNAPSHOTS SNAPSHOT 1:
Dept of CSE,SCE
Page 16
SNAPSHOT 2:
Dept of CSE,SCE
Page 17
SNAPSHOT 3:
Dept of CSE,SCE
Page 18
SNAPSHOT:4
Dept of CSE,SCE
Page 19
SNAPSHOT:5
Dept of CSE,SCE
Page 20
CHAPTER 7
CONCLUSION
An attempt has been made to develop an OpenGL package which meets necessary requirements of the user successfully. Since it is user friendly, it enables the user to interact efficiently and easily. The development of the mini project has given us a good exposure to OpenGL by which we have learnt some of the technique which help in development of animated pictures, gaming. Hence it is helpful for us even to take up this field as our career too and develop some other features in OpenGL and provide as a token of contribution to the graphics world. The mini project developed has a scope for future enhancement too as follows Making the water seem more realistic. Adding lighting effects etc,. By implementing a project using Open GL we came to know how to use The functions like menus, rotation, translation and scaling.
FUTURE ENHANCEMENT
This project has been designed using C++, which works on the Windows platform. The project can be designed using other languages and better graphical interfaces .The following features have been incorporated Resizing windows Page 21
Dept of CSE,SCE
Choosing color
BIBLIOGRAPHY
The books and the other sources we referred while doing this project are as follows:
Education ,2001
Dept of CSE,SCE
Page 22
Dept of CSE,SCE
Page 23