Professional Documents
Culture Documents
UNIT 4 Computer Graphics
UNIT 4 Computer Graphics
Structure
1.1 Introduction
Objectives
1.1 Introduction
The Graphics software is a collection of programs written to make it convenient for user
a user to operate the computer the computer graphic system. It includes programs to
generate images on the CRT screen, to manipulate the images and to accomplish
various types of interaction between the user and system. The Graphics software for a
particular computer graphics system is very much function of the type of hardware used
in the system. The software must be written specifically for the type of CRT and the
types of CRT and the types of input devices used in the system. The details of the
software for a stroke- writing CRT would be different than for raster scan CRT. The
differences between a storage tube and a refresh a tube would also influence the
graphics software.
The Newman and Sproull Ground Rules that should be considered in designing
graphics software:
OBJECTIVES
In the operation of the graphic system by the user, a variety of activities take place,
which can be divided in to three categories:
• Interact with the graphics terminal to create and alter images on the screen.
• To construct a model of something physical out of the images on the screen. The
models are sometimes called application models.
• Enter the model in to computer memory and / or secondary storage.
In working of Graphics System the user performs the various activities in combination
rather than sequentially.The user performs these various activities in combination rather
than sequentially. The user constructs a physical model and inputs it to memory by
interactively describing images to the system. The reason for separating these activities
in this fashion is that they correspond to the general configuration of the software
package used with the interactive computer graphics system. The graphics software
can be divided in to these modules according to conceptual model defined by Foley and
Van Dam.
The graphic package must perform a variety of different functions. It can be grouped in
to set of functions. Each set of functions accomplishes a certain kind of interaction
between the user and the system. The functions of graphic package are
A graphic element in computer graphics is a basic image entity such as a dot, line
segment, circle and so on. The collection of elements in the system could also include
alphanumeric characters and special symbols. There is often a special hardware
component in the graphics system associated with the display of many elements. This
speeds up the process of generating the element. The user can construct the
application model out of collection of elements available in the system.
The term ‘primitive’ is often used in reference to graphic elements. The use of this term
to three-dimensional graphics construction. Accordingly, a primitive is a three –
dimensional graphics element such as a sphere, cube, or cylinder. In a three-
dimensional wire-frame models and solid modeling, primitives are used a building
blocks to construct the three-dimensional model of particular object of interest to user.
1.3.2 Transformations:
Transformations are used to change the image on the display screen and to reposition
the item in the data base. Transformations are applied to the graphic elements in order
to aid the user in constructing an application model. The transformations include
enlargement and reduction of the image by a process called scaling, repositioning of the
image or translation and rotation.
The function set provides the user with the ability to view the image from the desired
angle and at the desired magnification. In effect, it makes use of various transformations
to display the application model the way the user wants it shown. This is some times
referred to us windowing functions because the graphics screen is like a window being
used to observe the graphics model. The notion is that the window can be placed
wherever desired in order to look at the object being modeled.
Another aspect of display control is hidden line removal. In the most graphic system, the
image is made of lines used to represent a particular project. Hidden line removal is the
procedure by which the image is divided into is visible and invisible lines. In some
systems, the user must identify which lines are invisible so that they can be removed
from the image to make it more understandable. In other systems, the graphics package
is sufficiently sophisticated to remove the hidden lines remove from the picture
automatically.
The segmenting functions provide users with the capability to selectively replace,
delete, or otherwise modify portions of the image. The term segment refers to a
particular portion of the image which has been identified for the purposes of modifying it.
The segment may define a single element or logical grouping elements that can be
modified as a unit.
Storage –type CRT Tubes are unsuited to segmenting functions. To delete or modify a
portion of the image on a storage tube requires erasing entire pictures and redrawing it
with the changes incorporated. Raster Scan refresh tubes are ideally suited to
segmenting functions because the screen is automatically redrawn 30 or more times per
second. The image is regenerated each cycle from a display file, a file used for storage
that is part of hard ware in the raster scan CRT. The segment can readily defined as a
portion of the file would then be deleted or altered to execute the particular segmenting
functions.
The user input functions constitute a critical set of functions in the graphic package
because they permit the operator to the enter commands or data to the system. The
entry is accomplished by means of operator input devices. The user input functions, be
written specifically for the particular compliment of input devices used on the system.
The extent to which the user input functions are well designed has to significant effect
on how friendly the system is to the user, that is how easy it is work on the system.
The input functions should be written to maximize the benefits of the interactive feature
of ICG. The software design compromise is to find optimum balance between providing
enough functions to conveniently cover all data entry situations without inundating the
user with so many commands that they cannot be remembered. One of the goals that
are sought after by software designers with little or no programming experience can
function effectively on the system.
1.4 Transformation
The transformation actually converts the geometry from one coordinate system to
theother coordinate system. By means of the transformation, the images can be
enlarged insize or reduced, rotated or moved on the screen. It plays a central role in
modelconstruction and viewing the image.
• Translation.
• Scaling.
• Rotation.
1.5.1 Translation
Pꞌ = [Xꞌ,Yꞌ]
Xꞌ = X+Tx
Yꞌ=Y+Ty
Pꞌ = [ X + T x , Y + T y ]
= [ X Y ] + [T x T y ]
1 0 0
[Pꞌ] = [XꞌYꞌ1]=[X Y 1] 0 1 0
TxTy 1
Pꞌ =P.T
For 3 D Translation
xꞌ = x + tyꞌ yꞌ = y + tyꞌ zꞌ = z + tz
Pꞌ=Tt• P Tt = transformation matrix for translation
1.5.2 Scaling
Figure 3 Scaling
The new co-ordinates after scaling are given by the following equations
Sx 0
0 Sy
For example, figure 4 shows a triangle to be scaled before scaling. Figure shows the
same triangle after scaling. Here, all coordinates of the entity are multiplied by scaling
matrix. Therefore, it is enlarged two times the original one.
Figure 4 Scaling
For 3 D Scaling
Pꞌ=Ts• P
1.5.3 Rotation
Pꞌ = [Xꞌ, Yꞌ]
X= r cos
y= r sin
Xꞌ = r cos(+)
= r cos cos -r sin sin
=x cos-y sin
Y'= r sin ( + )
= r sin cos +r cos sin
= x sin + y cos
Figure 5: Rotation
For 3 D Rotation
xꞌ = x cos − y sin
yꞌ = x sin + y cos
zꞌ =z
Pꞌ=Tr• P
Tr= Transformation matrix for rotation
The same effect can be achieved using the concatenated matrix or overall
transformation given below.
SAQ 1:
(a) Explain the software configuration of the system with suitable Block diagram.
1.7 SUMMARY
This unit covers the construction and working of the software configuration of the
system. The software configuration system which includes Graphic Package,
Application Programme, Application Data Base and Application Data base and also in
this unit describe the Function of graphic package which include, Generation of graphic
elements, Transformations, Display control and windowing functions, Segmenting
functions, User input functions. The various basic geometric 2D and 3D transformations
such as Translation, Scaling and Rotation are described in this unit.