B B.E/B.TECH DEGEREE EXAMINATON-NOV/DEC 2015
Fifth Semester
Computer Science and Engineering
CS6504-Computer Graphics
(Regulation 2013)
Part-A
1. Compute the resolution of a 2*2 inch image that has 512*512 pixels.
512/2=256 pixels per inch
2. Give the contents of display file.
Display file contains function definitions of graphics primitives that are updated as per the
need to the application program and generated by graphics software.
3. Derive the general form of scaling matrix about a fixed point (xf, yf).
General form of scaling matrix about a fixed point
sx 0 0
0 sy 0
xf(1-sx) yf(1-sy) 1
4. Write down the condition of point clipping for window.
Given a point(x,y)
xmin<=x<=xmax
ymin<=y<=ymax
5. Represent the parametric representation of a cubic Bezier curve.
p(t)=b0(1-t)^3+b1.3t(1-t)^2+B2.3t^2(1-t)+b3T^3
6. Define projection plane and centre of projection.
The plane on which projection of object is formed projection plane the point from where
projection is taken. In perspective projection this is the point where object position lines converge to a
point called center of projection.
7. Define dithering. When it occurs?
Dithering is a color approximation.
It occurs when an image is opened in a different machine using different applications.
8. Convert the given color value to CMY value color mode where R=0.23 G=0.57 and B=0.11.
C = 1 - R
M = 1 - G
Y = 1 - B
C=1-0.23=0.77
M=1-0.57=0.43
Y=1-0.11=0.89
9. Give the basic principle of animation.
Persistence of vision
10. List the attributes of turtle in graphics.
Location, orientation and pen.
PART-B
11.a)(i) Define and Differentiate random and raster scan systems.
Random Scan:
Electron beam i9s moved along a particular direction and length given in vectorial
fashion.graphics commands are transmitted to display file programs generated by computer and
stored in refresh storage area or buffer memory.there is a display processor and vector generator.
RasterScan:
It uses pixel principle.each row of pixel is called raster line or scan line.the electronbeam
covers the entire display area but controlled by display controller.each complete sweep is called
refresh cycle.
(ii)Using bresenham circle drawing algorithm plot one quadrant of a circle of radius 7 pixels
within origin as center
(0,7)(1,7)(2,7)(3,6)(4,6)(5,5)(6,4)(6,3)(7,2)(7,1)(7,0)
11. b) (i)How are event driven input devices handled by the hardware. Explain.
Polling-status is checked periodically by polling loop and when an event occurs the loop is
exited and event is handled by executing routines.
Interrupts-device sends an interrupt signal to processor when event occurs. The processor
breaks normal execution and executes interrupt handling routines.
(ii) Discuss the primitives used for filling.
p^2/4-Q^2=1 with limits p=2 and p=10
p=2 q=0 (2,0)(2,1)(3,1)(4,2)(5,2)(6,3)(8,4)(10,5)
12.(a)(i)Flip the given quadrilateral A(10,8), B(22,8),C(34,17),D(10,27) about the origin and then
zoom it to twice its size. Find the new position of Quadrilateral.
I/P O/P
10 8 1 -20 -16 1
22 8 1 -44 -16 1
34 17 1 -68 -34 1
10 27 1 -20 -54 1
(ii) Derive the viewing transformation matrix.
xwmin,xwmax,ywmin,ywmax-- window co-ordinates
xvmin,xvmax,yvmin,yvmax--viewport limits
xv-xvmin/xvmax-xvmin=xw-xwmin/xwmax-xwmin
xv-xvmin=(xvmax-xvmin/xwmax-xwmin)(xw-xwmin)
xv=xvmin+sx(xw-xwmin)
similarly yv=yvmin+sy(yw-ywmin)
12. (b) (i)Clip the line using Liang Barsky Algorithm.
Window boundaries
xwmin=2, xwmax=5
ywmin=2 ,ywmax=4
del x=3,del y=-2
p1=-3
p2=3
p3=2
p4=-2
q1=-1, q2=4
q3=1 ,q4=1
For left boundary (here p1<0)
r1=p1/q1=1/3
For right boundary (here p2>0)
r2=4/3~=1.33
For bottom boundary (here p3>0)
r3=0.5
For top boundary (p4<0)
r4=-1/2=-0.5
u1=max{0,0.33,-0.5}=0.33
u2=min{1,1.33,0.5}=0.5
x=x1+del xu=2
y=y1+del yu=7/3
Therefore point of intersection is (2, 2.33)
Next point of intersection is (2.5, 2)
(ii) Explain two dimensional viewing pipelines in detail.
Viewing pipeline
13. (a) (i)Derive the parametric equation for a cubic bezier curve.
For a cubic bezier curve,n=3
p(t)=BiJ3(t)
p(t)=B0J3,0(t)+B1J3,1(t)+B2 j3,2(t)+B3J3,3(t)
J3,0(t)=(1-t)^3
similarly
J3,1(t)=3t(1-t)^2
J3,2(t)=3t^2(1-t)
J3,3(t)=t^3
therfore
p(t)=b0(1-t)^3+b1.3t(1-t)^2+b2.3t^2(1-t)+b3T^3
(ii) Compare and contrast orthographic, Axonometric and oblique projections.
Orthographic projection
 Parallel projection
 Center of projection tends to infinity
 Projectors are perpendicular to projection plane.
 Used for engineering drawing.
 It is the projection of one of the coordinate planes.
Axonometric projection:
 This will overcome the limitation of orthographic projection in illustrating the general
3D shape of the object.
 This is done using rotation and translation.
 Projected at infinity onto one of the coordinate planes.
This is of three types
 trimetric
 dimetric
 isometric
Oblique projection:
Formed by parallel projection from a center of projection at infinity that intersects the
plane of projection of an oblique plane.
Two types: cavalier,cabinet.
13. (b)(i) Write down Back face detection algorithm.
1) Identify the first polygon and let the Mj vetex of this polygon be Vj(1)....Vj(Mj)
2) Set Vj(Mj+1)=Vj(1)
3)find r=(X3-X2)(x1-x2)+(y3-y2)(y1-y2)+(z3-z2)(z1-z2)
4) Start polygon loop. on i=1 to n
5)let the n0o of vertices for polygon i be Mi and the set of vertices be Vi(1)....Vi(Mi) Vj(1)....Vj(Mj)
6) Start polygon loop.on j=1to n
Compare every sequential pair of vertex no's p and q for polygon i,with every sequential pair of
vertex members r and s for polygon j except for j=1.
If p=r and q=s a straight match, then reverse the order of all Mi vertices for polygon i
End loop on j
Find k=(x2-x1)(y3-y1)-(x3-x1)(y2-y1)
From the co-ordinates of first three vertices of polygon i.
If k>=0 pass the co-ordinates of all Mi vertices and the edges and surface attributes of polygon
i to the plot module.
End loop on i.
(ii) How will you perform three dimensional rotation about an arbitrary axis in space.
step1: translate so that the point(X0,Y0,Z0) is at origin.the matrix is 1 1 1 -X0
0 1 0 -Y0
0 0 1 -Z0
0 0 0 1
step2: perform appropriate rotations to make the axis of rotation coincident with the 2 axis (or any
other axis)
ste3: then perform rotation about x-axis until the rotation axis is in ZX-plan
step4: then perform rotation about y-axis until the axis cioincides with z-axis.
Therefore, the resultant matrix is
1 0 Cx 0
0 1 0 0
Cx 0 l 0
0 0 0 1
step5: rotate about z-axis by tyheta angle
step6: reverse the rotation about x-axis and reverse the rotation about x-axis
step7: reverse the translation carried out instep1.
14.(a) Discuss on color spectrum, colour concepts and colour models in detail..
Frequency, hue, colour, luminance, brightness, chromaticity, complementary colors-palette-
chromatic and achromatic lights-shades-tints-tones-cie chromaticity diagram-XYZ color model-CMY-RGB-
HLS-HSVexplanation of all the above components are needed.
(b)Explain about ambient light.
I=IaKa
Ia-intensity of ambient light
Ka-ambient reflection coefficient
I-illuminationequation
diffuse reflection,specular reflections,frensel's law of reflection,phongs specular reflection model.
Ispec=gouraud shading and phong shading.
15.(a)Distinguish between Rasteranimation and key frame animation in detail.
1) Raster Animation:
 Animation frames made of pixels
 Images as pixels
 More realistic
 Rendering takes time
2) keyframe animation
 Animation frames made of vertices,edges,nodes.
 Scalable components
 Stores images as vectors
 Rendering takes less time
3) Grammar based model
 Structure is defined by a language and grammar for that language
eg.fractal generation
 shape grammar
 self similar fractal generation
(b)Write short notes on
(i) Ray tracing
(ii) Koch curve
(iii) morphing
1) ray tracing -techniques for generating an image by tracing the path of light through pixels in an
image plane and stimulating the effects with virtual objects.
2) koch curve is the limiting curve obtained by applying construction an infinite number of times.
3) morphing:the process of changing or mapping object of one shape to another shape by considering
control points.

AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE

  • 1.
    B B.E/B.TECH DEGEREEEXAMINATON-NOV/DEC 2015 Fifth Semester Computer Science and Engineering CS6504-Computer Graphics (Regulation 2013) Part-A 1. Compute the resolution of a 2*2 inch image that has 512*512 pixels. 512/2=256 pixels per inch 2. Give the contents of display file. Display file contains function definitions of graphics primitives that are updated as per the need to the application program and generated by graphics software. 3. Derive the general form of scaling matrix about a fixed point (xf, yf). General form of scaling matrix about a fixed point sx 0 0 0 sy 0 xf(1-sx) yf(1-sy) 1 4. Write down the condition of point clipping for window. Given a point(x,y) xmin<=x<=xmax ymin<=y<=ymax 5. Represent the parametric representation of a cubic Bezier curve. p(t)=b0(1-t)^3+b1.3t(1-t)^2+B2.3t^2(1-t)+b3T^3 6. Define projection plane and centre of projection. The plane on which projection of object is formed projection plane the point from where projection is taken. In perspective projection this is the point where object position lines converge to a point called center of projection. 7. Define dithering. When it occurs? Dithering is a color approximation. It occurs when an image is opened in a different machine using different applications. 8. Convert the given color value to CMY value color mode where R=0.23 G=0.57 and B=0.11. C = 1 - R M = 1 - G Y = 1 - B
  • 2.
    C=1-0.23=0.77 M=1-0.57=0.43 Y=1-0.11=0.89 9. Give thebasic principle of animation. Persistence of vision 10. List the attributes of turtle in graphics. Location, orientation and pen. PART-B 11.a)(i) Define and Differentiate random and raster scan systems. Random Scan: Electron beam i9s moved along a particular direction and length given in vectorial fashion.graphics commands are transmitted to display file programs generated by computer and stored in refresh storage area or buffer memory.there is a display processor and vector generator. RasterScan: It uses pixel principle.each row of pixel is called raster line or scan line.the electronbeam covers the entire display area but controlled by display controller.each complete sweep is called refresh cycle. (ii)Using bresenham circle drawing algorithm plot one quadrant of a circle of radius 7 pixels within origin as center (0,7)(1,7)(2,7)(3,6)(4,6)(5,5)(6,4)(6,3)(7,2)(7,1)(7,0) 11. b) (i)How are event driven input devices handled by the hardware. Explain. Polling-status is checked periodically by polling loop and when an event occurs the loop is exited and event is handled by executing routines. Interrupts-device sends an interrupt signal to processor when event occurs. The processor breaks normal execution and executes interrupt handling routines. (ii) Discuss the primitives used for filling. p^2/4-Q^2=1 with limits p=2 and p=10 p=2 q=0 (2,0)(2,1)(3,1)(4,2)(5,2)(6,3)(8,4)(10,5) 12.(a)(i)Flip the given quadrilateral A(10,8), B(22,8),C(34,17),D(10,27) about the origin and then zoom it to twice its size. Find the new position of Quadrilateral.
  • 3.
    I/P O/P 10 81 -20 -16 1 22 8 1 -44 -16 1 34 17 1 -68 -34 1 10 27 1 -20 -54 1 (ii) Derive the viewing transformation matrix. xwmin,xwmax,ywmin,ywmax-- window co-ordinates xvmin,xvmax,yvmin,yvmax--viewport limits xv-xvmin/xvmax-xvmin=xw-xwmin/xwmax-xwmin xv-xvmin=(xvmax-xvmin/xwmax-xwmin)(xw-xwmin) xv=xvmin+sx(xw-xwmin) similarly yv=yvmin+sy(yw-ywmin) 12. (b) (i)Clip the line using Liang Barsky Algorithm. Window boundaries xwmin=2, xwmax=5 ywmin=2 ,ywmax=4 del x=3,del y=-2 p1=-3 p2=3 p3=2 p4=-2 q1=-1, q2=4 q3=1 ,q4=1 For left boundary (here p1<0) r1=p1/q1=1/3 For right boundary (here p2>0) r2=4/3~=1.33
  • 4.
    For bottom boundary(here p3>0) r3=0.5 For top boundary (p4<0) r4=-1/2=-0.5 u1=max{0,0.33,-0.5}=0.33 u2=min{1,1.33,0.5}=0.5 x=x1+del xu=2 y=y1+del yu=7/3 Therefore point of intersection is (2, 2.33) Next point of intersection is (2.5, 2) (ii) Explain two dimensional viewing pipelines in detail. Viewing pipeline 13. (a) (i)Derive the parametric equation for a cubic bezier curve. For a cubic bezier curve,n=3 p(t)=BiJ3(t) p(t)=B0J3,0(t)+B1J3,1(t)+B2 j3,2(t)+B3J3,3(t) J3,0(t)=(1-t)^3 similarly
  • 5.
    J3,1(t)=3t(1-t)^2 J3,2(t)=3t^2(1-t) J3,3(t)=t^3 therfore p(t)=b0(1-t)^3+b1.3t(1-t)^2+b2.3t^2(1-t)+b3T^3 (ii) Compare andcontrast orthographic, Axonometric and oblique projections. Orthographic projection  Parallel projection  Center of projection tends to infinity  Projectors are perpendicular to projection plane.  Used for engineering drawing.  It is the projection of one of the coordinate planes. Axonometric projection:  This will overcome the limitation of orthographic projection in illustrating the general 3D shape of the object.  This is done using rotation and translation.  Projected at infinity onto one of the coordinate planes. This is of three types  trimetric  dimetric  isometric Oblique projection: Formed by parallel projection from a center of projection at infinity that intersects the plane of projection of an oblique plane. Two types: cavalier,cabinet. 13. (b)(i) Write down Back face detection algorithm. 1) Identify the first polygon and let the Mj vetex of this polygon be Vj(1)....Vj(Mj) 2) Set Vj(Mj+1)=Vj(1) 3)find r=(X3-X2)(x1-x2)+(y3-y2)(y1-y2)+(z3-z2)(z1-z2) 4) Start polygon loop. on i=1 to n 5)let the n0o of vertices for polygon i be Mi and the set of vertices be Vi(1)....Vi(Mi) Vj(1)....Vj(Mj)
  • 6.
    6) Start polygonloop.on j=1to n Compare every sequential pair of vertex no's p and q for polygon i,with every sequential pair of vertex members r and s for polygon j except for j=1. If p=r and q=s a straight match, then reverse the order of all Mi vertices for polygon i End loop on j Find k=(x2-x1)(y3-y1)-(x3-x1)(y2-y1) From the co-ordinates of first three vertices of polygon i. If k>=0 pass the co-ordinates of all Mi vertices and the edges and surface attributes of polygon i to the plot module. End loop on i. (ii) How will you perform three dimensional rotation about an arbitrary axis in space. step1: translate so that the point(X0,Y0,Z0) is at origin.the matrix is 1 1 1 -X0 0 1 0 -Y0 0 0 1 -Z0 0 0 0 1 step2: perform appropriate rotations to make the axis of rotation coincident with the 2 axis (or any other axis) ste3: then perform rotation about x-axis until the rotation axis is in ZX-plan step4: then perform rotation about y-axis until the axis cioincides with z-axis. Therefore, the resultant matrix is 1 0 Cx 0 0 1 0 0 Cx 0 l 0 0 0 0 1 step5: rotate about z-axis by tyheta angle step6: reverse the rotation about x-axis and reverse the rotation about x-axis step7: reverse the translation carried out instep1. 14.(a) Discuss on color spectrum, colour concepts and colour models in detail..
  • 7.
    Frequency, hue, colour,luminance, brightness, chromaticity, complementary colors-palette- chromatic and achromatic lights-shades-tints-tones-cie chromaticity diagram-XYZ color model-CMY-RGB- HLS-HSVexplanation of all the above components are needed. (b)Explain about ambient light. I=IaKa Ia-intensity of ambient light Ka-ambient reflection coefficient I-illuminationequation diffuse reflection,specular reflections,frensel's law of reflection,phongs specular reflection model. Ispec=gouraud shading and phong shading. 15.(a)Distinguish between Rasteranimation and key frame animation in detail. 1) Raster Animation:  Animation frames made of pixels  Images as pixels  More realistic  Rendering takes time 2) keyframe animation  Animation frames made of vertices,edges,nodes.  Scalable components  Stores images as vectors  Rendering takes less time 3) Grammar based model  Structure is defined by a language and grammar for that language eg.fractal generation  shape grammar  self similar fractal generation (b)Write short notes on (i) Ray tracing (ii) Koch curve (iii) morphing
  • 8.
    1) ray tracing-techniques for generating an image by tracing the path of light through pixels in an image plane and stimulating the effects with virtual objects. 2) koch curve is the limiting curve obtained by applying construction an infinite number of times. 3) morphing:the process of changing or mapping object of one shape to another shape by considering control points.