0% found this document useful (0 votes)
66 views14 pages

CGR - Summer 2023 Ans-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, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views14 pages

CGR - Summer 2023 Ans-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, TXT or read online on Scribd
You are on page 1/ 14

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
SUMMER – 2023 EXAMINATION b) Define : 2M
Model Answer – Only for the Use of RAC Assessors (i) Convex Polygon
Subject Name: Computer Graphics Subject Code: (ii) Concave polygon
22318
Ans Convex Polygon: It is a polygon in which if you take any two positions of polygon then all 1 M each
Important Instructions to examiners: XXXXX the points on the line segment joining these two points fall within the polygon itself. for correct
1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. definition
Concave Polygon: It is a polygon in which if you take any two positions of polygon then
2) The model answer and the answer written by candidate may vary but the examiner may try to assess the
understanding level of the candidate. all the points on the line segment joining these two points does not fall entirely within the
3) The language errors such as grammatical, spelling errors should not be given more Importance (Not applicable for polygon.
subject English and Communication Skills.
4) While assessing figures, examiner may give credit for principal components indicated in the figure. The figures
drawn by candidate and model answer may vary. The examiner may give credit for any equivalent figure drawn.
5) Credits may be given step wise for numerical problems. In some cases, the assumed constant values may vary and
there may be some difference in the candidate’s answers and model answer.
6) In case of some questions credit may be given by judgement on part of examiner of relevant answer based on
candidate’s understanding.
7) For programming language papers, credit may be given to any other program based on equivalent concept.
8) As per the policy decision of Maharashtra State Government, teaching in English/Marathi and Bilingual (English +
Marathi) medium is introduced at first year of AICTE diploma Programme from academic year 2021-2022. Hence if
the students in first year (first and second semesters) write answers in Marathi or bilingual language (English c) Write matrix representation for X-shear and Y-shear 2M
+Marathi), the Examiner shall consider the same and assess the answer based on matching of concepts with model
answer. Ans Shearing in X Axis- X-shear
Matrix –
Shearing in X axis is achieved by using the following shearing equations-
Q. Sub Answer Marking 1 M,
No. Q. Scheme Xnew = Xold + Shx x Yold
N. Y-shear
Ynew = Yold
Matrix –
1 Attempt any FIVE of the following: 10 M 1M
a) Define : 2M
(i) Pixel
(ii) Frame Buffer

Ans i) Pixel 1 M each


for any
Pixel or Pel is defined as "the smallest addressable screen element". correct
OR definition

A pixel may be defined as the smallest size object or color spot that can be displayed and
addressed on a monitor. Shearing in Y Axis-

ii) Frame Buffer Shearing in Y axis is achieved by using the following shearing equations-
Xnew = Xold
The frame buffer is the video memory (RAM) that is used to hold or map the image
displayed on the screen. Ynew = Yold + Shy x Xold

OR
A framebuffer (frame buffer, or sometimes framestore) is a portion of RAM containing a
bitmap that drives a video display.

Page No: 1 | 27 Page No: 2 | 27


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
points in euclidean space means matrix multiplication.

3) Homogeneous coordinate systems mean expressing each coordinate as a homogeneous


coordinate to represent all geometric transformation equations as matrix multiplication.

4) The restricted form of homogeneous coordinate is also valuable in computer graphics it


solves problems in representing and implementing transformations of geometric objects.

5) 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.
d) List any four display devices. 2M
6) Homogeneous coordinates are ubiquitous in computer graphics because they allow
Ans 1) Raster Scan Display Any 4 common vector operations such as translation, rotation, scaling and perspective projection
correct to be represented as a matrix by which the vector is multiplied.
2) Random Scan Display display
devices - g) Give any four applications of computer graphics. 2M
3) Liquid crystal display(LCD)
2M
4) Light Emitting Diode(LED) Ans Applications of Computer Graphics Any 4
correct
5) Plasma Display • Computer graphics user interfaces (GUIs) − A graphic, mouse-oriented paradigm applications
which allows the user to interact with a computer. -2M
6) Touch Screen display
• Business presentation graphics −""A picture is worth a thousand words""
e) State any four general criteria applied for any line drawing algorithm. 2M • Cartography − Drawing maps.
• Weather Maps −Real-time mapping, symbolic representations.
Ans There are the following general criteria of Line Drawing Algorithm. Any 4 • Satellite Imaging − Geodesic images.
correct
• Photo Enhancement − Sharpening blurred photos.
1) An algorithm should be precise: Each step of the algorithm must be adequately criteria –
defined. 2M • Medical imaging − MRIs, CAT scans, etc. - Non-invasive internal examination.
2) Finiteness: An algorithm must contain finiteness. It means the algorithm stops after • Engineering drawings − mechanical, electrical, civil, etc. - Replacing the blueprints
the execution of all steps. of the past.
3) Easy to understand: An algorithm must help learners to understand the solution in a • Architecture − Construction plans, exterior sketches - replacing the blueprints and
more natural way. hand drawings of the past.
4) Correctness: An algorithm must be in the correct manner. • Art − Computers provide a new medium for artists.
5) Effectiveness: The steps of an algorithm must be valid and efficient. • Entertainment − Movies and games.
6) Uniqueness: All steps of an algorithm should be clearly and uniquely defined, and • Simulation and modeling−Replacing physical modeling and enactments
the result should be based on the given input.
7) Input: A good algorithm must accept at least one or more input.
8) Output: An algorithm must generate at least one output. 2. Attempt any THREE of the following: 12 M
f) List any four properties of homogeneous co-ordinate system. 2M a) Differentiate between random scan and raster scan. 4M

Ans 1) Homogeneous coordinates will have some neutral applications in computer graphics, Any 4
they form the basis for geometry which is used extensively to display three-dimensional correct
objects on two-dimensional image planes. properties -
2M
2) Homogeneous coordinate provides a standard to perform certain standard operations on

Page No: 3 | 27 Page No: 4 | 27


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
Ans Any 4 2. Starbust method
correct • In this method a fix pattern of line segments are used to generate characters.
Difference- • As shown in figure, there are 24 line segments.
4M • Out of 24 line segments, segments required to display for particular character, are
(each highlighted
difference- • This method is called starbust method because of its characteristic appearance. This
1 M) method of character generation has some disadvantages. They are
1. The 24-bits are required to represent a character. Hence more memory is required
2. Requires code conversion software to display character from its 24-bit code
3. Character quality is poor. It is worst for curve shaped characters.

b) State different character generation method. Describe any one in detail. 4M


3. Bitmap Method: Also known as dot matrix because in this method characters are
Ans There are basic three methods: Listing represented by an array of dots in the matrix form.
– Stroke method three • It’s a two dimensional array having columns and rows: 5 X 7 as shown in figure.
– Starbust method Methods – • 7 X 9 and 9 X 13 arrays are also used.
– Bitmap method 1M, • Higher resolution devices may use character array 100 X 100.
1. Stroke method
• This method uses small line segments to generate a character. Any One
• The small series of line segments are drawn like a stroke of a pen to form a character as correct
shown in figure. description-
3M

c) Explain types of parallel projections with examples. 4M


• We can build our own stroke method. Ans Various types of parallel projections are shown in the following hierarchy. Orthograph
• By calling a line drawing algorithm. ic
• Here it is necessary to decide which line segments are needed for each character and projection
• Then drawing these segments using line drawing algo. explanation
• This method supports scaling of the character. with
• It does this by changing the length of the line segments used for character drawing. example -

Page No: 5 | 27 Page No: 6 | 27


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
2 M,
Oblique
projection
explanation
with
example-
2M

Orthographic Projection d) Describe Sutherland Hodgeman algorithm for polygon clipping. 4M


• In orthographic projection the direction of projection is normal to the projection of the
Ans In Sutherland-Hodgeman, a polygon is clipped by processing the polygon boundary as a Explanation
plane.
whole against each window edge. Clipping window must be convex. -1M
• There are three types of orthographic projections −
and
– Front Projection
– Top Projection This could be accomplished by processing all polygon vertices against each clip rectangle Algorithm-
3M
– Side Projection boundary in turn beginning with the original set of polygon vertices, first clip the polygon
against the left rectangle boundary to produce a new sequence of vertices.

The new set of vertices could then be successively passed to a right boundary clipper, a top
boundary clipper and a bottom boundary clipper.

At each step a new set of polygon vertices us generated and passed to the next window
boundary clipper. This is the logic used in Sutherland-Hodgeman algorithm.

Fig. Clipping polygon against successive window boundaries

The output of algorithm is a list of polygon vertices all of which are on the visible side of
clipping plane. Such each edge of the polygon is individually compared with the clipping
plane.
Oblique Projection This is achieved by processing two vertices of each edge of the polygon around the
• In oblique projection, we can view the object better than orthographic projection.
clipping boundary or plane.
• There are two types of oblique projections − Cavalier and Cabinet.
• The Cavalier projection makes 45° angle with the projection plane. This results in four possible relationships between the edge and clipping plane.
• The projection of a line perpendicular to the view plane has the same length as the line
itself in Cavalier projection. Case 1. If first vertex of polygon edge is outside and second is inside window boundary,
• In a cavalier projection, the foreshortening factors for all three principal directions are then intersection point of polygon edge with window boundary and second vertex are added
equal.
to output vertices set as shown in Fig.
• The Cabinet projection makes 63.4° angle with the projection plane.
• In Cabinet projection, lines perpendiculars to the viewing surface are projected at ½ their
actual length.
• Both the projections are shown in the following figure –

Page No: 7 | 27 Page No: 8 | 27


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
window is:

(i) IX = xmax

(ii) IY = slope*(xmax – x1) + y1, where the slope = (y2 – y1)/(x2 – x1)

3. The intersection of the polygon's edge with the top side of the window is:

(i) IX = x1 + (ymax – y1) / slope

(ii) IY = ymax

4. Finally, the intersection of the edge with the bottom side of the window is:

(i) IX = x1 + (ymin – y1) / slope

(ii) IY = ymin

Algorithm for Sutherland-Hodgeman Polygon Clipping:


Case 2. If both vertices of edge are inside window boundary, then add only second vertex to
Step 1: Read co-ordinates of all vertices of the polygon.
output set as shown in Fig.
Step 2: Read co-ordinates of the clipping window.
Case 3. If first vertex of edge is inside and second is outside of window boundary then point
of intersection of edge with window boundary is stored in output set as shown in Fig. Step 3: Consider the left edge of window.
Case 4. If both vertices of edges are outside of window boundary then those vertices are Step 4: Compare vertices of each of polygon, individually with the clipping plane.
rejected as shown in Fig.
Step 5: Save the resulting intersections and vertices in the new list of vertices according to
Going through above four cases we can realize that there are two key processes in this four possible relationships between the edge and the clipping boundary.
algorithm:
Step 6: Repeat the steps 4 and 5 for remaining edges of clipping window. Each time
1. Determine the visibility of point or vertex (Inside – Outside Test) resultant list of vertices is successively passed to process next edge of clipping window.
2. Determine the intersection of the polygon edge and clipping plane. Step 7: Stop.
The second key process in Sutherland-Hodgeman polygon clipping algorithm is to
determine the intersection of the polygon edge and clipping plane.
3. Attempt any THREE of the following: 12 M
Assume that we're clipping a polygon’s edge with vertices at (x1, y1) and (x2, y2) against a
clip window with vertices at (xmin, ymin) and (xmax, ymax). a) Write and explain steps for DDA Line drawing algorithm. 4M

1. The location (IX, IY) of the intersection of the edge with the left side of the Ans Steps 1: Read the end points of line (x1,y1) and (x2,y2) Correct
algorithm-
window is: Steps 2: x = abs (x2 – x1) 4M

(i) IX = xmin and

(ii) IY = slope*(xmin – x1) + y1, where the slope = (y2 – y1)/(x2 – x1). y = abs (y2 – y1)

2. The location of the intersection of the edge with the right side of the Step 3:

Page No: 9 | 27 Page No: 10 | 27


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
if x  y Rotate about point P1(x1, y1).

then 1) Translate P1 to origin.

length = x 2) Rotate

else 3) Translate back to P1.

length = y Equation for this composite transformation matrix form is as follows:

end if

Step 4: x = (x2 – x1)/length

Step 5: y = (y2 – y1)/length

Step 6:

x= x1 + 0.5 * sign (x) Here (x1,y1) are coordinates of point P1 and hence are translation factors tx and ty; we want
to move P1 to origin , x1 and y1 are x and y distances to P1and hence it is translation factor
y= y1 + 0.5 * sign (y)

Step 7:

i = 1 while (i  length)

plot (integer (x), integer (y))


It is demonstrated in following figure :
x = x + x

y = y + y

i=i+1

Step 8: End

b) Describe 2D transformation matrix for rotation about arbitrary point 4M

Ans To do rotation of an object about any selected arbitrary point P1(x1, y1); following Explanation c) Explain any two text clipping methods. 4M
sequence of operations shall be performed. - 3 M,
Matrix- Ans Many techniques are used to provide text clipping in a computer graphics. It depends on Any two
1. Translate: Translate an object so that arbitrary point P1 is moved to coordinate origin. 1 M, the methods used to generate characters and the requirements of a particular application. method
Diagram- There are three methods for text clipping which are listed below – explanation
2. Rotate: Rotate object about origin. 1M 1) All or none string clipping 4M
(2 M each)
3. Translate: Translate object so that arbitrary point P1 is moved back to its original 2) All or none character clipping
position.
Page No: 11 | 27 Page No: 12 | 27
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
3) Text clipping

The following figure shows all or none string clipping –

This clipping method is based on characters rather than the entire string. In this method if
the string is entirely inside the clipping window, then we keep it. If it is partially outside
the window, then you reject only the portion of string being outside. If the character is on
the boundary of the clipping window, then we discard only that portion of character that
In all or none string clipping method, either we keep the entire string or we reject entire is outside of the clipping window.
string based on the clipping window. As shown in the above figure, STRING2 is entirely d) Write C program to generate Hilbert’z Curve. 4M
inside the clipping window so we keep it and STRING1 being only partially inside the
Ans #include <stdio.h> Any correct
window, we reject.
The following figure shows all or none character clipping – #include <stdlib.h> logic
#include <dos.h> program-
#include <graphics.h> 4M
#include <conio.h>

void move(int j, int h, int &x, int &y)


{
if(j==1)
y-=h;
else if(j==2)
x+=h;
else if(j==3)
This clipping method is based on characters rather than entire string. In this method if the y+=h;
string is entirely inside the clipping window, then we keep it. If it is partially outside the else if(j==4)
window, then − x-=h;
You reject only the portion of the string being outside If the character is on the boundary lineto(x,y);
of the clipping window, then we discard that entire character and keep the rest string. delay(10);
The following figure shows text clipping –
}

void hilbert(int r,int d,int l,int u,int i,int h,int &x,int &y)
{
if(i>0)
{
i--;
hilbert(d,r,u,l,i,h,x,y);
Page No: 13 | 27 Page No: 14 | 27
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
move(r,h,x,y); Mars surface, the top of Mt. Everest, areas deep under the sea, and many more things that
hilbert(r,d,l,u,i,h,x,y); we can imagine only. It uses three of our senses: hearing, touching, seeing, to trick the brain
move(d,h,x,y); into thinking that we are at a different place.
hilbert(r,d,l,u,i,h,x,y);
move(l,h,x,y); Advantages of Virtual Reality:
hilbert(u,l,d,r,i,h,x,y); • It creates an interactive environment.
} • It helps us to explore the world by creating a realistic world using computer
} technology.
• It makes education comfortable and easy.
void main() • It allows users to do an experiment in an artificial environment.
{ • It increases the work capabilities.
int n,x1,y1; • Virtual reality is helpful for medical students to do practice well. It will be helpful
int x0=50,y0=150,x,y,h=10,r=2,d=3,l=4,u=1; for patients, too, as it offers a safe environment to them by which a patient can come
printf("\nGive the value of n: "); into contact with the things they fear.
scanf("%d",&n); • Virtual reality helps to measure the performance of sportsperson and analyze their
x=x0;y=y0; techniques.
int gm,gd=DETECT;
Disadvantages of Virtual Reality:
initgraph(&gd,&gm,NULL);
moveto(x,y); • Using VR, people start ignoring the real world. They started living in the virtual
hilbert(r,d,l,u,n,h,x,y); world instead of dealing with the issues of the real world.
getch(); • Training in the virtual environment does not have the same result as training in the
closegraph(); actual world.
} • It is not guaranteed that a person has done a task well in the real world if he/she has
performed that task well in the virtual world.

4. Attempt any THREE of the following: 12 M


ii) Augmented Reality:
a) Describe following : 4M
The word "Augmented" means to add. It is created by using the technology by adding
(i) Virtual Reality digital information to an image or something. Augmented reality is an important concept
(ii) Augmented Reality and impacts our lives deeply. It provides an improved version of reality as it uses different
Ans i) Virtual Reality: Virtual tools to make the environment existing and real. Augmented reality gives you an interactive
Reality- experience of the real-world environment. It keeps you in your place and superimposes the
It is a very important and interesting term. The terms 'Virtual' refers to something 2 M, technology in the form of text, sounds, and images.
conceptual that does not have its physical existence, and the word 'reality refers to the state Augmented
of being real. So, virtual reality means something that is almost real. It is defined as the Reality - Augmented reality merges the physical world with computer-generated virtual elements. It
creation of a simulated environment by using computer technology. Viewing virtual reality 2M is accessed using common equipment such as mobile phones. There are nearly uncountable
means viewing a completely different reality than the one in front of you. It can be artificial, possibilities with the Augmented Reality. With the smartphone's camera, AR adds the
like an animated scene or a place which is photographed and integrated in a virtual reality digital elements to a live view. It uses the smartphone's camera to present the real world's
app. It enables us to move around and look in every direction - up, down, sideways, and view in front of us and then put a layer of information that includes the text or images on
behind, as we are present there actually. the top of that view. Some of the examples of Augmented Reality are the Pokémon Go
game, Snapchat lenses.
Virtual reality apps allow us to explore the places that we have never been to, such as the

Page No: 15 | 27 Page No: 16 | 27


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
Advantages of Augmented Reality This method is also used with the simple polygons to test the given point is interior or not.
It can be simply understood with the help of a pin and a rubber band.
The advantages of Augmented Reality are listed as follows - Fix up the pin on one of the edge of the polygon and tie-up the rubber band in it and then
stretch the rubber band along the edges of the polygon.
• It increases accuracy. When all the edges of the polygon are covered by the rubber band, check out the pin
• It offers innovation, continuous improvement, and individualized learning. which has been fixed up at the point to be test. If we find at least one wind at the point
• It helps developers to build games that offer real experiences. consider it within the polygon, else we can say that the point is not inside the polygon.
• It enhances the knowledge and information of the user.

Disadvantages of Augmented Reality

• Projects based on AR technology are expensive to implement and develop.


• Excessive use of augmented reality technology can lead to eye problems, obesity,
etc.
• It can cause mental health issues.

b) Explain Inside and Outside test for the polygon with suitable example. 4M

Ans This method is also known as counting number method. While filling an object, we often Explanation
need to identify whether particular point is inside the objector outside it. -4M

There are two methods by which we can identify whether particular point is inside an
object or outside namely, Odd-Even Rule, and Non-zero winding number rule. Fig b: Non-zero Winding Number Rule

In another alternative method, give directions to all the edges of the polygon. Draw a scan
1. Odd-Even Rule:
line from the point to be test towards the left most of X direction. Given the value 1 to all
In this technique, we count the edge crossing along the line from any point (x, y) to
the edges which are going to upward direction and all other – 1 as direction values.
infinity. If the number of interactions is odd then the point (x, y) is an interior point. If the
Check the edge direction values from which the scan line is passing and sumup them.
number of interactions is even then point (x, y) is an exterior point.
If the total sum of this direction value is non-zero, then this point to be tested is an interior
Here is the example to give you the clear idea,
point, otherwise it is an exterior point.
In the above figure, we sum up the direction values from which the scan line is passing
then the total is 1 – 1 + 1 = 1; which is non-zero. So the point is said to be an interior
point.
c) Describe 3D scaling along with its matrix representation. 4M

Ans Scaling means to change the size of object. This change can either be positive or negative. Description
- 2 M,
• To change the size of an object, scaling transformation is used. In the scaling Matrix-
process, you either expand or compress the dimensions of the object. 2M
• Scaling can be achieved by multiplying the original co-ordinates of the object with
the scaling factor to get the desired result.

3D Scaling Matrix
From the Fig., we can see that from the point (x, y), the number of interactions point on
the left side is 5 and on the right side is 3. So the total number of interaction point is 8,
which is odd. Hence, the point is considered within the object.

2. Non-zero Winding Number Rule:

Page No: 17 | 27 Page No: 18 | 27


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
It specifies three co-ordinates with their own scaling factors. If scale factors,Sx = Sy = Sz =
S > 1 then the scaling is called as magnification.
Sx = Sy = Sz = S < 1 then the scaling is called as reduction.
Therefore, point after scaling with respect to origin can be calculated as,P=P . S

d) Write down Cyrus Beck Line clipping algorithm. 4M

Ans Any correct


logic
Proper
algorithm
4 Marks

5. Attempt any TWO of the following: 12 M

a) Use Bresenham’s line drawing algorithm to rasterize line from (6, 5) to (15, 10). 6M

d) Explain curve generation using interpolation techniques. 4M

Ans Specify a spline curve by giving a set of coordinate positions, called control points, which Diagram-
indicates the general shape of the curve These, control points are then fitted with 2 M,
piecewise continuous parametric polynomial functions in one of two ways. When
polynomial sections are fitted so that the curve passes through each control point, the Explanation
resulting curve is said to interpolate the set of control points. On the other hand, when the -2M
polynomials are fitted to the general control -point path without necessarily passing
through any control point, the resulting curve is said to approximate the set of control
points interpolation curves are commonly used to digitize drawings or to specify
animation paths. Approximation curves are primarily used as design tools to structure
object surfaces an approximation spline surface credited for a design application.
Straight lines connect the control -point positions above the surface.

Page No: 19 | 27 Page No: 20 | 27


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
Ans Calculation
s of dx, dy
and p- 2 M;
Calculation
s of steps-
4M

b) Perform 2D scaling transformation on square ABCD with coordinates 6M


(0,1),(4,1),(4,5),(0,5) by 3 units for X-direction and 2 units in y-direction.

Ans Correct
solution -
6M

c) Obtain the curve parameters for drawing a smooth Bezier curve for the 6M

Page No: 21 | 27 Page No: 22 | 27


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
following points A(0,10), B(10,50), C(70,40) &D(70,-20).

Ans Correct
solution-
6M

Page No: 23 | 27 Page No: 24 | 27


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
Ans The Transformation matrix for reflection about the line y=x is given as: Transforma
tion matrix
for
0 1 reflection -
1 0 2 M,
Counter
clockwise
rotation
The transformation matrix for reflection about x-axis and for counter clockwise rotation of matrix -
900 2 M,
final
answer -
2M
1 0 and cos(90) sin(90)

6. Attempt any TWO of the following: 12 M 0 -1 -sin(90) cos(90)

a) Write boundary fill algorithm and flood fill algorithm with pseudo code. 6M
Hence,
Ans Boundary fill algorithm: Boundary
fill- 3 M, T= 1 0 0 1
boundaryFill(int x, int y, int fill_color,int boundary_color) and Flood
{ Fill 0 -1 -1 0
if(getpixel(x, y) != boundary_color && algorithm-
getpixel(x, y) != fill_color) 3M
{
putpixel(x, y, fill_color); = 0 1
boundaryFill(x + 1, y, fill_color, boundary_color);
boundaryFill(x, y + 1, fill_color, boundary_color); 1 0
boundaryFill(x - 1, y, fill_color, boundary_color);
boundaryFill(x, y - 1, fill_color, boundary_color);
} c) Apply the Liang-Barsky algorithm to the line with co-ordinates (30,60) and (60,25) 6M
} against window :
(Xmin, Ymin) = (10,10)
Flood fill Algorithm: (Xmax,Ymax) = (50,50)
Ans P = (30 , 60) Slope
floodfill (x, y,fill_ color, old_color) calculation
If (getpixel (x, y)=old_color) Q = (60 , 25) - 2 M,
{
setpixel (x, y, fill_color); (Xmin , Ymin) = (10 , 10) Point P
fill (x+1, y, fill_color, old_color); calculation
fill (x-1, y, fill_color, old_color);
(Xmax , Ymax) = (50 , 50) – 2 M,
fill (x, y+1, fill_color, old_color); Slope of line PQ Point Q
fill (x, y-1, fill_color, old_color);
calculation
} m = (y₂ – y₁)
} –2M
b) Show the transformation matrix for a reflection about the line Y=X is 6M (x₂ – x₁)
equivalent to reflection about X-axis followed by counter clockwise rotation of
m = (25-60)
90°.
(60-30)

Page No: 25 | 27 Page No: 26 | 27


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
m = -35/30

m = -1.16

x = x₁ + (y – y₁) / m

x = 30 + (50 - 60) / (-1.16)

x = 30 + (-10) / (-1.16)
x = 30 + 8.6

x = 38.6

The coordinate of intersection point is P⁻ (38.6 , 50).

y = y₁ + m(x – x₁)
y = 25 + (-1.16)(50 - 60)

y = 25 + 11.6

y = 36.6

The coordinate of intersection point is Q⁻ (50 , 36.6).

Page No: 27 | 27

You might also like