0% found this document useful (0 votes)
69 views8 pages

Neel Sanjay Bhatt SE Computer A Roll No:-07

This document discusses computer graphics and basic OpenGL functions to draw primitives. It begins with an introduction to OpenGL, describing it as a software interface to render 2D and 3D objects. It then discusses the basic OpenGL operations: primitive specification and mode setting via function calls, per-vertex operations and primitive assembly, rasterization, and per-fragment operations to produce pixels in the framebuffer. A block diagram illustrates the OpenGL processing pipeline. The document concludes with a sample program using OpenGL commands to draw basic primitives and its output.

Uploaded by

piyush
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views8 pages

Neel Sanjay Bhatt SE Computer A Roll No:-07

This document discusses computer graphics and basic OpenGL functions to draw primitives. It begins with an introduction to OpenGL, describing it as a software interface to render 2D and 3D objects. It then discusses the basic OpenGL operations: primitive specification and mode setting via function calls, per-vertex operations and primitive assembly, rasterization, and per-fragment operations to produce pixels in the framebuffer. A block diagram illustrates the OpenGL processing pipeline. The document concludes with a sample program using OpenGL commands to draw basic primitives and its output.

Uploaded by

piyush
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Neel Sanjay Bhatt

SE Computer A
Roll No:- 07

EXPERIMENT NO.1

CASE STUDY 1

Aim:To Study Computer Graphics, Application, Input And Output Devices, Advantages &
Disadvantages.

➢ COMPUTER GRAPHICS:-
1. Creation, Manipulation and Storage of geometric objects (modeling) & their images
(rendering)
2. Display those images on screens or hardcopy devices
3. It is an art of drawing images, lines, charts, and other visuals on the computer screens with
the help of programming.
4. The visuals/images on the computer screens are made up of numerous pixels. A pixel is a dot
or square on the computer screen, it is the smallest unit of graphic that is displayed on the
computer screen. The number of individual non-overlapping pixels contained on a computer
screen is called Resolution.
5. Now we know what is computer graphics lets know about its applications

➢ APPLICATION OF COMPUTER GRAPHICS:-

Applications area are as follows-

➔ Computer Aided Design (CAD):


Designing of buildings, automobile, aircraft is done with the help of computer aided drawing, this
helps in providing minute details to the drawing and producing more accurate and sharp drawings
with better specifications.
➔ Presentation Graphics:
For the preparation of reports or summarising the financial, statistical, mathematical, scientific,
economic data for research reports, managerial reports, moreover creation of bar graphs, pie charts,
time chart, can be done using the tools present in computer graphics.

➔ Computer Art:
Using computer graphics we can create fine and commercial art which include animation packages,
paint packages. These packages provide facilities for designing object shapes and specifying object
motion. Cartoon drawing, paintings, logo design can also be done.

➔ Entertainment :
Computer graphics finds a major part of its utility in the movie industry and game industry. Used for
creating motion pictures , music video, television shows, cartoon animation films. In the game
industry where focus and interactivity are the key players, computer graphics helps in providing such
features in the efficient way.
➔ Education & Training:
Computer generated models are extremely useful for teaching huge number of concepts and
fundamentals in an easy to understand and learn manner. Using computer graphics many
educational models can be created through which more interest can be generated among the
students regarding the subject.

Fig: Specialized systems used for training applications

➔ Graphical user Interfaces: Nowadays all operating systems provide graphical interfaces. They
contain a number of windows. User can interact with the computer system by making some
clicks instead of typing commands

➔ Visualization (scientific & business)


➔ Image Processing

➢ INPUT AND OUTPUT DEVICES:-


The Input Devices are the hardware that is used to transfer transfers input to the computer. The data
can be in the form of text, graphics, sound, and text. Output device display data from the memory of
the computer. Output can be text, numeric data, line, polygon, and other objects.

Input Devices:
1. Keyboards, button boxes, and dials
2. Mouse devices
3. Trackballs (2D) which can be rotated and spaceballs (3D) that use the amount of pressure
applied
4. Joysticks
5. Data gloves
6. Digitizers (e.g. graphics tablets) for drawing, painting, or interactively selecting positions
7. Image scanners
8. Touch panels
9. Light pens
10. Voice systems

Output Devices:
1. Printers
2. Plotters

➢ ADVANTAGES:-
i. Higher Quality
ii. More precise results or products
iii. Greater Productivity
iv. Lower analysis and design cost
v. Significantly enhances our ability to understand data and to perceive trends.

➢ DISADVANTAGES:-
1. It is not easy to create effective CG(computer graphics).
2. Lot of resources are involved in CG creation,it make's cost very high, and it take's more time
to create
3. The designer has to figure out a way of obtaining the relevant results while maintaining the
objective of the design process.

➢ CONCLUSION:-
The term computer graphics has been used in a broad sense to describe "almost everything
on computers that is not text or sound.
Hence, we successfully studied about Computer Graphics, Application, Input And Output
Devices,Advantages & Disadvantages.

Neel Sanjay Bhatt


Roll No:-07
SE computer A
EXPERIMENT NO.1

CASE STUDY 2
Aim:To study and apply basic OpenGl function to draw basic primitives
1. Introduction to OpenGL
As a software interface for graphics hardware, OpenGL's main purpose is to render two- and three-
dimensional objects into a frame buffer. These objects are described as sequences of vertices
(which define geometric objects) or pixels (which define images). OpenGL performs several
processing steps on this data to convert it to pixels to form the final desired image in the frame
buffer.
This chapter presents a global view of how OpenGL works; it contains the following major sections:
 "OpenGL Fundamentals" briefly explains basic OpenGL concepts, such as what a graphic
primitive is and how OpenGL implements a client-server execution model.
 "Basic OpenGL Operation" gives a high-level description of how OpenGL processes data and
produces a corresponding image in the frame buffer.

2.Primitives and Commands

 OpenGL draws primitives—points, line segments, or


polygons—subject to several selectable modes. You can control modes independently of
each other; that is, setting one mode doesn't affect whether other modes are set (although
many modes may interact to determine what eventually ends up in the frame buffer).
Primitives are specified, modes are set, and other OpenGL operations are described by
issuing commands in the form of function calls.
 Primitives are defined by a group of one or more vertices. A vertex defines a point, an
endpoint of a line, or a corner of a polygon where two edges meet. Data (consisting of vertex
coordinates, colors, normals, texture coordinates, and edge flags) is associated with a vertex,
and each vertex and its associated data are processed independently, in order, and in the
same way. The only exception to this rule is if the group of vertices must be clipped so that a
particular primitive fits within a specified region; in this case, vertex data may be modified
and new vertices created. The type of clipping depends on which primitive the group of
vertices represents.
3.Basic OpenGL Operation
The processing stages in basic OpenGL operation are as follows:
Display list
• Rather than having all commands proceed immediately through the pipeline, you can choose
to accumulate some of them in a display list for processing later.
Evaluator
• The evaluator stage of processing provides an efficient way to approximate curve and surface
geometry by evaluating polynomial commands of input values.
Per-vertex operations and primitive assembly
• OpenGL processes geometric primitivespoints, line segments, and polygonsall of which are
described by vertices. Vertices are transformed and lit, and primitives are clipped to the
viewport in preparation for rasterization.
Rasterization
• The rasterization stage produces a series of frame-buffer addresses and associated values
using a two-dimensional description of a point, line segment, or polygon. Each fragment so
produced is fed into the last stage, per-fragment operations.
Per-fragment operations
• These are the final operations performed on the data before it is stored as pixels in the
framebuffer.
• Per-fragment operations include conditional updates to the framebuffer based on incoming
and previously stored z values (for z buffering) and blending of incoming pixel colors with
stored colors, as well as masking and other logical operations on pixel values.
• Data can be input in the form of pixels rather than vertices. Data in the form of pixels, such as
might describe an image for use in texture mapping, skips the first stage of processing
described above and instead is processed as pixels, in the pixel operations stage. Following
pixel operations, the pixel data is either:
 Stored as texture memory, for use in the rasterization stage.
 Rasterized, with the resulting fragments merged into the framebuffer just as if they
were generated from geometric data.

4.Block Diagram of Open GL :-

The following diagram illustrates how OpenGL processes data. As shown, commands enter from the
left and proceed through a processing pipeline. Some commands specify geometric objects to be
drawn, and others control how the objects are handled during various processing stages.
5. Program using OpenGL Commands to draw Basic primitive along with output :-

#include <windows.h>
#include <GL/glut.h>

void display() {
glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set background color to black and opaque
glClear(GL_COLOR_BUFFER_BIT); // Clear the color buffer

// Draw a Red 1x1 Square centered at origin


glBegin(GL_QUADS); // Each set of 4 vertices form a quad
glColor3f(1.0f, 0.0f, 0.0f); // Red
glVertex2f(-0.5f, -0.5f); // x, y
glVertex2f( 0.5f, -0.5f);
glVertex2f( 0.5f, 0.5f);
glVertex2f(-0.5f, 0.5f);
glEnd();

glFlush(); // Render now


}

/* Main function: GLUT runs as a console application starting at main() */

int main(int argc, char** argv) {


glutInit(&argc, argv); // Initialize GLUT
glutCreateWindow("OpenGL Setup Test"); // Create a window with the given title
glutInitWindowSize(320, 320); // Set the window's initial width & height
glutInitWindowPosition(50, 50); // Position the window's initial top-left corner
glutDisplayFunc(display); // Register display callback handler for window re-paint
glutMainLoop(); // Enter the infinitely event-processing loop
return 0;
}

OUTPUT :-
CONCLUSION:
Hence, we have studied Basic Open GL Operations and performed a Program in C language
using Open GL library.

You might also like