November 01, 2018

Computer Graphics - Answer Keys

Section – A (7 x 8 marks = 56 marks)

Question 1.The co-ordinates of only one eighth of the total pixels lying on circumference of a circle are computed. Why? The Bresenhem’s circle drawing algorithm can be adapted for computing the coordinates of other pixels, explain?

Solution Scheme: 
Circle is symmetric about its axis. So, if point (x,y) is on the circle, then we can trivially compute (450 segment) seven other points (y,x),(y,-x),(x,-y),(-x,-y),(-y,-x),(-y,x),(-x,y) using the symmetry.(2 marks)
Bresenhem’s circle drawing algorithm (6 marks)

Question 2.Cohen-Sutherland line clipping technique uses the concept of region codes (or outcodes) in order to clip lines. Suppose a rectangular clip window ABCD is defined such that the lower left hand corner is at A(1,2) and upper right hand corner is at C (9,8). Clip the following line segments using Cohen Sutherland technique
  Line 1 from P(-1,7) to Q(11,1)
  Line 2 from R(3,7) to S(3,10)
  Line 3 from U(2,3) to V(8,4).


Solution Scheme:
(2 marks for Line 3)
Line 3 from U(2,3) to V(8,4): Outcode of UV is 0000, therefore Inside, no need to clip.

Line 1: (3 marks for Line 1)
Outcode of PQ is non-zero, therefore outside clip window, (is a clipping candidate)
Slope m=-1/2
P1 : X=Xmin=1, y=6
Q1: X=7, Y =Ymin=2

Line 2: (3 marks for Line 2)
Outcode of RS is non-zero, therefore outside clip window, (is a clipping candidate)
R (3,7) Inside, therefore No change:
Slope m=0
S1= X=3, Y =Ymax=8

Question 3.As a part of graphic design application, you are supposed to eliminate the hidden surfaces in your design. You have the option of choosing either the Z-Buffer technique or the Painters algorithm. How would you address the following issues?
a.In the Z-Buffer algorithm, show that depth calculation at each pixel on a scan line 
can be done incrementally if the plane equation for each polygon is available.

Solution Scheme: (3 marks)
WKT the polygon is planar. We can simplify the calculation of z values for each point on a scan line by using Depth Coherence concept.(1 mark)
At (x,y) compute z by Z=(-D-Ax-By)/C .
At (x+dx, y) value of z= z1-{A/C}(dx) 
Only one subtraction is need to compute (z(x+1),y) given z(x,y) as dx=1.

b.In the Painters algorithm / the depth sorting method, indicate the tests that are to be carried out to determine if two surfaces R and S need not be ordered. 

Solution Scheme: (all 5 tests =4 marks)
Tests that are to be carried out are
Do the polygon’s x extent overlap
Do the polygon’s y extent overlap
Is R entirely on the opposite side of S’s plane from the viewpoint
Is S entirely on the opposite side of R’s plane from the viewpoint
Do the projections of the polygons onto the (x,y) plane not overlap.

Question 4.As a graphics designer you know that the painting of any real situation involves assembling several components in to a single object and it is required to shade various parts to bring reality. Now, in order to render a polygon, how does Gouraud surface rendering and Phong surface rendering proceed? Explain briefly.  Also discuss problems with Gouraud Shading. 

Question 5.In computer graphics a 3D point on a plane can be projected on to a 2D plane. What are the fundamental operations involved in projecting a 3D point to a 2D point on a Plane. Taking a suitable example explain one, two and three point perspective projection and also indicate, very briefly, how you generate an axonometric view on the screen.  

Solution Scheme: (4 marks for each)
Perspective projections are categorized by their number of principal vanishing points and therefore by the number of axes the projection plane cuts.
In one-point perspective projection the lines parallel to the x and y axes do not converge; only lines parallel to the z axis converge.
In two-point perspective, the lines parallel to the y axis do not converge in the projection
In three-point perspective, the lines parallel to all the axis converge in the projection
Axonometric Orthographic Projections use projection planes that are not normal to a principal axis and therefore show several faces of an object at once.

Question 6.You are working as a design engineer with ABC animations, which is a pioneer in designing automobile components. You are in the CAD team and your team lead has assigned you the task of designing some objects.
a.In the design of automobile parts curved objects plays an important role. Justify it by comparing the parametric cubic splines with parametric Bezier curves. 

Solution Scheme: (2 marks for each)

b.Given one set of control points P,Q,R,S and another set of control points A,B,C,D it is required to draw two cubic Bezier curves. Specify the conditions that would be necessary to ensure that the two curves join smoothly.

Solution Scheme: (1 marks for each condition)
1. The first curve C(u) is defined by m + 1 control points P,Q,R,S and the second curve D(u) be defined by n + 1 control points A,B,C,D. If we want to join these two BΓ©zier curves together, then S must be equal to A. This guarantees a C0 continuous join. 
2. The first curve is tangent to its last leg and the second curve is tangent to its first leg. Consequently, to achieve a smooth transition, R, S = A, and B must be on the same line such that the directions from R to S and the direction from A to B are the same.
3. C1 continuity at the joining point the ratio of the length of the last leg of the first curve (i.e., |S - R|) and the length of the first leg of the second curve (i.e., |B - A|) must be n/m. Since the degrees m and n are fixed, we can adjust the positions of R or B on the same line so that the above relation is satisfied.
4. To achieve C1 continuity, we have to make sure that the tangent vector at u = 1 of the first curve, C1 (1), and the tangent vector at u = 0 of the second curve, D1 (0), are identical. That is, the following must hold:
Equation:    C1 (1) = m(S-R) = D1(0) =n(B-A)

Question 7.A solid object will make possible the automatic generation of instructions for computer controlled machines tools. In many real world graphics applications, it is important to distinguish between the inside, outside, and surface of a 3D object. Support this statement through a brief discussion by comparing Boundary representation and Spatial partitioning representation methods.

Solution Scheme:
  • Boundary representation describe object in terms of its surface boundary, vertices, edges, and faces.
  • Methods:(3 marks for Method description): Polyhedra and Eulers’s formula, the Winged-edge representation, Boolean set operations, Nonpolyhedral b-reps
  • Spatial partitioning representation, a solid is decomposed into a collection of adjoining, non-intersecting solids.(1 marks for Comparison)
  • Methods: (3 marks for Method description):Cell decomposition, spatial occupancy enumeration, Octrees, BSP trees
Section – B (1 x 4 marks = 4 marks)

Question 1.The Cyrus-Beck clipping technique cannot be applied for all types of clip-windows. Justify the above statement and also specify how such cases are to be handled? 

Solution Scheme:
Cyrus–Beck clipping technique can be used with a convex polygon clipping window unlike Cohen-Sutherland that can be used only on a rectangular clipping area.

No comments:

Post a Comment