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 , below , right of , left of . A point inside the window has code 0000.
Algorithm
- Compute outcodes for both endpoints and .
- If both codes are 0000, the line is completely inside: accept it.
- If the bitwise AND of the two codes is not 0000, both endpoints lie on the outside of the same edge: reject the line.
- 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: or ,
- top/bottom: or , where .
- 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 () using 4-bit region codes.
Region code (bit = 1 if true): bit 1 = above (), bit 2 = below (), bit 3 = right (), bit 4 = left (). The window itself is 0000.
Algorithm
- Compute the codes of both end points.
- If both are 0000: trivially accept (line inside).
- If the bitwise AND of the codes is non-zero: trivially reject (both on the outside of the same edge).
- 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 : left/right edge ; top/bottom edge .
Example: Window , . Line to . Code of = 0001 (left); = 1000 (above). AND = 0000, so not rejected; . Clip at : , so , code 0000. Clip at : , giving . 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: where is the ambient reflection coefficient and 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 between the surface normal and the light direction (Lambert's cosine law) but not on the viewer: 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: where is the reflection vector, the viewing direction and the shininess (large for metals, small for rough surfaces). Example: the bright spot on a polished apple or metal ball.
Total intensity: .
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. () 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 between the unit surface normal and the unit direction to the light , according to Lambert's cosine law: It is independent of the viewing position: the surface looks equally bright from any direction and is brightest when the light is perpendicular (). 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 and .
Answer
Differences between DDA and Bresenham's algorithm
| DDA | Bresenham's |
|---|---|
| Uses floating-point increments ( or ) | Uses only integer arithmetic (additions, subtractions) |
| Rounding is needed for every point | No rounding; a decision parameter chooses the nearer pixel |
| Slower | Faster and more efficient |
| Accumulated rounding error can cause drift on long lines | More accurate, with no cumulative error |
| Simple to implement | Slightly more complex |
Bresenham's algorithm for to
, (in magnitude). Since the slope is steep, so is the driving axis. stays the same or increases by 1 and decreases by 1 at each step.
Initial decision parameter:
Rule: if , does not change and ; otherwise increases by 1 and .
| k | Plotted pixel | |
|---|---|---|
| 0 | -1 | (10, 6) |
| 1 | 3 | (10, 5) |
| 2 | -3 | (11, 4) |
| 3 | 1 | (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 and center as .
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 to is calculated. At each step increases by 1 and we decide whether stays or decreases by 1. The decision uses the circle function , evaluated at the midpoint between the two candidate pixels:
If , the midpoint is inside the circle, so the pixel is chosen; otherwise is chosen. The parameter is updated incrementally:
- :
- :
with the initial value (starting at ).
Circle with , centre
, start at .
| k | next | |
|---|---|---|
| 0 | -4 | (1, 5) |
| 1 | -1 | (2, 5) |
| 2 | 4 | (3, 4) |
At , the next point has so we stop. Octant points: (0,5), (1,5), (2,5), (3,4).
Shifting by the centre and using 8-way symmetry and :
- 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 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 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 be the unit surface normal, the direction to the light, the direction of reflected light and the direction to the viewer. Then
The specular intensity is
where is the specular reflection coefficient, the light intensity, the angle between and , and the specular exponent (shininess).
- A large (100 or more) gives a small sharp highlight for shiny surfaces such as metal; a small gives a broad highlight for dull surfaces.
- The intensity is maximum when and falls off as increases. It is zero when .
- 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 and (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 and about the origin:
If the object enlarges, if it shrinks, and 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:
- y-shear:
(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
- For each scan line, find the intersections of the line with the projections of all polygon edges.
- Sort the intersection points on the line by and divide the line into spans.
- For each span, find which polygons overlap it (using flags in/out and the polygon table).
- Calculate the depth of each overlapping polygon from its plane equation :
- 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.
- Depth is recalculated only where polygons intersect or overlap; it is updated incrementally across the span by .
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 , 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
| Basis | Gouraud shading | Phong shading |
|---|---|---|
| Interpolates | Intensity (colour) values | Surface normal vectors |
| Method | Compute intensity at vertices using vertex normals, then interpolate linearly across edges and scan lines | Interpolate normals across the polygon, then compute the illumination at every pixel |
| Computation | Faster, less expensive | Slower, more expensive |
| Specular highlight | Often missed or distorted, particularly if the highlight is inside a polygon | Highlights shown accurately |
| Quality | Good but with Mach bands in some cases | Smoother and more realistic |
| Use | Where speed matters | Where 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 . It is shaped by the control polygon and is widely used in graphics, CAD and font design. The curve is
where the Bernstein blending functions are
For (cubic) there are four control points, and .
Properties
- It passes through the first and last control points: , .
- 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 to vertex of the polygon, four cases are handled:
- Both and inside: output .
- inside, outside: output the intersection point.
- Both outside: output nothing.
- outside, inside: output the intersection point and .
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.
- Vertex normals: at each vertex, average the unit normals of the polygons sharing it:
- Vertex intensities: apply the illumination model (ambient + diffuse + specular) at each vertex using .
- Interpolate along edges: for a scan line between vertices 1 and 2 of an edge, and similarly on the other edge, giving the end intensities and of the scan-line span at and .
- Interpolate along the scan line: Incrementally, with .
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 and using Bresenham's line drawing algorithm.
Answer
Bresenham's line algorithm (for slope , )
- Input the endpoints and ; compute , .
- Plot the first point .
- Compute the decision parameter .
- For each along the line:
- if , the next point is and ;
- otherwise the next point is and .
- Repeat step 4 until ( times).
For other slopes the roles of and are swapped, and decreases when the line goes downward.
Line to
, (slope , so decreases by 1 with every step of ).
.
Since at every step, decreases by 1 each time, and .
| k | Pixel | |
|---|---|---|
| 0 | 4 | (6, 9) |
| 1 | 4 | (7, 8) |
| 2 | 4 | (8, 7) |
| 3 | 4 | (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 , and counterclockwise about the pivot point .
Answer
Parallel versus perspective projection
| Parallel projection | Perspective projection |
|---|---|
| Projectors are parallel; centre of projection is at infinity | Projectors meet at a centre of projection (eye point) |
| Object size does not depend on distance from the viewer | Distant objects look smaller (perspective foreshortening) |
| Parallel lines remain parallel | Parallel lines converge to a vanishing point |
| Preserves relative dimensions and shapes, so useful for measurement | Not realistic dimensions, but realistic appearance |
| Used in engineering and architectural drawings | Used in games, animation, and realistic views |
| Types: orthographic, axonometric, oblique | Types: one-, two-, three-point |
Rotation by counterclockwise about the pivot
Rotation about a pivot :
with , .
- A(5, 7): . ; . So .
- B(12, 85): . ; . So .
- C(5, 3): this is the pivot, so it does not move: .
The new triangle is , , .
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
- Markers (reflective balls or sensors) are placed on key joints of an actor (head, shoulders, elbows, wrists, hips, knees, ankles).
- Several cameras (optical systems) or inertial/magnetic sensors track the 3D position of each marker many times per second.
- The software triangulates marker positions into 3D coordinates for every frame.
- These positions are mapped onto the skeleton (rig) of a digital character, which drives the mesh through skinning.
- 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 (or ) instead of one variable in terms of another:
Thus . It can represent multi-valued curves, closed curves and curves with vertical tangents, which cannot. A circle is . Common graphics forms are Bezier, B-spline and Hermite curves.
Bezier curve
A Bezier curve of degree is defined by control points :
Properties
- It passes through the first and last control points: , .
- The tangent at the start is along and at the end along .
- The curve lies inside the convex hull of its control points (convex hull property).
- The blending functions are non-negative and sum to 1: .
- The curve has degree , i.e. one less than the number of control points, and is smooth (infinitely differentiable).
- It is invariant under affine transformations: transforming the control points transforms the curve.
- 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 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 may be stored as .
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 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 it covers, compute ; if 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 , giving . 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: ...; ; . The tables allow quick consistency checks (every edge belongs to two polygons) and each polygon's plane equation 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
- Display file memory: stores the picture definition as display commands (line, point, character with coordinates) produced by the graphics package.
- Display controller (processor): repeatedly reads the commands and sends them to the vector generator.
- Vector generator: converts coordinates into analog deflection voltages (via DACs) to move the beam.
- 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 and about a line . Draw initial and final result graph as well.
Answer
Reflection about the vertical line : translate the line to the y-axis, reflect about the y-axis, translate back.
The result simplifies to .
Matrix form (homogeneous):
- : , so .
- : , so .
Result: the reflected segment has end points and .
Graph (description): Draw the vertical mirror line . The original segment from to lies to the right of it, sloping up and to the right. The image segment from to lies to the left, sloping up and to the left. Each point and its image are at equal distance from (2 units for , 5 units for ), 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
- Initialise
depth(x,y) = 1.0(far plane) (or ) andframe(x,y) =background colour for all pixels. - For every polygon in the scene, for every pixel in its projection:
- Calculate the depth from the plane equation , i.e. .
- If
depth(x,y)(nearer): setdepth(x,y) = zandframe(x,y) =surface colour at .
- After all polygons are processed, the frame buffer holds the visible surfaces.
Along a scan line the depth is obtained incrementally: , and for the next scan line (or 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
- 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.
- 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.
- Aliasing: discrete pixel decisions give jagged edges. Remedy: A-buffer/supersampling for anti-aliasing.
- 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.
- 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 and 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 to
. Steps . .
| k | x | y (exact) | Plotted |
|---|---|---|---|
| 0 | 20 | 10.0 | (20, 10) |
| 1 | 21 | 10.8 | (21, 11) |
| 2 | 22 | 11.6 | (22, 12) |
| 3 | 23 | 12.4 | (23, 12) |
| 4 | 24 | 13.2 | (24, 13) |
| 5 | 25 | 14.0 | (25, 14) |
| 6 | 26 | 14.8 | (26, 15) |
| 7 | 27 | 15.6 | (27, 16) |
| 8 | 28 | 16.4 | (28, 16) |
| 9 | 29 | 17.2 | (29, 17) |
| 10 | 30 | 18.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 , , about the rotation axis .
Answer
Clockwise rotation matrices (angle , homogeneous 3D, right-handed system, clockwise when looking from the positive axis towards the origin):
Rotation about the axis
The axis (with ) is a line parallel to the x-axis. The angle is not given, so take clockwise. Steps: translate the axis to the x-axis, rotate about x, translate back:
With , a point becomes ; then , ; finally .
- : , so , giving .
- : , so , giving .
- : , so , giving .
New object: . 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
- Find vertex normals: for each vertex, average the normals of the polygons sharing it:
- Interpolate normals along polygon edges: for an edge between vertices 1 and 2, the normal at scan-line intersection is (incrementally, ).
- Interpolate along each scan line between the left and right edge normals to get the normal at every pixel, then normalise it.
- Apply the illumination model at each pixel with the interpolated normal:
- 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 , , coordinates are cubic polynomials in the parameter ():
and similarly for and . In vector form with , the basis matrix and 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
- 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.
- It gives smooth curves; two segments joined with matching tangents have (or ) continuity at the joint (parametric continuity , or geometric ).
- It is independent of the coordinate system and can represent multi-valued curves and vertical tangents.
- It can be easily transformed, as only the control geometry needs transforming.
- Types: Hermite (end points and tangents), Bezier (control points), B-spline and Catmull-Rom splines.
- 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 and radius .
Answer
Use the midpoint circle algorithm with centre and . Start at with decision parameter .
Rule: if , next point and ; else next point and . Stop when .
| k | p_k | (x_{k+1}, y_{k+1}) |
|---|---|---|
| 0 | -5 | (1, 6) |
| 1 | -2 | (2, 6) |
| 2 | 3 | (3, 5) |
| 3 | 0 | (4, 4) |
Starting point ; the points in the first octant are .
Using 8-way symmetry, each gives and :
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
- Vertex table: .
- Edge table: each edge with its two end vertices, e.g. .
- Surface-facet (polygon) table: each polygon with the edges forming it, e.g. , plus attributes.
Example (triangle mesh): ; share edge .
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 is stored (computed from three vertices); the normal is used in visibility tests (back-face: ) 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 scan | Random 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 , the physical rule is inverse-square: . Since this gives too sharp variation for nearby sources, graphics uses an attenuation factor with constants . The diffuse and specular terms are multiplied by so that farther surfaces appear darker, which gives depth realism.
Types of projection
Projection maps 3D coordinates to a 2D plane.
- 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).
- 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)andglutMotionFunc(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 , with the normal giving the orientation.
Attribute information: how it appears, such as colour, transparency, reflectivity, texture and shading parameters.
Storage in three tables
- Vertex table:
- Edge table:
- Surface table (with attributes): (red); (green); (blue); (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 to .
Answer
Bresenham's circle drawing algorithm
For a circle of radius centred at the origin, compute only one octant (from until ) and use 8-way symmetry. The decision parameter chooses between the pixel and using integer arithmetic only.
- Input ; set and decision parameter .
- Plot the 8 symmetric points (added to the centre ).
- While (using the current, old and ):
- if : (y unchanged)
- else: and
- plot the 8 symmetric points.
- Stop when .
The method uses only additions, subtractions and shifts, so it is fast.
DDA from to
; steps ; .
| k | x | y | Plotted |
|---|---|---|---|
| 0 | 2 | 2 | (2, 2) |
| 1 | 3 | 3 | (3, 3) |
| 2 | 4 | 4 | (4, 4) |
| 3 | 5 | 5 | (5, 5) |
| 4 | 6 | 6 | (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 , , and axes. Apply the scaling transformation to a point with , , .
Answer
Scaling is a transformation that changes the size of an object by multiplying its coordinates with scaling factors. In 3D, with factors 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 maps to :
Writing this as a matrix in homogeneous coordinates (so that all transformations can be combined by multiplication):
(For scaling about a fixed point : translate by , scale, translate back.)
Numerical: with :
So .
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 that form the control polygon. The curve starts at and ends at , 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: The blending functions are Bernstein polynomials, taken from the binomial expansion of : Because the terms of the binomial expansion add up to 1, , so the curve stays in the convex hull.
For the cubic (), the usual case: or in matrix form
Check: , ; and .
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 continuity ensured by making of one segment the first point of the next and collinear tangent points . Using a 3D point for each 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 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
- Model detail (polygon count, smoothness of the mesh).
- Resolution and anti-aliasing (to remove jagged edges).
- Illumination model (ambient, diffuse, specular) and shading method (flat, Gouraud, Phong); global illumination (ray tracing, radiosity) is more realistic.
- Textures, bump/normal maps and material properties.
- Shadows, reflections, refraction and transparency.
- Depth-buffer precision and visibility algorithm.
- 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 is shifted by translation distances (horizontal) and (vertical):
In matrix form, with ; in homogeneous coordinates
The inverse is translation by , and successive translations add: .
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 , , with becomes , , .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
Given a polygon with vertices , , , , clip it against a rectangular window with coordinates , using the Sutherland-Hodgman polygon clipping algorithm.
Answer
Window: . Polygon: .
Sutherland-Hodgman clips the polygon against each window edge in turn; for each edge : 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 ()
- : out to in: intersection , then
- : in to in:
- : in to out: intersection
- : out to out: none
Result:
2. Right edge ()
- : in to out:
- : out to out: none
- : out to in: ,
- : in to in:
Result:
3. Bottom edge ()
- : out to in: ,
- : in to in:
- : in to out:
- : out to out: none
Result:
4. Top edge ()
- : in to out:
- : out to out: none
- : out to in: ,
- : in to in:
Final clipped polygon: , 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 is a back face if (equivalently in the viewing system, looking down ); 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 ) 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
- 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 .
- 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).
- In spans where only one polygon flag is on, fill with that polygon's colour.
- Where several flags are on (overlap), compute the depth of each polygon with its plane equation, , at the span and display the nearest polygon's colour.
- If surfaces penetrate each other or cyclically overlap, the span is divided into sub-intervals at the intersection.
- 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.
is the intensity of the ambient light and () is the ambient-reflection coefficient of the surface material: the fraction of ambient light the surface reflects. A higher 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:
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
- Find the unit normal at each vertex by averaging the normals of all polygons meeting there: .
- Apply the illumination model at each vertex using its normal to get its intensity.
- Linearly interpolate intensities along the polygon edges to the scan line:
- Linearly interpolate along each scan line between left and right edge intensities to get the pixel intensity:
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
- Input devices/trackers: head, hand and body tracking sensors, data gloves, controllers, joysticks, treadmills that give the user's position and actions.
- Output devices: head-mounted display (HMD) with stereoscopic lenses giving the visual sense, plus spatial audio headphones and haptic (force/touch) feedback devices.
- Computer/graphics engine: powerful CPU and GPU for rendering two views at a high frame rate (about 90 fps) with low latency.
- VR software and database: the 3D world models, physics engine, collision detection, interaction handling and rendering software (e.g. Unity, Unreal, OpenXR).
- 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.