Merged
Merged
Merged
Q1. Clipping
When we have to display a large portion of the picture, then not only scaling & translation is
necessary, but the visible part of the picture is also identified. This process is not easy. Certain
parts of the image are inside, while others are partially inside. The lines or elements which are
partially visible will be omitted.
For deciding the visible and invisible portions, a particular process called clipping is used.
Clipping determines each element into visible and invisible portions. The visible portion is
selected. An invisible portion is discarded.
Types of Lines:
Lines are of three types:
3. Clipped: A-line partially inside the window and partially outside is clipped. For clipping
point of intersection of a line with the window is determined.
Clipping can be applied through hardware as well as software. In some computers, hardware
devices automatically do the work of clipping. In a system where hardware clipping is not
available software clipping is applied.
The following figure shows before and after clipping
The window against which the object is clipped is called a clip window. It can be curved or
rectangular in shape.
Applications of clipping:
Clipping can be applied to world coordinates. The contents inside the window will be mapped to
devise coordinates. Another alternative is a complete world coordinates picture is assigned to
devise co-ordinates, and then clipping of viewport boundaries is done.
Types of Clipping:
1. Point Clipping
2. Line Clipping
4. Curve Clipping
5. Text Clipping
6. Exterior Clipping
Q2. Scan Conversion
It is a process of representing graphics objects as a collection of pixels. The graphics objects are
continuous. The pixels used are discrete. Each pixel can have either an on or off-state.
The circuitry of the video display device of the computer is capable of converting binary values
(0, 1) into pixel-on and pixel-off information. 0 is represented by a pixel-off. 1 is represented
using pixel on. Using this ability graphics computers represent pictures having discrete dots.
Any model of graphics can be reproduced with a dense matrix of dots or points. Most human
beings think of graphics objects as points, lines, circles, and ellipses. For generating graphical
objects, many algorithms have been developed.
1. Point
2. Line
3. Sector
4. Arc
5. Ellipse
6. Rectangle
7. Polygon
8. Characters
9. Filled Regions
The process of converting is also called as rasterization. The algorithms implementation varies
from one computer system to another computer system. Some algorithms are implemented using
the software. Some are performed using hardware or firmware. Some are performed using
various combinations of hardware, firmware, and software.
In this method, the next pixel selected is the one that has the least distance from the true line.
Assume a pixel P1'(x1',y1'), then select subsequent pixels as we work our way to the night,
one-pixel position at a time in the horizontal direction toward P2'(x2',y2').
To chooses the next one between the bottom pixel S and top pixel T.
If S is chosen
If T is chosen
s = y-yi
t = (yi+1)-y
s-t
This difference is
s-t = (y-yi)-[(yi+1)-y]
= 2y - 2yi -1
Substituting m by and introducing decision variable
di=△x (s-t)
di=△x (2 (xi+1)+2b-2yi-1)
=2△xyi-2△y-1△x.2b-2yi△x-△x
di=2△y.xi-2△x.yi+c
We can write the decision variable di+1 for the next slip on
di+1=2△y.xi+1-2△x.yi+1+c
di+1-di=2△y.(xi+1-xi)- 2△x(yi+1-yi)
di+1+di=2△y.(xi+1-xi)- 2△x(yi+1-yi)
Special Cases
di+1=di+2△y-2△x
If chosen pixel is at the bottom pixel T (i.e., d i<0)⟹ yi+1=yi
di+1=di+2△y
Finally, we calculate d1
d1=△x[2m(x1+1)+2b-2y1-1]
d1=△x[2(mx1+b-y1)+2m-1]
d1=2△y-△x
Advantage:
3. It can be implemented using hardware because it does not use multiplication and division.
4. It is faster as compared to DDA (Digital Differential Analyzer) because it does not involve
floating point calculations like DDA Algorithm.
Disadvantage:
1. This algorithm is meant for basic line drawing only Initializing is not a part of Bresenham's
line algorithm. So to draw smooth lines, you should want to look into a different algorithm.
Bresenham's Line Algorithm:
Calculate dy = y2-y1
Calculate i1=2*dy
Calculate i2=2*(dy-dx)
Calculate d=i1-dx
Step5: Consider (x, y) as starting point and xendas maximum possible value of x.
If dx < 0
Then x = x2
y = y2
xend=x1
If dx > 0
Then x = x1
y = y1
xend=x2
If x > = xend
Stop.
If d < 0
Then d = d + i1
If d ≥ 0
Then d = d + i2
Increment y = y + 1
Step9: Increment x = x + 1
Step11: Go to step 7
Solution: x1=1
y1=1
x2=8
y2=5
dx= x2-x1=8-1=7
dy=y2-y1=5-1=4
I1=2* ∆y=2*4=8
I2=2*(∆y-∆x)=2*(4-7)=-6
d = I1-∆x=8-7=1
x y d=d+I1 or I2
1 1 d+I2=1+(-6)=-5
2 2 d+I1=-5+8=3
3 2 d+I2=3+(-6)=-3
4 3 d+I1=-3+8=5
5 3 d+I2=5+(-6)=-1
6 4 d+I1=-1+8=7
7 4 d+I2=7+(-6)=1
8 5
Q. Short note on Video Controllers:-
Ans. Video controller:-
1. The video controller is a key hardware component that allows computers to generate
graphic information for any video display device, such as a monitor or projector.
2. They are also known as graphics or video adapters that are directly integrated into the
computer motherboard.
4. They also offer various functions beyond accelerated image rendering, such as TV output
and the ability to hook up to several monitors.
Q. Input Technologies
Ans. The Input Devices are the hardware that is used to transfer input to the computer. The data
can be in the form of text, graphics, sound, and text. The output device displays data from the
memory of computer. Output can be text, numeric data, lines, polygons, and other objects.
1. Keyboard
2. Mouse
3. Trackball
4. Spaceball
5. Joystick
6. Light Pen
7. Digitizer
8. Touch Panels
9. Voice Recognition
Keyboard:
The most commonly used input device is a keyboard. The data is entered by pressing the set of
keys. All keys are labeled. A keyboard with 101 keys is called a QWERTY keyboard.
The keyboard has alphabetic as well as numeric keys. Some special keys are also available.
1. Numeric Keys: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
7. Numeric Keyboard: It is on the right-hand side of the keyboard and used for fast entry
of numeric data.
Function of Keyboard:
2. Keyboards are available with special features line screen co-ordinates entry, Menu
selection or graphics functions, etc.
3. Special purpose keyboards are available having buttons, dials, and switches. Dials are
used to enter scalar values. Dials also enter real numbers. Buttons and switches are used
to enter predefined function values.
Advantage:
2. Function keys are a fast and effective method of using commands, with fewer errors.
Disadvantage:
Mouse:
A Mouse is a pointing device and used to position the pointer on the screen. It is a small palm
size box. There are two or three depression switches on the top. The movement of the mouse
along the x-axis helps in the horizontal movement of the cursor and the movement along the
y-axis helps in the vertical movement of the cursor on the screen. The mouse cannot be used to
enter text. Therefore, they are used in conjunction with a keyboard.
Advantage:
1. Easy to use
Trackball
It is a pointing device. It is similar to a mouse. This is mainly used in notebook or laptop
computer, instead of a mouse. This is a ball which is half inserted, and by changing fingers on
the ball, the pointer can be moved.
Advantage:
2. Compact Size
Spaceball:
It is similar to trackball, but it can move in six directions where trackball can move in two
directions only. The movement is recorded by the strain gauge. Strain gauge is applied with
pressure. It can be pushed and pulled in various directions. The ball has a diameter around 7.5
cm. The ball is mounted in the base using rollers. One-third of the ball is an inside box, the rest is
outside.
Applications:
Joystick:
A Joystick is also a pointing device which is used to change cursor position on a monitor screen.
Joystick is a stick having a spherical ball as its both lower and upper ends as shown in fig. The
lower spherical ball moves in a socket. The joystick can be changed in all four directions. The
function of a joystick is similar to that of the mouse. It is mainly used in Computer Aided
Designing (CAD) and playing computer games.
Light Pen
Light Pen (similar to the pen) is a pointing device which is used to select a displayed menu item
or draw pictures on the monitor screen. It consists of a photocell and an optical system placed in
a small tube. When its tip is moved over the monitor screen, and pen button is pressed, its
photocell sensing element detects the screen location and sends the corresponding signals to the
CPU.
Uses:
Digitizers:
The digitizer is an operator input device, which contains a large, smooth board (the appearance is
similar to the mechanical drawing board) & an electronic tracking device, which can be changed
over the surface to follow existing lines. The electronic tracking device contains a switch for the
user to record the desire x & y coordinate positions. The coordinates can be entered into the
computer memory or stored or an off-line storage medium such as magnetic tape.
Advantages:
Disadvantages:
1. Costly
Touch Panels:
Touch Panels is a type of display screen that has a touch-sensitive transparent panel covering the
screen. A touch screen registers input when a finger or other object comes in contact with the
screen.
When the wave signals are interrupted by some contact with the screen, that located is recorded.
Touch screens have long been used in military applications.
Voice Recognition is one of the newest, most complex input techniques used to interact with the
computer. The user inputs data by speaking into a microphone. The simplest form of voice
recognition is a one-word command spoken by one person. Each command is isolated with
pauses between the words.
Voice Recognition is used in some graphics workstations as input devices to accept voice
commands. The voice-system input can be used to initiate graphics operations or to enter data.
These systems operate by matching an input against a predefined dictionary of words and
phrases.
Advantage:
2. Easy to use
Disadvantages:
Image Scanner
It is an input device. The data or text is written on paper. The paper is feeded to scanner. The
paper written information is converted into electronic format; this format is stored in the
computer. The input documents can contain text, handwritten material, picture extra. By storing
the document in a computer document became safe for longer period of time. The document will
be permanently stored for the future. We can change the document when we need. The document
can be printed when needed.Scanning can be of the black and white or colored picture. On stored
picture 2D or 3D rotations, scaling and other operations can be applied.
1. Flat Bed Scanner: It resembles a photocopy machine. It has a glass top on its top. Glass top
in further covered using a lid. The document to be scanned is kept on glass plate. The light is
passed underneath side of glass plate. The light is moved left to right. The scanning is done the
line by line. The process is repeated until the complete line is scanned. Within 20-25 seconds a
document of 4" * 6" can be scanned.
2. Hand Held Scanner: It has a number of LED's (Light Emitting Diodes) the LED's are
arranged in the small case. It is called a Hand held Scanner because it can be kept in hand which
performs scanning. For scanning, the scanner is moved over the document from the top towards
the bottom. Its light is on, while we move it on document. It is dragged very slowly over
document. If dragging of the scanner over the document is not proper, the conversion will not
correct.
Q. Antialiasing
Ans. Antialiasing is a technique used in computer graphics to remove the aliasing effect. The
aliasing effect is the appearance of jagged edges or “jaggies” in a rasterized image (an image
rendered using pixels). The problem of jagged edges technically occurs due to distortion of the
image when scan conversion is done with sampling at a low frequency, which is also known as
Undersampling. Aliasing occurs when real-world objects which comprise of smooth, continuous
curves are rasterized using pixels.
fs =2*fmax
This can also be stated as that our sampling interval should be no larger than half the cycle
interval. This maximum required the sampling interval is called Nyquist sampling interval Δxs:
Δxs = Δxcycle/2
Where Δxcycle=1/fmax
Aliasing is removed using four methods: Using high-resolution display, Post filtering
(Supersampling), Pre-filtering (Area Sampling), Pixel phasing. These are explained as following
below.
1. Using high-resolution display:
One way to reduce aliasing effect and increase sampling rate is to simply display objects at a
higher resolution. Using high resolution, the jaggies become so small that they become
indistinguishable by the human eye. Hence, jagged edges get blurred out and edges appear
smooth.
Practical applications:
For example retina displays in Apple devices, OLED displays have high pixel density due to
which jaggies formed are so small that they blurred and indistinguishable by our eyes.
In this method, we are increasing the sampling resolution by treating the screen as if it’s made of
a much more fine grid, due to which the effective pixel size is reduced. But the screen resolution
remains the same. Now, intensity from each subpixel is calculated and average intensity of the
pixel is found from the average of intensities of subpixels. Thus we do sampling at higher
resolution and display the image at lower resolution or resolution of the screen, hence this
technique is called supersampling. This method is also known as post filtration as this procedure
is done after generating the rasterized image.
Practical applications:
In gaming, SSAA (Supersample Antialiasing) or FSAA (full-scene antialiasing) is used to create
best image quality. It is often called the pure AA and hence is very slow and has a very high
computational cost. This technique was widely used in early days when better AA techniques
were not available. Different modes of SSAA available are: 2X, 4X, 8X, etc. denoting that
sampling is done x times (more than) the current resolution.
3. Pre-filtering (Area Sampling):
In area sampling, pixel intensities are calculated proportional to areas of overlap of each pixel
with objects to be displayed. Here pixel color is computed based on the overlap of scene’s
objects with a pixel area.
For example: Suppose, a line passes through two pixels. The pixel covering bigger portion(90%)
of line displays 90% intensity while less area(10%) covering pixel displays 10-15% intensity. If
pixel area overlaps with different color areas, then the final pixel color is taken as an average of
colors of the overlap area. This method is also known as pre-filtering as this procedure is done
BEFORE generating the rasterized image. It’s done using some graphics primitive algorithms.
4. Pixel phasing:
It’s a technique to remove aliasing. Here pixel positions are shifted to nearly approximate
positions near object geometry. Some systems allow the size of individual pixels to be adjusted
for distributing intensities which is helpful in pixel phasing.
Random Scan System uses an electron beam which operates like a pencil to create a
line image on the CRT screen. The picture is constructed out of a sequence of
straight-line segments. Each line segment is drawn on the screen by directing the beam
to move from one point on the screen to the next, where its x & y coordinates define
each point. After drawing the picture. The system cycles back to the first line and design
all the lines of the image 30 to 60 time each second. The process is shown in fig:
Advantages:
1. A CRT has the electron beam directed only to the parts of the screen where an
image is to be drawn.
3. High Resolution
Disadvantages:
A Raster Scan Display is based on intensity control of pixels in the form of a rectangular
box called Raster on the screen. Information of on and off pixels is stored in refresh
buffer or Frame buffer. Televisions in our house are based on Raster Scan Method. The
raster scan system can store information of each pixel position, so it is suitable for
realistic display of objects. Raster Scan provides a refresh rate of 60 to 80 frames per
second.
Frame Buffer is also known as Raster or bit map. In Frame Buffer the positions are
called picture elements or pixels. Beam refreshing is of two types. First is horizontal
retracing and second is vertical retracing. When the beam starts from the top left corner
and reaches the bottom right scale, it will again return to the top left side called at
vertical retrace. Then it will again more horizontally from top to bottom call as horizontal
retracing shown in fig:
2. Non-Interlaced Scanning
In Interlaced scanning, each horizontal line of the screen is traced from top to bottom.
Due to which fading of display of object may occur. This problem can be solved by
Non-Interlaced scanning. In this first of all odd numbered lines are traced or visited by
an electron beam, then in the next circle, even number of lines are located.
For non-interlaced display refresh rate of 30 frames per second used. But it gives
flickers. For interlaced display refresh rate of 60 frames per second is used.
Advantages:
1. Realistic image
Disadvantages:
1. Low Resolution
2. Expensive
Q. Interactive GRaphics
Ans.
In interactive Computer Graphics user have some controls over the picture, i.e., the user
can make any change in the produced image. One example of it is the ping-pong game.
1. Higher Quality
3. Greater Productivity
2. A Monitor likes a home T.V. set without the tuning and receiving electronics.
3. Display Controller or Video Controller: It passes the contents of the frame buffer
to the monitor.
Frame Buffer: A digital frame buffer is large, contiguous piece of computer memory
used to hold or map the image displayed on the screen.
● At a minimum, there is 1 memory bit for each pixel in the raster. This amount of
memory is called a bit plane.
● ∵ A memory bit has only two states (binary 0 or 1), a single bit plane yields a
black and white (monochrome display).
2. Resolution: Use to describe the number of pixels that are used on display image.
3. Aspect Ratio: It is the ratio of width to its height. Its measure is unit in length or
number of pixels.
Aspect Ratio =
Q. Homogenous Corrdinates (2D, 3D)
Ans.
Homogeneous coordinates will have some neutral applications in computer graphics, they form
the basis for geometry which is used extensively to display three-dimensional objects on
two-dimensional image planes. Homogeneous coordinate provides a standard to perform certain
standard operations on points in euclidean space means matrix multiplication.
Homogeneous coordinate systems are used in two ways in computer graphics. One of them is by
taking an extra value(for example taking the third element in two dimensions and the fourth
element in three dimensions) extra element can be any value that will be the divisor of other
components which is used occasionally. The restricted form of homogeneous coordinates is also
valuable in computer graphics it solves problems in representing and implementing
transformations of geometric objects. Most graphics are represented by matrices, and applied for
vectors in cartesian form, by taking vectors as column vectors and multiplying them by the
transformation’s matrix.
Homogeneous coordinates are generally used in design and construction applications. Here we
perform translations, rotations, and scaling to fit the picture into proper position.
Q14. What do you mean by retracing? Define horizontal as well as vertical retracing.
Ans. At the end of each scan line, the electron beam returns to the left side of the screen to begin
displaying the next scan line. The return to the left of the screen, after refreshing each scan line is called
the horizontal retrace. And at the end of each frame, the electron beam returns to the top left corner of
the screen to begin the next frame is called the vertical retrace.
Q19. What are advantages of DVST over CRT? Also list some disadvantages of DVST.
Ans. Advantages:
i. No refreshing is needed.
ii. Very complex pictures can be displayed at very high resolution without
flicker. Disadvantages:
i. They ordinarily do not display color
ii. Selected part of the picture can not be erased
iii. The erasing and redrawing process can take several seconds for complex pictures.
3] Color electrostatic plotters are available. They make multiple passes over the paper to plot color
pictures.
Q32.Consider three different raster systems with resolutions of 640 x 480, 1280 x 1024, and 2560 x
2048.
a) What size is frame buffer (in bytes) for each of these systems to store 12 bits per pixel?
Ans. Because eight bits constitute a byte, frame-buffer sizes of the systems are as follows:
640 x 480 x 12 bits / 8 = 450KB;
1280 x 1024 x 12 bits / 8 = 1920KB;
2560 x 2048 x 12 bits / 8 = 7680KB;
b) How much storage (in bytes) is required for each system if 24 bits per pixel are to be stored?
Similarly, each of the above results is just doubled for 24 (12×2) bits of storage per pixel.
Q33.Consider two raster systems with the resolutions of 640 x 480 and 1280 x 1024.
a) How many pixels could be accessed per second in each of these systems by a display controller
that refreshes the screen at a rate of 60 frames per second?
Ans. Since 60 frames are refreshed per second and each frame consists of 640 x 480 pixels, the access
rate of such a system is (640 x 480) * 60 = 1.8432 x 107 pixels/second.
Likewise, for the 1280 x 1024 system, the access rate is (1280 x 1024) * 60 = 7.86432 x
107 pixels/second.
Q34. Consider a raster system with the resolution of 1024 x 768 pixels and the color palette
calls for 65,536 colors. What is the minimum amount of video RAM that the computer must
have to support the above-mentioned resolution and number of colors?
Ans. Recall that the color of each pixel on a display is represented with some number of bits. Hence,
a display capable of showing up to 256 colors is using 8 bits per pixels (i.e. “8-bit color”).
Notice first that the color palette calls for 65,536 colors. This number is but 216 , which implies that 16
bits are being used to represent the color of each pixel on the display. The display’s resolution is 1024
by 768 pixels, which implies that there is a total of 786,432 (1024 × 768) pixels on the display. Hence,
the total number of bits required to display any of 65,536 colors on each of the screen’s 786,432 pixels
is 12,582,912 (786,432 × 16). Dividing this value by 8 yields an answer of 1,572,864 bytes. Dividing
that value by 1,024 yields an answer of 1,536 KB. Dividing that value by 1,024 yields an answer of 1.5
MB.
Q36. How Many k bytes does a frame buffer nees in a 600 x 400 pixel ?
Ans.
Given :- Resolution is 600 x 400
Suppose 1 pixel can store n bits
Then, the size of frame buffer = Resolution X bits per pixel
= (600 X 400) X n bits
= 240000 n bits
= 240000 n (as 1kb = 1024 bites)
k bytes
1024 X 8
= 29.30 n k bytes
Q37. Find out the aspect ratio of the raster system using 8 x 10 inches screen and 100 pixel/inch.
= 8 x 100 = 4/5
10 x 100
Q38. How much time is spent scanning across each row of pixels during screen refresh on a
raster system with resolution of 1280 X 1024 and a refresh rate of 60 frames per second?
That means system contains 1024 scan lines and each scan line contains 128 pixels
1
Sec = 0.058 sec
60 X 1024
Q 39. Suppose RGB raster system is to be designed using on 8 inch X 10 inch screen with a
resolution of 100 pixels per inch in each direction. If we want to store 6 bits per pixel in the
frame buffer, how much storage (in bytes) do we need for frame buffer?
= 800 X 100 X 6
Bytes = 6 x 105 bytes.
8
(x , y)
(x+1, y)
(x+1, y+1)
(x , y+1)
and let the transformation matrix be a c
b d
So,
0 2 8 6 a c x x+1 x+1 x
=
0 3 4 1 b d y y y+1 y+1
0 3 4 1
=
ax+cy a(x+1)+cy a(x+1)+c(y+1) 0 ax+c(y+1)
3 4 1
3 1
Q41. a) Find the matrix that represents rotation of an object by 45o about the origin.
b) What are the new coordinates of the point P(2 , -4) after the rotation?
2 2 4
Find the transformed coordinates after the following transformation
Q43. Translate the square ABCD whose co-ordinate are A(0,0), b(3,0), C(3,3), D(0,3) by 2 units in
both direction and then scale it by 1.5 units in x direction and 0.5 units in y direction.
Q45. Find the transformation matrix that transforms the square ABCD whose center is at (2,2)
is reduced to half of its size, with center still remaining at (2,2). The coordinate of square ABCD
are A(0,0), B(0,4), C(4,4) and D(4,0). Find the co-ordinate of new square.
Ans. (HINT:- After scaling the square to half of its size, the new translated square will have
center at (1,1) so, translate again the new square by (1,1), so that center again reach to (2,2).)
Q46. Consider the square A(1,0), B(0,0), C(0,1), D(1,1). Rotate the square ABCD by 45o
clockwise about A(1,0).
Ans . HINT:-
1) First, translate the square by Tx= -1 and Ty=0.
2) Then rotate the square by 45o.
3) Again translate the square by Tx=1 and Ty=0.
Q.47. Magnify the triangle with vertices A(0,0), B(1,1) and C(5,2) to twice its size while keeping
C(5,2) fixed.
Ans . HINT:-
1) First, translate the triangle by Tx= -5 and Ty=-2
2) Then Magnify the triangle by twice its size
3) Again translate the triangle by Tx= 5 and Ty= 2.
Q48. Prove that 2D rotation and scaling is commutative i.e R.S = S.R if
1.) Sx = Sy
2.) = n
[T] = 1-t2 2t
1-t2 1 + t2
represents pure rotation.
-2t 1-t2
1+t2 1+t2
Ans. We know that for pure rotational transformation determinant of the transformation matrix
is always equal to 1.
2 2
So, the determinant of [T] = 1-t2
2t
1-t2
1 + t2 1 + t2 1-t2
1 + t2 1 + t2
= (1-t2)2 4t2
+
2 2
(1+t ) (1+t2)2
1 a 1 0
Shearing in x direction is and in y direction is . . Therefore,
0 1 b 1
1 a 1 0 1 + ab a
=
0 1 b 1 b 1
1
is not equal to Sh .
Q51. Prove that two 2D rotation above the origin commutative i.e R1R2=R2R1.
Ans :- Hint take R1 be the rotation by the angle and R2 be the rotation in same direction by
the angle α . First perform matrix for R1.R2 then R2.R1 and prove.
Q52. Prove that two scaling transformation are commutative i.e. S1.S2 = S2.S1
0 m 0 0 n 0
0 0 1 0 0 1
Ans:
(50,40) (80,40)
) )
P1P1(70,20)
(70,20)
(50,10) (80,10)
) P2 (100,10)
M = y – y2
x – x2
-1/3 = y – 10
80 – 100
y-10 = 20 / 3
y=16.66
(50,40) (80,40)
) )
P1 (70,20) P3 (80,16.66)
(50,10) (80,10)
) P2 (100,10)