0 ratings0% found this document useful (0 votes) 92 views91 pagesComputer Graphics
computer graphics solved paper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Computer-Graphics
Section-A (1-Marks)
1.)
(a)What is Raster Scan Display?
Ans- Raster Scan Displays :- Raster Scan
Displays are most common type of
graphics monitor which employs CRT. It is
based on television technology. In raster
scan system electron beam sweeps
across the screen, from top to bottom
covering one row at a time.
(b)Define Aspect Ratio?
Ans- Aspect Ratio :-An aspect ratio
describes the width and height of a screen
or image. An aspect ratio consists of two
numbers separated by a colon, the first
number denoting the image's width and
the second its height. For example, an
aspect ratio of 1.33:1 means the image's
width is 1.33 times the size of its height.(c)Explain lookup Table?
Ans- Lookup Table :-In computer
graphics, lookup tables are used to store
the starting addresses of each line and
the values corresponding to the
placement of pixels within a byte.
2.)
(a)Explain Coordinate System?
Ans- Coordinate System:- A
mathematical point (x,y) where x and y are
real number with in a image area,need to
be scan converted to a pixel at
location(x’,y').
OR
Ans:-A coordinate system is a method for
identifying the location of a point on the
earth. Most coordinate systems use two
numbers, a coordinate, to identify the
location of a point. Each of these numbers
indicates the distance between the point
and some fixed reference point, called the
origin.(b)Explain Loading Frame Buffer?
Ans- Loading Frame Buffer:- A
framebuffer (frame buffer, or sometimes
framestore) is a portion of random-access
memory (RAM) containing a bitmap that
drives a video display. It is a memory
buffer containing data representing all the
pixels in a complete video frame. Modern
video cards contain framebuffer circuitry
in their cores.
(c)Define line Drawing Method?
Ans- line Drawing Method:- In computer
graphics, a line drawing algorithm is an
algorithm for approximating a line
segment on discrete graphical media,
such as pixel-based displays and printers.
On such media, line drawing requires an
approximation. Basic algorithms rasterize
lines in one color.3.)
(a)Define Translation in 2D?
Ans- Translation:- 2D Translation is a
process of moving an object from one
position to another in a two dimensional
plane. Consider a point object '0' has to be
moved from one position to another ina
2D plane. Let- Initial coordinates of the
object '0'(X,Y). New coordinates of the
object O after translation(X',Y’).
(b)Explain line clipping?
Ans- Line Clipping:- In computer
graphics, line clipping is the process of
removing (clipping) lines or portions of
lines outside an area of interest (a
viewport or view volume). Typically, any
part of a line which is outside of the
viewing area is removed.(c)Define point clipping?
Ans- Point Clipping:- Point clipping tells
us whether the given point X,Y is within
the given window or not; and decides
whether we will use the minimum and
maximum coordinates of the window. The
X-coordinate of the given point is inside
the window, if X lies in between Wx1 < X =
Wx2..
4.)
(a)What is window and Viewport?
Ans- Window and Viewport:- Window -It
is the area on the world coordinate
selected for display.
ViewPort —It is the area on the device
coordinate where graphics is to be
displayed.
(b)Define Clipping?
Ans- Clipping:- Clipping is the process to
cut off the part of the image which is
outside the window.(c)Define Zooming?
Ans- Zooming:- It is also known as
Nearest neighbor interpolation.Zooming
simply means enlarging a picture ina
sense that the details in the image
became more visible and clear.Zoom lets
you look closer (zoom in) or further away
(zoom out),
Section-B (3-Marks)
Q-5.)Explain working of CRT in detail?
Ans- CRT :-CRT Stand for Cathode Ray
Tube.It is a technology used in traditional
computer monitors and televisions. The
image on CRT display is created by firing
electrons from the back of the tube of
phosphorous located toward the front of
the screen.diagram:-
. fot! “4 Avie
~~
=] _— Phsehar
Coated
G aoe Satten.
Bin Caden
qe
Gort pcelordiy
qn Ards. Pegaelc dPtodon
Gi)
Working :-A cathode ray tube (CRT) is a
specialized vacuum tube in which images
are produced when an electron beam
strikes a phosphorescent surface. It
modulates, accelerates, and deflects
electron beam(s) onto the screen to
create the images. Most desktop
computer displays make use of CRT for
image-displaying purposes.
sa WA SA 4A SS SeQ-6.) Explain Line drawing algorithm ?
Ans- Line Drawing Algorithm :-The Line
Drawing Algorithm is a graphical
algorithm for representing line segments
on discrete graphical media, such as
printers and pixel-based media.
The Simple line drawing equation:
Y=mx+b
Algorithm :-
Step:-1)Given variable X ; ,X 2,¥71,Y2.
Where (X ; ,Y 1 ) and (X 2 ,Y 2 ) are
coordinates of the line.
Step:-2)Calculate M=Y 9 -Y ; /X2-X1,
where dy=Y 2 -Y 7 and dx=X 9 -X 1,
Therefore, M=dx/dy
Step:-3)Calculate b=Y ; -M*X 4Step:-4)Set(x,y)equal to starting point i.e
lowest point and Xend to largest value of
xX.
if(dx < 0)
then
X=X 2
Y=Y 9
Xend=X
if(dx>0)
then, X=X 4
Y=Y 1
X end =X 2
Step:-5)Check whether the complete line
has been drawn if X=Xend stop.
Step:-6)Plot a point at current(X,Y)
coordinates.
Step:-7)Increment value of X i.e; X=X+1
Step:-8)compute next value of Y for
equation:- Y=mx+b
Step:-9)Goto step-5 until X=X eng -Q-7.)Explain Matrix representation and
homogeneous coordinate?
Ans- Matrix Representation :-Matrix
representation is a method used by a
computer language to store matrices of
more than one dimension in memory.
Fortran and C use different schemes for
their native arrays. Fortran uses 'Column
Major’ in which all the elements for a
given column are stored contiguously in
memory.
Homogeneous Coordinate :-
Homogeneous coordinate systems mean
expressing each coordinate as a
homogeneous coordinate to represent all
geometric transformation equations as
matrix multiplication.
The transformed matrix can be expressed
in general matrix form:-
P'=M1.P+M2Q-8.)Explain liang-Barsky line clipping in
detail?
Ans- Liang-Barsky line clipping:- Liang
and barsky introduced a line clipping in
the year 1984.It is basically extension of
cyrus and Reck work. This algorithm is
faster than Cohen Sutherland algorithm.
The following concepts are used in this
clipping:-
1.)Parametric Equation of line:-
XW min <=X 1 tUAX<=XW max
YW min <=Y 1 +uAY<=YW max
2.)Inequalities describing the range of the
clipping window which is used to
determine the intersection between the
line and the clipping window.
-uAX<=X 74 -XW min (Left Boundary of
Clipping window)
uAX<=XW max -X 1 (Right Boundary of
Clipping window)
-uAY<=Y 1 -YW max (Bottom Boundary
of Clipping window)
uAY<=YW max -Y 1 (Top Boundary of
Clipping window)Section-C (6-Marks)
Q-9.)Explain Random scan Display in
detail?
Ans- Random scan Display :-To draw
picture or image in random scan use CRT
technology. The random sean is a
technique in which the display is
constructed through an electron beam,
which is directed only to the specific
areas of the screen where the image is to
be drawn.
->The picture is constructed out of a
sequence of straight line segments.
->Each line of segments is drawn on the
screen by directing the beam to move
from one point to the next point on the
screen where its x and y coordinates
define each point.forte d Tater SGn dyPlos
Bore Boater, San aut
Gf
->In random scan or image are formed
with the help and short lines.
->In random scan electron beam is
deflected from end point to end point that
is why it is called vectored display.
->Phosphor has short persistance-delays
in 10-100 us.
->Persistence-delays means the amount
of time over which Phosphor emits light
after the electron beam is withdrawn.
->Due to short persistence day picture in
random scan must be re-drawn.
->In random scan display must be
refreshed at regular interval-minimum of
30Hz(FPS) for sticker-free display.OR
Q-)What is computer graphics and
explain its application?
Ans- Computer Graphics :-Computer
graphics is a field which deals with picture
and images.
->Computer graphics is the use of
hardware and software to
create,manipulate and present picture and
images.
->Computer graphics is a pictorial
representation and manipulation of data
by a computer.
Application of Computer Graphics:-
1.) 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.
2.) Advertisement :-The advertising
comes in various forms such as copy,
videos, and promotion through multiple
mediums, namely newspapers,
televisions, internet, radio, trade journals,
billboards, or movie theatres.3.) Simulation Modelling :-A computer
simulation model is a computer program
or algorithm which simulates changes of a
modeled system in response to input
signals.
4.) Architecture :-Computer architecture
is the organisation of the components
which make up a computer system and
the meaning of the operations which
guide its function.
5.) Virtual Reality :-Virtual reality(VR) is
special kind of graphical user interface
which presents a computer-generated
immersive, three-dimensional, interactive
environment that is accessed and
manipulated using, for instance, stereo
headphones, head-mounted stereo
television goggles, and data-gloves.
6.) Image Processing :-Image processing
is a method to perform some operations
on an image, in order to get an enhanced
image or to extract some useful
information from it.
7.) Miscellaneous :-Miscellaneous
functions perform a variety of operations
and return specific information or values.Q-10.)Explain Bresenham line drawing
algorithm?
Ans- Bresenham Line Drawing
Algorithm :-This algorithm is used to draw
a line on computer or display screen it
was developed by Bresenham.It replace
DDA algorithm for line drawing because
DDA use floating point
addition,subtraction,multiplication and
division in order to draw a line which is
time consuming.
->Bresenham line drawing algorithm use
only integer addition,subtraction and
multiplication.
->In Bresenham algorithm is also make
decision which next pixel will be selected.
->In Bresenham next pixel is selected
based on the least distance from true line.
->When we draw line slope less than one
i.e; M <1 .X is always incrementing but y
will be remain same.
oem
fHAlgorithm :-
Bresenham algo(X 7 ,Y 1,X2,Y2)
{
dx=X 9 -X 7 ,dy=Y2-Y4
P=2dy-dx
X=X 71 ,Y=¥ 1 .X end =X 2
set pixel(X,Y)
while(X<=X ong )
{
X=X+1
if(P < 0)
{
P=P+2dy
}
else
{
P=P+2dy-2dx
Y=Y+1
}
set pixel(X,Y)
}
}
ORQ-)Explain Symmetric DDA line drawing
algorithm?
Ans- Symmetric DDA line drawing
algorithm :-The Digital Differential
Analyzer (DDA) generates lines from their
differential equations. The equation of a
straight line is. The DDA works on the
principle that we simultaneously
increment x and y by small steps
proportional to the first derivatives of x
and y.
Algorithm Steps :-
Symmetrical DDA(X 1 ,Y 1X 2,Y 2)
{
X,Y,X ine sY ine »X end
length,dx,dy,k;
dx=X 2 -X 1
dy=Y 2 -Yj
if(abs(dx)>abs(dy))
{
length=abs(dx)
}else
{
length=abs(dy)
}
21 <=length<2"
X inc =dx/2"
Y inc =dy/2 "
X=X 15 Y=Y 1
set pixel(round(X),round(Y))
X end =X 2
while(X<=X eng )
{
X=X+#X ine
Y=Y+Y inc
set pixel(round(X),round(Y))
}
end.
11.)Explain general pivot point rotation in
detail?
Ans- General Pivot Point Rotation :-From
the previous discussion or graphics
Package a object or image rotate about
the origin only.->To perform rotation about any given
coordinate or selected pivot point(Xr, Yr)
the following sequence of translation
follow:-
1.)Translate the object so that the pivot
point position is moved to the coordinate
origin.
2.)Rotate the object about the coordinate
origin.
3.)Translate the object so that the pivot
point is returned to its original position.
This transformation sequences is
illustrated in given below:-
[xe]
Orn Postion of abjectand A
Trarsiaton of objectso that
Pivot Potter Yr} iea origin
Phot point
werustersia
o 1 dl
y
beatThe Composite transformation matrix for
above sequence is obtain with
concatenations.
1 9 oO Cos@ Sind 0] }1 O
- {9 1 oO -Sin8 Cos6 0] |0 1
“Xr “Yr 1 0 Oo 1] |xr Yr
os8 Sind Oo ji 0 oO
= }Sind Cosd 0 1 0
XrCos6+¥rSin8 -XrSin6-YrCos6 Me Yr 1
038 Siné oO
Sin8 Cos® O)
[YrSin@-XrCas@+Xr) (-XrSin@-¥rCos@+Yr} 1}
Above equation is for anticlockwise
direction :-
Hoa
Cos8 Sin 0
= |-Sin6 Cos6 0
Xr(1-Cos@)+¥rSin@ = Yr(1-Cos®)-xrsin@ 1:
The rotation transformation to rotate an
object about pivot point(Xr,Yr) with 6
angle in clockwise direction.
Cos6 -Sin6 0
= | Sind Cos8 0
Xr(1-Cos6)+YrSin@ = —- Yr(1-Cos@)-XrSiné 1Final equation for anticlockwise rotation @
is.
Xr(1-CosO}+¥rSinO Yr(1-CosO)-Xrsind 1
> yo. ]= [x Y 1] Coso Sino 0
-Sind Coso 0
Here General Pivot rotation:-
R(X r¥ ¢ 8)=T(-X ¢-
Y r)-R(8).T(X ¢ Yr)
OR
Q-)Explain rotation about straight line in
detail?
Ans- Straight line :-Any two points
specified in a plane will define a line. The
equation of a line is used to determine the
x,y coordinate of all the points that lies
between these two endpoints.
->The equation of a line is :-
y=mx+c
->m is slope of line.
->The slope is the rate at which any
coordinate of a point on a plane changes
with respect to a change in the horizontal
coordinate.
->M=dy/dx
->dy=vertical distance between two points
=Yo-Y1->dx=horizontal distance between two
points
=X2-X4
‘Ve [nz ee}
Yi-Fy
Cave
dy Cladndetr )
oy
~
ae
Clary
nw Sche hle fig Line dials dels by f00
, . Tes Tends (xbev
le eal tan 0 = Bae.
dang = ay =n
an\lasiou tye ohh Pa Une
Td
6) ' aL ay
9D any Qde 2 gale een ts Ye >t
Oo Grade dln Usted dno 7h
> 4s"
od oD 4
ay Ma he
2 TP Teas Qhle ta Gh shen
he eh2 TP reas abe te Os haa 1
Need
» Ov (as chan use,
dang Window to viewport coordinate
transformation is also called viewing
transformation.->In viewing transformation we maintain
the same relative placement of all point in
the ViewPort as in the window.
->To maintain the relative position we use
scaling transformation on the selected
image of the window to fit it to the box of
viewport.
->To apply the scaling transformation we
find scale factors in both X and Y
direction.
->Sx is scaling transformation in x
direction on window.
->Sx is scaling transformation in y
direction on window.
->Sx is derived by taking the ratio of x-
dimension of viewport to that of window.
x-dimension of viewport @)
Sx= _yx-dimension of window
->Sy is derived by taking the ratio of y-
dimension of viewport to that of window.
y-dimension of viewport (2)
SY= _y-dimension of window->The dimension of window in X-direction
= XW max ~ XW min
->The dimension of window in Y-direction
= YW max - YW min
->The dimension of viewport in X-
direction = XV max - XV min
->The dimension of viewport in Y-
direction = YV max - YV min
Putting this in eq. (1) and (2) we get
XVmax-XVmin
XWmax-XWmin
Sx =
Y¥Vmax-YVmin
YWmax-Ywmin
Sy=
->The scale transformation matrix which
is used in viewing transformation or
window to ViewPort transformation is:-
. x 0 0
Sview= |5 sy 0
0 Oo a
xVmax-XVmin 0 0
XWmax-xWwmin
Sviews | 0 YVmax-YVmin 0
YWmax-Ywmin
0 0 1->Further the position of the window and
ViewPort are generally different on the
display device.
->So to put the scaled image on the
desired place of the viewport,translation
will be needed.
->To do this first the lower left corner of
the window(XW min ,YW min ) will be
translated to the origin of the display
device and then performing the
scaling,the scaled image will be translated
to the lower left position of the ViewPort.
->The translation factor to translate the
window to the origin are:-
TW x =-XW min
TW y =-YW min
Translation matrix:-
1 0 0
twe |° 1 0
-XWmin -YWmin 1
->Translation factor to translate scaled
image to the place of ViewPort are:-
Translation matrix:-
1 0 0
y= |? 1 0
TVX Tvy iThe complete viewing transformation
consist of the following three
transformation:-
1)Translation on the window that is T y .
2)Scaling that is S yiew -
3)Translation of scaled image to the place
of ViewPort that is T ,
Mathematical Viewing Transformation
is:-
VT=Tw-Sview-Tv
Diagramatically represent of three step:-
1, Brey ah Ginkas aes 2. Teribatin of cites 40
on
~ ++ >See Heer3. SGhiry 4 Telly of Sald thy to the
Pate id Gal Vie Pad
Na Pete
VT=Tw-S view -Ty
L ° 6] PRremmn 0 on ° a
=o 1 0 | [pvmacownin ° 1 °
min -Yevmin 1 uractvmin XVvmin min 1
° YWwmactwmin 0
o 1
Xvmacxvmin a 0
asin 1 ° °
= Yvmax:yvmin 0 je 1 °
Xvmin Wmin 1
vmaxxvmin 0 o
xwmax-xwimin
o YWenax-Winin o
YwmacywminNow equation for viewing transformation:-
Putting, Sxz XVmaxX¥min sys YWmax-YVmin
Ywmaxyw
XWmax-xWmin
0
[x y 1]= [x Y sq °
Xvmin-xWminSx rnin rYWminSy 2
Xv =X w-S x +XV min XW min S x
X vy =XV min *(XW-XW min )S x
Yy=Y¥w-Sy +YV min -YW min S y
Y vy =YV min +(YW-YW iin )S y
XV=XV min +(XW-XW min )
Xvmax-XVmi
XV=XVmin+(XW-XWmin) [sean
ORQ-)Explain Midpoint subdivision line
clipping algorithm?
Midpoint Subdivision Line Clipping
Algorithm :-
Mid Point Subduiion algaites Qs Cin Chitty
Sphoull & Sethrlnd davebfed the Mid-Pint Sub-
division Ging clipting algerithn in the Yar 1968.
4 Thy Again 42 tuck Siniles to Colon. Sutherland
otd - Gee, abet -
* Tihs abpsitin , the Chittag Une. ap dick inde Lb
Cine Spenents in the mid-feint oP tha Cine Benen!
Unlike ab every clrrig boundaries in ~Ghen - Sutherline!
Menta « ;
x Tn thy aedn , abks Gy Od-Gde or Byen Gde fo
tho line” Senent, tha. line Sgnent ay divided into dso
Cpust Px and noo again oul-Gce ake given fo Sub -
tine Sepnends indleding thay Mid finds.
w Moo exch of the Sabdiuded line Pepenends 7 now
Checked Pe He Perohle erechon or alelina .
xy Gke ‘tm Ghen- Sduerhnd abpaitin xp iat Aub
ofaatin forked on od-Gle and if Geen en
West, than that Sibdivigion catty be Bedey =oberoite the cit! be allepkd ..
% The Poles: cit! be Almwel asain on the déjeckd
Subdivittn ‘and. + catit be ieradively. Greknaed FU)
Fedliny fthe entre dng Secret Grapistely Griploled -
ae -Plitoshn Ae rid-Pent Sabduisin Line CPP
BOL. Gitulele ther Posrhin L bol endRinds Pe fing
(ing “Tapas de (P.O4,y) , CM)
Skea! TP balk cabfuint epi Gde 2 0000 Her
Gre Gethin te. Clitfiy — Loindas
a
oh.
Palen logic AWD Oferrdion bekeen 20 end
Reds etinn Cade
Wer TP Clrics vig fk ent Pain #00 .)
dle te (ne cy Oedside He bealengle Sindy
a
(byes Hwy = = 0008)
~ ther, Gre Sy Crider Pethadty @ ide Bode
dae Gointod ve Ling ¥y Cryider by Cling
Gle - =:| Sete 38 tine ap Galan sr chy Gl Than
| nd te ridpont of fe ng re.
Km = vite ; (ricdteind A X- Grdink ds
Nm = Niro e7 gen Oe)
zo (Mitr fy. Gain
ret gies line)
| Sle $!- “vos hanes. Cheat Pid cobaher i]
to tle bunbry of Barrel b the bundy fA
GQ Gindow os not :
JSepg'— fvoo divide He Gre Sebeo wl tuo Parts
) Prn Setheg do" ‘rid foink
WD Prom paidfomt + Skethny
ShPP!— ford APP, Sep t'da & to bom Paty of Ke
fine Gatti tobaly Vitible: a6, dotally teygcly Gre
not Pound .
SOF: gop.© Jool tly leet Meo std . folo
P
ppg
~
on? Cone
«Cag
Olof ne), o|po C60,20)
aa allo
1 pe Je yo fe ke
a =
Korn Xepayys a
Giws Yorns Fo. XOmy = 60
Yonin= 2 Yomy = 4o
PAR arc tee ent: Point fa Cine
Reed)” b=@r)
jow aig idfint — gubdvitien anh
Gin Point
(tu) (Soar)
Geo,224) (S8)| (40, 38.395)
fos3B3) (SF) (4, adh) ma
(u2r » Westie
my
(Ho, 38) (418)dine Poe |p
P,P S101
1000
Section-D(8-Marks)
13.)Explain various input device in detail
?
Ans- Input device :-An input device allows
data such as text, images, video or sound
to be entered into a computer system.
Keyboard - The most common input
device used for entering text. Includes
keys for word processing and data
inputting, and for performing specific
functions.Different Input Devices :-
1. Keyboard :A keyboard is a peripheral
device that enables a user to input text
into a computer or any other electronic
machinery. A keyboard is an input device
and is the most basic way for the user to
communicate with a computer.
2. Mouse :The mouse is a small,
movable device that control a cursor ona
computer. Most types of mouse have two
buttons, and some will have a wheel in
between the buttons. Most types of
mouse connect to the computer with a
cable, and use the computer's power to
work. Some types of mouse are wireless.
3. Joystick :A joystick is an input
device that can be used for controlling the
movement of the cursor or a pointer ina
computer device. The pointer/cursor
movement is controlled by maneuvering a
lever on the joystick. The input device is
mostly used for gaming applications and,
sometimes, in graphics applications.
4. Light Pen :A light pen is a device that
uses light-sensitive sensors to put
information on the screen with the help of
a cathode ray tube. A light pen is used to
draw text and diagrams or select the
object with the user interface system inthe CRT monitor.
5. Scanner :A scanner is a device that
captures images from photographic
prints, posters, magazine pages and
similar sources for computer editing and
display. Scanners work by converting the
image on the document into digital
information.
6. OCR :Optical Character Recognition
(OCR) is the process that converts an
image of text into a machine-readable text
format. For example, if you scan a form or
a receipt, your computer saves the scan
as an image file.
7. Barcode Reader :Barcode readers
capture and translate barcodes into
numbers and/or letters for translation by
computer. Barcode scanners can be
connected to a computer through a serial
port, keyboard port or interface device
called a wedge.
8. Web Camera :A webcam is a video
camera that saves real-time images and
video to a computer or streams them
through a computer network.
ORQ-)Explain display processor in detail ?
Ans- Display Processor :-Display
processor is a hardware which convert
display code into image.Display processor
is one of the main part of display
system.Display processor is converts the
digital information from CPU to analog
values.
->In simple term the display processor
digitalize a picture definations given in an
application program into a set of pixel
intensity values for storage in the frame
buffer.
->This digitalization process is called
scan conversion.
->In addition with the system memory,
Display processor have a separate
memory area called Display file memory.
Various part of display processor are:-
1)Display Controller
2)Display Generator
3)Display Console
4)Display file Memory1) Display Controller :-It is also called
Video Controller.It control the operation of
display device.In CRT it control the
movement of beam over the display
screen.
->It is also used to handle the interrupt.
->It is used to interpret the instruction
given by the display memory.
->It also manage the refresh rate of
display device.
2) Display Generator :-It is used to
generate the curve or character in display
device.Display generator produce the
shape and characters according to the
input given by the display controller.
3) Display Console :-It is a combination of
a display device and an input device. This
show the output on the screen.
->In Common term display console is the
screen on which we see all our graphical
output.
4) Display File Memory :-It is a storage
device for Display system.All information
about the image or video are stored ina
display file memory.Whenever we want to
display it on screen the information is
given to the Display processor.14.) Explain Bresenham circle Drawing
algorithm ?
Ans- Bresenham Circle Drawing
Algorithm :-Bresenham's Circle drawing
algorithm uses the decision parameter to
decide which pixel will fall on the
circumference of the circle. Bresenham
circle drawing algorithm also reduce the
calculation as it does not use square root
and multiplications and hence this
algorithm is more efficient compared to
other algorithm.
->This algorithm performs calculation
only for (1/8)th part (or for 45°)of a circle.
->The rest 7 parts will be copied drawing
using 8-way symmetric concept.
->The best approximation of pixels is
achieved by comparing the distance of
two pixels from the circumference.
->The pixel which is much closer to the
circumference will be activated.
aOu),%)
6
Gay)->Two pixels A(X j+7 ,Y ; ) and B(X ja7 ,Y i-
1)
The distance of point A and B from origin
are:-
Die VG? + Gj-98 = Vadaye
Dbz Very = Viet?
->The distance of point A and B from the
circumference are:-
da=D , 2 -r?
db=D,, 2 -r2
->Therefore the decision variable for ith
step will be
d=d, +dp
dis less than zero if da< db that is A is
nearer to the circumference of the circle.Therefore value of x is incremented by 1.
ddb then Ais
nearer to the circumference of the circle.
Therefore value of x is incremented by 1
and y is decremented by 1.
Xi+1=Xi+1, Yi+1=Yi-1. d20
The initial value of decision parameter d
that is value of d at X=0 and Y=r is
obtained by substituting value of x and y
in equation (1)
ie. d = 3-2r ---------- > initial decision
parameter
By substituting eq.3 and eq.4 in (1) we get
the value of decision parameters in case d
< 0 and d20.They are:-
d=d+4x+6 ford <0
d=d+4(x-4)+10 for d20
Algorithm Bresenham Circle drawing
(Xe,Ye,r)
Step 1:- Xc,Yc are centre of the circle, ris
radius of the circle.
Step 2:- X=0, Y=r
Step 3:- Calculate initial decision
parameter
d=3-2rStep 4:- while (x<=y)
{
Now using X,Y ploat the eight point by
using eight symmetrical coordinate
concept of circle concerning the center
(Xe, Ye) at the current coordinate
P1:- setPixel (X+Xc,Y+Yc)
P2:- setPixel (-X+Xc,Y+Yc)
P3:- setPixel (-Y+Xc,X+Yc)
P4:- setPixel (-Y+Xc,-X+Yc)
P5:- setPixel (-X+Xc,-Y+Yc)
P6:- setPixel (X+Xc,-Y+Yc)
P7:- setPixel (Y+Xc,-X+Yc)
P8:- setPixel (Y+Xc,X+Yc)
Increment X and Y according to decision
parameter d.
i.e.:- if(d < 0)
{
d=d+4x+6
}
else
{
d=d+4(X-4)+10
Y=Y-1
X=X+1
}
}
Step 5:- Stop.
ORQ-)Explain Polynomial Method of circle
drawing algorithm?
Ans- Polynomial Method of circle drawing
algorithm :-
Macihe Pinal eked PG Dwi
* In Cid Vong Wade of Xady COineds A one. octsed
axnt— ve C Gorte 4dmo Using thy Gitirads Catepl of 8 Syeirtghias
Ghinede Crt ter Goons ave Red od -
Corned Ly Case to). (Go He veld Ay
Ranads us do 0 (Go axe inechore )
Ve ¥=Y
4
Yaupro dhe abore Glial 9% (ote Ur) 2 (urbe)
se Single Piel Qe Amo De cher Plater 3
“Wa Gute15.)Explain Composite transformation in
detail?
Ans- Composite Transformation :-
Gontsik Tasbowla ox GrQbeln fhe
» Cohen cae Petfem Douunle of Frotliralin on
a Cig objedt’ “thon “tk Sy Glled Grips drangPenele
~ : .
¥ Seotente A terybrades on an objed Gke we
Weed to Sele i} then ‘hurebh t+ R they Dhle
Gnd Yo on.
# Thee ate too AvP yoaches bes Peering Gnbosite
paesParadeons:
vo Gok one ca Hal Ge Parbary tha: “rersflraben
on objed one by One gad Gtulate te inkerredik
oink.
» Bond aoa yy by rubPhiny ail the Pehry
and Hen Ge Qn daedty ath ‘ik +p the Tepe)
Gotind§ B5d foxy Gotinde died .
a QeGrd aftr “H Mome CMient .Advackye of GrnPisben
> Th -tambanatene bene Grnfecl .
The vitenber of Ofertin coil be dated
» Rubs urd Br dehig Frnglereaben in bn of
Clickee are Guflex. oe Grofit to “radix.
Bari. 2d Teeslemachuny
) Fowulehin «
Loo
«Le = [xvi [322]
7
» QQbiny
(x yi t= fra [Ss : |
D Pelebon ankehawik 0
Go Sin
& yi}= Poy of [8 6 |Grfook Toman 2 Subs Tye
xD ea ~
D Temlabin
% EP too Quctatne tenabder cy applied theh Hf
“4 Grice Senabdin B
“Git 3 Ca) a too
Sullaive “heals ten. Reel Gotdnee P! ate
Ps TG.) Th.7,) -P]
Fis TEA) TE al P
he P SPI pefttad the henetanses Gelenel
WS Voth. me
* GP tesbredin rate By above Legusate ef |
Trans lao Ox — !
L 00 Loo 100
o10 : O10 j= fo io
K, hy t Te Tat | Withee tv@
Ne Cplakin Conorsbils thes shoo Sudtive
‘labia are qddibre
[ses 100
Olo
pote |
[x y' t= bys [eas]
py): Tov [: re
Tr 4, &
Ly FTay Tyiy, 4
/;
2. Rolehin aakcltinie 9
noes
ycchen fyo CSutldive poled alplied to Roind P
Men ibar Giud Anfyile gertin « -
P= Rio.) Ree -P
» O, 30, at
R@ = [et dar" 2|
oO 1
Rio) = | GO, Sing, O
~Sind, Gio, Oo
oO 5 L
too Qu llasnre tokder den-Sind, GIO, o
“Sina, GiO, 0
Qc) -Ro)=[ 4% Sasi fs a 2
>:
o Oo Ft
° ot
Qo, ino, 0 C10, Sin, O
Sin, Gto, oO -Sind, GO, o | 7
Oo L oO ok
. G0, G50) ~ Sino Sag, Gro, sino,
— Gro, to, 4 So, ino.) Cro, Glo,
o o
= | GsCo,+0,) sin(0,+0,)
~Sin(9,40,) G(0,40,)
Oo
+ Sin,10.
SiO, Sind, O
z
oO
oO
° L
++ REO). R(w.) = RCo)
t P= P.£Rt0d- Reo»)
pt PR (odor) \Noe epuahir denow fdr “thas hoo Sultedhte Yohehor
ae gadihe.
C80, Si Sin
xy! te fx vw [See & tao," 2] [S38 thes J
' Blot) Sinlotan) O
by Y ys [x yt} [et GA(ode2) 2]
° L
a
3. SGli
Gling
% Ghan hoo Sullehive SGliy ofershin applied thy,
Hee Qld Gmpsile SGling
p= P. S (Se. ,Sn) *8 Coen, 84e)
a S (Su, Sy) BS (Qn, Gx too Sulage
SQby dren
8 7
SGis)= | See
oOo!
8G): [ é |
oO of$6.9). Sh )=/ $40 © [eves
0° o | Oo \
_ 8X, -Sx, 0 Oo
O SYSn o
“Oo Oo L
Tue Supeptive, Sela) Sélitg 5 1 Gnbosile Say | aK
MulbPiGsive.1. Plz PSG $-SGa-Sn)
Sx, 00 ex. 00
[x y' 1} = fx yl [es2] [e ‘sie |
Oot oot
TS
SS °
-ffeva: pos [3 88) |
pi = P. SGerSu, Qv.8ve) aGrrdoslk treesbiradin oD diblond the
g
Covk Grif dantbrecker Gurdon be Dering -
Feibrmakon: —
b Sling AeosPnar
2) Sota hens beth Chwk ceeoik ibn)
» Parslahn barslard-
w WP be tytkel Gotha 2 Ph be the
Walked Gaia b, letting Sling p rddfon Bs
drnbohin -
plz fix! y! ral
pe fx yt
Gatiy SC%.3= [2 :|
oO L
Bolhr RCO)= E Sind |
~~ Sing Gio O
oO
Oobarkhm Tht) =} £ 0° ~
° io |
to 4
S(Q.)) + Rl) -T Coch),
sx 00) [Go sino 0 Loo
o S80 HZ Gr O © 40
00 L oO oO L det
Go QSind © 100
~S sing G19 oLO0
tity t
ll
it
oo Ft
8x19 &S8ind oO
“Byting YEO O
dy 4 oL+ BEd Carbon! —
SHO &SinO O
fx yi ihe [x YJ SSino9 SyGn9 0
ty ty o£
Pl =p. C(80x5) - Rew)-TCh yD
ORQ-)Explain various 2-D transformation in
detail?
Ans-
, * 2D Tirmbraks eo. Porea of Prodsing
eRe boiy tha Cxang obi or tls Q-
Cinengon.
"As objel as prfhics ‘inages Qe Gded ad Nenkese
the. Nunes Gn be Ghd in Mehety Thee Nunhess
Give prodfed by ModhenehGr oferahors Glted
“Tere foraden « :
= The Roo of teangllenabon cy to Phovide fei |
jo Utes to Uso the object fon dient agi, |
enlerriy oe Yeducing the SGle oF State of object
Tso Merkel a8 aspect of hauLratin Qe!
t) Each oes Donen wa Grol enlty Lb Ga be
donokd bya Crigue rene oF Siebel.2. Thy Roibte 4. Gnbine hoo dreslyralans , able
Gennecay Sigh trnesferaten tu obhined
Thatc are oo GrPlerealay Pong of Vids Arc daily
Objed os ‘image, Tenshanade
* Conde Tinshoabin:—
‘hen “tha obiel a¢ image ttanlemed thie
to the G-oidingh Sysker- then the dnogdanedin “x
@lled Gand heatlereabe
» G-sxtnale Tewsllrabin to
Cohan the. chiee! or thay ca hold Sleoarsy
he He Gadd Sten iw Trvtbened delete
ho He cbjetl «hen tha RrwsBarudsy cu Glee
G-oRnte -FeavsPanedun .
Eanjle!— shon Qe we Feouing 2 bectprant are Pred
ty Glked Secrictic Arlteda
chen Qe cu Res 2 batigried wy Toung cu Glud
G-Bitalr toasdradan.Trae ade Atte, basic henabrading ¢—
. Troblar
2 Rolain
D Gling .
Delo Hoe weRebl there fice bet
dean Apnadin
Teolohr
la
Delo. Sabhep Aber shiPlap
Bere Mabe Shy
Mor § Gly?
"the hl Ake all
Tran lehoo
% Tirnalden Pan objec! rreaay Frotigg an obiced
Bin one Phleb another.
NTaamelin 2 an obit! tap Pattible ‘in any one
tha Bhuseg tree dixedone : —
D Trarahdiio @ an obi) ia He haizdy deecen,
tak dt temtlshey Rediel to X- 9xie-
2 Taaublin. of an objed in the Wether directa,
the) 9 tanbho Rill 4 V-ad
3) Taube 2 an died inthe haidoolel Verkod |
dechoy Simutlanas tal. |Tawablio 1 haters oo Patlel to K-aniz
re Sufek coe co te rue a Pink Cur) in
Abe vsmenly dieckin ttat yin @ dachn Partin
“sy K axa by Th Gnits- \
¥ Then thy pevorent Gq be abla by Sinply
addi Th bh X- G-olins.
» The cotdraks of fis ables Arnnsldory call bk
X= L4TR
Yry
i Y
Cy)
? Y . ¢
* 7x x xt BX
eho
Teurablio “in Neshat ov Paslly to Y-axr
2% SOM to mete a Point (X07) in Vertes
diacdin thal zy yn te dredion Pavel to Van.
etThon thy PoVoHont Qn be ofthr obbined by
Aadayy T, ® Y G-obinabs.
* The G-cfinda 2 Pink alley teangldm 43111
be!-
ys %
WeytTy
a av Plu?
yt Pow) v
wx x
Pearslaiag bob Vpovitenfal Nath! Qitrullanes ofr
Jo rate chjad in tenkel 9 Wethiot dacs
Ginallergeuly by tabten Rebr Te end abe
Arielabeg a Pink in th Ye daeclin 3 Y-ditechonTron fe at fe oD tn
y's dT
Ye YT,
te Cay) = (rk, WH)
6 fxyl= bottlim
Pls pr]
pl=Cot.yI
P= Puy)
72f7)
aohere Tag eli cant Py GD
aa Clad & Frracelen Veoh 08 Shift ver.
ed
y | Posy
yf -POM) ty °
vy.
x
x!
at edcha Pip a Ika Bo rahi P Gacfind of the
Teuedoh! Paint -
Pimp dhe 1x2 Bo fabian cL G-oQiea of coginet
Pair
Tip the two nabix 2 teraldhin Veckr 6 eivabbin
Bebe.
» Reflero depan Shoo He Jeremrbred holier
Lan okie
A
A
, Abkr ‘Raubhin in beth
Gee tranbhen x ay divechons
a Frlchon avalatelen wa Spe body fant
* Arrsiskotobsn 2 Qed Bi-bdy alee
D the i
a ed | Fe¥es fin one Pilg do neler Gih
08Cohen a Euctden dukinte bebseen Qn, tuo
Gothing Tettaans Unchanged by the dal ster
He ti lo Gd. Bg
trulelan, ae Spl Baby
> He fonullon oy Pafd on Quch 3D ebery Ved
2 an chil tre te onl bet
» Aber Ini WAL te Vethin he chee! av tedto
by Wes deste Verkces»
* Teh dD the clay tbied bee & Relith 4
Dedangd by fry thay Gob find «6
Relation
X Polatn “9 a, Pinbbs dé Chogsy the Angle
@ the objeed «
© Jn Belaten Obieu! 24 Noles ona Cea Ph
hed @n Oia
* Tolan Beguuva two hays Pararele.—
) ‘Died oP tokdin
2 Arye. yolahen» An; ge objed! Ga be telaled citer dn
Clotwaite dedin of in anbcbncik, dixchan by
q é ante. 0.
J heal Org shed Chats nkdin
# Th Qdnensioral wh He ke) Zo odd
Aund Cred Pot ether an Btigin w 4 ge
Poin.
0 Thy wen Point xy Glled ahlan Paras ow
Pivat Point »
» Rolain AXy cu the Qty cohidd PaPes HryA
Babin Quek Ley Vardar to tle ¥y Pong.
obied-
a
[at ss, fineRy
\ (ore)
xt Pow) Pod to be welakd in ankcbckote
cbrechio-
AP (xiy) iste ne Gainde abbr whhin re.
Ruler cP Point Don Paths Gir) to Cre) thegh
an aryl O rhe to the Gand R-
0 Rilore) 2 Fhe Pivot Poin) ae whahin Poin Moyh
cohich an obiel cu Boke by Gayle Qe.
+The orignal acgay cafblrend oP the Piet Bn
ake Y-aty in g.
nF de bp A Pict P RnB. os QPP.
Altay do Single ‘Daher Proc Pls.'—
L= tGsg Y= Bing
—)Sinker GOink x' sy! @xe
x'2 3 Glos) Y= siin(d2 O10)
9 —-@
B | @GID= Gwap- Sowsinp
Sin (oc: B)= Crxcsgafl + SinkGE a
— (Fs
Sabsthde,
Weis (3m GE) Le pel
x= % (Goes — Sinosing)
x= YOO Gg - 1Sn9Sing
@
YER (Go sing + S90.)
Y= BOsosing +2inw Gd
©.
Bok Xs TBS —-Yertng
Shoes ee in & @ 3 CSL.
X's 656 —YanoViz X86 + G9.
cotati Popeed x! Ayn Aabx rokha
oe
cx oY) = {x yd jee ed
~Sing oe |
a Gn be Covtlan Ww
P= PD Re
Ps Px yJ
pe fx yI
Gs Sind
Res “Sag a
x Ra oy the yin arlmnaton Matix, Dre Bib
Q Pink P in Anbelttotte divin Goth agle O
hive to hin re aR.Seba _
% Sealing trapleralen (2 URd -b aller the Size
ode ie object -
© The qllerbin d Si20 of the objecl cy dePred by
the Gling Ba Rote. ye Qin X dhreelon 3% in
Y ditechsy
2 The Sale Ree spat, hoo by a6 Shalt He
Object Shoutd be aber ableraten.
» & wy Ugd to alex Tha objeel 1" horiontes
cheerhin -
»S ww Ukd tb alke the objed in Vetas dinclin.
0 The, Sly Tomibbedion -y fathRubned Snbh
by hutkphigy te (TY) Gooding Valu by Pale
Leer ob haitenler 2 Verhier chacdlon -Sinhiy Ge Gn dhrve the Glas b while &
heidi Chetan dined by any 9 abet the arpa,
sine bi9= Gad 5'79
SinCg-6) ? Separo-2-
G (P-9= CxoG:9 +S°b5"O
Riou
a Gee) Siel-8)
(x YJ= hy [& ed
S09 Gxg
prvieley [ Gs we
1. Re} Go er
Sid Gi
Ry a Wahin Arafinedn nahin to lah @ fant
in Clcweik, dxden 7 6 rebhe a Are Cryin
* Modharahis sepichallin cP teansPerghen
ony
GooBik (2c,y) ‘into Sled rented G-cBinels Cey)
cy
Ws Qo , yis Say* Govut thy tang lradin ins) Habis ¢ Altes:
fx yb = Led [ & “J
Cohid ty eputalend 40
P= P.g
ol pls Pxy'l
Pz fx}
gz a a || Sear bebe.
AQ AZ Awe Vole Deboe thay axe ahoays Residue.
» hen & 89 Ore Grader than 1 chen, the obi
8 Calne im hoi ov Vee clinchin .
P he Seb Dube Debwn Oand L then Ste of
dhe obyed redued im the debclve drechans
» TP He Nalbe oP Sx BS are eplat b1 then
there x no chaye inthe ohed .* Cohen the chic! wa allered cath Same Kale
Reber He Spas, By bok the haan 3 Vertes
ditedhon ke QS , then Sealing Arent berrchor,
B Kroon ae Uris 86ling ctonalbmeton
» chen dle chieet 21 alfere!d coh bPsenf Sele
| Reb re 8% Aen Lali -fensBareehon
|* Fron i iferental Ge Stig cherry -
8 Pom the abe trenflitielin cre chive Het
by Cling Dan objel He Poin Pte
Aitexed obigl “a alte Chorped abry ‘he
TeePorchee -
% Bub atnat att the oraphias aPpliGhen Reed
fo Heep Me objech ab g igired Poshun OF
Sere Presfeted Piiben (Xe, Ye) olen afer He
QGle ear Brehin
¥ Thin Wabiy tsbrelin tebhee fo aBed Rien
ae (hid CX, Yp) iw dane by te Biasiyy Be of
Ce tighing +.
X= x + CL)
Y's Ye + Ca y-ye)s,Gm Yourke tube sling tat brrcedong chy
Reade the putkplictre » Qddidve: terre
oll
tynifars Sling eoibatebto
[AP
» TO Rel Gali on an obsed! , te. SGling
Ft bnader “# Rebred on al} He Verbicy of
dha obied -X's X& + LP (Sx)
Y= Ye + Eyp(-S)
Th makin Bor tts Ga be Yeo ag.
(x Js tx yj [ = oh [xeC-s), (15)
Cohen XellS.) Ye 08,) are Gritat deen
keh ax added bthe ciyiny Sale brubreln.
2TH abr &. conan, Ee shag Gre bed
vot Pig Cick os elup Gr 02
» Velere ReGuk Cin Seluph PGlliny defend on
badiny ot “Rey mejer or Ser anivt OXY16.)Explain Cohen-Sutherland line
clipping algorithm in detail?
Ans- Cohen-Sutherland Line Clipping
Algorithm :-In computer graphics, the
Cohen-Sutherland algorithm is an
algorithm used for line clipping. The
algorithm divides a two-dimensional
space into 9 regions and then efficiently
determines the lines and portions of lines
that are visible in the central region of
interest (the viewport).
Nasshn As Cohen Satertnd Cine Chitty algeria
Sken- Fiodig He Parke ad bot, endftias of te Cre
Using Tepion Gde-
Ser- TP bok endfbintt Vein Gde ut Zee 0000 Hen
Hen fine 4 Grider Goibin tte Thagr winds L
Misble
.| t
Ju |
6
| Revlon Gare Abding olin on beth entAinte
YE behvetn Tegn Gde .
a (bjs ASDing + 000)
Aken the lng “2 Oubtide “the Secleuly cind,,
dk
le Lina te Gryjdired the Clipping Ch .
a
BE Sh 4 — TP bine a1 Graideret “te Clitliy Cle
Alen,
Rnd Slate beheen eso Prinz ef Line te
m= Nou
Yo-%
tio Bas an iakeSiclen coils bounding d Tabn
Gubr sindoo ie (oy)
UL hound eb Setlayte coirdro’)
¢
X = Xtonin
y=y, Ende %)
)
>
>
>
>
>
d
>
‘ at C 18 bil of Deion de up 1 Ve ‘WerSeds awk
>
>
>
>»
>
, >id
2
2h C2" bi of Begin Gade art ve Inbael oils
yp baundany of decdongle indy)
Ke Yo may )
> = WEN CXm
Poy ee
DCP GL A depen Cde art ve inlaleds ci Ger
bocncay ef Aedeagde (sindecs’)
€
Y= Yorn
X= Hb YW
2 nm
a Cy
bor
x
Y= Von
bik of Sapo Cde te Lye wee coh pkey
edany of ecleaple esindewo )
XE % 4 yey
nN
}
SkOSs— Wok.OR
Q-)Explain Sutherland-Hodgman polygon
clipping algorithm in detail?
Ans- Sutherland-Hodgman Polygon
Clipping Algorithm :-
Cutter land - Hed) eon Clphiag Aljathm
Gn thie ahggihn , a the Novice: ave Phrleted
fs charg i exch individual Clip beundssy
ob clPting Goindes one-bj- one
© De Mam im he Ofgattirn Rigen Chphed Sy
then
Bat in GePh Side hen on he. pe! Side,
she bP dat Git fom [puer Side of the Clifige
Coindia«
Tis 29 Shoon in gre balers Pastas: —
on
pC
(of side cling an cile 2p Side clayRignh_Side_cliig Becdbues side Clifiy
X cohon . ali the Verkes of « que Polygen ave Pixe—
Sed agrigt Gry Cling Side, the Gud be any
te Bllsig ux Psibitiker Be @ Cucesive Pur of
tuo Vertes of Polygon
Glet: Beh the Sleshng Verkx. and ending Verkx
Ge oud the Chahing boundasieg
7 7
Gie2 | oh tha Shtbeg Velx and te ending Verk.x
Gre ide the Cling bound.
_—‘
Grea! “The Shy Vere 4 inside He Cy
boundny bed the ending Wevtor +# ouside the
. Chitfig boundary ae
G4! The” Ghahyy ede oudtide Clty boundary
be} dhe @nding Vertex cg pide the CupPing
boundery
+]
Alisdiny to Stdhechad-Hodarten paihin , ant the Warkx
Neier of a Polym Ate Phieted Ob Gch of the
clotiy houndarier One~by- one .
Pe Get! cohen both the Verde Shab es
Cndiey aye ote He Chili baundyy, Hebe
Woking coil) Be qdded fo Fhe fl di| Fe Geo token both Hoe Stecing and ending Verdes
Ge inside the Cling boundsey Hen only he
ending \leckx Gail! bedded ot Pleleveved in
the oud lat.
PeGhs: Cohen the Slaliy Rink J imide He
boundary god the endiy Veske. = Otte the
betnday, athe edge Srlertechen Point of the Agen
eye and he Clg boiny cre died te
AL op lal +
foe Dey cohen He Glecling elon ty cide
The boundiny 29 the nding Neth Jp ind
de bunday, the tnlessedin Polk and the
nding \reskx Qe Pleemel Inthe oulpeh
4 ’
U3
% The above Bur Gey a (Neer) 2x Perdrred
on AN the boundenies of the ClipPing comdee *
wy The Pong cohith aye Clifed coith the Rest
bounday ase only then PaSted to the rexd
Clty boimdry A Aether Ploet.
are chpred
a Blenkeally only thde Point colich
‘m by QW the Clipping houndovies Gill be Gon4 The. feel Poteing, kchnipue os Pall Prleners
Coll Male Hig Plocess Auer. |