0% found this document useful (0 votes)
14 views6 pages

DC66

1. The document discusses various uses of computer graphics such as user interfaces, graphs/charts, desktop publishing, computer-aided design, simulation and animation. 2. It also provides solutions to questions about frame buffer size for a raster system, digitizing a line using Bresenham's algorithm, 2D transformations, and line clipping algorithms. 3. Key concepts around Bezier curves, oblique projections, back face detection, and frame-by-frame animation techniques are also explained.

Uploaded by

funnyclups413
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
14 views6 pages

DC66

1. The document discusses various uses of computer graphics such as user interfaces, graphs/charts, desktop publishing, computer-aided design, simulation and animation. 2. It also provides solutions to questions about frame buffer size for a raster system, digitizing a line using Bresenham's algorithm, 2D transformations, and line clipping algorithms. 3. Key concepts around Bezier curves, oblique projections, back face detection, and frame-by-frame animation techniques are also explained.

Uploaded by

funnyclups413
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 6

DC66 COMPUTER GRAPHICS JUNE 2013

Q2 (a) Write various uses of computer graphics.

Answer
1. User interface: Most of the applications that run on personal computer and
workstations have user interfaces that rely on desktop window systems to manage
multiple simultaneous activities, clicking facilities that allow user to select menu items,
icons and other objects on the window.
2. Graphs plotting in commercial applications: To create 20 and 30 graphs of
mathematical, physical and economic function, histograms, bar and pie charts,
spreadsheets, task scheduling charts etc. So CG is used to clarify complex phenomena
and to facilitate informed decision making.
3. Desktop publishing: The use of graphics for the creation and dissemination of
information has increased since the advent of desktop publishing on personal computers.
Desktop publishing set up columns for entering text and rearranges the text and
rearranges the text in the columns to fit the new size. We can mix graphics in to the text
and this is possible because these system treats text as a graphics object, knowing the
precise position coordinates, rotation, size and style of every letter.
4. Computer aided design: It allow for speedy, simple design of buildings mechanical
systems, floor plans, pcb. CAD systems save time and energy, when revising
designs.CAD systems are user friendly.
5. Simulation, animation and video games: Simulation indicates a touch of visualization,
which makes the process of simulation more convincing. Many CAD softwares are
available for simulation. Another area is cartooning .cartoon characters are modelled in
the computer as 3D shape descriptions

Q2 (b) Consider a raster system with resolution of 640 x 480.What size of frame
buffer (in bytes) is needed to store 12 bits per pixel.

Answer
Resolution = 640 x 480
Size of frame buffer = 640 x 480 pixels
= 640 x 480 x 12 bits
= (640 x 480 x 12) / 8 bytes
= 460800 bytes

Q3 (b) Digitize a line from (1, 2) to (12, 18) on a raster screen using Bresenham’s
straight line algorithm.

Answer
Algorithm:-
integer is integer floor function.
sign returns -1,0,1 as its arguments is <=0 ,=0,>0
/* appropriate the line length so that we can move along either of x or y axis */

© IETE 1
DC66 COMPUTER GRAPHICS JUNE 2013

if abs(x2 – x1) = abs(y2 –y1)


{ len= abs(x2-x1); }
else
{
len = abs(y2 –y1);
}
dx=(x2-x1) / len;
dy= (y2 –y1)/ len;
x= x1 + 0.5 * sign(dx);
y=y1+0.5 * sign(dy);
i=1;
while( i<=len)
{
putpixel (integer(x),integer(y));
x= x+dx;
y=y+dy;
i=i+1;
};

Q4 (a) Explain 2D transformation for scaling and rotation transformation. Use


suitable example.

Answer
There are times when we require a change of scale to suit our requirements.
Scaling Transformation of the form:
S= sx 0
0 sy

The contents of matrix S do matter when we are multiplying our points on the plane with
it. Suppose the scaling matrix S were identity matrix.
S= sx 0
0 sy

Then the image would not change, as anything multiplied by identity matrix would
remain the same.
Rotation Transformation of the form:
Suppose, we have a point Q1=[x1, y1] and we rotate it about the origin of an angle θ to
get a new position
Q2 = [x2, y2]. Now these rotations can be anticlockwise and clockwise.
This form of rotation is performed in three transformation steps:
1. Translate the point (xc, yc) to the origin.

2. Rotate about the origin by the specified angle.

© IETE 2
DC66 COMPUTER GRAPHICS JUNE 2013

3. Translate the center of rotation back to where it belong that is where it started.

Q4 b What are the new coordinates of the point P (2, -4) after the rotation by 30
degrees.

Answer
The given point is (2, -4) and it has to be rotated by 30 degrees.

(2 -4) √3/2 1/2 = (√3 + 2) (1-2√3)


-1/2 √3/2

The new coordinates of the point are = (√3 + 2) (1-2√3)

Q5 (a) Explain Cohen-Sutherland line clipping algorithm. Use a suitable example.

Answer
step1: compute the outcodes for each of the vertices of the given polygon.
Step 2: if both the outcodes come out to be zero, then the sides ‘k’ is within the window
part and is fully visible. So retain it and go to step 3.
Step 3: if both the outcodes are non-zero, compute the value of ‘AND’operation between
them.
Step a: if the value comes out to be non-zero, the side ‘k’ is completely outside the
window port, so is fully invisible and because will be rejected go to step 3.

Step b: If the value comes out to be zero, the side may need clipping go to step d.

Step c: If one of the two outcodes is zero, the sides requires to be clipped, go to step d.

Step d: the equation of the side using the intersection formula


(x-x1) (y2-y1) = (y-y1) (x2 – x1)

Step e: Find intersections of the side ‘k’ with each of the edges of the
windowport.Pushing the segments towards the edge of the windowport, and get the new
fresh outcodes. Go to step b.

Q5 (b) Use Sutherland-Hodgman algorithm for line clipping to clip a line [(0, 0), (10,
10)] against rotated window shown in figure.

© IETE 3
DC66 COMPUTER GRAPHICS JUNE 2013

Answer Page No 163 of textbook 1

Q6 (a) Describe the use of Bezier curves and its working principle used in computer
graphics.

Answer
Bezier curves are used in computer graphics to produce curves which appear reasonably
smooth at all scales. This curve construction is based on certain control points.Working: -
For a set of four points p0, p1, p2, p3 we associate a curve with the following properties:

1. It starts at p0 and ends at p3.

2. When it starts from p0 it heads directly towards p1 , and when it arrives at p3 it is


coming from the direction of p2.

3. The entire curve is contained in the quadrilateral whose concerns are the four
given points.

These are used in CG as they are very efficient to construct, since a simple
recursion process means that the basic arithmetic operation needed to build the
points along one is just division by two.

For this reason the most efficient implementation use scaled integers instead of
floating point numbers as basic numerical data.

Q6 (b) What do you understand by oblique parallel projections? How it is different


from perspective projection?

Answer
Oblique projections have their projections that are not perpendicular to the projection
plane.
i.e. (q,p,r)!=(a,b,c)
There are two common oblique parallel projections:

1. Cavalier parallel projections: The lines perpendicular to projections plane are


preserved in length, i.e. L=1

1 0 0 0
0 1 0 0
Cos θ Sin θ 0 0
0 0 0 1

© IETE 4
DC66 COMPUTER GRAPHICS JUNE 2013

Cabinet parallel projections: - Lines perpendicular to projection plane are ½ their true
length, i.e. is L=1/2

1 0 0 0
0 1 0 0
cosθ sinθ 0 0
0 0 0 1

Q7 (a) Explain the method of back face detection with the help of example.

Answer Page number 303

Q8 (b) Explain the method of frame by frame animation technique for expert
animator.

Answer
Key frame systems were developed by classical animators such as Walt Disney. An
expert animator would design an animation by drawing certain intermediate frames,
called key frames. Then other animators would draw the in between frames.

The sequence of steps to produce a full animation would be as follows:

1. Develop a script or story for the animation.

2. Layout a story board, i.e. a sequence of informal drawings that shows the form,
structure, and story of the animation.

3. Record a sound track.

4. Produce a detailed layout of the action.

5. Correlate the layout with the soundtrack.

6. Create the key frames of the animation. The key frames are those where the
entities to be animated are in positions such that intermediate positions can be
easily inferred.

7. Fill in the intermediate frames called tweening.

8. Make a trial film called a pencil test.

© IETE 5
DC66 COMPUTER GRAPHICS JUNE 2013

9. Transfer the pencil test frames to sheets of acetate film, called “cels” .these may
have multiple planes e.g. a static background with an animated foreground.

10. The cels are then assembled in to a sequence and filmed.

With computers the animator would specify the key frames and the computer would draw
the in between frames “tweening”. Many different parameters can be interpolated but
care must be taken in such interpolate if the motion is to be look “real”.

The simplest type of interpolation is linear the computer interpolates points along a
straight line.

Text Book

Computer Graphics, Amarendra N. Sinha, Arun D Udai, TMH, 2008

© IETE 6

You might also like