Skip to main content

Chapter 4

Computer Graphics

TU BIT past exam questions

Past questions and answers

48 questions set from this chapter. Most repeated first.

  • 2079 · 5 marks

Explain Cohen-Sutherland line clipping Algorithm.

Similar questions: Explain Cohen-Sutherland Line Clipping algorithm with (2080)

Answer

The Cohen-Sutherland algorithm clips a line against a rectangular window quickly by using region codes.

Region codes. The plane is divided into 9 regions by the window edges. Each endpoint gets a 4-bit outcode (bits: top, bottom, right, left), where a bit is 1 if the point is: above ymaxy_{max}, below yminy_{min}, right of xmaxx_{max}, left of xminx_{min}. A point inside the window has code 0000.

Algorithm

  1. Compute outcodes for both endpoints P1P_1 and P2P_2.
  2. If both codes are 0000, the line is completely inside: accept it.
  3. If the bitwise AND of the two codes is not 0000, both endpoints lie on the outside of the same edge: reject the line.
  4. Otherwise the line is partially inside. Pick an endpoint with a nonzero code, find the intersection with the window edge indicated by a 1 bit, and replace the endpoint by the intersection:
    • left/right: x=xminx = x_{min} or xmaxx_{max}, y=y1+m(x−x1)y = y_1 + m(x - x_1)
    • top/bottom: y=ymaxy = y_{max} or yminy_{min}, x=x1+(y−y1)/mx = x_1 + (y - y_1)/m where m=(y2−y1)/(x2−x1)m = (y_2 - y_1)/(x_2 - x_1).
  5. Compute the new outcode and repeat from step 2 until the line is accepted or rejected.

It is efficient when most lines are clearly inside or outside, but a line may need up to four intersection calculations.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

Explain Cohen-Sutherland Line Clipping algorithm with example.

Similar questions: Explain Cohen-Sutherland line clipping Algorithm. (2079)

Answer

Cohen-Sutherland line clipping quickly accepts or rejects lines against a rectangular window (xmin,xmax,ymin,ymaxx_{min},x_{max},y_{min},y_{max}) using 4-bit region codes.

Region code (bit = 1 if true): bit 1 = above (y>ymaxy>y_{max}), bit 2 = below (y<yminy<y_{min}), bit 3 = right (x>xmaxx>x_{max}), bit 4 = left (x<xminx<x_{min}). The window itself is 0000.

Algorithm

  1. Compute the codes of both end points.
  2. If both are 0000: trivially accept (line inside).
  3. If the bitwise AND of the codes is non-zero: trivially reject (both on the outside of the same edge).
  4. Otherwise, pick an end point outside the window, find the intersection with a window edge it crosses, replace that end point by the intersection, recompute its code and repeat.

Intersection: with slope m=(y2−y1)/(x2−x1)m=(y_2-y_1)/(x_2-x_1): left/right edge y=y1+m(xedge−x1)y = y_1 + m(x_{edge}-x_1); top/bottom edge x=x1+(yedge−y1)/mx = x_1 + (y_{edge}-y_1)/m.

Example: Window x:10..20x:10..20, y:10..20y:10..20. Line P1(5,15)P_1(5,15) to P2(15,25)P_2(15,25). Code of P1P_1 = 0001 (left); P2P_2 = 1000 (above). AND = 0000, so not rejected; m=1m = 1. Clip P1P_1 at x=10x=10: y=15+1(10−5)=20y=15+1(10-5)=20, so P1′=(10,20)P_1'=(10,20), code 0000. Clip P2P_2 at y=20y=20: x=15+(20−25)/1=10x = 15 + (20-25)/1 = 10, giving (10,20)(10,20). Both ends are the same point, so the line only touches the corner of the window; in general the clipped segment is drawn between the two new inside points.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

Explain ambient light, diffuse reflection and specular reflection with examples.

Similar questions: Write short notes on: (a) Ambient (2081)

Answer

Ambient light: light of uniform intensity that reaches an object after repeated reflections from the surroundings; it has no direction. Every surface receives it equally, giving the basic brightness of shadowed areas: Iamb=kaIaI_{amb} = k_a I_a where kak_a is the ambient reflection coefficient and IaI_a the ambient intensity. Example: the faint illumination inside a room away from the lamp.

Diffuse reflection: light from a point source is scattered equally in all directions by a dull, rough surface (e.g. chalk, matte paint). Brightness depends on the angle θ\theta between the surface normal NN and the light direction LL (Lambert's cosine law) but not on the viewer: Idiff=kdIlcos⁡θ=kdIl(N⋅L)I_{diff} = k_d I_l \cos\theta = k_d I_l (N\cdot L) Example: a matte wall looks equally bright from any viewpoint but darker as it turns away from the lamp.

Specular reflection: mirror-like reflection from shiny surfaces that produces a bright highlight whose position depends on the viewer. Phong model: Ispec=ksIl(V⋅R)nsI_{spec} = k_s I_l (V\cdot R)^{n_s} where RR is the reflection vector, VV the viewing direction and nsn_s the shininess (large for metals, small for rough surfaces). Example: the bright spot on a polished apple or metal ball.

Total intensity: I=Iamb+Idiff+IspecI = I_{amb}+I_{diff}+I_{spec}.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · 5 marks

Write short notes on: (a) Ambient light (b) Diffuse reflection

Similar questions: Explain ambient light, diffuse reflection and (2080)

Answer

(a) Ambient light

Ambient light is non-directional light of uniform intensity resulting from multiple reflections of light from walls, floor and other objects of the environment. It lights all surfaces equally from all directions, independent of position and viewer, so surfaces facing away from every light source are not completely black. Iamb=kaIaI_{amb}=k_aI_a kak_a (0≤ka≤10\le k_a\le1) is the surface's ambient reflection coefficient. Example: a room corner not directly lit by a bulb is still dimly visible.

(b) Diffuse reflection

Diffuse reflection is the scattering of incident light equally in all directions by a rough, matte surface (e.g. paper, chalk). The brightness depends only on the angle θ\theta between the unit surface normal NN and the unit direction to the light LL, according to Lambert's cosine law: Idiff=kdIlcos⁡θ=kdIl (N⋅L)(N⋅L≥0)I_{diff}=k_dI_l\cos\theta=k_dI_l\,(N\cdot L)\quad(N\cdot L\ge0) It is independent of the viewing position: the surface looks equally bright from any direction and is brightest when the light is perpendicular (θ=0\theta=0). Example: a matte-painted wall.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 10 marks

List the major differences between DDA and Bresenham's algorithm. Illustrate the Bresenham's algorithm to the line with end points (10,6)(10, 6) and (12,1)(12, 1).

Answer

Differences between DDA and Bresenham's algorithm

DDABresenham's
Uses floating-point increments (Δx=1\Delta x = 1 or Δy=m\Delta y = m)Uses only integer arithmetic (additions, subtractions)
Rounding is needed for every pointNo rounding; a decision parameter chooses the nearer pixel
SlowerFaster and more efficient
Accumulated rounding error can cause drift on long linesMore accurate, with no cumulative error
Simple to implementSlightly more complex

Bresenham's algorithm for (10,6)(10, 6) to (12,1)(12, 1)

Δx=2\Delta x = 2, Δy=5\Delta y = 5 (in magnitude). Since ∣Δy∣>∣Δx∣|\Delta y| > |\Delta x| the slope is steep, so yy is the driving axis. xx stays the same or increases by 1 and yy decreases by 1 at each step.

Initial decision parameter: p0=2Δx−Δy=4−5=−1p_0 = 2\Delta x - \Delta y = 4 - 5 = -1

Rule: if pk<0p_k < 0, xx does not change and pk+1=pk+2Δx=pk+4p_{k+1} = p_k + 2\Delta x = p_k + 4; otherwise xx increases by 1 and pk+1=pk+2(Δx−Δy)=pk−6p_{k+1} = p_k + 2(\Delta x - \Delta y) = p_k - 6.

kpkp_kPlotted pixel (x,y)(x, y)
0-1(10, 6)
13(10, 5)
2-3(11, 4)
31(11, 3)
4-5(12, 2)
5-1(12, 1)

The pixels plotted are (10,6), (10,5), (11,4), (11,3), (12,2), (12,1).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 10 marks

How decision parameter can be used to draw circle? Calculate the points to draw a circle having radius 55 and center as (10,5)(10, 5).

Answer

Decision parameter in circle drawing (midpoint circle algorithm)

A circle centred at the origin is symmetric in 8 octants, so only the octant from (0,r)(0, r) to x=yx = y is calculated. At each step xx increases by 1 and we decide whether yy stays or decreases by 1. The decision uses the circle function f(x,y)=x2+y2−r2f(x, y) = x^2 + y^2 - r^2, evaluated at the midpoint between the two candidate pixels:

pk=f(xk+1,  yk−12)p_k = f\left(x_k + 1,\; y_k - \tfrac12\right)

If pk<0p_k < 0, the midpoint is inside the circle, so the pixel (xk+1,yk)(x_k+1, y_k) is chosen; otherwise (xk+1,yk−1)(x_k + 1, y_k - 1) is chosen. The parameter is updated incrementally:

  • pk<0p_k < 0: pk+1=pk+2xk+1+1p_{k+1} = p_k + 2x_{k+1} + 1
  • pk≥0p_k \ge 0: pk+1=pk+2xk+1+1−2yk+1p_{k+1} = p_k + 2x_{k+1} + 1 - 2y_{k+1}

with the initial value p0=1−rp_0 = 1 - r (starting at (0,r)(0, r)).

Circle with r=5r = 5, centre (10,5)(10, 5)

p0=1−5=−4p_0 = 1 - 5 = -4, start at (0,5)(0, 5).

kpkp_knext (x,y)(x, y)
0-4(1, 5)
1-1(2, 5)
24(3, 4)

At (3,4)(3,4), the next point has x>yx > y so we stop. Octant points: (0,5), (1,5), (2,5), (3,4).

Shifting by the centre (10,5)(10, 5) and using 8-way symmetry (xc±x,yc±y)(x_c \pm x, y_c \pm y) and (xc±y,yc±x)(x_c \pm y, y_c \pm x):

  • from (0,5): (10,10), (10,0), (15,5), (5,5)
  • from (1,5): (11,10), (9,10), (11,0), (9,0), (15,6), (5,6), (15,4), (5,4)
  • from (2,5): (12,10), (8,10), (12,0), (8,0), (15,7), (5,7), (15,3), (5,3)
  • from (3,4): (13,9), (7,9), (13,1), (7,1), (14,8), (6,8), (14,2), (6,2)

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 10 marks

Draw the block diagram of vector and raster graphics display architecture and write the advantages and disadvantage of both display architecture.

Answer

Vector (random-scan) display architecture

Block diagram: Host CPU and application program -> Display Processor Unit (display program in a display list/refresh buffer) -> Display controller with vector generator and DAC -> CRT.

  • The picture is stored as a set of line-drawing commands (display list) in the refresh buffer.
  • The display processor reads the commands and the electron beam is moved directly from endpoint to endpoint, drawing only the lines needed. The picture is refreshed (30-60 times per second) by repeating the list.

Advantages: high resolution and smooth lines, little memory needed, easy to modify parts of a picture, fast for line drawings. Disadvantages: poor for filled areas and shaded realistic images, flicker when the picture is complex, expensive, limited colours.

Raster-scan display architecture

Block diagram: CPU -> system memory -> video controller (display processor) -> frame buffer (pixel values) -> DAC / colour lookup table -> CRT (or LCD).

  • The screen is a matrix of pixels. The frame buffer stores the intensity or colour of every pixel; the video controller reads it line by line, row by row, and the beam sweeps the whole screen (scanning left to right, top to bottom) at the refresh rate.

Advantages: can fill areas and show shaded, realistic, multi-colour images, low cost, no flicker for complex scenes, easy to combine with TV technology. Disadvantages: needs large memory for the frame buffer, lines show aliasing (jaggies) because of discrete pixels, lower resolution of lines, and redrawing needs scan conversion.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

Discuss the use of computer graphics in different areas.

Answer

Computer graphics is used in many areas.

  • Computer-aided design (CAD): design of buildings, machines, vehicles, circuits and chips with 2D/3D models and simulation.
  • Entertainment: movies, special effects, animation, video games and virtual reality.
  • Education and training: simulators for pilots, drivers and surgeons, and interactive learning.
  • Presentation graphics and data visualisation: charts, graphs, histograms and dashboards.
  • Medicine: CT, MRI and ultrasound imaging, 3D reconstruction and surgical planning.
  • Scientific visualisation and simulation: weather, molecular structures, fluid flow and astronomy.
  • GIS and cartography: maps, satellite images and terrain modelling.
  • Graphical user interfaces: windows, icons, menus in operating systems and apps.
  • Art and advertising: digital painting, image editing, logos and web design.
  • Image processing and virtual/augmented reality.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

Describe polygon, vertex and edge table of a polygon.

Answer

A polygon is a closed plane figure made of straight line segments (edges) that join vertices. In a computer, a polygon surface is stored using tables.

  • Vertex table: a list of all the vertices, with the coordinates (x,y,z)(x, y, z) of each, for example V1: (x1,y1,z1).
  • Edge table: a list of the edges; each edge entry holds the two vertices it joins, for example E1: V1, V2.
  • Polygon (surface) table: a list of the polygons; each entry holds the edges that make up the polygon, for example S1: E1, E2, E3.

Example (triangle): V1(0,0), V2(4,0), V3(2,3); E1 = V1V2, E2 = V2V3, E3 = V3V1; S1 = E1, E2, E3.

The three-table scheme avoids storing coordinates repeatedly, gives fast access to shared edges and vertices, and supports consistency checks (every edge belongs to at least one polygon, every vertex to at least two edges). Extra attributes, such as surface normal, can be added to the polygon table.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

What is boundary representation technique? Explain.

Answer

Boundary representation (B-rep) describes a 3D solid by its surface boundary, which separates the interior of the object from the exterior. The object is defined as a collection of connected surface elements: faces, edges and vertices.

  • Geometry gives the shape of each element: vertex coordinates, edge curves and surface equations.
  • Topology records the connections: which faces share edges, which edges meet at vertices, and which side is outside (face orientation).

Typically, it is stored as polygon meshes (vertex, edge and face tables) or as curved patches (NURBS), and the Euler formula V−E+F=2V - E + F = 2 holds for a valid simple solid.

Advantages: the surface is directly available for rendering and display, suitable for complex shapes, and allows local editing. Disadvantages: stores a large amount of data, does not directly record the volume, and Boolean operations are complex. It contrasts with constructive solid geometry (CSG) and spatial partitioning.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

Explain the Phong illumination model for specular reflection.

Answer

The Phong model calculates the specular reflection, the bright highlight on shiny surfaces, which is seen when the viewer is near the direction of mirror reflection of the light.

Let N\mathbf{N} be the unit surface normal, L\mathbf{L} the direction to the light, R\mathbf{R} the direction of reflected light and V\mathbf{V} the direction to the viewer. Then

R=2(N⋅L)N−L\mathbf{R} = 2(\mathbf{N}\cdot\mathbf{L})\mathbf{N} - \mathbf{L}

The specular intensity is

Ispec=ks Il (V⋅R)ns=ksIlcos⁡nsϕI_{spec} = k_s \, I_l \, (\mathbf{V}\cdot\mathbf{R})^{n_s} = k_s I_l \cos^{n_s}\phi

where ksk_s is the specular reflection coefficient, IlI_l the light intensity, ϕ\phi the angle between V\mathbf{V} and R\mathbf{R}, and nsn_s the specular exponent (shininess).

  • A large nsn_s (100 or more) gives a small sharp highlight for shiny surfaces such as metal; a small nsn_s gives a broad highlight for dull surfaces.
  • The intensity is maximum when ϕ=0\phi = 0 and falls off as ϕ\phi increases. It is zero when V⋅R<0\mathbf{V}\cdot\mathbf{R} < 0.
  • The highlight colour is that of the light.

The total intensity is the sum of ambient, diffuse and specular terms. A common faster variant uses the halfway vector H=(L+V)/∣L+V∣\mathbf{H} = (\mathbf{L}+\mathbf{V})/|\mathbf{L}+\mathbf{V}| and (N⋅H)ns(\mathbf{N}\cdot\mathbf{H})^{n_s} (Blinn-Phong).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

Write short notes on: (a) Shearing and Scaling (b) Line Clipping

Answer

(a) Shearing and scaling

Scaling changes the size of an object. For scale factors sxs_x and sys_y about the origin:

x′=x⋅sx,y′=y⋅sy,[x′y′]=[sx00sy][xy]x' = x \cdot s_x,\quad y' = y \cdot s_y,\qquad \begin{bmatrix}x'\\y'\end{bmatrix} = \begin{bmatrix}s_x & 0\\0 & s_y\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}

If s>1s > 1 the object enlarges, if s<1s < 1 it shrinks, and sx=sys_x = s_y is uniform scaling (the shape is preserved).

Shearing distorts the shape by shifting the coordinates proportionally to the other coordinate, as if layers slide over one another.

  • x-shear: x′=x+shx⋅y,  y′=yx' = x + sh_x \cdot y,\; y' = y
  • y-shear: x′=x,  y′=y+shy⋅xx' = x,\; y' = y + sh_y \cdot x

[x′y′]=[1shx01][xy]\begin{bmatrix}x'\\y'\end{bmatrix} = \begin{bmatrix}1 & sh_x\\0 & 1\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}

(b) Line clipping

Line clipping removes the parts of a line that lie outside a clipping window (usually rectangular) and keeps the part inside. A line is classed as completely inside (accepted), completely outside (rejected) or partially inside (clipped by finding intersections with the window boundaries). Algorithms: Cohen-Sutherland (region outcodes), Liang-Barsky (parametric) and Nicholl-Lee-Nicholl. It saves processing and display of invisible parts.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

Explain how can line method detects the visible surface with example.

Answer

The "line method" here refers to the scan-line method of visible-surface detection, an image-space method that processes the picture one scan line at a time.

Procedure

  1. For each scan line, find the intersections of the line with the projections of all polygon edges.
  2. Sort the intersection points on the line by xx and divide the line into spans.
  3. For each span, find which polygons overlap it (using flags in/out and the polygon table).
  4. Calculate the depth zz of each overlapping polygon from its plane equation Ax+By+Cz+D=0Ax + By + Cz + D = 0: z=−Ax−By−DCz = \frac{-Ax - By - D}{C}
  5. The polygon with the smallest depth (nearest to the viewer) is visible in that span, and its colour is placed in the frame buffer for the span.
  6. Depth is recalculated only where polygons intersect or overlap; it is updated incrementally across the span by z′=z−A/Cz' = z - A/C.

Example. Two overlapping polygons S1 and S2 are given. On a scan line, the spans where only S1 or only S2 is present take its colour. In the span where both overlap, their depths are compared: if S1 has the smaller zz, S1's colour is shown there. Where they do not intersect, the order cannot change across the span, so no extra depth calculation is needed.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

Differentiate Phong Shading with Gouraud Shading method.

Answer

BasisGouraud shadingPhong shading
InterpolatesIntensity (colour) valuesSurface normal vectors
MethodCompute intensity at vertices using vertex normals, then interpolate linearly across edges and scan linesInterpolate normals across the polygon, then compute the illumination at every pixel
ComputationFaster, less expensiveSlower, more expensive
Specular highlightOften missed or distorted, particularly if the highlight is inside a polygonHighlights shown accurately
QualityGood but with Mach bands in some casesSmoother and more realistic
UseWhere speed mattersWhere realism matters

Both are more realistic than flat shading and first compute vertex normals by averaging the normals of the polygons that share the vertex.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2079 · 5 marks

What is Bezier curve? Describe its properties.

Answer

A Bezier curve is a parametric curve defined by a set of control points P0,…,PnP_0, \dots, P_n. It is shaped by the control polygon and is widely used in graphics, CAD and font design. The curve is

P(u)=∑i=0nPi Bi,n(u),0≤u≤1P(u) = \sum_{i=0}^{n} P_i \, B_{i,n}(u),\quad 0 \le u \le 1

where the Bernstein blending functions are

Bi,n(u)=(ni)ui(1−u)n−iB_{i,n}(u) = \binom{n}{i} u^i (1-u)^{n-i}

For n=3n = 3 (cubic) there are four control points, and P(u)=(1−u)3P0+3u(1−u)2P1+3u2(1−u)P2+u3P3P(u) = (1-u)^3P_0 + 3u(1-u)^2P_1 + 3u^2(1-u)P_2 + u^3P_3.

Properties

  • It passes through the first and last control points: P(0)=P0P(0) = P_0, P(1)=PnP(1) = P_n.
  • The tangent at the ends is along the first and last segments of the control polygon.
  • The degree of the curve is one less than the number of control points.
  • The curve lies within the convex hull of its control points (convex hull property).
  • The blending functions are non-negative and sum to 1 (partition of unity).
  • It is invariant under affine transformations, so only the control points need to be transformed.
  • It is smooth and has no local control: changing one control point changes the whole curve.
  • It is symmetric: reversing the order of the control points gives the same curve.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 10 marks

How can polygons be clipped? Describe Gouraud Shading model with necessary derivations.

Answer

Polygon clipping

Polygons are clipped so that only the parts inside the clipping window remain, and the result must still be a closed polygon (new edges along the window boundary are added). Clipping the edges as separate lines is not enough.

Sutherland-Hodgman algorithm. The polygon is clipped against each window boundary in turn (left, right, bottom, top); the output list of vertices of one stage is the input of the next. For each edge from vertex SS to vertex EE of the polygon, four cases are handled:

  1. Both SS and EE inside: output EE.
  2. SS inside, EE outside: output the intersection point.
  3. Both outside: output nothing.
  4. SS outside, EE inside: output the intersection point and EE.

Other methods are Weiler-Atherton (handles concave polygons and holes) and Liang-Barsky.

Gouraud shading model

Gouraud shading (intensity interpolation) renders a smooth surface from a polygon mesh.

  1. Vertex normals: at each vertex, average the unit normals of the polygons sharing it: Nv=∑k=1nNk∣∑k=1nNk∣\mathbf{N}_v = \frac{\sum_{k=1}^{n}\mathbf{N}_k}{\left|\sum_{k=1}^{n}\mathbf{N}_k\right|}
  2. Vertex intensities: apply the illumination model (ambient + diffuse + specular) at each vertex using Nv\mathbf{N}_v.
  3. Interpolate along edges: for a scan line ysy_s between vertices 1 and 2 of an edge, Ia=ys−y2y1−y2I1+y1−ysy1−y2I2I_a = \frac{y_s - y_2}{y_1 - y_2} I_1 + \frac{y_1 - y_s}{y_1 - y_2} I_2 and similarly IbI_b on the other edge, giving the end intensities IaI_a and IbI_b of the scan-line span at xax_a and xbx_b.
  4. Interpolate along the scan line: Ip=xb−xpxb−xaIa+xp−xaxb−xaIbI_p = \frac{x_b - x_p}{x_b - x_a} I_a + \frac{x_p - x_a}{x_b - x_a} I_b Incrementally, I(x+1)=I(x)+ΔII(x+1) = I(x) + \Delta I with ΔI=(Ib−Ia)/(xb−xa)\Delta I = (I_b - I_a)/(x_b - x_a).

It removes the intensity discontinuities between faces and is fast, but it can miss highlights and show Mach bands.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 10 marks

Write the algorithm for Bresenham's line drawing? Digitize a line with end points A(6,9)A(6, 9) and B(10,5)B(10, 5) using Bresenham's line drawing algorithm.

Answer

Bresenham's line algorithm (for slope 0<m<10 < m < 1, x0<x1x_0 < x_1)

  1. Input the endpoints (x0,y0)(x_0, y_0) and (x1,y1)(x_1, y_1); compute Δx=x1−x0\Delta x = x_1 - x_0, Δy=∣y1−y0∣\Delta y = |y_1 - y_0|.
  2. Plot the first point (x0,y0)(x_0, y_0).
  3. Compute the decision parameter p0=2Δy−Δxp_0 = 2\Delta y - \Delta x.
  4. For each xkx_k along the line:
    • if pk<0p_k < 0, the next point is (xk+1,yk)(x_k + 1, y_k) and pk+1=pk+2Δyp_{k+1} = p_k + 2\Delta y;
    • otherwise the next point is (xk+1,yk±1)(x_k + 1, y_k \pm 1) and pk+1=pk+2Δy−2Δxp_{k+1} = p_k + 2\Delta y - 2\Delta x.
  5. Repeat step 4 until x=x1x = x_1 (Δx\Delta x times).

For other slopes the roles of xx and yy are swapped, and yy decreases when the line goes downward.

Line A(6,9)A(6, 9) to B(10,5)B(10, 5)

Δx=4\Delta x = 4, Δy=4\Delta y = 4 (slope =−1= -1, so yy decreases by 1 with every step of xx).

p0=2Δy−Δx=8−4=4p_0 = 2\Delta y - \Delta x = 8 - 4 = 4.

Since pk≥0p_k \ge 0 at every step, yy decreases by 1 each time, and pk+1=pk+2Δy−2Δx=pk+0=4p_{k+1} = p_k + 2\Delta y - 2\Delta x = p_k + 0 = 4.

kpkp_kPixel (x,y)(x, y)
04(6, 9)
14(7, 8)
24(8, 7)
34(9, 6)
4-(10, 5)

The pixels plotted are (6,9), (7,8), (8,7), (9,6), (10,5).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 10 marks

Differentiate between parallel and perspective projection. Perform the rotation of triangle with vertices A(5,7)A(5, 7), B(12,85)B(12, 85) and C(5,3)C(5, 3) counterclockwise 30∘30^\circ about the pivot point (5,3)(5, 3).

Answer

Parallel versus perspective projection

Parallel projectionPerspective projection
Projectors are parallel; centre of projection is at infinityProjectors meet at a centre of projection (eye point)
Object size does not depend on distance from the viewerDistant objects look smaller (perspective foreshortening)
Parallel lines remain parallelParallel lines converge to a vanishing point
Preserves relative dimensions and shapes, so useful for measurementNot realistic dimensions, but realistic appearance
Used in engineering and architectural drawingsUsed in games, animation, and realistic views
Types: orthographic, axonometric, obliqueTypes: one-, two-, three-point

Rotation by 30∘30^\circ counterclockwise about the pivot (5,3)(5, 3)

Rotation about a pivot (xr,yr)(x_r, y_r):

x′=xr+(x−xr)cos⁡θ−(y−yr)sin⁡θx' = x_r + (x - x_r)\cos\theta - (y - y_r)\sin\theta y′=yr+(x−xr)sin⁡θ+(y−yr)cos⁡θy' = y_r + (x - x_r)\sin\theta + (y - y_r)\cos\theta

with cos⁡30∘=0.866\cos 30^\circ = 0.866, sin⁡30∘=0.5\sin 30^\circ = 0.5.

  • A(5, 7): (x−xr,y−yr)=(0,4)(x - x_r, y - y_r) = (0, 4). x′=5+0−4(0.5)=3x' = 5 + 0 - 4(0.5) = 3; y′=3+0+4(0.866)=6.464y' = 3 + 0 + 4(0.866) = 6.464. So A′=(3,6.46)A' = (3, 6.46).
  • B(12, 85): (7,82)(7, 82). x′=5+7(0.866)−82(0.5)=5+6.062−41=−29.94x' = 5 + 7(0.866) - 82(0.5) = 5 + 6.062 - 41 = -29.94; y′=3+7(0.5)+82(0.866)=3+3.5+71.01=77.51y' = 3 + 7(0.5) + 82(0.866) = 3 + 3.5 + 71.01 = 77.51. So B′=(−29.94,77.51)B' = (-29.94, 77.51).
  • C(5, 3): this is the pivot, so it does not move: C′=(5,3)C' = (5, 3).

The new triangle is A′(3,6.46)A'(3, 6.46), B′(−29.94,77.51)B'(-29.94, 77.51), C′(5,3)C'(5, 3).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

Explain motion capture with an example.

Answer

Motion capture (mocap) is the process of recording the movement of real people or objects and transferring it to a digital 3D model so that the model moves in the same natural way.

How it works

  1. Markers (reflective balls or sensors) are placed on key joints of an actor (head, shoulders, elbows, wrists, hips, knees, ankles).
  2. Several cameras (optical systems) or inertial/magnetic sensors track the 3D position of each marker many times per second.
  3. The software triangulates marker positions into 3D coordinates for every frame.
  4. These positions are mapped onto the skeleton (rig) of a digital character, which drives the mesh through skinning.
  5. The animator cleans the data (removes noise, fills gaps) and edits it.

Types: optical (marker-based or markerless), inertial (gyroscope/accelerometer suits), magnetic and mechanical.

Example: In a film or game, an actor wearing a marker suit walks, fights and jumps in a studio. The captured motion is applied to a 3D monster or game character, so its walk cycle looks realistic without an animator posing every frame. Gollum in The Lord of the Rings and sports-game players are well-known examples.

Advantages: realistic motion, fast production, subtle detail. Disadvantages: expensive equipment, data clean-up, limited to motions that humans/real objects can perform.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

Explain about parametric curve. Describe the properties of Bezier curve.

Answer

Parametric curve

A parametric curve represents the coordinates of each point as a function of a parameter uu (or tt) instead of one variable in terms of another:

x=x(u),y=y(u),z=z(u),0≤u≤1x = x(u),\quad y = y(u),\quad z = z(u),\qquad 0 \le u \le 1

Thus P(u)=(x(u),y(u),z(u))P(u) = (x(u), y(u), z(u)). It can represent multi-valued curves, closed curves and curves with vertical tangents, which y=f(x)y=f(x) cannot. A circle is x=rcos⁡θ, y=rsin⁡θx = r\cos\theta,\ y = r\sin\theta. Common graphics forms are Bezier, B-spline and Hermite curves.

Bezier curve

A Bezier curve of degree nn is defined by n+1n+1 control points P0,…,PnP_0,\dots,P_n:

P(u)=∑i=0nPi Bi,n(u),Bi,n(u)=(ni)ui(1−u)n−iP(u) = \sum_{i=0}^{n} P_i\, B_{i,n}(u),\qquad B_{i,n}(u) = \binom{n}{i}u^i(1-u)^{n-i}

Properties

  1. It passes through the first and last control points: P(0)=P0P(0)=P_0, P(1)=PnP(1)=P_n.
  2. The tangent at the start is along P1−P0P_1-P_0 and at the end along Pn−Pn−1P_n-P_{n-1}.
  3. The curve lies inside the convex hull of its control points (convex hull property).
  4. The blending functions are non-negative and sum to 1: ∑Bi,n(u)=1\sum B_{i,n}(u)=1.
  5. The curve has degree nn, i.e. one less than the number of control points, and is smooth (infinitely differentiable).
  6. It is invariant under affine transformations: transforming the control points transforms the curve.
  7. It has global control: moving one control point changes the whole curve, and it is symmetric (reversing the point order gives the same curve).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

Explain the wireframe representation of 3D objects.

Answer

Wireframe representation shows a 3D object only by its edges (the skeleton), like a frame made of wire; faces are not filled.

Data stored

  • A vertex table with the (x,y,z)(x, y, z) coordinates of each vertex.
  • An edge table where each edge is a pair of vertex indices.
  • Optionally, a surface/face table listing edges per face.

For a cube: 8 vertices, 12 edges, 6 faces. The edge E1E_1 may be stored as (V1,V2)(V_1, V_2).

Display: the vertices are transformed and projected to 2D, and then each edge is drawn as a line between the projected end points. Curved surfaces are drawn by a mesh of lines (e.g. latitude/longitude lines on a sphere).

Advantages: very fast to draw, little memory, ideal for quick previews, modelling and editing in CAD.

Disadvantages: no surface or shading information; hidden lines are not removed, so the picture is ambiguous (the Necker cube effect) and looks unrealistic. Hidden-line removal can be added to reduce this.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

How does a polygon can be created in OpenGL? Illustrate with an example.

Answer

In OpenGL a polygon is created by listing its vertices between glBegin() and glEnd(). The mode argument decides the primitive: GL_POLYGON (a single convex polygon), GL_TRIANGLES, GL_QUADS, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, etc. The polygon must be convex and planar. Colour is set by glColor3f() and vertices by glVertex2f()/glVertex3f().

Example (draw a coloured pentagon, using GLUT)

#include <GL/glut.h>

void display(void) {
    glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(1.0, 0.0, 0.0);          // red
    glBegin(GL_POLYGON);
        glVertex2f(-0.3, -0.5);
        glVertex2f( 0.3, -0.5);
        glVertex2f( 0.5,  0.1);
        glVertex2f( 0.0,  0.6);
        glVertex2f(-0.5,  0.1);
    glEnd();
    glFlush();
}

int main(int argc, char** argv) {
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
    glutInitWindowSize(400, 400);
    glutCreateWindow("Polygon");
    glClearColor(1, 1, 1, 1);
    glutDisplayFunc(display);
    glutMainLoop();
    return 0;
}

The vertices are joined in order and the last is joined to the first. glPolygonMode(GL_FRONT_AND_BACK, GL_LINE) can draw only the outline instead of a filled polygon.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

Write short notes: (a) Z-Buffer (b) Polygon Table

Answer

(a) Z-Buffer

The Z-buffer (depth buffer) is an image-space method of visible surface detection. Two buffers of the same size as the screen are used: a frame (refresh) buffer storing colour of each pixel and a depth buffer storing the depth zz of the nearest surface seen so far at each pixel.

Algorithm: initialise depth to the maximum (far) value and the frame buffer to the background colour. For each polygon and each pixel (x,y)(x,y) it covers, compute zz; if zz is nearer than depth[x][y], set depth[x][y] = z and frame[x][y] = the surface colour. Depth along a scan line is computed incrementally from the plane equation z=(−Ax−By−D)/Cz = (-Ax - By - D)/C, giving z′=z−A/Cz' = z - A/C. It is simple and handles any order of polygons, but needs extra memory and cannot handle transparency easily.

(b) Polygon Table

A polygon table stores the geometric and attribute data of a polygon-mesh object in tables:

  • Vertex table: coordinates of each vertex.
  • Edge table: each edge as a pair of vertex pointers.
  • Surface (polygon) table: each polygon as a list of edges, plus attributes such as colour and transparency.

Example: V1(x1,y1,z1)V_1(x_1,y_1,z_1) ...; E1:V1,V2E_1: V_1, V_2; S1:E1,E2,E3S_1: E_1, E_2, E_3. The tables allow quick consistency checks (every edge belongs to two polygons) and each polygon's plane equation Ax+By+Cz+D=0Ax+By+Cz+D=0 can also be stored for visibility tests and shading.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

Explain architecture of random scan display systems with suitable diagram.

Answer

Random scan (vector) display draws a picture as a set of line segments directly, with the electron beam moving from one end point to the next in any order, rather than sweeping the whole screen.

Architecture

 Application program --> Graphics package --> Display file (refresh buffer)
                                                      |
                                           Display controller (DPU)
                                                      |
                                  Vector generator / DACs --> Deflection amps
                                                      |
                                             CRT (beam deflection)

Components

  1. Display file memory: stores the picture definition as display commands (line, point, character with coordinates) produced by the graphics package.
  2. Display controller (processor): repeatedly reads the commands and sends them to the vector generator.
  3. Vector generator: converts coordinates into analog deflection voltages (via DACs) to move the beam.
  4. CRT: phosphor lights where the beam passes; because phosphor fades, the picture is refreshed 30 to 60 times a second.

Features: high resolution and smooth lines; refresh time depends on the number of lines; less memory; poor at shaded/filled areas; used in plotters and CAD.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2080 · 5 marks

Reflect a line segment having end points (9,3)(9, 3) and (12,10)(12, 10) about a line X=7X = 7. Draw initial and final result graph as well.

Answer

Reflection about the vertical line x=7x = 7: translate the line to the y-axis, reflect about the y-axis, translate back.

M=T(7,0)⋅Ry⋅T(−7,0)M = T(7,0)\cdot R_{y}\cdot T(-7,0)

The result simplifies to x′=14−x, y′=yx' = 14 - x,\ y' = y.

Matrix form (homogeneous): [x′y′1]=[−1014010001][xy1]\begin{bmatrix}x'\\y'\\1\end{bmatrix}=\begin{bmatrix}-1&0&14\\0&1&0\\0&0&1\end{bmatrix}\begin{bmatrix}x\\y\\1\end{bmatrix}

  • A(9,3)A(9,3): x′=14−9=5x' = 14-9 = 5, so A′(5,3)A'(5,3).
  • B(12,10)B(12,10): x′=14−12=2x' = 14-12 = 2, so B′(2,10)B'(2,10).

Result: the reflected segment has end points (5,3)(5,3) and (2,10)(2,10).

Graph (description): Draw the vertical mirror line x=7x=7. The original segment from (9,3)(9,3) to (12,10)(12,10) lies to the right of it, sloping up and to the right. The image segment from (5,3)(5,3) to (2,10)(2,10) lies to the left, sloping up and to the left. Each point and its image are at equal distance from x=7x=7 (2 units for AA, 5 units for BB), and the joining lines are horizontal (perpendicular to the mirror).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · 10 marks

Describe z-buffer method for visible surface detection. State its limitations and how these limitations can be reduced.

Answer

Z-buffer (depth-buffer) method

An image-space visible-surface method that compares surface depths pixel by pixel. It uses two arrays of screen size: a depth buffer depth(x,y) and a refresh (frame) buffer frame(x,y).

Algorithm

  1. Initialise depth(x,y) = 1.0 (far plane) (or ∞\infty) and frame(x,y) = background colour for all pixels.
  2. For every polygon in the scene, for every pixel (x,y)(x,y) in its projection:
    • Calculate the depth zz from the plane equation Ax+By+Cz+D=0Ax+By+Cz+D=0, i.e. z=−Ax−By−DCz = \dfrac{-Ax-By-D}{C}.
    • If z<z < depth(x,y) (nearer): set depth(x,y) = z and frame(x,y) = surface colour at (x,y)(x,y).
  3. After all polygons are processed, the frame buffer holds the visible surfaces.

Along a scan line the depth is obtained incrementally: z(x+1,y)=z(x,y)−ACz(x+1,y) = z(x,y) - \dfrac{A}{C}, and for the next scan line z(x,y−1)=z(x,y)+BCz(x,y-1)= z(x,y)+\dfrac{B}{C} (or z−A/Cz - A/C along an edge), reducing computation.

Advantages: simple, objects can be drawn in any order, no sorting, easy hardware implementation, works with any surface for which depth can be computed.

Limitations and remedies

  1. Memory: needs an extra buffer of full screen size. Remedy: process the screen in strips or sub-regions (area subdivision), or use smaller depth precision.
  2. Only one visible surface per pixel: cannot handle transparency or translucency. Remedy: the A-buffer method keeps a linked list of surfaces per pixel and blends them.
  3. Aliasing: discrete pixel decisions give jagged edges. Remedy: A-buffer/supersampling for anti-aliasing.
  4. Depth precision and z-fighting: limited bits cause errors for nearly coplanar surfaces. Remedy: tighter near/far planes, higher bit depth (24/32-bit), non-linear (1/z) depth.
  5. Wasted work: hidden polygons are still rasterised (overdraw). Remedy: early-z test, front-to-back ordering or hierarchical z-buffers.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · 10 marks

What is the role of clipping? Plot the line with end points (20,10)(20, 10) and (30,18)(30, 18) using DDA.

Answer

Role of clipping

Clipping removes the parts of a picture that lie outside a chosen clipping window (or view volume) so that only the visible portion is processed and displayed. Its roles are:

  • It prevents drawing outside the display area or viewport and the wrong display (wrap-around) of objects.
  • It saves computation, since scan conversion, shading and transformation work are done only for visible parts.
  • It is used in viewing transformations, in selecting parts of a picture to enlarge, in hidden-surface and anti-aliasing procedures, and in copy/move/delete editing operations.
  • Algorithms: Cohen-Sutherland and Liang-Barsky (lines), Sutherland-Hodgman and Weiler-Atherton (polygons).

DDA for (20,10)(20,10) to (30,18)(30,18)

Δx=10, Δy=8\Delta x = 10,\ \Delta y = 8. Steps =max⁡(∣Δx∣,∣Δy∣)=10= \max(|\Delta x|,|\Delta y|) = 10. xinc=10/10=1,yinc=8/10=0.8x_{inc} = 10/10 = 1,\quad y_{inc} = 8/10 = 0.8.

kxy (exact)Plotted
02010.0(20, 10)
12110.8(21, 11)
22211.6(22, 12)
32312.4(23, 12)
42413.2(24, 13)
52514.0(25, 14)
62614.8(26, 15)
72715.6(27, 16)
82816.4(28, 16)
92917.2(29, 17)
103018.0(30, 18)

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · 10 marks

List the rotation matrix in clockwise direction with respect to x-axis, y-axis and z-axis. Rotate the object (0,0,0)(0, 0, 0), (2,3,0)(2, 3, 0), (5,4,0)(5, 4, 0) about the rotation axis y=4y = 4.

Answer

Clockwise rotation matrices (angle θ\theta, homogeneous 3D, right-handed system, clockwise when looking from the positive axis towards the origin):

Rx(−θ)=[10000cos⁡θsin⁡θ00−sin⁡θcos⁡θ00001],Ry(−θ)=[cos⁡θ0−sin⁡θ00100sin⁡θ0cos⁡θ00001]R_x(-\theta)=\begin{bmatrix}1&0&0&0\\0&\cos\theta&\sin\theta&0\\0&-\sin\theta&\cos\theta&0\\0&0&0&1\end{bmatrix},\quad R_y(-\theta)=\begin{bmatrix}\cos\theta&0&-\sin\theta&0\\0&1&0&0\\\sin\theta&0&\cos\theta&0\\0&0&0&1\end{bmatrix}

Rz(−θ)=[cos⁡θsin⁡θ00−sin⁡θcos⁡θ0000100001]R_z(-\theta)=\begin{bmatrix}\cos\theta&\sin\theta&0&0\\-\sin\theta&\cos\theta&0&0\\0&0&1&0\\0&0&0&1\end{bmatrix}

Rotation about the axis y=4y=4

The axis y=4y=4 (with z=0z=0) is a line parallel to the x-axis. The angle is not given, so take θ=90∘\theta = 90^\circ clockwise. Steps: translate the axis to the x-axis, rotate about x, translate back:

M=T(0,4,0)⋅Rx(−90∘)⋅T(0,−4,0)M = T(0,4,0)\cdot R_x(-90^\circ)\cdot T(0,-4,0)

With cos⁡90∘=0, sin⁡90∘=1\cos90^\circ=0,\ \sin90^\circ=1, a point (x,y,z)(x,y,z) becomes y1=y−4y_1 = y-4; then y2=y1cos⁡θ+zsin⁡θ=zy_2 = y_1\cos\theta + z\sin\theta = z, z2=−y1sin⁡θ+zcos⁡θ=−y1z_2 = -y_1\sin\theta + z\cos\theta = -y_1; finally y′=y2+4y' = y_2+4.

  • (0,0,0)(0,0,0): y1=−4y_1=-4, so y2=0, z2=4y_2 = 0,\ z_2 = 4, giving (0,4,4)(0,4,4).
  • (2,3,0)(2,3,0): y1=−1y_1=-1, so y2=0, z2=1y_2=0,\ z_2=1, giving (2,4,1)(2,4,1).
  • (5,4,0)(5,4,0): y1=0y_1=0, so y2=0, z2=0y_2=0,\ z_2=0, giving (5,4,0)(5,4,0).

New object: (0,4,4), (2,4,1), (5,4,0)(0,4,4),\ (2,4,1),\ (5,4,0). The x-coordinates are unchanged, as expected for rotation about an axis parallel to x, and the point on the axis stays fixed.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · 5 marks

Write procedure to render the polygon surface by using Phong shading model.

Answer

Phong shading (normal-vector interpolation) gives more accurate highlights than Gouraud shading because it interpolates surface normals, not intensities, and applies the illumination model at every pixel.

Procedure

  1. Find vertex normals: for each vertex, average the normals of the polygons sharing it: Nv=∑kNk∣∑kNk∣N_v = \frac{\sum_k N_k}{\left|\sum_k N_k\right|}
  2. Interpolate normals along polygon edges: for an edge between vertices 1 and 2, the normal at scan-line intersection ysy_s is N=ys−y2y1−y2N1+y1−ysy1−y2N2N = \frac{y_s - y_2}{y_1 - y_2}N_1 + \frac{y_1 - y_s}{y_1 - y_2}N_2 (incrementally, N′=N+ΔNN' = N + \Delta N).
  3. Interpolate along each scan line between the left and right edge normals to get the normal at every pixel, then normalise it.
  4. Apply the illumination model at each pixel with the interpolated normal: I=kaIa+kdIl(N⋅L)+ksIl(N⋅H)nsI = k_a I_a + k_d I_l (N\cdot L) + k_s I_l (N\cdot H)^{n_s}
  5. Set the pixel to the computed intensity and repeat for all scan lines and polygons.

Features: realistic specular highlights and reduced Mach bands, but it is much more costly than Gouraud shading since lighting is computed per pixel.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · 5 marks

Explain about parametric cubic curve with its properties.

Answer

Parametric cubic curve

A parametric cubic curve is a curve whose xx, yy, zz coordinates are cubic polynomials in the parameter uu (0≤u≤10\le u\le1):

x(u)=axu3+bxu2+cxu+dxx(u)=a_xu^3+b_xu^2+c_xu+d_x and similarly for y(u)y(u) and z(u)z(u). In vector form P(u)=au3+bu2+cu+d=U⋅M⋅GP(u) = a u^3 + b u^2 + c u + d = U\cdot M\cdot G with U=[u3 u2 u 1]U=[u^3\ u^2\ u\ 1], MM the basis matrix and GG the geometry vector (control points or end points and tangents). The 12 coefficients are fixed by 12 conditions, such as end points and tangent vectors (Hermite), or four control points (Bezier, B-spline).

Properties

  1. Cubic is the lowest degree that can represent a non-planar space curve and gives enough flexibility (end points plus end tangents) with low computation.
  2. It gives smooth curves; two segments joined with matching tangents have C1C^1 (or C2C^2) continuity at the joint (parametric continuity C0,C1,C2C^0,C^1,C^2, or geometric G0,G1G^0,G^1).
  3. It is independent of the coordinate system and can represent multi-valued curves and vertical tangents.
  4. It can be easily transformed, as only the control geometry needs transforming.
  5. Types: Hermite (end points and tangents), Bezier (control points), B-spline and Catmull-Rom splines.
  6. A long curve is built by joining many cubic segments (piecewise cubic) rather than using a high-degree polynomial, which oscillates.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · 5 marks

Digitize circle with center (0,0)(0, 0) and radius =6= 6.

Answer

Use the midpoint circle algorithm with centre (0,0)(0,0) and r=6r=6. Start at (x0,y0)=(0,6)(x_0,y_0)=(0,6) with decision parameter p0=1−r=−5p_0 = 1 - r = -5.

Rule: if pk<0p_k<0, next point (xk+1, yk)(x_k+1,\,y_k) and pk+1=pk+2xk+1+1p_{k+1}=p_k+2x_{k+1}+1; else next point (xk+1, yk−1)(x_k+1,\,y_k-1) and pk+1=pk+2xk+1+1−2yk+1p_{k+1}=p_k+2x_{k+1}+1-2y_{k+1}. Stop when x≥yx\ge y.

kp_k(x_{k+1}, y_{k+1})
0-5(1, 6)
1-2(2, 6)
23(3, 5)
30(4, 4)

Starting point (0,6)(0,6); the points in the first octant are (0,6),(1,6),(2,6),(3,5),(4,4)(0,6),(1,6),(2,6),(3,5),(4,4).

Using 8-way symmetry, each (x,y)(x,y) gives (±x,±y)(\pm x,\pm y) and (±y,±x)(\pm y,\pm x):

  • (0,6),(0,−6),(6,0),(−6,0)(0,6),(0,-6),(6,0),(-6,0)
  • (1,6),(−1,6),(1,−6),(−1,−6),(6,1),(−6,1),(6,−1),(−6,−1)(1,6),(-1,6),(1,-6),(-1,-6),(6,1),(-6,1),(6,-1),(-6,-1)
  • (2,6),(−2,6),(2,−6),(−2,−6),(6,2),(−6,2),(6,−2),(−6,−2)(2,6),(-2,6),(2,-6),(-2,-6),(6,2),(-6,2),(6,-2),(-6,-2)
  • (3,5),(−3,5),(3,−5),(−3,−5),(5,3),(−5,3),(5,−3),(−5,−3)(3,5),(-3,5),(3,-5),(-3,-5),(5,3),(-5,3),(5,-3),(-5,-3)
  • (4,4),(−4,4),(4,−4),(−4,−4)(4,4),(-4,4),(4,-4),(-4,-4)

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · 5 marks

Explain the use of polygon tables for boundary representations.

Answer

In boundary representation (B-rep), a 3D object is described by its bounding surfaces, usually polygons forming a polygon mesh. Polygon tables store this information in organised tables for processing and display. They have two groups of data: geometric (vertex coordinates and spatial orientation) and attribute (colour, transparency, reflectivity, texture).

Tables used

  1. Vertex table: Vi:(xi,yi,zi)V_i: (x_i, y_i, z_i).
  2. Edge table: each edge EjE_j with its two end vertices, e.g. E1:V1,V2E_1: V_1, V_2.
  3. Surface-facet (polygon) table: each polygon with the edges forming it, e.g. S1:E1,E2,E3S_1: E_1, E_2, E_3, plus attributes.

Example (triangle mesh): S1:E1,E2,E3S_1: E_1,E_2,E_3; S2:E3,E4,E5S_2: E_3,E_4,E_5 share edge E3E_3.

Uses

  • Fast access to the data when drawing and transforming objects.
  • Error checking: every edge should be in at least two polygons and every vertex in at least two edges, with closed polygons.
  • Each polygon's plane equation Ax+By+Cz+D=0Ax+By+Cz+D=0 is stored (computed from three vertices); the normal (A,B,C)(A,B,C) is used in visibility tests (back-face: V⋅N>0V\cdot N>0) and shading.
  • Sharing of vertices and edges avoids repeated data and drawing common edges twice.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · 5 marks

Differentiate between raster scan and random scan display systems.

Answer

Raster scanRandom scan (vector)
The beam sweeps the whole screen row by row (left to right, top to bottom).The beam moves only along the lines of the picture, in any order.
Picture stored as a matrix of pixel intensities in a frame buffer.Picture stored as a set of line-drawing commands in a display file.
Needs large memory (the frame buffer).Needs small memory.
Refresh rate is fixed (about 60 Hz), independent of picture complexity.Refresh time depends on the number of lines; complex pictures flicker.
Lines are jagged (staircase/aliasing).Smooth lines with high resolution.
Good for realistic, shaded and filled images with many colours.Poor at filled areas and shading; limited colours.
Cheaper and common (TV, monitors, LCD).Costly and now rare (pen plotters, CAD vector displays).
Example: television, computer monitor.Example: oscilloscope, vector plotter.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · 5 marks

What is intensity attenuation? Describe the various types of projection.

Answer

Intensity attenuation

Light intensity from a point source decreases as it travels away from the source. For distance dd, the physical rule is inverse-square: I∝1/d2I\propto 1/d^2. Since this gives too sharp variation for nearby sources, graphics uses an attenuation factor f(d)=min⁡(1, 1a0+a1d+a2d2)f(d)=\min\left(1,\ \frac{1}{a_0+a_1 d+a_2 d^2}\right) with constants a0,a1,a2a_0,a_1,a_2. The diffuse and specular terms are multiplied by f(d)f(d) so that farther surfaces appear darker, which gives depth realism.

Types of projection

Projection maps 3D coordinates to a 2D plane.

  1. Parallel projection: projectors are parallel; size is preserved, with no perspective foreshortening.
    • Orthographic: projectors are perpendicular to the plane (front, top, side views; axonometric views such as isometric).
    • Oblique: projectors are at an angle to the plane (cavalier: scale 1; cabinet: scale 1/2 on receding lines).
  2. Perspective projection: projectors converge to the centre of projection; distant objects appear smaller (foreshortening), which looks realistic. Depending on the number of vanishing points: one-point, two-point and three-point perspective. Matches the human eye and camera but does not preserve shape or parallel lines.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · 5 marks

Explain about openGL and call back functions.

Answer

OpenGL (Open Graphics Library) is a cross-platform, cross-language API for rendering 2D and 3D vector graphics. It is hardware independent, provides about 250 commands for drawing primitives, transformations, lighting, texture mapping, shading and hidden-surface removal (z-buffer), and works as a state machine and a rendering pipeline. Related libraries: GLU (utilities such as gluPerspective), GLUT (windowing and input, platform independent), and GLFW/GLEW.

Syntax: functions are prefixed gl (e.g. glVertex3f), constants GL_ and types GL.

Callback functions

GLUT is event driven: the program registers functions that the library calls when an event occurs, and then enters glutMainLoop().

  • glutDisplayFunc(display) called when the window needs redrawing.
  • glutReshapeFunc(reshape) called when the window is resized (set viewport and projection).
  • glutKeyboardFunc(keyboard) called for a key press.
  • glutMouseFunc(mouse) and glutMotionFunc(motion) for mouse buttons and movement.
  • glutIdleFunc(idle) called when nothing else is happening (animation).
  • glutTimerFunc(ms, func, value) called after a delay.
void display(){ glClear(GL_COLOR_BUFFER_BIT); /* draw */ glFlush(); }
void keyboard(unsigned char k,int x,int y){ if(k==27) exit(0); }
int main(int c,char**v){
  glutInit(&c,v); glutCreateWindow("Demo");
  glutDisplayFunc(display); glutKeyboardFunc(keyboard);
  glutMainLoop();
}

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2081 · 5 marks

How the geometric and attribute information of a 3D objects are stored for the object representations? Explain with suitable example.

Answer

A 3D object is commonly represented by boundary representation as a polygon mesh, and its data is split into geometric and attribute information and stored in tables.

Geometric information: where the object is and how it is shaped. It consists of the vertex coordinates, the edges (vertex pairs), the surfaces (edge lists) and each plane's equation Ax+By+Cz+D=0Ax+By+Cz+D=0, with the normal (A,B,C)(A,B,C) giving the orientation.

Attribute information: how it appears, such as colour, transparency, reflectivity, texture and shading parameters.

Storage in three tables

  • Vertex table: V1:(0,0,0), V2:(1,0,0), V3:(0,1,0), V4:(0,0,1)V_1:(0,0,0),\ V_2:(1,0,0),\ V_3:(0,1,0),\ V_4:(0,0,1)
  • Edge table: E1:V1V2, E2:V2V3, E3:V3V1, E4:V1V4, E5:V2V4, E6:V3V4E_1:V_1V_2,\ E_2:V_2V_3,\ E_3:V_3V_1,\ E_4:V_1V_4,\ E_5:V_2V_4,\ E_6:V_3V_4
  • Surface table (with attributes): S1:E1,E2,E3S_1: E_1,E_2,E_3 (red); S2:E1,E5,E4S_2: E_1,E_5,E_4 (green); S3:E3,E6,E4S_3: E_3,E_6,E_4 (blue); S4:E2,E6,E5S_4: E_2,E_6,E_5 (yellow)

This example is a tetrahedron (4 vertices, 6 edges, 4 faces). The tables avoid duplication (shared vertices stored once), allow consistency checks and give the data needed for transformation, hidden-surface removal and shading. A compact alternative is a single list of polygons with direct vertex coordinates, or a plane equation table with a vertex list.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 10 marks

Describe Bresenham's circle drawing algorithm. Trace the DDA algorithm to draw a line segment from (2,2)(2,2) to (6,6)(6,6).

Answer

Bresenham's circle drawing algorithm

For a circle of radius rr centred at the origin, compute only one octant (from (0,r)(0,r) until x≥yx\ge y) and use 8-way symmetry. The decision parameter chooses between the pixel (x+1,y)(x+1, y) and (x+1,y−1)(x+1, y-1) using integer arithmetic only.

  1. Input rr; set x=0, y=rx=0,\ y=r and decision parameter d=3−2rd=3-2r.
  2. Plot the 8 symmetric points (±x,±y),(±y,±x)(\pm x,\pm y),(\pm y,\pm x) (added to the centre (xc,yc)(x_c,y_c)).
  3. While x<yx<y (using the current, old xx and yy):
    • if d<0d<0: d=d+4x+6d = d+4x+6 (y unchanged)
    • else: d=d+4(x−y)+10d = d+4(x-y)+10 and y=y−1y=y-1
    • x=x+1x = x+1
    • plot the 8 symmetric points.
  4. Stop when x≥yx\ge y.

The method uses only additions, subtractions and shifts, so it is fast.

DDA from (2,2)(2,2) to (6,6)(6,6)

Δx=4, Δy=4\Delta x=4,\ \Delta y=4; steps =4=4; xinc=1, yinc=1x_{inc}=1,\ y_{inc}=1.

kxyPlotted
022(2, 2)
133(3, 3)
244(4, 4)
355(5, 5)
466(6, 6)

The line is the 45 degree diagonal, with all pixels exactly on the line.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 10 marks

What is scaling in 3D graphics? Derive the scaling matrix for scaling along the XX, YY, and ZZ axes. Apply the scaling transformation to a point (2,3,4)(2,3,4) with Sx=2S_x=2, Sy=3S_y=3, Sz=4S_z=4.

Answer

Scaling is a transformation that changes the size of an object by multiplying its coordinates with scaling factors. In 3D, with factors Sx,Sy,SzS_x, S_y, S_z along the axes (value greater than 1 enlarges, less than 1 shrinks, equal factors give uniform scaling). With the origin as the fixed point, a point P(x,y,z)P(x,y,z) maps to P′(x′,y′,z′)P'(x',y',z'):

x′=x⋅Sx,y′=y⋅Sy,z′=z⋅Szx' = x\cdot S_x,\qquad y' = y\cdot S_y,\qquad z' = z\cdot S_z

Writing this as a matrix in homogeneous coordinates (so that all transformations can be combined by multiplication):

[x′y′z′1]=[Sx0000Sy0000Sz00001][xyz1]\begin{bmatrix}x'\\y'\\z'\\1\end{bmatrix}=\begin{bmatrix}S_x&0&0&0\\0&S_y&0&0\\0&0&S_z&0\\0&0&0&1\end{bmatrix}\begin{bmatrix}x\\y\\z\\1\end{bmatrix}

(For scaling about a fixed point (xf,yf,zf)(x_f,y_f,z_f): translate by (−xf,−yf,−zf)(-x_f,-y_f,-z_f), scale, translate back.)

Numerical: P(2,3,4)P(2,3,4) with Sx=2, Sy=3, Sz=4S_x=2,\ S_y=3,\ S_z=4:

[x′y′z′1]=[2000030000400001][2341]=[49161]\begin{bmatrix}x'\\y'\\z'\\1\end{bmatrix}=\begin{bmatrix}2&0&0&0\\0&3&0&0\\0&0&4&0\\0&0&0&1\end{bmatrix}\begin{bmatrix}2\\3\\4\\1\end{bmatrix}=\begin{bmatrix}4\\9\\16\\1\end{bmatrix}

So P′=(4,9,16)P'=(4,9,16).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 10 marks

Describe the concept of Bezier curves in 3D modeling. Derive the equation for a Bezier curve and discuss how it is used in curve modeling and animation.

Answer

Bezier curves

A Bezier curve is a parametric curve defined by a set of control points P0,…,PnP_0,\dots,P_n that form the control polygon. The curve starts at P0P_0 and ends at PnP_n, is pulled towards the intermediate points but generally does not pass through them. It is widely used in CAD, font design (TrueType/PostScript), vector graphics and 3D modelling.

Derivation of the equation

The curve is a weighted sum (blend) of the control points: P(u)=∑i=0nPi Bi,n(u),0≤u≤1P(u)=\sum_{i=0}^{n}P_i\,B_{i,n}(u),\quad 0\le u\le1 The blending functions are Bernstein polynomials, taken from the binomial expansion of [(1−u)+u]n=1\left[(1-u)+u\right]^n=1: Bi,n(u)=(ni)ui(1−u)n−i,(ni)=n!i!(n−i)!B_{i,n}(u)=\binom{n}{i}u^i(1-u)^{n-i},\qquad \binom{n}{i}=\frac{n!}{i!(n-i)!} Because the terms of the binomial expansion add up to 1, ∑Bi,n(u)=1\sum B_{i,n}(u)=1, so the curve stays in the convex hull.

For the cubic (n=3n=3), the usual case: P(u)=(1−u)3P0+3u(1−u)2P1+3u2(1−u)P2+u3P3P(u)=(1-u)^3P_0+3u(1-u)^2P_1+3u^2(1-u)P_2+u^3P_3 or in matrix form P(u)=[u3u2u1][−13−313−630−33001000][P0P1P2P3]P(u)=\begin{bmatrix}u^3&u^2&u&1\end{bmatrix}\begin{bmatrix}-1&3&-3&1\\3&-6&3&0\\-3&3&0&0\\1&0&0&0\end{bmatrix}\begin{bmatrix}P_0\\P_1\\P_2\\P_3\end{bmatrix}

Check: P(0)=P0P(0)=P_0, P(1)=P3P(1)=P_3; P′(0)=3(P1−P0)P'(0)=3(P_1-P_0) and P′(1)=3(P3−P2)P'(1)=3(P_3-P_2).

Use in curve modelling: the designer moves the control points interactively to shape the curve; control is intuitive. Smooth long curves are made by joining cubic segments, with C1C^1 continuity ensured by making P3P_3 of one segment the first point of the next and collinear tangent points P2,P3=P0′,P1′P_2, P_3 = P_0', P_1'. Using a 3D point for each PiP_i gives space curves and (as a tensor product) Bezier surface patches, e.g. for car bodies and characters.

Use in animation: a Bezier curve defines a motion path for a camera or object, with uu as time, and defines easing curves (cubic-bezier timing functions) to control speed in keyframe animation, giving smooth acceleration and deceleration.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 5 marks

Discuss how rasterization and rendering help in generating a realistic image from a 3D model. What factors affect the quality of the rendered output?

Answer

Rasterization converts the geometric description of a 3D model (triangles after modelling, viewing and projection transformations) into pixels on the screen. It performs clipping and viewport mapping, scan-converts each primitive into fragments, and interpolates attributes (depth, colour, normals, texture coordinates) across them. A depth test (z-buffer) then decides which fragment is visible.

Rendering computes the final colour of each pixel using illumination and shading models, texture mapping, shadows, reflections and transparency, and finally anti-aliasing. Together they turn a wireframe of coordinates into a realistic picture: rasterization gives correct shape, visibility and position; rendering gives the appearance of material and light.

Factors affecting quality

  1. Model detail (polygon count, smoothness of the mesh).
  2. Resolution and anti-aliasing (to remove jagged edges).
  3. Illumination model (ambient, diffuse, specular) and shading method (flat, Gouraud, Phong); global illumination (ray tracing, radiosity) is more realistic.
  4. Textures, bump/normal maps and material properties.
  5. Shadows, reflections, refraction and transparency.
  6. Depth-buffer precision and visibility algorithm.
  7. Hardware/time available (real-time versus offline rendering).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 5 marks

Explain the concept of translation transformation in 2D graphics. Discuss the effect of translation on objects.

Answer

Translation is a rigid-body transformation that moves an object along a straight line from one position to another without changing its size, shape or orientation. Every point P(x,y)P(x,y) is shifted by translation distances txt_x (horizontal) and tyt_y (vertical):

x′=x+tx,y′=y+tyx' = x + t_x,\qquad y' = y + t_y

In matrix form, P′=P+TP' = P + T with T=[txty]T = \begin{bmatrix}t_x\\t_y\end{bmatrix}; in homogeneous coordinates

[x′y′1]=[10tx01ty001][xy1]\begin{bmatrix}x'\\y'\\1\end{bmatrix}=\begin{bmatrix}1&0&t_x\\0&1&t_y\\0&0&1\end{bmatrix}\begin{bmatrix}x\\y\\1\end{bmatrix}

The inverse is translation by (−tx,−ty)(-t_x,-t_y), and successive translations add: T(tx1,ty1) T(tx2,ty2)=T(tx1+tx2, ty1+ty2)T(t_{x1},t_{y1})\,T(t_{x2},t_{y2}) = T(t_{x1}+t_{x2},\,t_{y1}+t_{y2}).

Effect on objects: the object keeps its size, shape, orientation and the distances and angles between points; only its position changes. For a polygon every vertex is translated and the lines are redrawn; for a circle only the centre need be translated.

Example: triangle A(1,1)A(1,1), B(3,1)B(3,1), C(2,3)C(2,3) with T=(4,2)T=(4,2) becomes A′(5,3)A'(5,3), B′(7,3)B'(7,3), C′(6,5)C'(6,5).

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 5 marks

Given a polygon with vertices A(3,4)A(3,4), B(7,4)B(7,4), C(7,8)C(7,8), D(3,8)D(3,8), clip it against a rectangular window with coordinates (4,5)(4,5), (6,7)(6,7) using the Sutherland-Hodgman polygon clipping algorithm.

Answer

Window: xmin=4, xmax=6, ymin=5, ymax=7x_{min}=4,\ x_{max}=6,\ y_{min}=5,\ y_{max}=7. Polygon: A(3,4),B(7,4),C(7,8),D(3,8)A(3,4),B(7,4),C(7,8),D(3,8).

Sutherland-Hodgman clips the polygon against each window edge in turn; for each edge PiPi+1P_iP_{i+1}: in to in outputs the second point; in to out outputs the intersection; out to in outputs the intersection and the second point; out to out outputs nothing.

1. Left edge (x≥4x\ge4)

  • A→BA\to B: out to in: intersection (4,4)(4,4), then B(7,4)B(7,4)
  • B→CB\to C: in to in: C(7,8)C(7,8)
  • C→DC\to D: in to out: intersection (4,8)(4,8)
  • D→AD\to A: out to out: none

Result: (4,4),(7,4),(7,8),(4,8)(4,4),(7,4),(7,8),(4,8)

2. Right edge (x≤6x\le6)

  • (4,4)→(7,4)(4,4)\to(7,4): in to out: (6,4)(6,4)
  • (7,4)→(7,8)(7,4)\to(7,8): out to out: none
  • (7,8)→(4,8)(7,8)\to(4,8): out to in: (6,8)(6,8), (4,8)(4,8)
  • (4,8)→(4,4)(4,8)\to(4,4): in to in: (4,4)(4,4)

Result: (6,4),(6,8),(4,8),(4,4)(6,4),(6,8),(4,8),(4,4)

3. Bottom edge (y≥5y\ge5)

  • (6,4)→(6,8)(6,4)\to(6,8): out to in: (6,5)(6,5), (6,8)(6,8)
  • (6,8)→(4,8)(6,8)\to(4,8): in to in: (4,8)(4,8)
  • (4,8)→(4,4)(4,8)\to(4,4): in to out: (4,5)(4,5)
  • (4,4)→(6,4)(4,4)\to(6,4): out to out: none

Result: (6,5),(6,8),(4,8),(4,5)(6,5),(6,8),(4,8),(4,5)

4. Top edge (y≤7y\le7)

  • (6,5)→(6,8)(6,5)\to(6,8): in to out: (6,7)(6,7)
  • (6,8)→(4,8)(6,8)\to(4,8): out to out: none
  • (4,8)→(4,5)(4,8)\to(4,5): out to in: (4,7)(4,7), (4,5)(4,5)
  • (4,5)→(6,5)(4,5)\to(6,5): in to in: (6,5)(6,5)

Final clipped polygon: (6,7),(4,7),(4,5),(6,5)(6,7),(4,7),(4,5),(6,5), i.e. the polygon completely fills the window rectangle.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 5 marks

What are object space techniques in visible surface detection? Explain how these techniques are used in 3D graphics.

Answer

Object-space techniques (object-precision methods) determine visibility by comparing the objects or polygon parts directly in 3D (the world/eye coordinate space), before rasterization. For each object, they decide which parts are not hidden by other objects, and then only those visible parts are projected and displayed. The accuracy is that of the object description, independent of the screen resolution, and the output is a list of visible polygons or edges.

Examples

  • Back-face detection: a polygon with plane parameters (A,B,C)(A,B,C) is a back face if V⋅N>0V\cdot N>0 (equivalently C<0C<0 in the viewing system, looking down −z-z); such faces are removed. It removes about half of the faces of closed objects.
  • Depth-sorting (painter's) method: polygons are sorted by decreasing depth and painted from far to near, with overlap tests to resolve ambiguities.
  • BSP-tree method: the space is divided by polygon planes into a tree, traversed in back-to-front order for the viewpoint.
  • Area subdivision / Warnock (partly) and hidden-line algorithms such as Appel's.

Use in 3D graphics: they are used to reduce the number of polygons before rendering, for vector and wireframe output with hidden line removal and in CAD. They give exact results suited to plotters, but are costly when the number of objects is large (comparisons grow roughly as n2n^2) and complex to implement, so image-space methods like the z-buffer are used in raster systems.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 5 marks

Describe the Scan-Line method for visible surface detection. Write its advantages and limitations.

Answer

Scan-line method

An image-space method that processes the picture one scan line at a time. It extends the scan-line polygon fill to several surfaces: for each scan line, the visible surface in each span is determined, and its colour is placed in the frame buffer.

Procedure

  1. Build an edge table (edges with end coordinates, inverse slope, polygon id), a polygon table (plane coefficients, colour, in/out flag) and an active edge list sorted by xx.
  2. For each scan line, find the active edges and the flag for each polygon (on when the scan line enters the polygon, off when it leaves).
  3. In spans where only one polygon flag is on, fill with that polygon's colour.
  4. Where several flags are on (overlap), compute the depth of each polygon with its plane equation, z=(−Ax−By−D)/Cz=(-Ax-By-D)/C, at the span and display the nearest polygon's colour.
  5. If surfaces penetrate each other or cyclically overlap, the span is divided into sub-intervals at the intersection.
  6. Use coherence: the active list and depths are updated incrementally from one scan line to the next.

Advantages: needs only a one-line depth buffer so memory is small, uses scan-line and edge coherence, each pixel is processed once, and no sorting of the whole polygon set is needed.

Limitations: complex bookkeeping (tables, active lists), difficult for cutting or penetrating surfaces, no easy handling of transparency, slow for scenes with many polygons, and aliasing as with other image-space methods.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 5 marks

Explain the concept of ambient reflection in the context of illumination models. How does it affect the overall lighting in a 3D scene?

Answer

Ambient reflection models the light reflected by a surface from the general background illumination of a scene, which is light scattered many times by walls and other objects and arrives uniformly from all directions. It does not come from a particular source and does not depend on the surface orientation or the viewer's position.

Iamb=ka IaI_{amb}=k_a\,I_a

IaI_a is the intensity of the ambient light and kak_a (0≤ka≤10\le k_a\le1) is the ambient-reflection coefficient of the surface material: the fraction of ambient light the surface reflects. A higher kak_a gives a brighter, more "washed" surface.

Effect on the scene: it sets the minimum base brightness. Surfaces facing away from the point light sources, or in shadow, are not completely black and remain visible. If only ambient light is used, all objects look flat with uniform colour and no depth, since there is no variation with orientation; if it is too high, the scene looks washed out and the contrast of shading is lost. It is therefore added to the diffuse and specular terms: I=kaIa+kdIl(N⋅L)+ksIl(V⋅R)nsI=k_aI_a+k_dI_l(N\cdot L)+k_sI_l(V\cdot R)^{n_s}

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 5 marks

Describe the Gouraud Shading model. How does Gouraud shading improve the rendering of 3D objects compared to constant shading?

Answer

Gouraud shading (intensity interpolation shading) renders a polygon-mesh surface by computing intensities at vertices and interpolating them linearly across the polygon.

Steps

  1. Find the unit normal at each vertex by averaging the normals of all polygons meeting there: Nv=∑Nk∣∑Nk∣N_v=\dfrac{\sum N_k}{|\sum N_k|}.
  2. Apply the illumination model at each vertex using its normal to get its intensity.
  3. Linearly interpolate intensities along the polygon edges to the scan line: Ia=ya−y2y1−y2I1+y1−yay1−y2I2I_a=\frac{y_a-y_2}{y_1-y_2}I_1+\frac{y_1-y_a}{y_1-y_2}I_2
  4. Linearly interpolate along each scan line between left and right edge intensities to get the pixel intensity: Ip=xb−xpxb−xaIa+xp−xaxb−xaIbI_p=\frac{x_b-x_p}{x_b-x_a}I_a+\frac{x_p-x_a}{x_b-x_a}I_b

Improvement over constant (flat) shading

  • Flat shading gives the whole polygon a single intensity, so facets are visible, with discontinuities (and Mach bands) at polygon edges.
  • Gouraud shading gives smoothly varying intensity and continuity at the polygon edges (same vertex normal for adjacent polygons), so curved surfaces look smooth even with few polygons.
  • It is cheap, as the illumination model is evaluated only at the vertices and the rest is incremental addition.

Limitations: specular highlights can be missed or distorted (they inside a polygon are not found), and some Mach banding remains; Phong shading overcomes this.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 5 marks

What is virtual reality? Describe the components of a VR system.

Answer

Virtual reality (VR) is a computer-generated, three-dimensional, interactive environment that a user can explore and manipulate in real time with the feeling of being present (immersion) inside it. It uses real-time 3D graphics and sensors that track the user's movement and update the view accordingly. Applications include games, training simulators (flight, surgery), architecture, education and therapy.

Components of a VR system

  1. Input devices/trackers: head, hand and body tracking sensors, data gloves, controllers, joysticks, treadmills that give the user's position and actions.
  2. Output devices: head-mounted display (HMD) with stereoscopic lenses giving the visual sense, plus spatial audio headphones and haptic (force/touch) feedback devices.
  3. Computer/graphics engine: powerful CPU and GPU for rendering two views at a high frame rate (about 90 fps) with low latency.
  4. VR software and database: the 3D world models, physics engine, collision detection, interaction handling and rendering software (e.g. Unity, Unreal, OpenXR).
  5. User: interacts through the interface; the loop is track, compute, render, display and feedback.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

  • 2082 · 2.5+2.5 marks

Write short notes on: (a) Area subdivision method (b) OpenGL viewing

Answer

(a) Area subdivision method

An image-space visible-surface method (Warnock's algorithm) that recursively divides the view area into smaller rectangles until the visibility of each can be decided easily. For each area, the polygons are classed as surrounding, intersecting, contained or disjoint. The area is displayed directly if (1) all polygons are disjoint from it (background colour), (2) only one polygon intersects or is contained in it (fill background, then polygon), or (3) a surrounding polygon is in front of all others (fill with its colour). Otherwise the area is divided into four equal quadrants and the tests are repeated; at pixel size, the nearest polygon's colour is chosen. It uses area coherence, but recursion and testing can be costly.

(b) OpenGL viewing

OpenGL viewing is done by the model-view and projection transformations. gluLookAt(eyex,eyey,eyez, centerx,centery,centerz, upx,upy,upz) places the camera (viewing transformation) and works with the model transformations on the GL_MODELVIEW matrix. The projection is set on the GL_PROJECTION matrix by glOrtho(l,r,b,t,n,f) for parallel or gluPerspective(fovy,aspect,near,far)/glFrustum for perspective projection, defining the view volume that clips the scene. Finally, glViewport(x,y,w,h) maps the projected image onto the window area.

Answer checked by Claude Sonnet · Oct 21, 2026

Test yourself · 2 MCQs

Loading…

Questions from TU BIT 2079 Fifth Semester Web Technology II (TU IOST semester board exam, 2079 (BS), via StudyNp), TU BIT 2080 Fifth Semester Web Technology II (TU IOST semester board exam, 2080 (BS), via StudyNp), TU BIT 2081 Fifth Semester Web Technology II (TU IOST semester board exam, 2081 (BS), via StudyNp), TU BIT 2082 Fifth Semester Web Technology II (TU IOST semester board exam, 2082 (BS), via StudyNp), TU BIT 2079 Fifth Semester Software Engineering (TU IOST semester board exam, 2079 (BS), via StudyNp), TU BIT 2080 Fifth Semester Software Engineering (TU IOST semester board exam, 2080 (BS), via StudyNp), TU BIT 2081 Fifth Semester Software Engineering (TU IOST semester board exam, 2081 (BS), via StudyNp), TU BIT 2082 Fifth Semester Software Engineering (TU IOST semester board exam, 2082 (BS), via StudyNp), TU BIT 2079 Fifth Semester Information Security (TU IOST semester board exam, 2079 (BS), via StudyNp), TU BIT 2080 Fifth Semester Information Security (TU IOST semester board exam, 2080 (BS), via StudyNp), TU BIT 2081 Fifth Semester Information Security (TU IOST semester board exam, 2081 (BS), via StudyNp), TU BIT 2082 Fifth Semester Information Security (TU IOST semester board exam, 2082 (BS), via StudyNp), TU BIT 2079 Fifth Semester Computer Graphics (TU IOST semester board exam, 2079 (BS), via StudyNp), TU BIT 2080 Fifth Semester Computer Graphics (TU IOST semester board exam, 2080 (BS), via StudyNp), TU BIT 2081 Fifth Semester Computer Graphics (TU IOST semester board exam, 2081 (BS), via StudyNp), TU BIT 2082 Fifth Semester Computer Graphics (TU IOST semester board exam, 2082 (BS), via StudyNp), TU BIT 2079 Fifth Semester Technical Writing (TU IOST semester board exam, 2079 (BS), via StudyNp) and TU BIT 2082 Fifth Semester Technical Writing (TU IOST semester board exam, 2082 (BS), via StudyNp). Answers are written for this site; check them against your class notes.