0% found this document useful (0 votes)
7 views5 pages

Complete Computer Graphics Answers

The document provides detailed answers to questions on computer graphics, covering topics such as 2D transformations, composite transformations, shearing, reflections, and polygon edge tables. It also explains concepts related to display technologies, including CRT operation, raster scan displays, and line drawing algorithms like DDA and Bresenham's. Additionally, it contrasts raster scan and vector scan methods and outlines the midpoint circle algorithm.

Uploaded by

chirag302005
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)
7 views5 pages

Complete Computer Graphics Answers

The document provides detailed answers to questions on computer graphics, covering topics such as 2D transformations, composite transformations, shearing, reflections, and polygon edge tables. It also explains concepts related to display technologies, including CRT operation, raster scan displays, and line drawing algorithms like DDA and Bresenham's. Additionally, it contrasts raster scan and vector scan methods and outlines the midpoint circle algorithm.

Uploaded by

chirag302005
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

Complete Answers - Computer Graphics (Combined)

PAPER 1 — Computer Graphics (Elective I) — Answer any FIVE (4 marks each)


1) What is 2D Transformation? Define three types and give matrix representation.
2D transformation changes position, size or orientation of 2D objects using linear algebra (homogeneous
coordinates). Represented by 3x3 matrices in homogeneous coordinates.
a) Translation by (tx,ty)
Matrix:
[ 1 0 tx ]
[ 0 1 ty ]
[0 0 1]
b) Scaling by (sx,sy)
Matrix:
[ sx 0 0 ]
[ 0 sy 0 ]
[0 0 1]
c) Rotation by θ about origin
Matrix:
[ cosθ -sinθ 0 ]
[ sinθ cosθ 0 ]
[ 0 0 1]
(Brief note) To apply to a point (x,y), convert to homogeneous p=[x y 1]^T and compute p' = M p.
---
2) Explain composite transformations with an example.
Composite transformation = product of two or more transformation matrices. Order matters (matrix
multiplication not commutative).
Example: Rotate by θ about origin, then translate by (tx,ty).
R(θ) = rotation matrix, T(tx,ty) = translation matrix.
Composite matrix M = T(tx,ty) * R(θ).
To transform point p: p' = M p. This applies rotation first, then translation.
---
3) Given a square with coordinates (unit square): A(0,1), B(1,1), C(1,0), D(0,0).
Apply shear on X-axis with shear factor sh_x = 2. Matrix (homogeneous):
[ 1 sh_x 0 ]
[0 1 0]
[0 0 1]
Using x' = x + sh_x * y, y' = y.
Compute new coords:
A(0,1) -> A'(0 + 2*1, 1) = (2, 1)
B(1,1) -> B'(1 + 2*1, 1) = (3, 1)
C(1,0) -> C'(1 + 2*0, 0) = (1, 0)
D(0,0) -> D'(0 + 2*0, 0) = (0, 0)
So the square is sheared right; top edge shifted right by 2 units relative to bottom edge.
---
4) Given triangle A(3,4), B(6,4), C(5,6). Apply reflection on X-axis then reflection about line x = 2.
Reflection about X-axis: (x,y) -> (x, -y)
A -> A1 = (3, -4)
B -> B1 = (6, -4)
C -> C1 = (5, -6)
Reflection about vertical line x = a: (x,y) -> (2a - x, y). For a = 2, x' = 4 - x.
A1(3,-4) -> A2 = (4-3, -4) = (1, -4)
B1(6,-4) -> B2 = (4-6, -4) = (-2, -4)
C1(5,-6) -> C2 = (4-5, -6) = (-1, -6)
Final coordinates: A''(1,-4), B''(-2,-4), C''(-1,-6).
---
5) Fill Active Edge Table for polygon A(2,4) -> B(2,7) -> C(4,9) -> D(4,6) -> A(2,4).
For scan-line filling the edge table stores ymin, ymax, x at ymin, and inverse slope dx/dy (used to increment
x). Compute edges (non-horizontal):
Edge AB: (2,4) to (2,7)
ymin = 4, ymax = 7, x_at_ymin = 2, dx = 0, dy = 3 -> 1/m = dx/dy = 0
Edge BC: (2,7) to (4,9)
ymin = 7, ymax = 9, x_at_ymin = 2, dx = 2, dy = 2 -> 1/m = 1.0
Edge CD: (4,9) to (4,6)
ymin = 6, ymax = 9, x_at_ymin = 4, dx = 0, dy = -3 -> 1/m = 0 (vertical, handle as x constant)
Edge DA: (4,6) to (2,4)
ymin = 4, ymax = 6, x_at_ymin = 4, dx = -2, dy = -2 -> 1/m = dx/dy = 1.0
Sorted by ymin for scan conversion (use in AET):
y = 4: edges AB (x=2,1/m=0), DA (x=4,1/m=1)
y = 6: edge CD becomes active (x=4,1/m=0)
y = 7: edge BC becomes active (x=2,1/m=1)
Use AET to fill spans between pairs of active edges per scan line.
---
6) Different line attributes of output primitives (brief list):
- Line type/style: solid, dashed, dotted
- Line width/thickness
- Line color (RGB or indexed)
- Line join style: miter, round, bevel (affects polygon joins)
- Line cap style: butt, round, square (affects line ends)
- Anti-aliasing (smoothness)
- Pattern and stipple (for raster primitives)
---
PAPER 2 — Computer Graphics (Elective I) — Answer any FIVE (4 marks each)
1) Define Computer Graphics, Pixel, Resolution, Aspect Ratio.
- Computer Graphics: creation and manipulation of visual content (images, models, animation) using computers
and algorithms.
- Pixel: smallest addressable element on a raster display; has color/intensity.
- Resolution: number of pixels in each dimension (e.g., 1920×1080) or total pixel count; higher resolution
gives finer detail.
- Aspect Ratio: ratio width:height (e.g., 16:9).
---
2) Working of CRT (brief with diagram idea).
CRT components (brief):
- Electron gun: emits a focused electron beam.
- Control grids & focusing system: shape and focus beam.
- Deflection system: magnetic or electrostatic plates steer beam horizontally and vertically.
- Phosphor-coated screen: when hit by beam, phosphor emits visible light.
Operation:
- Beam scans left-to-right, top-to-bottom (raster scanning). Intensity modulated to light pixels. Retrace
(flyback) moves beam back to start. Persistence of phosphor and refresh rate produce continuous image.
(Diagram: electron gun at back, beam, deflection plates/coils, phosphor screen.)
---
3) Explain Raster Scan Display.
- Screen composed of rows and columns of pixels.
- Electron beam scans each row (scan-line) sequentially; frame buffer stores intensity values per pixel.
- After each frame, beam returns to top (vertical retrace).
- Advantages: simple hardware, suited to shaded images and bitmaps. Disadvantages: flicker if refresh low,
less precise for vector-quality lines (compared to vector displays).
---
4) DDA Line Drawing Algorithm (steps and short explanation).
Digital Differential Analyzer (DDA):
- Input endpoints (x1,y1),(x2,y2).
- dx = x2-x1; dy = y2-y1
- steps = max(|dx|,|dy|)
- x_inc = dx/steps; y_inc = dy/steps
- x = x1; y = y1
- For i = 0 to steps: plot(round(x), round(y)); x += x_inc; y += y_inc
Properties: simple, uses floating point increments; accurate enough for many uses but slower than integer-only
algorithms.
---
5) Bresenham's Line Algorithm between (9,18) and (14,22).
Given: x0=9,y0=18 ; x1=14,y1=22
dx = 5 ; dy = 4
Initial decision parameter p0 = 2*dy - dx = 8 - 5 = 3.
Use integer updates. Starting point (9,18).
Iteration table (choose next pixel each x-step):
Points plotted:
(9,18) p=3 -> since p>=0: y->19 ; next p = p + 2*(dy-dx) = 3 + 2*(4-5) = 1
(10,19) p=1 -> p>=0: y->20 ; next p = 1 + 2*(4-5) = -1
(11,20) p=-1 -> p<0: y stays 20 ; next p = -1 + 2*dy = -1 + 8 = 7
(12,20) p=7 -> p>=0: y->21 ; next p = 7 + 2*(4-5) = 5
(13,21) p=5 -> p>=0: y->22 ; next p = 5 + 2*(4-5) = 3
(14,22) final point.
So pixels: (9,18),(10,19),(11,20),(12,20),(13,21),(14,22).
---
6) Difference: Raster Scan vs Random (Vector) Scan.
- Raster Scan: refreshes entire screen scan-line by scan-line; uses frame buffer; suited for filled images
and bitmaps; cheaper hardware.
- Random Scan (Vector): draws lines directly by deflecting beam between endpoints; no full frame buffer
needed; excellent line quality for wireframe; poor for filled images; more complex and costly.
---
7) Midpoint circle algorithm (center (6,9), r=10) — method outline.
- Start at (x=0,y=r) = (0,10). Center = (6,9), so plotted point = (6+0,9+10) etc.
- Initial decision p = 1 - r = -9.
- For each x from 0 while x <= y:
if p < 0: p = p + 2*x + 3
else: p = p + 2*(x - y) + 5 ; y = y - 1
x=x+1
plot the eight symmetric points: (xc±x, yc±y) and (xc±y, yc±x).
- Continue until x > y.
(Use symmetry to draw full circle from octant calculations.)
---
End of answers. If you want these arranged differently, or want a single condensed one-page handout, or want
the file in a different format, tell me.

You might also like