SlideShare uma empresa Scribd logo
1 de 26
Baixar para ler offline
Graphics Editor
DEPARTMENT OF CSE,BNMIT 1
CHAPTER 1
INTRODUCTION
MS-Paint program comes pre-installed on Microsoft’s ‘Windows’ series of operating systems. It
is the default graphics program for windows systems. It’s mainly used for basic image editing
purposes. This project aims to simulate the working of this MS-Paint program. For creating the
GUI and implementing various functionalities, OpenGL graphics library has been used in C
language. The project has been implemented in Microsoft Visual Studio Professional Edition 2008
and 2013 which uses C and/or C++ as the language tool.
OpenGL provide various viewing function that helps us to develop various views of single
object, and the way in which it appears on screen. Orthographic projection is the default view.
OpenGL also provide various transformation functions with the help of these functions user can
render its object at the desired location on the screen. In OpenGL we obtain viewing and modeling
functionality through a small set of transformation functions. We can even rotate the object along
desired locations and with the desired angle on the screen.
OpenGL provides a set of commands to render a three dimensional scene. OpenGL is a
hardware- and system-independent interface. An OpenGL-application will work on every
platform, as long as there is an installed GLUT library.
GLUT is a complete API written by Mark Kilgard which allows us to create windows and
render the 2D or 3D scenes. It exists for several platforms, that means that a program which uses
GLUT can be compiled on many platforms without (or at least with very few) changes in the code.
Graphics Editor
DEPARTMENT OF CSE,BNMIT 2
The various features implemented in this paint program are-
Open: This option can be used to open any previously saved image or drawing by the user.
Save: This option can be used by the user to save any drawing.
Clear: This option clears the screen completely.
2D-Gasket: This option can be used to draw the 2D Sierpinski Gasket.
2D-House: This option can be used to draw 2D house of any color.
3D-Gasket: This option can be used to draw the 3D Sierpinski Gasket.
Pencil: This tool can be used for free-hand drawing.
Line: This tool can be used to draw any straight line.
Triangle: This tool can be used to draw any type of outlined triangle.
Rectangle: This tool can be used to draw rectangle of any dimension.
Polygon: This tool can be used to draw polygon of any kind.
Graphics Editor
DEPARTMENT OF CSE,BNMIT 3
Circle: This tool can be used to draw a circle of specified radius.
Spray: This tool can be used for spray paint.
Eraser: This tool can be used to erase any drawing or a part of it.
Fill: This tool can be used to fill any closed object with selected color.
Brush: This tool can be used to draw or fill color with free hand.
Color Palette: This option can be used to select any particular color.
Menu: This menu appears on right click of the mouse and can be used to change the point size,
Theme or to quit the application.
Graphics Editor
DEPARTMENT OF CSE,BNMIT 4
CHAPTER 2
REQUIREMENTS ANALYSIS
2.1 Software Requirements
Operating system like Windows XP, Windows 7 and Windows 8 is the platform required to
develop 2D & 3D graphics applications.
A Visual C++ compiler is required for compiling the source code to make the executable file which
can then be directly executed.
A built-in graphics library like glut, glut32 & header file like glut.h and DLL i.e. dynamic link
libraries like glut, glut32 are required for creating the 3D layout.
2.2 Hardware requirements
The hardware requirements are very minimal and the software can be made to run on most of the
machines.
Processor: Above x86
Processor speed: 500 MHz and above
RAM: 64 MB or above storage space 4GB and more
Monitor Resolution: A color monitor with a minimum resolution of 640*480
2.3 Platform
The package is implemented using Microsoft visual C++ under the windows programming
environment. OpenGL and associated toolkits are used for the package development.
Graphics Editor
DEPARTMENT OF CSE,BNMIT 5
CHAPTER 3
DESIGN
3.1 Header files and their descriptions
#include<GL/glut.h>
#include<stdio.h>
#include<math.h>
#include<windows.h>
 GL/glut.h: This header files provides an interface with application programs that are
installed on the system.
 stdio.h: Input & Output operations can also be performed in C using C standard input,
output library.
 math.h: contains constant definitions and external subordinate declarations for the math
subroutine library.
 Windows.h: handles the output window creation.
3.2 Description of OpenGL functions
Glut library functions used are:
main(): Execution of any program always starts with main function irrespective of where it is
written in a program.
glutSwapBuffers(void): Performs a buffer swap on the layer in use for the current window.
Specifically, glutSwapBuffers promotes the contents of the back buffer of the layer in use of the
current window to become the contents of the front buffer. The contents of the back buffer then
become undefined. The update typically takes place during the vertical retrace of the monitor,
rather than immediately after glutSwapBuffers is called.
glutPostRedisplay(): marks the plane of current window as needing to be redisplayed. The next
iteration through glutMainLoop, the window’s display callback will be called to redisplay the
Graphics Editor
DEPARTMENT OF CSE,BNMIT 6
window’s normal plane. Multiple calls to glutPostRedisplay before the next display callback
opportunity generates only a single redisplay callback.
glutInit(&argc,char ** argv): 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.
glutInitDisplayMode(unsigned int mode): The initial display mode is used when creating
toplevel windows, sub windows, and overlays to determine the OpenGL display mode for the
to-becreated window or overlay.
GLUT_RGB specifies the structure of each pixel.
GLUT_DEPTH is a buffer to hold the depth of each pixel.
glutCreateWindow(char *title): The glutCreateWindow creates a top-level window. The name
will be provided to the window system as the window's name. The intent is that the window
system will label the window with the name.
glutReshapeFunc():glutReshapeFunc sets the reshape callback for the current window. The
reshape callback is triggered when a window is reshaped. A reshape callback is also triggered
immediately before a window's first display callback after a window is created or whenever an
overlay for the window is established. The width and height parameters of the callback specify
the new window size in pixels. Before the callback, the current window is set to the window that
has been reshaped.
glutMainLoop():glutMainLoop enters the GLUT event processing loop. This routine should be
called at most once in a GLUT program. Once called, this routine will never return. It will call
as necessary any callbacks that have been registered.
glutBitmapCharacter(font,c): Without using any display lists, glutBitmapCharacter renders
the character ‘c’ in the named bitmap font.
glPointSize(size): glPointSize specifies the rasterized diameter of points.
Graphics Editor
DEPARTMENT OF CSE,BNMIT 7
glFlush():Different GL implementations buffer commands in several different locations,
including network buffers and the graphics accelerator itself. glFlush empties all of these buffers,
causing all issued commands to be executed as quickly as they are accepted by the actual
rendering engine. Though this execution may not be completed in any particular time period, it
does complete in finite time.
glRasterPos3f(x , y, z):This function is used to set the cursor at the x, y, z location. glBegin(enum)
and glEnd(): glBegin and glEnd delimit the vertices that define a primitive or a group of like
primitives. glBegin accepts a single argument that specifies in which often ways the vertices are
interpreted.
glColor3f(R,G,B): This function is used to pick a color of specified R,G,B value.
glClear(GLbitfield): glClear sets the bit plane area of the window to values previously selected
by glClearColor, glClearIndex, glClearDepth, glClearStencil, and glClearAccum. Multiple color
buffers can be cleared simultaneously by selecting more than one buffer at a time using
glDrawBuffer.
glVertex2f(x,y): This function is used to draw a vertex at location x,y.
glEnable(GLenum): This function is used to enable the various functionalities like enabling the
light, enabling the Z buffer.
glDisable(GLenum): This function is used to disable the various functionalities like enabling
the light, enabling the Z buffer.
glRectf(x0,y0,x1,y1): This function is used to draw rectangle using the two diagonal points.
Graphics Editor
DEPARTMENT OF CSE,BNMIT 8
glClearColor(R,G,B,A):glClearColor specifies the red, green, blue, and alpha values used by
glClear to clear the color buffers. Values specified by glClearColor are clamped to the range 0
to1 .
glMaterialfv(GLenum,GLenum,GLfloat *): glMaterial assigns values to material parameters.
There are two matched sets of material parameters. One, the front-facing set, is used to shade
points, lines, bitmaps, and all polygons (when two-sided lighting is disabled), or just front-facing
polygons (when two-sided lighting is enabled).
glutSolidTeapot(size): glutSolidTeapot and glutWireTeapot render a solid or wireframe teapot
respectively. Both surface normals and texture coordinates for the teapot are generated. The
teapot is generated with OpenGL evaluators
glutSolidCube(size): glutSolidCube and glutWireCube render a solid or wireframe cube
respectively. The cube is centered at the modeling coordinate’s origin with sides of length size.
glutDisplayFunc(void (*func)()): glutDisplayFunc sets the display callback for the current
window. When GLUT determines that the normal plane for the window needs to be redisplayed,
the display callback for the window is called. Before the callback, the current window is set to
the window needing to be redisplayed and (if no overlay display callback is registered) the layer
in use is set to the normal plane. The display callback is called with no parameters.
glutKeyboardFunc(void (*func)(unsigned char key, int x, int y)): glutKeyboardFunc sets the
keyboard callback for the current window. When a user types into the window, each key press
generating an ASCII character will generate a keyboard callback. The key callback parameter is
the generated ASCII character
glutMouseFunc(void (*func)(int button, int state, int x, int y)): glutMouseFunc sets the
mouse callback for the current window. When a user presses and releases mouse buttons in the
window, each press and each release generates a mouse callback. The button parameter is one of
GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON, or GLUT_RIGHT_BUTTON.
Graphics Editor
DEPARTMENT OF CSE,BNMIT 9
glutMotionFunc(void (*func)(int x, int y)): glutMotionFunc set the motion callback for the
current window. The motion callback for a window is called when the mouse moves within the
window while one or more mouse buttons are pressed.
glutPassiveMotionFunc(void(*func)(int x, int y)): glutPassiveMotionFunc set the
passive motion callback for the current window. The passive motion callback for a window
is called when the mouse moves within the window while no mouse buttons are pressed.
glMatrixMode(GLenum) mode: Specifies which matrix stack is the target for subsequent
matrix operations. Values accepted are: GL_MODELVIEW, GL_PROJECTION.The
initial value is GL_MODELVIEW. Additionally, if the ARB tension extension is
supported, GL_COLOR is also accepted.
gluPerspective(fovy, aspect, near, far): gluPerspective specifies a viewing frustum into the
world coordinate system. In general, the aspect ratio in gluPerspective should match the aspect
ratio of the associated viewport. For example, aspect = 2.0means the viewer's angle of view is
twice as wide in x as it is in y.
glOrtho(left, right, top, bottom, Znear, Zfar): glOrtho describes a transformation that
produces a parallel projection. The current matrix is multiplied by this matrix and the result
replaces the current matrix.
3.3Description of User-defined functions
Various user-defined functions used are:
void drawstring(float x, float y, float z, char *string): Used to display text.
void drawpoint(int x, int y): Used to draw point.
void paint(int x, int y): Used for PAINT BRUSH function.
Graphics Editor
DEPARTMENT OF CSE,BNMIT 10
void eraser(int x, int y): Used for ERASER function.
void reset(): It resets the variables in which vertices are stored, after a polygon is drawn.
void draw_pixel(GLfloat x, GLfloat y): It’s used to draw the points of a circle.
void draw_circle(GLfloat p, GLfloat q, GLfloat r): It’s used to draw a CIRCLE using
MIDPOINT CIRCLE DRAWING algorithm
void draw_circle1(GLfloat p, GLfloat q, GLfloat r): It’s used to draw the circle option on the
tool bar.
void edgedetect(float x1, float y1, float x2, float y2, int *le, int *re): It’s used to detect edges of
the polygon to be filled.
void scanfill(GLint num1, GLint num2): It’s used to FILL a Polygon using SCAN LINE
ALGORITHM.
void detect_point(GLint num1, GLint num2, int x, int y): It’s used to detect which POLYGON
TO BE FILLED.
void display(void): It’s user-defined DISPLAY function.
void keys(unsigned char key, int x, int y): It’s used to get FILENAME from the KEYBOARD.
void divide_trinagle(GLfloat *a, GLfloat *b, GLfloat *c, int k): It’s used for drawing the 2D
Sierpinski gasket.
void tetra(GLfloat *a, GLfloat * b, GLfloat * c, GLfloat * d): It’s used in drawing 3D Sierpinski
gasket.
Graphics Editor
DEPARTMENT OF CSE,BNMIT 11
void divide_tetra(GLfloat * a, GLfloat * b, GLfloat * c, GLfloat * d, int m): It’s used in
drawing 3D Sierpinski gasket.
void myMouse(int btn, int state, int x, int y): It’s used to handle all the mouse events.
void myReshape(GLsizei w, GLsizei h): It’s user defined RESHAPE FUNCTION.
void point_size(int id): Used to change the pixel size.
Graphics Editor
DEPARTMENT OF CSE,BNMIT 12
CHAPTER 4
IMPLEMENTATION
4.1 drawstring() :
/* to display text */
void drawstring(float x, float y, float z, char *string)
{
/* position the string at x,y,z location */
/* display it on output screen using standard glut API */
}
4.2 setFont():
void setFont(void *font)
{
/* sets the current font */
}
4.3 drawpoint:
/* to draw point */
void drawpoint(int x, int y)
{
/* set y = window height- y position */
if (within the viewport)
{
/* display the point and flush */
}
}
4.4 paint:
Graphics Editor
DEPARTMENT OF CSE,BNMIT 13
/* PAINT BRUSH function */
void paint(int x, int y)
{
/*set y = window height- y position */
if (within the viewport)
{
/* paint the x,y position */
}
}
4.5 Eraser():
/* ERASER function */
void eraser(int x, int y)
{
/* set y = window height- y position */
/* set the eraser color to the background color */
if (within the viewport)
{
/* erase the x,y position by drawing a rectangle */
}
}
4.6 palette():
/* to draw the COLOR PALETTE */
void palette(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
{
/* Draw the Color Palette */
}
Graphics Editor
DEPARTMENT OF CSE,BNMIT 14
4.7 draw_pixel(GLfloat, GLfloat):
/*to draw the points of a circle */
void draw_pixel(GLfloat x, GLfloat y)
{
if (within the viewport)
{
if (fill is TRUE)
/* set point size to 3 */
else
/* set pointsize as specified in size value */
/* start drawing the points */
}
}
4.8 plotpixels(GLfloat, GLfloat, GLfloat):
/* To plot the pixels */
void plotpixels(GLfloat p, GLfloat q, GLfloat x, GLfloat y)
{
/* start drawing the points */
}
4.9 draw_circle(GLfloat, GLfloat, GLfloat):
/* to draw a CIRCLE using MIDPOINT CIRCLE DRAWING algorithm */
void draw_circle(GLfloat p, GLfloat q, GLfloat r)
{
while (y is greater than x)
{
/* call plotpixels function */
if (d is lesser than 0)
Graphics Editor
DEPARTMENT OF CSE,BNMIT 15
/* increment d by 2*x+3 */
else
{
/* increment d by 2*(x-y) +5 */
/* pre-decrement y by 1 */
}
/* pre-increment x by 1 */
}
/* call plotpixels function */
}
4.10 draw_pixell(GLfloat, GLfloat):
void draw_pixel1(GLfloat x, GLfloat y)
{
/* draw a point */
}
4.10 plotpixels1(GLfloat, GLfloat, GLfloat, GLfloat):
/* to draw the circle option on the tool bar */
void plotpixels1(GLfloat p, GLfloat q, GLfloat x, GLfloat y)
{
/* call this function to draw the circle option on the tool bar */
}
4.11 edgedetect:
/* to detect edges of the polygon to be filled */
void edgedetect(float x1, float y1, float x2, float y2, int *le, int *re)
{
float mx, x, temp;
Graphics Editor
DEPARTMENT OF CSE,BNMIT 16
if ((y2 - y1)<0)
{
temp = y1;
y1 = y2;
y2 = temp;
temp = x1;
x1 = x2;
x2 = temp;
}
if ((y2 - y1) != 0)
mx = (x2 - x1) / (y2 - y1);
else
mx = x2 - x1;
x = x1;
for (i = y1; i <= y2; i++)
{
if (x<(float)le[i])
le[i] = (int)x;
if (x>(float)re[i])
re[i] = (int)x;
x += mx;
}
}
4.12 scanfill:
/* to FILL a Polygon using SCAN LINE ALGORITHM*/
void scanfill(GLint num1, GLint num2)
{
int le[1000], re[1000];
Graphics Editor
DEPARTMENT OF CSE,BNMIT 17
int p, q;
int bottom, top;
for (p = 0; p<wh; p++)
{
le[p] = ww;
re[p] = 0;
}
for (p = num1; p<num2; p++)
{
edgedetect(a[p][0], a[p][1], a[p + 1][0], a[p + 1][1], le, re);
}
edgedetect(a[num2][0], a[num2][1], a[num1][0], a[num1][1], le, re);
for (q = 0; q<wh; q++)
le[q] = le[q] + 1;
bottom = 0;
while (re[bottom]<le[bottom])
bottom++;
bottom++;
top = wh - 1;
while (re[top]<le[top])
top--;
for (q = bottom; q<top; q++)
{
if (le[q] <= re[q])
{
for (p = (int)le[q]; p<(int)re[q]; p++)
draw_pixel(p, q);
}
}
}
Graphics Editor
DEPARTMENT OF CSE,BNMIT 18
4.13 detect_point:
/* to detect which POLYGON TO BE FILLED */
void detect_point(GLint num1, GLint num2, int x, int y) {
int le[1000], re[1000];
int p, q;
for (p = 0; p<wh; p++)
{
le[p] = ww;
re[p] = 0;
}
for (p = num1; p<num2; p++)
{
edgedetect(a[p][0], a[p][1], a[p + 1][0], a[p + 1][1], le, re);
}
edgedetect(a[num2][0], a[num2][1], a[num1][0], a[num1][1], le, re);
for (q = 0; q<wh; q++)
{
if (le[q] <= re[q])
{
for (p = (int)le[q]; p<(int)re[q]; p++)
{
if (x == p && y == q)
flag = num1;
}
}
}
}
Graphics Editor
DEPARTMENT OF CSE,BNMIT 19
4.14 keys:
/* to get FILENAME from the KEYBOARD */
void keys(unsigned char key, int x, int y)
{
if (key is a character)
{
/* save the character in an array */
/* display the character at specified location */
/* increase textx by 10 */
/* post increment s by 1 */
}
/* to SAVE current image on a file */
if (‘Enter’ key is pressed & Save is TRUE)
{
/* append '0' to the end of array to make it a string */
/* Open a file in write mode and save the data in specified filename*/
/* re-initialize save to 0 */
/* re-initialize s to 0 */
}
/* to open an existing file */
if (‘Enter’ key is pressed & Open is TRUE)
{
/* append '0' to the end of array to make it a string */
/* Open a file in Read mode and flush the data on output screen*/
/* re-initialize save to 0 */
/* re-initialize s to 0 */
}
}
Graphics Editor
DEPARTMENT OF CSE,BNMIT 20
CHAPTER 5
RESULTS AND SNAPSHOTS
Fig 1: Welcome Screen
Fig 2: Default Layout of application
Graphics Editor
DEPARTMENT OF CSE,BNMIT 21
Fig 3: Application with yellow theme
Fig 4: 3D-Sierpinski Gasket
Graphics Editor
DEPARTMENT OF CSE,BNMIT 22
Fig 5: 2D-Sierpinski gasket
Fig 6: Application showing menu on right click
Graphics Editor
DEPARTMENT OF CSE,BNMIT 23
Fig 7: 2D-House
Fig 8: Various free hand drawings
Graphics Editor
DEPARTMENT OF CSE,BNMIT 24
CHAPTER 6
CONCLUSION
The project is well suited for designing 2D and 3D objects, as well as for carrying out basic
graphics functionalities like drawing a simple line, creating a cube, circle, square, erasing and
filling them. However, if implemented on large scale with sufficient resources, it has the potential
to become a standard stand-alone GUI based application for Windows Operating System.
Out of the many features available, the project demonstrates some popular and commonly
used features of OpenGL such as Rendering, Transformation, Rotation, Lighting, Scaling etc.
These graphic functions will also work in tandem with various rules involved in the game. Since
this project works on dynamic values, it can be used for real time computation.
The project enabled to work with mid-level. OpenGL complexity and the project
demonstrates the scope of OpenGL platform as a premier game developing launch pad. Hence, it
has indeed been useful in developing many games. OpenGL in its own right is good for low cost
and simple game development. It serves as an important stepping stone for venturing into other
fields of Computer Graphics design and applications.
Graphics Editor
DEPARTMENT OF CSE,BNMIT 25
CHAPTER 7
FUTURE ENHANCEMENTS
In future versions of paint project, addition of some more in-built 2D and 3D models of geometric
figures like cone, and pyramids, option to change line thickness, pick up color of line and various
options to set light properties according to users’ requirements is a feasible idea.
Making the User-interface of this program simpler and more user friendly will certainly
help beginners in using this program more easily. The added functionality of giving information
about an object on mouse hover over the object as well as ‘Undo’ and ‘Redo’ options will be also
be a good choice.
Perhaps the most challenging task will be to implement the functionality of ‘Layers’ which are
used extensively by Professionals in graphics industry.
Graphics Editor
DEPARTMENT OF CSE,BNMIT 26
BIBLIOGRAPHY
1. Interactive Computer Graphics (a top down approach) by Edward Angel
2. OpenGL Programming Guide by Addison-Wesley
Online Resources
1. www.opengl.org
2. www.cs.unm.edu/~angel
3. www.aw.com/cssupport

Mais conteúdo relacionado

Mais procurados

applications of computer graphics
applications of computer graphicsapplications of computer graphics
applications of computer graphicsAaina Katyal
 
Minor project Report for "Quiz Application"
Minor project Report for "Quiz Application"Minor project Report for "Quiz Application"
Minor project Report for "Quiz Application"Harsh Verma
 
Computer graphics mini project on bellman-ford algorithm
Computer graphics mini project on bellman-ford algorithmComputer graphics mini project on bellman-ford algorithm
Computer graphics mini project on bellman-ford algorithmRAJEEV KUMAR SINGH
 
Hostel management system srs
Hostel management system srsHostel management system srs
Hostel management system srshira akram
 
Hand gesture recognition system(FYP REPORT)
Hand gesture recognition system(FYP REPORT)Hand gesture recognition system(FYP REPORT)
Hand gesture recognition system(FYP REPORT)Afnan Rehman
 
CSE Final Year Project Presentation on Android Application
CSE Final Year Project Presentation on Android ApplicationCSE Final Year Project Presentation on Android Application
CSE Final Year Project Presentation on Android ApplicationAhammad Karim
 
Online Examination System Project report
Online Examination System Project report Online Examination System Project report
Online Examination System Project report SARASWATENDRA SINGH
 
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniquesMani Kanth
 
SYNOPSIS ON BANK MANAGEMENT SYSTEM
SYNOPSIS ON BANK MANAGEMENT SYSTEMSYNOPSIS ON BANK MANAGEMENT SYSTEM
SYNOPSIS ON BANK MANAGEMENT SYSTEMNitish Xavier Tirkey
 
Time Table Management System Software Report
Time Table Management System Software ReportTime Table Management System Software Report
Time Table Management System Software ReportAditya Jain
 
Attendance Management System using Face Recognition
Attendance Management System using Face RecognitionAttendance Management System using Face Recognition
Attendance Management System using Face RecognitionNanditaDutta4
 
e-commerce web development project report (Bookz report)
e-commerce web development project report (Bookz report)e-commerce web development project report (Bookz report)
e-commerce web development project report (Bookz report)Mudasir Ahmad Bhat
 
Android Based Application Project Report.
Android Based Application Project Report. Android Based Application Project Report.
Android Based Application Project Report. Abu Kaisar
 
Web Development on Web Project Presentation
Web Development on Web Project PresentationWeb Development on Web Project Presentation
Web Development on Web Project PresentationMilind Gokhale
 
Internship Presentation 1 Web Developer
Internship Presentation 1 Web DeveloperInternship Presentation 1 Web Developer
Internship Presentation 1 Web DeveloperHemant Sarthak
 

Mais procurados (20)

applications of computer graphics
applications of computer graphicsapplications of computer graphics
applications of computer graphics
 
Minor project Report for "Quiz Application"
Minor project Report for "Quiz Application"Minor project Report for "Quiz Application"
Minor project Report for "Quiz Application"
 
Computer graphics mini project on bellman-ford algorithm
Computer graphics mini project on bellman-ford algorithmComputer graphics mini project on bellman-ford algorithm
Computer graphics mini project on bellman-ford algorithm
 
Hostel management system srs
Hostel management system srsHostel management system srs
Hostel management system srs
 
Hand gesture recognition system(FYP REPORT)
Hand gesture recognition system(FYP REPORT)Hand gesture recognition system(FYP REPORT)
Hand gesture recognition system(FYP REPORT)
 
CSE Final Year Project Presentation on Android Application
CSE Final Year Project Presentation on Android ApplicationCSE Final Year Project Presentation on Android Application
CSE Final Year Project Presentation on Android Application
 
Bank Management System
Bank Management SystemBank Management System
Bank Management System
 
Srs for banking system
Srs for banking systemSrs for banking system
Srs for banking system
 
Online Examination System Project report
Online Examination System Project report Online Examination System Project report
Online Examination System Project report
 
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniques
 
SYNOPSIS ON BANK MANAGEMENT SYSTEM
SYNOPSIS ON BANK MANAGEMENT SYSTEMSYNOPSIS ON BANK MANAGEMENT SYSTEM
SYNOPSIS ON BANK MANAGEMENT SYSTEM
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Time Table Management System Software Report
Time Table Management System Software ReportTime Table Management System Software Report
Time Table Management System Software Report
 
Attendance Management System using Face Recognition
Attendance Management System using Face RecognitionAttendance Management System using Face Recognition
Attendance Management System using Face Recognition
 
e-commerce web development project report (Bookz report)
e-commerce web development project report (Bookz report)e-commerce web development project report (Bookz report)
e-commerce web development project report (Bookz report)
 
Atm project
Atm projectAtm project
Atm project
 
Android Based Application Project Report.
Android Based Application Project Report. Android Based Application Project Report.
Android Based Application Project Report.
 
tour management system
tour management systemtour management system
tour management system
 
Web Development on Web Project Presentation
Web Development on Web Project PresentationWeb Development on Web Project Presentation
Web Development on Web Project Presentation
 
Internship Presentation 1 Web Developer
Internship Presentation 1 Web DeveloperInternship Presentation 1 Web Developer
Internship Presentation 1 Web Developer
 

Destaque

Computer Graphics 471 Project Report Final
Computer Graphics 471 Project Report FinalComputer Graphics 471 Project Report Final
Computer Graphics 471 Project Report FinalAli Ahmed
 
OpenGL Projects on SIMULATION OF WATER RIPPELS
OpenGL Projects on SIMULATION OF WATER RIPPELSOpenGL Projects on SIMULATION OF WATER RIPPELS
OpenGL Projects on SIMULATION OF WATER RIPPELSRAJEEV KUMAR SINGH
 
Computer Graphics Project Development Help with OpenGL computer graphics proj...
Computer Graphics Project Development Help with OpenGL computer graphics proj...Computer Graphics Project Development Help with OpenGL computer graphics proj...
Computer Graphics Project Development Help with OpenGL computer graphics proj...Team Codingparks
 
LUDO BOARD GAME OPENGL COMPUTER GRAPHICS
LUDO BOARD GAME OPENGL COMPUTER GRAPHICSLUDO BOARD GAME OPENGL COMPUTER GRAPHICS
LUDO BOARD GAME OPENGL COMPUTER GRAPHICSRAJEEV KUMAR SINGH
 
Design A Screen saver in c on Moving Train with Side view.
Design A Screen saver in c on Moving Train with Side view.Design A Screen saver in c on Moving Train with Side view.
Design A Screen saver in c on Moving Train with Side view.Sanjay Kumar Chakravarti
 
KARNAUGH MAP using OpenGL (KMAP)
KARNAUGH MAP using OpenGL (KMAP)KARNAUGH MAP using OpenGL (KMAP)
KARNAUGH MAP using OpenGL (KMAP)Sagar Uday Kumar
 
CG simple openGL point & line-course 2
CG simple openGL point & line-course 2CG simple openGL point & line-course 2
CG simple openGL point & line-course 2fungfung Chen
 
Instancing
InstancingInstancing
Instancingacbess
 
Computer graphics report
Computer graphics reportComputer graphics report
Computer graphics reportAlisha Korpal
 
VU Computer Graphics project - SkyRoads remake
VU Computer Graphics project - SkyRoads remakeVU Computer Graphics project - SkyRoads remake
VU Computer Graphics project - SkyRoads remakeMircea Mare
 
OpenGL Introduction
OpenGL IntroductionOpenGL Introduction
OpenGL IntroductionYi-Lung Tsai
 
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPT
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPTImage Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPT
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPTAkshit Arora
 

Destaque (20)

Computer Graphics 471 Project Report Final
Computer Graphics 471 Project Report FinalComputer Graphics 471 Project Report Final
Computer Graphics 471 Project Report Final
 
OpenGL Projects on SIMULATION OF WATER RIPPELS
OpenGL Projects on SIMULATION OF WATER RIPPELSOpenGL Projects on SIMULATION OF WATER RIPPELS
OpenGL Projects on SIMULATION OF WATER RIPPELS
 
Computer Graphics Project Development Help with OpenGL computer graphics proj...
Computer Graphics Project Development Help with OpenGL computer graphics proj...Computer Graphics Project Development Help with OpenGL computer graphics proj...
Computer Graphics Project Development Help with OpenGL computer graphics proj...
 
LUDO BOARD GAME OPENGL COMPUTER GRAPHICS
LUDO BOARD GAME OPENGL COMPUTER GRAPHICSLUDO BOARD GAME OPENGL COMPUTER GRAPHICS
LUDO BOARD GAME OPENGL COMPUTER GRAPHICS
 
Mini Project- 3D Graphics And Visualisation
Mini Project- 3D Graphics And VisualisationMini Project- 3D Graphics And Visualisation
Mini Project- 3D Graphics And Visualisation
 
bhargav_flowing-fountain
bhargav_flowing-fountainbhargav_flowing-fountain
bhargav_flowing-fountain
 
Design A Screen saver in c on Moving Train with Side view.
Design A Screen saver in c on Moving Train with Side view.Design A Screen saver in c on Moving Train with Side view.
Design A Screen saver in c on Moving Train with Side view.
 
KARNAUGH MAP using OpenGL (KMAP)
KARNAUGH MAP using OpenGL (KMAP)KARNAUGH MAP using OpenGL (KMAP)
KARNAUGH MAP using OpenGL (KMAP)
 
CG simple openGL point & line-course 2
CG simple openGL point & line-course 2CG simple openGL point & line-course 2
CG simple openGL point & line-course 2
 
SYNOPSIS WRITING
SYNOPSIS WRITINGSYNOPSIS WRITING
SYNOPSIS WRITING
 
Project on sdl 01
Project  on sdl 01Project  on sdl 01
Project on sdl 01
 
Instancing
InstancingInstancing
Instancing
 
Presentatie Lucas Hulsebos DWWA 2008
Presentatie Lucas Hulsebos DWWA 2008Presentatie Lucas Hulsebos DWWA 2008
Presentatie Lucas Hulsebos DWWA 2008
 
Computer graphics report
Computer graphics reportComputer graphics report
Computer graphics report
 
Arcanoid 3D
Arcanoid 3DArcanoid 3D
Arcanoid 3D
 
VU Computer Graphics project - SkyRoads remake
VU Computer Graphics project - SkyRoads remakeVU Computer Graphics project - SkyRoads remake
VU Computer Graphics project - SkyRoads remake
 
I phone 3
I phone 3I phone 3
I phone 3
 
OpenGL Introduction
OpenGL IntroductionOpenGL Introduction
OpenGL Introduction
 
6th semester Computer Science and Information Science Engg (2013 December) Qu...
6th semester Computer Science and Information Science Engg (2013 December) Qu...6th semester Computer Science and Information Science Engg (2013 December) Qu...
6th semester Computer Science and Information Science Engg (2013 December) Qu...
 
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPT
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPTImage Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPT
Image Segmentation using Otsu's Method - Computer Graphics (UCS505) Project PPT
 

Semelhante a COMPUTER GRAPHICS PROJECT REPORT

openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).pptHIMANKMISHRA2
 
openGL basics for sample program.ppt
openGL basics for sample program.pptopenGL basics for sample program.ppt
openGL basics for sample program.pptHIMANKMISHRA2
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...ICS
 
OpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI PlatformsOpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI PlatformsPrabindh Sundareson
 
3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptxssuser255bf1
 
Computer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming IComputer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming I💻 Anton Gerdelan
 
Computer graphics
Computer graphics Computer graphics
Computer graphics shafiq sangi
 
CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing StuffMark Kilgard
 
VisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalVisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalMasatsugu HASHIMOTO
 
Computer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptxComputer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptxAnandM62785
 
Computer graphics
Computer graphicsComputer graphics
Computer graphicsamitsarda3
 

Semelhante a COMPUTER GRAPHICS PROJECT REPORT (20)

openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).ppt
 
openGL basics for sample program.ppt
openGL basics for sample program.pptopenGL basics for sample program.ppt
openGL basics for sample program.ppt
 
Arkanoid Game
Arkanoid GameArkanoid Game
Arkanoid Game
 
Introduction to 2D/3D Graphics
Introduction to 2D/3D GraphicsIntroduction to 2D/3D Graphics
Introduction to 2D/3D Graphics
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
 
Open gl
Open glOpen gl
Open gl
 
OpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI PlatformsOpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI Platforms
 
Open gles
Open glesOpen gles
Open gles
 
3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx
 
Opengl (1)
Opengl (1)Opengl (1)
Opengl (1)
 
Computer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming IComputer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming I
 
Computer graphics
Computer graphics Computer graphics
Computer graphics
 
Qt Programming on TI Processors
Qt Programming on TI ProcessorsQt Programming on TI Processors
Qt Programming on TI Processors
 
CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing Stuff
 
VisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalVisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_Final
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Computer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptxComputer Graphics with OpenGL presentation Slides.pptx
Computer Graphics with OpenGL presentation Slides.pptx
 
Bai 1
Bai 1Bai 1
Bai 1
 
18csl67 vtu lab manual
18csl67 vtu lab manual18csl67 vtu lab manual
18csl67 vtu lab manual
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 

Último

Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxsomshekarkn64
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptJasonTagapanGulla
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 

Último (20)

POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptx
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.ppt
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 

COMPUTER GRAPHICS PROJECT REPORT

  • 1. Graphics Editor DEPARTMENT OF CSE,BNMIT 1 CHAPTER 1 INTRODUCTION MS-Paint program comes pre-installed on Microsoft’s ‘Windows’ series of operating systems. It is the default graphics program for windows systems. It’s mainly used for basic image editing purposes. This project aims to simulate the working of this MS-Paint program. For creating the GUI and implementing various functionalities, OpenGL graphics library has been used in C language. The project has been implemented in Microsoft Visual Studio Professional Edition 2008 and 2013 which uses C and/or C++ as the language tool. OpenGL provide various viewing function that helps us to develop various views of single object, and the way in which it appears on screen. Orthographic projection is the default view. OpenGL also provide various transformation functions with the help of these functions user can render its object at the desired location on the screen. In OpenGL we obtain viewing and modeling functionality through a small set of transformation functions. We can even rotate the object along desired locations and with the desired angle on the screen. OpenGL provides a set of commands to render a three dimensional scene. OpenGL is a hardware- and system-independent interface. An OpenGL-application will work on every platform, as long as there is an installed GLUT library. GLUT is a complete API written by Mark Kilgard which allows us to create windows and render the 2D or 3D scenes. It exists for several platforms, that means that a program which uses GLUT can be compiled on many platforms without (or at least with very few) changes in the code.
  • 2. Graphics Editor DEPARTMENT OF CSE,BNMIT 2 The various features implemented in this paint program are- Open: This option can be used to open any previously saved image or drawing by the user. Save: This option can be used by the user to save any drawing. Clear: This option clears the screen completely. 2D-Gasket: This option can be used to draw the 2D Sierpinski Gasket. 2D-House: This option can be used to draw 2D house of any color. 3D-Gasket: This option can be used to draw the 3D Sierpinski Gasket. Pencil: This tool can be used for free-hand drawing. Line: This tool can be used to draw any straight line. Triangle: This tool can be used to draw any type of outlined triangle. Rectangle: This tool can be used to draw rectangle of any dimension. Polygon: This tool can be used to draw polygon of any kind.
  • 3. Graphics Editor DEPARTMENT OF CSE,BNMIT 3 Circle: This tool can be used to draw a circle of specified radius. Spray: This tool can be used for spray paint. Eraser: This tool can be used to erase any drawing or a part of it. Fill: This tool can be used to fill any closed object with selected color. Brush: This tool can be used to draw or fill color with free hand. Color Palette: This option can be used to select any particular color. Menu: This menu appears on right click of the mouse and can be used to change the point size, Theme or to quit the application.
  • 4. Graphics Editor DEPARTMENT OF CSE,BNMIT 4 CHAPTER 2 REQUIREMENTS ANALYSIS 2.1 Software Requirements Operating system like Windows XP, Windows 7 and Windows 8 is the platform required to develop 2D & 3D graphics applications. A Visual C++ compiler is required for compiling the source code to make the executable file which can then be directly executed. A built-in graphics library like glut, glut32 & header file like glut.h and DLL i.e. dynamic link libraries like glut, glut32 are required for creating the 3D layout. 2.2 Hardware requirements The hardware requirements are very minimal and the software can be made to run on most of the machines. Processor: Above x86 Processor speed: 500 MHz and above RAM: 64 MB or above storage space 4GB and more Monitor Resolution: A color monitor with a minimum resolution of 640*480 2.3 Platform The package is implemented using Microsoft visual C++ under the windows programming environment. OpenGL and associated toolkits are used for the package development.
  • 5. Graphics Editor DEPARTMENT OF CSE,BNMIT 5 CHAPTER 3 DESIGN 3.1 Header files and their descriptions #include<GL/glut.h> #include<stdio.h> #include<math.h> #include<windows.h>  GL/glut.h: This header files provides an interface with application programs that are installed on the system.  stdio.h: Input & Output operations can also be performed in C using C standard input, output library.  math.h: contains constant definitions and external subordinate declarations for the math subroutine library.  Windows.h: handles the output window creation. 3.2 Description of OpenGL functions Glut library functions used are: main(): Execution of any program always starts with main function irrespective of where it is written in a program. glutSwapBuffers(void): Performs a buffer swap on the layer in use for the current window. Specifically, glutSwapBuffers promotes the contents of the back buffer of the layer in use of the current window to become the contents of the front buffer. The contents of the back buffer then become undefined. The update typically takes place during the vertical retrace of the monitor, rather than immediately after glutSwapBuffers is called. glutPostRedisplay(): marks the plane of current window as needing to be redisplayed. The next iteration through glutMainLoop, the window’s display callback will be called to redisplay the
  • 6. Graphics Editor DEPARTMENT OF CSE,BNMIT 6 window’s normal plane. Multiple calls to glutPostRedisplay before the next display callback opportunity generates only a single redisplay callback. glutInit(&argc,char ** argv): 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. glutInitDisplayMode(unsigned int mode): The initial display mode is used when creating toplevel windows, sub windows, and overlays to determine the OpenGL display mode for the to-becreated window or overlay. GLUT_RGB specifies the structure of each pixel. GLUT_DEPTH is a buffer to hold the depth of each pixel. glutCreateWindow(char *title): The glutCreateWindow creates a top-level window. The name will be provided to the window system as the window's name. The intent is that the window system will label the window with the name. glutReshapeFunc():glutReshapeFunc sets the reshape callback for the current window. The reshape callback is triggered when a window is reshaped. A reshape callback is also triggered immediately before a window's first display callback after a window is created or whenever an overlay for the window is established. The width and height parameters of the callback specify the new window size in pixels. Before the callback, the current window is set to the window that has been reshaped. glutMainLoop():glutMainLoop enters the GLUT event processing loop. This routine should be called at most once in a GLUT program. Once called, this routine will never return. It will call as necessary any callbacks that have been registered. glutBitmapCharacter(font,c): Without using any display lists, glutBitmapCharacter renders the character ‘c’ in the named bitmap font. glPointSize(size): glPointSize specifies the rasterized diameter of points.
  • 7. Graphics Editor DEPARTMENT OF CSE,BNMIT 7 glFlush():Different GL implementations buffer commands in several different locations, including network buffers and the graphics accelerator itself. glFlush empties all of these buffers, causing all issued commands to be executed as quickly as they are accepted by the actual rendering engine. Though this execution may not be completed in any particular time period, it does complete in finite time. glRasterPos3f(x , y, z):This function is used to set the cursor at the x, y, z location. glBegin(enum) and glEnd(): glBegin and glEnd delimit the vertices that define a primitive or a group of like primitives. glBegin accepts a single argument that specifies in which often ways the vertices are interpreted. glColor3f(R,G,B): This function is used to pick a color of specified R,G,B value. glClear(GLbitfield): glClear sets the bit plane area of the window to values previously selected by glClearColor, glClearIndex, glClearDepth, glClearStencil, and glClearAccum. Multiple color buffers can be cleared simultaneously by selecting more than one buffer at a time using glDrawBuffer. glVertex2f(x,y): This function is used to draw a vertex at location x,y. glEnable(GLenum): This function is used to enable the various functionalities like enabling the light, enabling the Z buffer. glDisable(GLenum): This function is used to disable the various functionalities like enabling the light, enabling the Z buffer. glRectf(x0,y0,x1,y1): This function is used to draw rectangle using the two diagonal points.
  • 8. Graphics Editor DEPARTMENT OF CSE,BNMIT 8 glClearColor(R,G,B,A):glClearColor specifies the red, green, blue, and alpha values used by glClear to clear the color buffers. Values specified by glClearColor are clamped to the range 0 to1 . glMaterialfv(GLenum,GLenum,GLfloat *): glMaterial assigns values to material parameters. There are two matched sets of material parameters. One, the front-facing set, is used to shade points, lines, bitmaps, and all polygons (when two-sided lighting is disabled), or just front-facing polygons (when two-sided lighting is enabled). glutSolidTeapot(size): glutSolidTeapot and glutWireTeapot render a solid or wireframe teapot respectively. Both surface normals and texture coordinates for the teapot are generated. The teapot is generated with OpenGL evaluators glutSolidCube(size): glutSolidCube and glutWireCube render a solid or wireframe cube respectively. The cube is centered at the modeling coordinate’s origin with sides of length size. glutDisplayFunc(void (*func)()): glutDisplayFunc sets the display callback for the current window. When GLUT determines that the normal plane for the window needs to be redisplayed, the display callback for the window is called. Before the callback, the current window is set to the window needing to be redisplayed and (if no overlay display callback is registered) the layer in use is set to the normal plane. The display callback is called with no parameters. glutKeyboardFunc(void (*func)(unsigned char key, int x, int y)): glutKeyboardFunc sets the keyboard callback for the current window. When a user types into the window, each key press generating an ASCII character will generate a keyboard callback. The key callback parameter is the generated ASCII character glutMouseFunc(void (*func)(int button, int state, int x, int y)): glutMouseFunc sets the mouse callback for the current window. When a user presses and releases mouse buttons in the window, each press and each release generates a mouse callback. The button parameter is one of GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON, or GLUT_RIGHT_BUTTON.
  • 9. Graphics Editor DEPARTMENT OF CSE,BNMIT 9 glutMotionFunc(void (*func)(int x, int y)): glutMotionFunc set the motion callback for the current window. The motion callback for a window is called when the mouse moves within the window while one or more mouse buttons are pressed. glutPassiveMotionFunc(void(*func)(int x, int y)): glutPassiveMotionFunc set the passive motion callback for the current window. The passive motion callback for a window is called when the mouse moves within the window while no mouse buttons are pressed. glMatrixMode(GLenum) mode: Specifies which matrix stack is the target for subsequent matrix operations. Values accepted are: GL_MODELVIEW, GL_PROJECTION.The initial value is GL_MODELVIEW. Additionally, if the ARB tension extension is supported, GL_COLOR is also accepted. gluPerspective(fovy, aspect, near, far): gluPerspective specifies a viewing frustum into the world coordinate system. In general, the aspect ratio in gluPerspective should match the aspect ratio of the associated viewport. For example, aspect = 2.0means the viewer's angle of view is twice as wide in x as it is in y. glOrtho(left, right, top, bottom, Znear, Zfar): glOrtho describes a transformation that produces a parallel projection. The current matrix is multiplied by this matrix and the result replaces the current matrix. 3.3Description of User-defined functions Various user-defined functions used are: void drawstring(float x, float y, float z, char *string): Used to display text. void drawpoint(int x, int y): Used to draw point. void paint(int x, int y): Used for PAINT BRUSH function.
  • 10. Graphics Editor DEPARTMENT OF CSE,BNMIT 10 void eraser(int x, int y): Used for ERASER function. void reset(): It resets the variables in which vertices are stored, after a polygon is drawn. void draw_pixel(GLfloat x, GLfloat y): It’s used to draw the points of a circle. void draw_circle(GLfloat p, GLfloat q, GLfloat r): It’s used to draw a CIRCLE using MIDPOINT CIRCLE DRAWING algorithm void draw_circle1(GLfloat p, GLfloat q, GLfloat r): It’s used to draw the circle option on the tool bar. void edgedetect(float x1, float y1, float x2, float y2, int *le, int *re): It’s used to detect edges of the polygon to be filled. void scanfill(GLint num1, GLint num2): It’s used to FILL a Polygon using SCAN LINE ALGORITHM. void detect_point(GLint num1, GLint num2, int x, int y): It’s used to detect which POLYGON TO BE FILLED. void display(void): It’s user-defined DISPLAY function. void keys(unsigned char key, int x, int y): It’s used to get FILENAME from the KEYBOARD. void divide_trinagle(GLfloat *a, GLfloat *b, GLfloat *c, int k): It’s used for drawing the 2D Sierpinski gasket. void tetra(GLfloat *a, GLfloat * b, GLfloat * c, GLfloat * d): It’s used in drawing 3D Sierpinski gasket.
  • 11. Graphics Editor DEPARTMENT OF CSE,BNMIT 11 void divide_tetra(GLfloat * a, GLfloat * b, GLfloat * c, GLfloat * d, int m): It’s used in drawing 3D Sierpinski gasket. void myMouse(int btn, int state, int x, int y): It’s used to handle all the mouse events. void myReshape(GLsizei w, GLsizei h): It’s user defined RESHAPE FUNCTION. void point_size(int id): Used to change the pixel size.
  • 12. Graphics Editor DEPARTMENT OF CSE,BNMIT 12 CHAPTER 4 IMPLEMENTATION 4.1 drawstring() : /* to display text */ void drawstring(float x, float y, float z, char *string) { /* position the string at x,y,z location */ /* display it on output screen using standard glut API */ } 4.2 setFont(): void setFont(void *font) { /* sets the current font */ } 4.3 drawpoint: /* to draw point */ void drawpoint(int x, int y) { /* set y = window height- y position */ if (within the viewport) { /* display the point and flush */ } } 4.4 paint:
  • 13. Graphics Editor DEPARTMENT OF CSE,BNMIT 13 /* PAINT BRUSH function */ void paint(int x, int y) { /*set y = window height- y position */ if (within the viewport) { /* paint the x,y position */ } } 4.5 Eraser(): /* ERASER function */ void eraser(int x, int y) { /* set y = window height- y position */ /* set the eraser color to the background color */ if (within the viewport) { /* erase the x,y position by drawing a rectangle */ } } 4.6 palette(): /* to draw the COLOR PALETTE */ void palette(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) { /* Draw the Color Palette */ }
  • 14. Graphics Editor DEPARTMENT OF CSE,BNMIT 14 4.7 draw_pixel(GLfloat, GLfloat): /*to draw the points of a circle */ void draw_pixel(GLfloat x, GLfloat y) { if (within the viewport) { if (fill is TRUE) /* set point size to 3 */ else /* set pointsize as specified in size value */ /* start drawing the points */ } } 4.8 plotpixels(GLfloat, GLfloat, GLfloat): /* To plot the pixels */ void plotpixels(GLfloat p, GLfloat q, GLfloat x, GLfloat y) { /* start drawing the points */ } 4.9 draw_circle(GLfloat, GLfloat, GLfloat): /* to draw a CIRCLE using MIDPOINT CIRCLE DRAWING algorithm */ void draw_circle(GLfloat p, GLfloat q, GLfloat r) { while (y is greater than x) { /* call plotpixels function */ if (d is lesser than 0)
  • 15. Graphics Editor DEPARTMENT OF CSE,BNMIT 15 /* increment d by 2*x+3 */ else { /* increment d by 2*(x-y) +5 */ /* pre-decrement y by 1 */ } /* pre-increment x by 1 */ } /* call plotpixels function */ } 4.10 draw_pixell(GLfloat, GLfloat): void draw_pixel1(GLfloat x, GLfloat y) { /* draw a point */ } 4.10 plotpixels1(GLfloat, GLfloat, GLfloat, GLfloat): /* to draw the circle option on the tool bar */ void plotpixels1(GLfloat p, GLfloat q, GLfloat x, GLfloat y) { /* call this function to draw the circle option on the tool bar */ } 4.11 edgedetect: /* to detect edges of the polygon to be filled */ void edgedetect(float x1, float y1, float x2, float y2, int *le, int *re) { float mx, x, temp;
  • 16. Graphics Editor DEPARTMENT OF CSE,BNMIT 16 if ((y2 - y1)<0) { temp = y1; y1 = y2; y2 = temp; temp = x1; x1 = x2; x2 = temp; } if ((y2 - y1) != 0) mx = (x2 - x1) / (y2 - y1); else mx = x2 - x1; x = x1; for (i = y1; i <= y2; i++) { if (x<(float)le[i]) le[i] = (int)x; if (x>(float)re[i]) re[i] = (int)x; x += mx; } } 4.12 scanfill: /* to FILL a Polygon using SCAN LINE ALGORITHM*/ void scanfill(GLint num1, GLint num2) { int le[1000], re[1000];
  • 17. Graphics Editor DEPARTMENT OF CSE,BNMIT 17 int p, q; int bottom, top; for (p = 0; p<wh; p++) { le[p] = ww; re[p] = 0; } for (p = num1; p<num2; p++) { edgedetect(a[p][0], a[p][1], a[p + 1][0], a[p + 1][1], le, re); } edgedetect(a[num2][0], a[num2][1], a[num1][0], a[num1][1], le, re); for (q = 0; q<wh; q++) le[q] = le[q] + 1; bottom = 0; while (re[bottom]<le[bottom]) bottom++; bottom++; top = wh - 1; while (re[top]<le[top]) top--; for (q = bottom; q<top; q++) { if (le[q] <= re[q]) { for (p = (int)le[q]; p<(int)re[q]; p++) draw_pixel(p, q); } } }
  • 18. Graphics Editor DEPARTMENT OF CSE,BNMIT 18 4.13 detect_point: /* to detect which POLYGON TO BE FILLED */ void detect_point(GLint num1, GLint num2, int x, int y) { int le[1000], re[1000]; int p, q; for (p = 0; p<wh; p++) { le[p] = ww; re[p] = 0; } for (p = num1; p<num2; p++) { edgedetect(a[p][0], a[p][1], a[p + 1][0], a[p + 1][1], le, re); } edgedetect(a[num2][0], a[num2][1], a[num1][0], a[num1][1], le, re); for (q = 0; q<wh; q++) { if (le[q] <= re[q]) { for (p = (int)le[q]; p<(int)re[q]; p++) { if (x == p && y == q) flag = num1; } } } }
  • 19. Graphics Editor DEPARTMENT OF CSE,BNMIT 19 4.14 keys: /* to get FILENAME from the KEYBOARD */ void keys(unsigned char key, int x, int y) { if (key is a character) { /* save the character in an array */ /* display the character at specified location */ /* increase textx by 10 */ /* post increment s by 1 */ } /* to SAVE current image on a file */ if (‘Enter’ key is pressed & Save is TRUE) { /* append '0' to the end of array to make it a string */ /* Open a file in write mode and save the data in specified filename*/ /* re-initialize save to 0 */ /* re-initialize s to 0 */ } /* to open an existing file */ if (‘Enter’ key is pressed & Open is TRUE) { /* append '0' to the end of array to make it a string */ /* Open a file in Read mode and flush the data on output screen*/ /* re-initialize save to 0 */ /* re-initialize s to 0 */ } }
  • 20. Graphics Editor DEPARTMENT OF CSE,BNMIT 20 CHAPTER 5 RESULTS AND SNAPSHOTS Fig 1: Welcome Screen Fig 2: Default Layout of application
  • 21. Graphics Editor DEPARTMENT OF CSE,BNMIT 21 Fig 3: Application with yellow theme Fig 4: 3D-Sierpinski Gasket
  • 22. Graphics Editor DEPARTMENT OF CSE,BNMIT 22 Fig 5: 2D-Sierpinski gasket Fig 6: Application showing menu on right click
  • 23. Graphics Editor DEPARTMENT OF CSE,BNMIT 23 Fig 7: 2D-House Fig 8: Various free hand drawings
  • 24. Graphics Editor DEPARTMENT OF CSE,BNMIT 24 CHAPTER 6 CONCLUSION The project is well suited for designing 2D and 3D objects, as well as for carrying out basic graphics functionalities like drawing a simple line, creating a cube, circle, square, erasing and filling them. However, if implemented on large scale with sufficient resources, it has the potential to become a standard stand-alone GUI based application for Windows Operating System. Out of the many features available, the project demonstrates some popular and commonly used features of OpenGL such as Rendering, Transformation, Rotation, Lighting, Scaling etc. These graphic functions will also work in tandem with various rules involved in the game. Since this project works on dynamic values, it can be used for real time computation. The project enabled to work with mid-level. OpenGL complexity and the project demonstrates the scope of OpenGL platform as a premier game developing launch pad. Hence, it has indeed been useful in developing many games. OpenGL in its own right is good for low cost and simple game development. It serves as an important stepping stone for venturing into other fields of Computer Graphics design and applications.
  • 25. Graphics Editor DEPARTMENT OF CSE,BNMIT 25 CHAPTER 7 FUTURE ENHANCEMENTS In future versions of paint project, addition of some more in-built 2D and 3D models of geometric figures like cone, and pyramids, option to change line thickness, pick up color of line and various options to set light properties according to users’ requirements is a feasible idea. Making the User-interface of this program simpler and more user friendly will certainly help beginners in using this program more easily. The added functionality of giving information about an object on mouse hover over the object as well as ‘Undo’ and ‘Redo’ options will be also be a good choice. Perhaps the most challenging task will be to implement the functionality of ‘Layers’ which are used extensively by Professionals in graphics industry.
  • 26. Graphics Editor DEPARTMENT OF CSE,BNMIT 26 BIBLIOGRAPHY 1. Interactive Computer Graphics (a top down approach) by Edward Angel 2. OpenGL Programming Guide by Addison-Wesley Online Resources 1. www.opengl.org 2. www.cs.unm.edu/~angel 3. www.aw.com/cssupport