Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CHAPTER 1
INTRODUCTION
1.1 About Computer Graphics
CG (computer graphics) started with the display of data on hardcopy plotters and cathode ray tube screens soon after the introduction of computer themselves. It includes the creation, storage and manipulation of models and images of objects. Computer graphics today is largely interactive the user controls contents structure and appearance of the objects and their displayed images by using input devices such as keyboard or touch sensitive panel on the screen. Bitmap graphics is used for user computer interaction. A bitmap is an ones and zeros representation of points on the screen. Bitmap graphics provide easy to use and inexpensive graphics based applications. By making communication more efficient, graphics makes it possible higher quality and more precise results or products, greater productivity, and lower analysis and design costs.
PENCIL SKETCH TO PHOTO REALISTIC RENDERING Interactive Plotting in Business, Science and Technology: The next most common use of graphics today is to create 2D and 3D graphs of mathematical, physical and economic functions; histograms, bar and pie charts; task scheduling charts; inventory and production charts; and the like. Office Automation and Electronic Publishing: The use of graphics for the creation and dissemination of information has increased enormously since the advent of desktop publishing on personal computers. Many organizations whose publications used to be printed by outside specialists can now produce printed materials in house. Computer-Aided Drafting and Design: In computer-aided design (CAD), interactive graphics is used to design components and systems of mechanical, electrical, electro-mechanical, and electronic devices, including structures such as buildings, automobile bodies, airplane and ship. Simulation and Animation: Computer produced animated movies and displays of the time-varying behavior of real and simulated objects are becoming increasingly popular for scientific and engineering visualization. Art and Commerce:
Dept. of CS&E
B.G.S.I.T
PENCIL SKETCH TO PHOTO REALISTIC RENDERING There is a lot of development in the tools provided by computer graphics. This allows user to create artistic pictures which express messages and attract attentions. Such pictures are useful in advertising. Process Control: Status displays in refineries, power plants, and computer networks show data values from sensors attached to critical system components so that operators can respond to problematic conditions. Cartography: Computer graphics is also used to represent geographic maps, weather maps, oceanographic charts, contour charts.
1.3DESCRIPTION
The initial virtual environment consists of natural scenery of hill-side. The environment then transits from sketch mode to colored mode followed by an introduction of small bridge over the stream. This is followed by colorless sketch of a house which transits to colored from. Then the interior detailing of the house is shown with similar color transition.
Dept. of CS&E
B.G.S.I.T
CHAPTER 2
REQUIREMENT ANALYSIS
2.1 SCOPE:
This is basically an gaming project and will help in understanding the working of Computer graphics and various concepts involved in it.
Dept. of CS&E
PENCIL SKETCH TO PHOTO REALISTIC RENDERING Hard Disk Drive VGA Adapter Monitor Keyboard Frequency Hard Disk Capacity : : : : : : 2 GB or Higher Intel 82810 graphics controller(minimum) Standard VGA Monitor 102 Keys Keyboard 66MHZ 540MB
: : :
PENCIL SKETCH TO PHOTO REALISTIC RENDERING operating system for microcomputers, it is natural that c has begun to influence the microcomputer community at large.
2.6 OpenGL:
OpenGL (Open Graphics Library) is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex threedimensional scenes from simple primitives. OpenGL was developed by Silicon Graphics Inc. (SGI) in 1992[1] and is widely used in CAD, virtual reality, scientific visualization, information visualization, and flight simulation. OpenGL is well structured with an intuitive design and logical commands. Efficient OpenGL routines typically result in applications with fewer lines of code than those that make up programs generated using other graphics libraries or packages. In addition, OpenGL drivers encapsulate information about the underlying hardware, freeing the application developer from having to design for specific hardware features.
Dept. of CS&E
B.G.S.I.T
CHAPTER 3
DESIGN
The aim is to develop a virtual environment through sketches and show transition effects using colors and introducing new objects and articles in the initially designed virtual environment. This is done using computer graphics by applying the skills we learnt in class. And in doing so, to understand better the algorithms and the techniques underlying interactive graphics. The designed environment incorporates all the basic properties that a simple animation clip must possess like colorful objects, graphical effects and some interesting concepts along with a few other features which serve mainly as an application of class-room knowledge. Interaction is provided through the numeric keys and some characters in keyboard. Num2: Introduction of color to the sketch of a hill side scene with a river. Num 3: Introduction of a bridge over the river. Num 4: Change of scenery from a hill side view to a black and white sketch of a house. Num 5: Transition of sketch from black and white to colored.
Dept. of CS&E
B.G.S.I.T
PENCIL SKETCH TO PHOTO REALISTIC RENDERING Num 6: Display of the sketch of the interiors of the house comprising of sofa, table, etc. Num 7: Transition of sketch from black and white to colored. Num 8: Introduction of bunch of flowers hanging from the ceiling.
Dept. of CS&E
B.G.S.I.T
CHAPTER 4
IMPLEMENTATION
4.1 Graphical Functions:
The following are in-built functions used in the project:
glutInit initialize the GLUT library and graphics system. Declaration: void glutInit( int *argc, char **argv);
Remarks: To start thr graphics system, you must first call glutInit (),glutInit will initialize the GLUT library and negotiate a session with the window system. During this process, glutInit may cause the termination of the GLUT program with an error message to the user if GLUT cannot be properly initialized.
Dept. of CS&E
PENCIL SKETCH TO PHOTO REALISTIC RENDERING void glutInitDisplayMode(unsigned int mode); Remarks:The initial display mode is used when creating top-level windows, sub windows, and overlays to determine the OpenGLdisplay mode for the to-becreated window or overlay.
glutMainLoop - enters the GLUT event processing loop. glutDisplayFunc - sets the display callback for the current window. glutReshapeFunc - sets the reshape callback for the current window. glutCreateWindow - creates a top-level window.
glViewport - set the viewport. glutSwapBuffers - swaps the buffers of the current window if double buffered. glEnable, glDisable - enable or disable server-side GL capabilities glClear - clear buffers to preset values glutTimerFunc - registers a timer callback to be triggered in a specified number of milliseconds.
10 B.G.S.I.T
Dept. of CS&E
glLoadIdentity - replace the current matrix with the identity matrix glMatrixMode - specify which matrix is the current matrix glutPostRedisplay, glutPostWindowRedisplay - marks the current or specified window as needing to be redisplayed. glOrtho - multiply the current matrix with an orthographic matrix glTranslated, glTranslatef - multiply the current matrix by a translation matrix glRotated, glRotatef - multiply the current matrix by a rotation matrix glPushMatrix, glPopMatrix - push and pop the current matrix stack glColor3* The GL stores both a current single-valued color index and a current fourvalued RGBA color. glColor sets a new four-valued RGBA color.glColor has two major variants: glColor3 and glColor4. glColor3 variants specify new red, green, and blue values explicitly and set the current alpha value to 1.0 (full intensity) implicitly.
wall(double thickness), wall1(double thickness): used to draw the walls. thickness), sofa11(double
Flowers( ), Flowers1( ): to draw dotted flowers. Enable(void): to test depth,set light and smooth shadow. Mydisplay1(void):to display sketched scene. Mydisplay2(void): to display colored scene. Mydisplay3(void): to display colored scene with bridge. Mydisplay4(void):to display the sketch of the house. Mydisplay5(void):to display the colored house. Mydisplay6(void):to display the sketch of interior of the room. Mydisplay7(void):to display the colored interior of the room.
12 B.G.S.I.T
Dept. of CS&E
Mydisplay8(void):to display the bunch of flowers in the room. Mouse( int btn,int state,int x,int y):to provide input from mouse. Keyboard(unsigned char key,int x,int y):to provide input from keyboard. myinit(void): Initialize material property and light source.
main( ): Open window with initial window size, title bar, RGB display mode, and handle input events
Dept. of CS&E
13
B.G.S.I.T
CHAPTER 5
Snapshots
Dept. of CS&E
14
B.G.S.I.T
Dept. of CS&E
15
B.G.S.I.T
Dept. of CS&E
16
B.G.S.I.T
Dept. of CS&E
17
B.G.S.I.T
Dept. of CS&E
18
B.G.S.I.T
Dept. of CS&E
19
B.G.S.I.T
Dept. of CS&E
20
B.G.S.I.T
CHAPTER 6
In top down testing the general problem is tested first, followed by the addition program modules, one level at a time to the lowest level. In bottom up small scale program modules are tested first, which are linked to a high level module, and so on until the program is completed. The testing phase involves the testing of the developed system using various test data. Preparation of test data plays an important role in the system testing.
Dept. of CS&E
22
B.G.S.I.T
PENCIL SKETCH TO PHOTO REALISTIC RENDERING interface errors have been uncovered and corrected and final series of system testing begins. System testing can be defined in many ways, but a simple definition is that the system succeeds when the user/customer. Acceptance Testing: User acceptance of a system is a key factor to the success of the developed system. The system under consideration was tested for user acceptance constantly keeping in touch with the prospective system user at the time of developing and making change wherever require. All the forms have been thoroughly tested for any bugs that may have crept in our design or implementation. So far no such bags have been discovered.
CHAPTER 7
FUTURE ENHANCEMENTS
Graphics can be enhanced and made more realistic by improving the program. The environment can be made more detailed by incorporating objects and articles.
24 B.G.S.I.T
Dept. of CS&E
Dept. of CS&E
25
B.G.S.I.T
CHAPTER 8
CONCLUSION
The concept used in program can be very useful in creating similar but complicated environments. This project can be used as the frame work for developing better graphical and animation clips.
Dept. of CS&E
26
B.G.S.I.T
CHAPTER 9
BIBILOGRAPHY
Dept. of CS&E
27
B.G.S.I.T
Text Books:
[1]. Interactive Computer Graphics ByEdward Angel, 5th Edition, Addison-Wesley, 2008 [2]. Computer Graphics Using OpenGl F.S. Hill, 2nd Edition, 2001
Website:
[1]. www.google.com [2]. www.wikipedia.com
Dept. of CS&E
28
B.G.S.I.T