09-08-2012, 12:26 PM
GRAPHICS EDITOR USING OPEN GL
57919415-Project-Report-on-Graphics-Editor-Using-Open-Gl.pdf (Size: 2.17 MB / Downloads: 233)
INTRODUCTION ON OPEN GL
. OpenGL is an open specification for an applications program interface for defining 2D and 3D objects. The specification is cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. It renders 3D objects to the screen, providing the same set of instructions on different computers and graphics adapters. Thus it allows us to write an application that can create the same effects in any operating system using any OpenGL-adhering graphics adapter.
Computer graphics, a 3-dimensional primitive can be anything from a single point to an n-sided polygon. From the software standpoint, primitives utilize the basic 3-dimensional rasterization algorithms such as Bresenham's line drawing algorithm, polygon scan line fill, texture mapping and so forth. OpenGL's basic operation is to accept primitives such as points, lines and polygons, and convert them into pixels. This is done by a graphics pipeline known as the OpenGL state machine. Most OpenGL commands either issue primitives to the graphics pipeline, or configure how the pipeline processes these primitives.
OpenGL is a low-level, procedural API, requiring the programmer to dictate the exact steps required to render a scene. OpenGL's low-level design requires programmers to have a good knowledge of the graphics pipeline, but also gives a certain amount of freedom to implement novel rendering algorithms.
GLUT:
GLUT, short for OpenGL Utility Toolkit, is a set of support libraries available on every major platform. OpenGL does not directly support any form of windowing, menus, or input. That's where GLUT comes in. It provides basic functionality in all of those areas, while remaining platform independent, so that you can easily move GLUT-based applications from, for example, Windows to UNIX with few, if any, changes.
GLUT is easy to use and learn, and although it does not provide you with all the functionality the operating system offers, it works quite well for demos and simple applications.
The OpenGL Utility Library
The OpenGL Utility Library, or GLU, supplements OpenGL by providing higher-level functions. GLU offers features that range from simple wrappers around OpenGL functions to complex components supporting advanced rendering techniques.
Its features include:
2D image scaling
Rendering 3D objects including spheres, cylinders, and disks
Computer Graphics Editor using OpenGL
Automatic bitmap generation from a single image
Support for curves surfaces through NURBS
Support for tessellation of non-convex polygons
Special-purpose transformations and matrices
OpenGL API hierarchy under Windows systems.
Problem Statement:
The objective is to build a graphics editor having all required operations that a normal graphics editor should offer. The coding is implemented for a single canvas graphics editor. In this editor importance is given to a simple user interface and implementation of all basic graphic routines and basic graphic editing options.
The basic requirements of the graphics editor were analysed to be:
1. User Interface- The presentation of the graphics editor is crucial to its acceptance by its users. The package should provide easy selection and implementation of the features through iconic interfaces.
2. Color Selection - To select a suitable color for drawing the primitives. The editor implements support for drawing various shapes mentioned above. The implementation is done using the graphics scan conversion algorithm.
3. Graphics Drawing – To draw basic primitives like line, circle, ellipse, rectangle on the canvas and to use tools like pencil, flood filling, eraser, copy, cut, paste etc. to manipulate the image.
Line: line is drawn by selecting two points start point and the end point. The start point begins with mouse click and end point is the point where mouse button is released.
Circle: Circle is drawn by selecting a point and dragging thereafter till the desired radius.
Text: selecting the text icon and thereafter entering the text from keyboard
Rectangle: rectangle is drawn by selecting a start point and dragging to end point of required size.
Freehand Drawing: a freehand drawing is the one in which wherever mouse is dragged pixels are plotted