Chapter 2
Computer Graphics and Animation
TU BCA past exam questions
Past questions and answers
60 questions set from this chapter. Most repeated first.
- 2020 · 5 marks
What is computer graphics? Explain different application areas of computer graphics.
Answer
Computer graphics: Computer graphics is the field of computer science concerned with creating, storing, manipulating and displaying pictures and images using a computer. A picture is built from basic primitives (points, lines, polygons, curves) and shown on an output device such as a monitor or printer. It may be interactive (the user controls the image in real time) or passive, and 2D or 3D.
Application areas:
- Computer-Aided Design (CAD): design of buildings, machines, cars, aircraft, circuits and VLSI chips, with drawings that can be viewed from any angle.
- Entertainment and animation: cartoons, films, special effects and video games.
- Education and training: simulators for pilots, drivers and ship captains; virtual laboratories.
- Presentation graphics: bar charts, pie charts, line graphs and slides for business and statistics.
- Medical imaging and visualisation: CT, MRI and ultrasound images, 3D organ models, surgical planning.
- Scientific visualisation: weather maps, molecular structures, simulations of fluid flow.
- Graphical user interfaces (GUI): windows, icons, menus used by operating systems and software.
- Virtual reality: immersive 3D environments for games, design and training.
- Cartography and GIS: digital maps, terrain models, satellite image processing.
- Image processing: enhancement, restoration and analysis of photographs.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2020 · 5 marks
How can you draw a circle using mid-point circle algorithm? Explain with the algorithm.
Answer
Mid-point circle algorithm: It draws a circle of radius centred at the origin by using the symmetry of the circle and an integer decision parameter. Only one octant (from to ) is computed, starting at ; the other seven octants come from symmetry: and . Shifting the centre to is done by adding and to every point.
Idea: The circle function is which is inside the circle, on it and outside. Having plotted , the next pixel is either or . The decision parameter is the function value at their midpoint:
- If , the midpoint is inside the circle, so the pixel is closer; then .
- If , choose ; then .
The initial value at is
Algorithm:
- Input radius and centre ; set , .
- Compute .
- Plot the point and its seven symmetric points.
- While :
- if :
- else: ,
- plot the eight symmetric points (shifted by the centre).
- Stop when .
It uses only integer addition and subtraction, so it is fast.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2020 · 5 marks
Explain 3D basic geometric transformation with an example.
Answer
In 3D, a point is written in homogeneous coordinates as and each transformation is a matrix, so that transformations can be combined by matrix multiplication: .
1. Translation by : i.e. .
2. Scaling by about the origin:
3. Rotation by angle :
- About the z-axis:
- About the x-axis:
- About the y-axis:
(Other basic transformations are reflection and shearing.)
Example: Let .
- Translation by gives .
- Scaling by gives .
- Rotation by about the z-axis: , , , so .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2020 · 5 marks
What is polygon clipping? Explain Sutherland Hodgman algorithm for polygon clipping.
Answer
Polygon clipping: Clipping is the process of removing the parts of a picture that lie outside a clipping window/region. Polygon clipping clips a polygon against the window so that the result is again a polygon (or polygons) that can be filled, with new edges added along the window boundary where required. Applying a line clipping algorithm to each edge separately does not give a closed polygon, so special algorithms are used.
Sutherland-Hodgman algorithm: The polygon is clipped against one window boundary at a time (left, right, bottom, top). The output vertex list of one stage becomes the input of the next stage. The polygon is processed edge by edge, taking each pair of consecutive vertices (from vertex to vertex ), and four cases arise with respect to the current clip boundary:
| Case | Edge | Vertices output |
|---|---|---|
| 1 | Both inside | |
| 2 | inside, outside | Intersection point only |
| 3 | Both outside | None |
| 4 | outside, inside | Intersection and |
Steps:
- Take the vertex list of the polygon.
- For each clip boundary in turn:
- Start with = last vertex of the list.
- For each vertex in the list, apply the four cases above (computing the intersection of segment with the boundary where needed), then set .
- The collected output vertices form the new list.
- After the four boundaries, the final list is the clipped polygon.
For a vertical boundary , the intersection of is with slope .
Limitation: For concave polygons it may produce extra connecting edges along the window boundary, which is removed by post-processing or by the Weiler-Atherton algorithm.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2020 · 5 marks
Given a triangle with vertices A(2,3), B(5,5), C(4,3) by rotating 90 degree about the origin and then translating two unit in each direction. Use homogenous transformation matrix to find the new vertices of the triangle.
Answer
Triangle: . The transformation is a rotation by (anticlockwise) about the origin followed by translation by .
Rotation matrix (, , ):
Composite matrix (rotation first, then translation, so ):
Apply to the vertices (as columns of homogeneous coordinates):
Check: : , . : , . : , .
New vertices: , , .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2020 · 5 marks
Explain the scan line algorithm for visible surface detection.
Answer
Scan-line algorithm: It is an image-space method for visible surface detection that works scan line by scan line, from top to bottom of the screen. For each scan line it finds which polygon surface is nearest to the viewer at each pixel and writes that surface's colour into the frame buffer. It is an extension of the scan-line polygon filling algorithm to several surfaces.
Data structures:
- Edge table: the edges of all polygons with end coordinates, slope and the polygons they belong to.
- Polygon table: for each polygon, its plane coefficients, colour and an in/out flag.
- Active edge list: edges that cross the current scan line, sorted by .
Procedure:
- For each scan line, update the active edge list with edges intersecting that line.
- Go along the line from left to right. Each time an edge is crossed, the flag of its polygon is switched on (entering) or off (leaving).
- Pixels (spans) between edges where only one polygon flag is on take the colour of that polygon.
- Where the flags of two or more polygons are on (overlap), the depth of each plane at the span is calculated from the plane equation , i.e. . The polygon with the smallest depth (closest to viewer) is visible and its colour is used.
- Where no flag is on, the background colour is used.
- Move to the next scan line, using coherence (edge values and depths change by constant amounts from one line to the next) to update values quickly.
If polygons do not intersect in depth, depth calculation is needed only when a new edge is crossed. Intersecting surfaces may need to be split.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2020 · 5 marks
Explain the architecture of VR system with necessary components.
Answer
Virtual Reality (VR) system: A VR system creates a computer-generated 3D environment that the user can enter and interact with in real time, using devices that track the user and give sensory feedback so that the user feels present in the virtual world.
Architecture and components:
- Input devices: let the user and the system interact with the virtual world.
- Position/motion trackers (magnetic, optical, inertial) that follow the head, hands and body.
- Data gloves, 3D mice, joysticks, wands, treadmills, voice input.
- Output devices: give sensory feedback.
- Visual: head-mounted display (HMD), CAVE projection rooms, stereoscopic glasses.
- Audio: 3D spatial sound through headphones or speakers.
- Haptic: force and touch feedback gloves and suits.
- VR engine / computer system: a powerful computer with a fast CPU and GPU that processes input, runs the simulation and renders images at a high frame rate (at least 30-60 frames per second) to avoid lag and motion sickness.
- Software and databases:
- A virtual world database holding 3D models, textures, sounds and physical properties of objects.
- Modelling tools (CAD/3D modelling) to build the objects.
- Real-time rendering, collision detection and physics simulation routines.
- VR toolkits/APIs (e.g. OpenGL, Unity) to integrate everything.
- Application: the specific content such as a flight simulator, game, training or medical system.
Working loop: Trackers send the user's position and orientation to the VR engine, which updates the virtual world and renders the new view, then sends it to the display, audio and haptic devices. This loop repeats continuously with minimal delay.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2020 · 10 marks
Explain the working details of DDA line drawing algorithm? Digitize the line with endpoints (2,2) and (10,5) using Bresenham's line drawing algorithm.
Answer
DDA (Digital Differential Analyzer) line algorithm: DDA draws a line between and by sampling at unit intervals along the axis in which the line changes most, and computing the other coordinate from the slope.
Working:
- Compute and .
- Number of steps: .
- Increments: , (one of them is 1 or ).
- Start at . Repeat times: , and plot .
It is simple and faster than using the line equation directly, but it uses floating-point addition and rounding, so error accumulates on long lines.
Bresenham's algorithm for (2,2) to (10,5):
, slope , so is incremented each step.
Initial decision parameter: .
- If : next point and .
- If : next point and .
| k | Next point | |
|---|---|---|
| 0 | -2 | (3, 2) |
| 1 | 4 | (4, 3) |
| 2 | -6 | (5, 3) |
| 3 | 0 | (6, 4) |
| 4 | -10 | (7, 4) |
| 5 | -4 | (8, 4) |
| 6 | 2 | (9, 5) |
| 7 | -8 | (10, 5) |
Pixels plotted: (2,2), (3,2), (4,3), (5,3), (6,4), (7,4), (8,4), (9,5), (10,5).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2020 · 10 marks
Write the difference between object space method and image space method. Explain Z buffer algorithm for visible surface detection.
Answer
Object-space vs image-space methods of visible surface detection:
| Basis | Object-space method | Image-space method |
|---|---|---|
| Working | Compares objects/parts of objects with each other in the 3D scene to decide which are visible | Decides visibility pixel by pixel on the projected image |
| Calculations | Done in the object (world) coordinate system | Done in the screen (device) coordinate system |
| Precision | Accurate to the precision of the object data; output independent of resolution | Limited by the resolution of the screen |
| Cost | Grows with the number of objects, roughly comparisons | Grows with number of pixels times number of objects |
| Examples | Back-face detection, depth sorting (painter's), BSP tree | Z-buffer, scan-line, A-buffer, ray casting |
Z-buffer (depth-buffer) algorithm: An image-space method that uses two buffers of the same size as the screen: a frame buffer holding the colour of each pixel, and a depth buffer holding the depth () of the surface currently visible at each pixel. Surfaces can be processed in any order.
Algorithm:
- Initialise the depth buffer to the maximum depth (far plane, e.g. 1.0 or ) and the frame buffer to the background colour:
- depth max depth, frame background, for all pixels.
- For each polygon, for each pixel it covers, compute its depth from the plane equation:
- If depth (closer to viewer): set depth and frame the polygon's colour at .
- Otherwise leave the pixel unchanged.
- After all polygons are processed, the frame buffer holds the visible image.
Depth along a scan line is computed incrementally: moving from to gives , and to the next scan line (using the edge change).
Merits: simple, easy to implement in hardware, handles any surface that can give a depth, no sorting needed. Demerits: needs extra memory for the depth buffer, cannot easily handle transparency, and has aliasing and depth precision problems.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2020 · 10 marks
Derive the formula for windows to viewport transformation. Given a window bordered by (0,0) at the lower left and (4,4) at the upper right. Similarly, a viewport bordered by (0,0) at the lower left and (2,2) at the upper right. If a window at position (2,4) is mapped into the viewport. What will be the position of viewport to maintain same relative placement as in window.
Answer
Window-to-viewport transformation: A window is the region of the world coordinate system selected for display and a viewport is the region of the screen where it is displayed. The mapping keeps the relative position of every point the same.
Derivation: Let the window be to and the viewport to . A window point maps to with the same relative position: Solving, where the scale factors are This is equivalent to: translate the window to the origin, scale by , and translate to the viewport position.
Numerical: Window: to ; viewport: to . For the point :
The point is mapped to (1, 2) in the viewport. It lies halfway along and on the top edge in both the window and the viewport, so the relative placement is preserved.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2021 · 5 marks
What do you mean by area filling? Explain boundary fill algorithm.
Answer
Area filling: Area filling is the process of colouring all the pixels inside a closed region (polygon or any bounded area) with a specified colour or pattern. Two approaches are used: the scan-line method (for regions defined by their edges) and the seed fill methods (boundary fill and flood fill) for regions defined by their pixel colours.
Boundary fill algorithm: Starting from an interior point (the seed), it paints neighbouring pixels until a boundary of a given colour is met. It works for regions whose boundary is a single colour.
Algorithm (4-connected):
boundaryFill(x, y, fillColor, boundaryColor):
current = getPixel(x, y)
if current != boundaryColor and current != fillColor:
setPixel(x, y, fillColor)
boundaryFill(x + 1, y, fillColor, boundaryColor)
boundaryFill(x - 1, y, fillColor, boundaryColor)
boundaryFill(x, y + 1, fillColor, boundaryColor)
boundaryFill(x, y - 1, fillColor, boundaryColor)
Steps:
- Choose a seed pixel inside the region.
- If the pixel colour is neither the boundary colour nor the fill colour, set it to the fill colour.
- Recursively repeat for its neighbours.
- Stop when all neighbours are boundary or already filled.
4-connected vs 8-connected: The 4-connected version visits left, right, up and down neighbours; the 8-connected version also visits the four diagonals, and so can fill regions with diagonal-only connections and avoid leaving gaps, but it may leak through diagonal boundary gaps.
Drawback: The recursion uses a lot of stack and is slow for large areas, so a stack-based or scan-line variant is used in practice.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2021 · 5 marks
Define scaling transformation? Prove that two successive scaling are multiplicative.
Answer
Scaling transformation: Scaling changes the size of an object. A point is multiplied by scale factors and about the origin: In homogeneous form: If the object is enlarged, and if it is reduced.
Proof that successive scalings are multiplicative: Apply and then to a point : The composite matrix is which equals .
Hence two successive scalings are equivalent to one scaling whose factors are the products of the individual factors. Since multiplication of numbers is commutative, the order does not matter either.
Example: Scaling by then by equals a single scaling by .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2021 · 5 marks
What is symmetric property of circle? Digitize a circle whose center is at origin and radius is 9.
Answer
Symmetry property of a circle: A circle centred at the origin is symmetric about both axes and both diagonals . So if lies on the circle, then so do the seven points Therefore only one octant (the arc from to ) needs to be computed, and the rest is obtained by reflection. This is called eight-way symmetry.
Digitising the circle with centre and (mid-point algorithm):
Start at , initial parameter .
- If : next point , .
- If : next point , .
| k | Next point | ||
|---|---|---|---|
| 0 | -8 | (1, 9) | -8 + 3 = -5 |
| 1 | -5 | (2, 9) | -5 + 5 = 0 |
| 2 | 0 | (3, 8) | 0 + 7 - 16 = -9 |
| 3 | -9 | (4, 8) | -9 + 9 = 0 |
| 4 | 0 | (5, 7) | 0 + 11 - 14 = -3 |
| 5 | -3 | (6, 7) | -3 + 13 = 10 |
The next point would be with , so we stop.
Points of the first octant: (0,9), (1,9), (2,9), (3,8), (4,8), (5,7), (6,7).
Other octants by symmetry (swap coordinates and change signs):
- Swapped: (9,0), (9,1), (9,2), (8,3), (8,4), (7,5), (7,6)
- Every point is also plotted with signs , e.g. (-1,9), (1,-9), (-9,-1) etc.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2021 · 5 marks
Define window and view port. Explain 2D viewing transformation pipeline.
Answer
Window: A window is the rectangular area in the world coordinate system that selects what part of the scene is to be displayed.
Viewport: A viewport is the rectangular area on the display device (screen coordinates) that specifies where the selected part is displayed.
2D viewing transformation pipeline: The pipeline is the sequence of steps that maps a scene described in world coordinates to device coordinates:
- Modelling coordinates to world coordinates: each object, defined in its own local (modelling) coordinates, is placed in the common world coordinate system by modelling transformations (translation, rotation, scaling).
- World coordinates to viewing coordinates: a window is defined (it may be rotated or placed at any position), and the world is transformed so that the window lies in a viewing coordinate system aligned with the axes: translate the window origin to the origin and rotate it.
- Viewing coordinates to normalised viewing coordinates: the window is mapped to a normalised square (0 to 1 or -1 to 1) so the process is independent of any device. Clipping against the window is usually done here.
- Normalised coordinates to device coordinates: the normalised picture is mapped to the viewport on the screen (the window-to-viewport transformation): and similarly for .
Summary: Modelling coordinates world coordinates viewing coordinates normalised coordinates (clipping) device coordinates.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2021 · 5 marks
Reflect a prism A(0,0,0), B(1,1,0), C(1,2,2) and (0,2,0) about yz-plane which has been rotated previously with +90 degree about y-axis.
Answer
The prism has vertices , , , . It is first rotated by about the y-axis and then reflected about the yz-plane.
Rotation about the y-axis by (, ):
Reflection about the yz-plane (the coordinate changes sign):
Composite matrix: so .
Applying to each vertex:
- : rotation gives , reflection gives .
- : rotation gives , reflection gives .
- : rotation gives , reflection gives .
- : rotation gives , reflection gives .
New vertices: , , , .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2021 · 5 marks
What do you mean by visible surface detection? Explain Z. buffer algorithm for visible surface detection.
Answer
Visible surface detection: When a 3D scene is projected onto a 2D screen, some surfaces are hidden behind others. Visible surface detection (hidden surface removal) is the process of identifying which parts of the surfaces are visible from a given viewing position so that only they are displayed, giving a realistic picture. The methods are of two kinds: object-space methods (back-face detection, depth sorting) and image-space methods (Z-buffer, scan-line).
Z-buffer (depth-buffer) algorithm: An image-space method that uses a frame buffer (colour of each pixel) and a depth buffer (depth of the nearest surface found so far at each pixel). Polygons can be processed in any order.
Algorithm:
- Initialise: for all pixels , depth maximum depth (far plane) and frame background colour.
- For each polygon in the scene, for each pixel covered by its projection:
- Calculate the depth using the plane equation :
- If depth: set depth and frame surface colour at .
- After all polygons are processed, the frame buffer contains the visible image.
Along a scan line the depth is found incrementally: .
Advantages: simple, no sorting, works for any surface that gives depth, easily done in hardware. Disadvantages: extra memory for the depth buffer, no direct support for transparency, and precision limits.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2021 · 5 marks
What is animation? Explain the steps to create animation sequence.
Answer
Animation is the process of generating a series of still images (frames) and displaying them quickly, usually 24-30 frames per second or more, so that the viewer perceives motion or change over time. In computer graphics, the frames are produced by changing object positions, shapes, colours, lighting or camera view from one frame to the next.
Steps to create an animation sequence
- Storyboard layout: an outline of the action is prepared as a set of sketches showing the main events, the timing and the order of scenes.
- Object definitions: each object taking part is defined, with its shape, size, colour, texture and the allowed motions (for example as polygon meshes or splines).
- Key-frame specification: a key frame is a detailed drawing of the scene at a chosen instant. Key frames are placed at points where the motion changes significantly.
- Generation of in-betweens: the frames between two key frames are produced by interpolating positions, sizes and colours (linear or spline interpolation). The number of in-betweens depends on the frame rate and on the speed of the action; for example, a 2-second shot at 24 fps needs 48 frames.
- Rendering and output: the frames are rendered (with lighting, shading and hidden-surface removal), then played back in sequence, or stored as a video, and checked and refined if the motion is not smooth.
Other tasks such as sound synchronisation and any needed motion-path or morphing specifications are done along these steps.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2021 · 10 marks
Define refresh rate and persistence of monitor. Explain architecture of random scan display system with block diagram.
Answer
Refresh rate: a CRT screen must be redrawn repeatedly because the phosphor glow fades. The number of times per second the picture is redrawn is the refresh rate (for example 60 Hz means 60 redraws per second). A rate below about 50-60 Hz causes visible flicker.
Persistence: the time a phosphor continues to emit light after the electron beam has been removed, usually measured as the time for the emitted light to fall to 10% of its original intensity. Low-persistence phosphors need a higher refresh rate, whereas high-persistence phosphors suit static displays.
Architecture of a random scan (vector) display system
In a random scan system the electron beam is directed only to those parts of the screen where the picture is to be drawn, one line at a time, in any order. Because it draws line segments, it is also called a vector or calligraphic display.
Block diagram (components in order):
Application program --> Graphics package --> Display file (refresh buffer)
|
v
CPU <--> System memory Display processor (display controller)
|
v
Vector generator / DAC --> Deflection amplifiers --> CRT
- Application program and graphics package: the application describes the picture, and the graphics package converts the picture description into line-drawing commands.
- Display file (refresh display file): stores the line-drawing commands (endpoints, colour, intensity) for the whole picture, in system memory.
- Display processor (display controller): cycles through the display file once in every refresh cycle, reads each command and sends it to the vector generator.
- Vector generator: converts the digital coordinates to analog voltages that control the horizontal and vertical deflection of the beam, so that the beam draws each line directly.
- CRT: the beam is turned on only while drawing a line, then moved to the start of the next line.
Refresh rate depends on the number of lines in the picture: more lines means a lower refresh rate. Random scan gives high resolution and smooth lines and suits line drawings, but it cannot fill areas or display realistic shaded scenes well.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2021 · 10 marks
How can you draw line using Bradenham’s line drawing algorithm? Trace it to rasterize the line with end points P(1, 4) and Q(7, 8).
Answer
Bresenham's line drawing algorithm is an incremental algorithm that uses only integer addition, subtraction and multiplication by 2, and a decision parameter to choose the pixel closest to the true line.
Algorithm (for slope )
- Input endpoints and . Compute and .
- Plot the first point . Compute the initial decision parameter .
- For each along the line:
- if : next point is and ;
- otherwise: next point is and .
- Repeat step 3 times.
Trace for P(1, 4) and Q(7, 8)
, , slope . , .
| k | next point | ||
|---|---|---|---|
| 0 | 2 | (2, 5) | |
| 1 | -2 | (3, 5) | |
| 2 | 6 | (4, 6) | |
| 3 | 2 | (5, 7) | |
| 4 | -2 | (6, 7) | |
| 5 | 6 | (7, 8) |
Pixels rasterized: (1, 4), (2, 5), (3, 5), (4, 6), (5, 7), (6, 7), (7, 8). The last point equals Q, which confirms the trace.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2021 · 10 marks
Explain Cohen Sutherland line clipping algorithm. Let ABCD be the rectangular window with A(20,20), B(90,20), C(90,70) and D(20,70). Use Cohen Sutherland algorithm to find the region codes and ellipse the lines with end point P(10,30) and Q(80,80)
Answer
Cohen-Sutherland line clipping divides the plane into 9 regions by extending the window edges, and gives each end point a 4-bit region code TBRL (Top, Bottom, Right, Left). A bit is 1 if the point is: above the window (), below (), right (), left ().
Algorithm
- Find the region codes of both end points.
- If both codes are 0000, the line is completely inside: accept.
- If the bitwise AND of the codes is non-zero, the line lies wholly outside one edge: reject.
- Otherwise, pick an end point that is outside, find the intersection of the line with the window edge indicated by a 1 bit (in order T, B, R, L), and replace that end point by the intersection. Using slope : for a vertical edge , for a horizontal edge .
- Recompute the code and repeat from step 2.
Numerical. Window: , , , .
- P(10, 30): , so left bit set. Code = 0001.
- Q(80, 80): , so top bit set. Code = 1000.
Neither code is 0000, and AND , so the line is neither trivially accepted nor rejected and must be clipped.
Slope: .
Clip P against the left edge : P becomes P'(20, 37.14), whose code is 0000.
Clip Q against the top edge : Q becomes Q'(66, 70), whose code is 0000.
Both new end points are inside, so the visible part of the line is from (20, 37.14) to (66, 70).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2022 · 5 marks
Define horizontal and vertical retrace of electron beam. Explain architecture of random scan display system.
Answer
Horizontal retrace: in a raster CRT, after the electron beam finishes a scan line it is switched off and moved quickly from the right end of that line back to the left end of the next line. This return is the horizontal retrace.
Vertical retrace: after the last line at the bottom of the screen has been scanned, the beam is turned off and moved from the bottom right back to the top left corner to begin the next frame. This return is the vertical retrace.
Architecture of a random scan display system
A random scan (vector) system draws the picture as straight line segments, with the beam directed only to the parts of the screen that contain the picture.
- Application program / graphics package: creates the picture definition and converts it into line-drawing commands.
- Display file (refresh buffer): stores these commands in system memory.
- Display processor (display controller): reads the display file every refresh cycle and sends each command to the vector generator.
- Vector generator and deflection circuits: convert the coordinates to analog voltages that deflect the beam along each line.
- CRT: displays the line segments; the picture is refreshed 30-60 times per second by redrawing all lines.
Because it draws lines directly, it gives smooth, high-resolution lines, but the refresh rate falls as the number of lines grows, and it is poor for filled or shaded pictures.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2022 · 5 marks
How does decision parameter can be used to draw circle? Calculate the points to draw a circle having radius 5 and center has (10, 5) using mid-point circle algorithm.
Answer
Decision parameter in the mid-point circle algorithm. The circle is . For a point inside the circle , on it , outside it . Starting from and stepping in over the octant from to , at each step we must choose between pixel and . The decision parameter is the value of at their mid-point:
- If , the mid-point is inside the circle, so is closer: next point and .
- Otherwise next point is and .
Initial value at : (the integer form of ).
Numerical, , centre
, start .
| k | next | ||
|---|---|---|---|
| 0 | -4 | (1, 5) | |
| 1 | -1 | (2, 5) | |
| 2 | 4 | (3, 4) |
Now is the last point of the octant; the next step gives , so we stop.
Octant points relative to origin: (0, 5), (1, 5), (2, 5), (3, 4). By eight-way symmetry, the other points are (4, 3), (5, 2), (5, 1), (5, 0) and their mirror images in the other quadrants.
Shift by the centre , i.e. add to and :
| Origin point | Plotted points for the 8 symmetric points |
|---|---|
| (0, 5) | (10, 10), (10, 0), (15, 5), (5, 5) |
| (1, 5) | (11, 10), (9, 10), (11, 0), (9, 0), (15, 6), (15, 4), (5, 6), (5, 4) |
| (2, 5) | (12, 10), (8, 10), (12, 0), (8, 0), (15, 7), (15, 3), (5, 7), (5, 3) |
| (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…
- 2022 · 5 marks
What do you mean by window to viewport transformation? Explain 2D viewing pipeline.
Answer
Window to viewport transformation. A window is the rectangular region of the world-coordinate scene that we want to display. A viewport is the rectangular area of the display device (normalized or device coordinates) in which the window contents are shown. The window-to-viewport transformation maps each point in the window to the corresponding point in the viewport, keeping the relative position:
with , . If the picture is distorted. It is done as translation of the window to the origin, scaling by , and translation to the viewport position.
2D viewing pipeline. The steps from the scene description to the display are:
- Modelling coordinates: objects are defined in their own local coordinates.
- Modelling transformation: objects are placed into the common world coordinate scene.
- Viewing transformation: world coordinates are converted to viewing coordinates relative to the window (translation and rotation if the window is rotated).
- Normalization transformation: viewing coordinates are mapped to normalized viewing coordinates (0 to 1), making the system device independent.
- Workstation transformation (window to viewport): normalized coordinates are mapped to device coordinates of the viewport on the output device.
- Clipping is done against the window (or the normalized viewport) so only the visible part is displayed.
Thus: Modelling coordinates -> World coordinates -> Viewing coordinates -> Normalized coordinates -> Device coordinates.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2022 · 5 marks
Generate the points between the end points of a line viz. (2, 2) and (9, 6) by using DDA line drawing algorithm.
Answer
DDA (Digital Differential Analyzer) algorithm for the line from to .
, . Steps .
Increments: , .
Starting at , add the increments at each step and round to the nearest pixel:
| Step | Plotted | ||
|---|---|---|---|
| 0 | 2 | 2.000 | (2, 2) |
| 1 | 3 | 2.571 | (3, 3) |
| 2 | 4 | 3.143 | (4, 3) |
| 3 | 5 | 3.714 | (5, 4) |
| 4 | 6 | 4.286 | (6, 4) |
| 5 | 7 | 4.857 | (7, 5) |
| 6 | 8 | 5.429 | (8, 5) |
| 7 | 9 | 6.000 | (9, 6) |
Points generated: (2, 2), (3, 3), (4, 3), (5, 4), (6, 4), (7, 5), (8, 5), (9, 6).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2022 · 5 marks
Define visible surface detection. Outline the Z-buffer algorithm along with its advantages and disadvantages.
Answer
Visible surface detection (hidden surface removal) is the process of identifying which surfaces or parts of surfaces of 3D objects are visible from a given viewing position, so that hidden parts are not displayed. It is needed to produce realistic pictures.
Z-buffer (depth-buffer) algorithm. This is an image-space method. It uses two buffers of the screen's size: a frame buffer (colours) and a depth buffer (the value of the nearest surface at each pixel).
- Initialise depth buffer to the maximum depth (farthest), (or 1), and frame buffer to the background colour.
- For each polygon, for each pixel that it covers, calculate the depth (by the plane equation , incrementally along scan lines: ).
- If depth (nearer to the viewer), set depth and frame = the polygon's colour at that point.
- After all polygons are processed, the frame buffer holds the visible picture.
Advantages
- Simple and easy to implement, in hardware as well.
- Polygons can be processed in any order, with no sorting.
- Works for any surface that can give depth at each pixel, and handles intersecting surfaces correctly.
Disadvantages
- Needs extra memory for the depth buffer.
- Only one visible surface per pixel is stored, so transparency and anti-aliasing are difficult.
- Time is wasted calculating depth for surfaces that later get overwritten.
- Limited depth precision can cause errors (z-fighting) for surfaces very close in depth.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2022 · 5 marks
What do you mean by Virtual Reality? Explain the types of Virtual Reality.
Answer
Virtual Reality (VR) is a computer-generated, interactive, three-dimensional environment that gives the user the feeling of being present in it (immersion). The user wears or uses devices such as a head-mounted display (HMD), data gloves, motion trackers and 3D sound, and the system updates the scene in real time according to the user's head and body movements.
Types of virtual reality
- Non-immersive VR: the virtual world is viewed on an ordinary computer monitor and interacted with by keyboard, mouse or joystick. The user remains aware of the real world. Examples: 3D video games, CAD walkthroughs, simulators on a desktop.
- Semi-immersive VR: gives a partial feeling of presence using large screens, projection systems or a high-resolution display with a physical cockpit or control set-up. Example: flight simulators for pilot training.
- Fully immersive VR: the user wears an HMD with head tracking and often gloves and body sensors, so that the real world is blocked out and the user feels inside the virtual world. Examples: VR games, surgical training, virtual tours.
- Augmented reality (AR) / mixed reality (often listed as a related type): virtual objects are overlaid on the view of the real world (for example on a phone or smart glasses).
- Collaborative VR: several users in different places share the same virtual environment at the same time, over a network.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2022 · 5 marks
Define reflection transformation and derive the 2D reflection matrix along x-axis and y-axis in homogeneous coordinate.
Answer
Reflection is a transformation that produces a mirror image of an object. The image is formed by rotating the object by about the reflection axis, which can be a line in the plane (such as the -axis or -axis).
Reflection about the x-axis. A point goes to : the coordinate is unchanged, the coordinate changes sign.
In homogeneous coordinates:
Reflection about the y-axis. A point goes to :
For example, the point reflects to about the x-axis and to about the y-axis.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2022 · 10 marks
What is the need of homogeneous coordinate system in geometric transformation system? Find the new co-ordinate of rectangle ABCD whose center is at (4, 2) is reduced to half of its size and center will remain same. The co-ordinate of ABCD are A(0, 0), B(0, 4), C(8, 4) and D(8, 0).
Answer
Need of homogeneous coordinates. In ordinary 2D coordinates, translation is an addition () while rotation and scaling are multiplications (, ). They cannot be combined into a single matrix. In homogeneous coordinates a point is written (or with , ), and then translation, rotation and scaling are all matrix multiplications. So:
- all basic transformations are handled in one uniform way;
- a sequence of transformations can be combined (concatenated) into one composite matrix, which saves computation;
- it is easy to implement in hardware and graphics software, and it also allows representing points at infinity and perspective projection in 3D.
Numerical. Scaling by about the fixed point keeps the centre unchanged. Composite matrix: translate , scale, translate back :
(since and ). So , .
- A(0, 0): , , so A'(2, 1)
- B(0, 4): , , so B'(2, 3)
- C(8, 4): , , so C'(6, 3)
- D(8, 0): , , so D'(6, 1)
The new rectangle A'(2, 1), B'(2, 3), C'(6, 3), D'(6, 1) has width 4 and height 2, half the original (8 by 4), and its centre is as before.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2022 · 10 marks
Explain Sutherland-Hodgeman Polygon Clipping algorithm and trace it to clip a polygon with end points P(10, 30), Q(25, 35), R(35, 50), S(60, 30), T(45, 28), U(40, 15) against a window whose lower left corner is at (15, 25) and upper right corner is at (50, 40).
Answer
Sutherland-Hodgeman polygon clipping clips a polygon against each edge of the clip window in turn (left, right, bottom, top). The output vertex list of one edge becomes the input of the next. For each polygon edge from vertex (previous) to (current), four cases against a clip edge:
- outside, inside: output the intersection point and .
- inside, inside: output .
- inside, outside: output the intersection point only.
- outside, outside: output nothing.
Numerical. Window: , , , . Polygon: P(10,30), Q(25,35), R(35,50), S(60,30), T(45,28), U(40,15).
1. Left edge (inside: ). P is outside, the others inside.
- U->P: intersection at , , giving (15, 27.5).
- P->Q: intersection , giving (15, 31.67), then Q.
- Then R, S, T, U.
Result: (15, 27.5), (15, 31.67), Q(25, 35), R(35, 50), S(60, 30), T(45, 28), U(40, 15).
2. Right edge (inside: ). Only S(60,30) is outside.
- R->S: , giving (50, 38).
- S->T: , giving (50, 28.67), then T.
Result: (15, 27.5), (15, 31.67), (25, 35), (35, 50), (50, 38), (50, 28.67), (45, 28), (40, 15).
3. Bottom edge (inside: ). Only U(40,15) is outside.
- T->U: , giving (43.85, 25).
- U->(15,27.5): , giving (20, 25), then (15, 27.5).
Result: (20, 25), (15, 27.5), (15, 31.67), (25, 35), (35, 50), (50, 38), (50, 28.67), (45, 28), (43.85, 25).
4. Top edge (inside: ). Only R(35,50) is outside.
- Q->R: , giving (28.33, 40).
- R->(50,38): , giving (47.5, 40), then (50, 38).
Final clipped polygon: (20, 25), (15, 27.5), (15, 31.67), (25, 35), (28.33, 40), (47.5, 40), (50, 38), (50, 28.67), (45, 28), (43.85, 25).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2022 · 10 marks
What do you understand by object space and image space method? Explain Flood Filled algorithm with its applicability and concept.
Answer
Object space and image space methods (for visible surface detection)
- Object space method: works with the 3D objects (surfaces) themselves, in the world coordinate system. It compares objects or parts of objects with each other to decide which surfaces are visible, and then displays only those. The accuracy is that of the object definition and it is independent of screen resolution. Example: back-face detection, depth sorting (painter's), area subdivision.
- Image space method: works pixel by pixel on the projected image. For each pixel on the screen it decides which surface is visible by examining the surfaces that project onto it. Its accuracy is limited by the screen resolution. Example: Z-buffer, scan-line, ray casting.
Flood fill algorithm
Concept. Flood fill fills a connected region whose pixels all have the same interior colour, replacing that colour by a new fill colour, starting from a seed point inside the region. The region need not have a single-coloured boundary; it spreads from the seed to every connected pixel of the old colour.
Algorithm (4-connected version):
floodFill(x, y, fillColor, oldColor):
if getPixel(x, y) == oldColor:
setPixel(x, y, fillColor)
floodFill(x+1, y, fillColor, oldColor)
floodFill(x-1, y, fillColor, oldColor)
floodFill(x, y+1, fillColor, oldColor)
floodFill(x, y-1, fillColor, oldColor)
An 8-connected version also recurses on the four diagonal neighbours, which allows filling regions that are connected only diagonally.
Applicability. It is used in paint programs ("bucket fill"), and to fill areas that are defined by pixel colour rather than by a geometric outline, especially regions with multi-coloured boundaries or irregular shapes. Disadvantages: the recursive form uses a lot of stack memory for large regions, and it is slow because each pixel is tested several times (this can be reduced with a scan-line/stack-based version).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 · 5 marks
Differentiate between beam penetration method and shadow mask method. How does raster scan display system work?
Answer
Beam penetration method vs shadow mask method
| Beam penetration | Shadow mask |
|---|---|
| Used with random scan CRT displays | Used with raster scan CRT displays |
| Screen coated with two layers of phosphor, red (outer) and green (inner) | Screen coated with many triads of red, green and blue phosphor dots |
| Colour depends on how far the electron beam penetrates, which depends on beam speed (voltage) | Colour is made by three electron guns (R, G, B), with their beams passing through a perforated shadow mask |
| Only four colours: red, green, orange, yellow | Millions of colours, since intensities of the three beams can be varied |
| Cheap, but poor colour quality | Expensive, but good picture quality and realistic colours |
Working of a raster scan display system
The screen is made of a matrix of pixels, arranged in rows (scan lines). The picture is stored as intensity values of all pixels in a frame buffer (refresh buffer).
- The electron beam sweeps across the screen one row at a time, from top to bottom.
- As the beam moves along each row, the pixel intensities are read from the frame buffer and used (through a DAC) to control the beam intensity, and so to light the pixels.
- At the end of each scan line, the beam goes through a horizontal retrace to the start of the next line, and after the last line it makes a vertical retrace to the top.
- The process is repeated 60 or more times per second (refresh rate), controlled by a video controller, to give a steady picture.
Raster scan can show shaded, filled and realistic images, but lines can show a jagged (aliasing) look at low resolution.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 · 5 marks
How DDA works? Digitize the line segment with the endpoints (15, 25) and (21, 35) using DDA line drawing algorithm.
Answer
Working of DDA (Digital Differential Analyzer). DDA is an incremental scan-conversion method based on the line's slope. It calculates the number of steps from the larger of and , and in each step increases and by small amounts and , so that one coordinate changes by exactly 1 and the other by the slope (or its inverse). The new position is rounded to the nearest pixel and plotted. It needs floating-point addition and rounding at each step.
Numerical. , .
, , steps .
, .
| Step | Plotted | ||
|---|---|---|---|
| 0 | 15.0 | 25 | (15, 25) |
| 1 | 15.6 | 26 | (16, 26) |
| 2 | 16.2 | 27 | (16, 27) |
| 3 | 16.8 | 28 | (17, 28) |
| 4 | 17.4 | 29 | (17, 29) |
| 5 | 18.0 | 30 | (18, 30) |
| 6 | 18.6 | 31 | (19, 31) |
| 7 | 19.2 | 32 | (19, 32) |
| 8 | 19.8 | 33 | (20, 33) |
| 9 | 20.4 | 34 | (20, 34) |
| 10 | 21.0 | 35 | (21, 35) |
The digitized pixels are (15, 25), (16, 26), (16, 27), (17, 28), (17, 29), (18, 30), (19, 31), (19, 32), (20, 33), (20, 34), (21, 35).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 · 5 marks
What is a viewport? Consider a window with lower left corner at (2, 2) and upper right corner (5, 10) and a viewport with left lower corner at (3, 5) and upper right corner at (8, 8). What will be the value of the point in the viewport after the window to viewport trans2D Transformations mation if the point is (4, 4) in the window?
Answer
Viewport. A viewport is the rectangular area on the display device (screen, or normalized device space) in which the part of the scene selected by the window is displayed. The window selects what to see in world coordinates and the viewport specifies where on the screen it is shown.
Numerical. Window: , , , . Viewport: , , , . Point .
Scale factors:
The point in the viewport is .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 · 5 marks
Explain how scan line algorithm can be used for hidden surface removal.
Answer
Scan-line method for hidden surface removal. This is an image-space method that processes the picture one scan line at a time, from top to bottom. For each scan line it finds which polygon surface is nearest to the viewer at every pixel (or span) of that line and fills that span with its colour. It extends the scan-line polygon-fill algorithm to several surfaces.
Data structures
- Edge table: all edges of the projected polygons, with of the lower end, , and .
- Polygon (surface) table: coefficients of each plane equation, surface colour/shading info, and an in/out flag.
- Active edge list: edges that cross the current scan line, sorted by .
Procedure
- For each scan line, update the active edge list and sort by .
- Walk along the scan line from left to right. The flag of a polygon is switched on when an edge of it is crossed entering it, and off when leaving.
- If only one polygon's flag is on in a span, the span is filled with that polygon's colour (no depth calculation is needed).
- If two or more flags are on in a span (overlapping surfaces), compare the depth of each polygon in the span using the plane equation, , and use the colour of the nearest one.
- Depth is calculated only where polygons overlap. If surfaces do not intersect in depth, the depth calculation can be done once for the overlapping span and not per pixel; coherence along scan lines and between neighbouring lines is used to cut computation (for example, changes by for each pixel step).
It is more efficient than a Z-buffer in memory since only one scan line of data is held, but it is more complex, and cyclically overlapping or intersecting surfaces need extra handling (splitting).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 · 5 marks
Derive the transformation matrices for 3D rotation and reflections.
Answer
3D rotation. A rotation is by angle about a coordinate axis, taken positive (counter-clockwise) when viewed looking from the positive axis toward the origin. Using homogeneous coordinates (4x4 matrices):
About the z-axis. is unchanged, and rotate as in 2D: , , .
About the x-axis. By cyclic permutation : , , .
About the y-axis. , , .
For a rotation about an arbitrary axis, translate the axis to pass through the origin, rotate it to coincide with a coordinate axis, rotate by , and apply the inverse transformations.
3D reflection. Reflection is about a plane; the coordinate perpendicular to the plane changes sign.
Reflection about the xy-plane ():
Reflection about the yz-plane ():
Reflection about the xz-plane ():
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 · 5 marks
What is animation? Explain about applications of Virtual Reality.
Answer
Animation is the technique of producing the illusion of motion by displaying a sequence of still images (frames) rapidly, at 24-30 frames per second or more. In computer animation, objects' position, shape, colour or view change from frame to frame; it is made using key frames and interpolated in-between frames.
Applications of Virtual Reality
- Education and training: flight, driving and military simulators, and virtual classrooms and labs, allow practice without cost or risk.
- Medicine and healthcare: surgical training and planning, therapy for phobias and PTSD, and rehabilitation.
- Entertainment and games: immersive games, virtual theme parks, VR cinema and concerts.
- Architecture and engineering: virtual walkthroughs of buildings before construction, and product design and testing of prototypes.
- Tourism and real estate: virtual tours of destinations, museums and properties.
- Science and visualisation: exploring molecules, space and weather data in 3D.
- Military and industry: combat simulation, maintenance training, remote operation of robots and hazardous equipment.
- Business: virtual meetings and product demonstrations.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 · 5 marks
Write short notes on (any two):
a) RGB color model
b) 2D shear transformation
c) Computer Graphics Vs. Image Processing
Answer
(a) RGB colour model
RGB is an additive colour model based on the three primary colours Red, Green and Blue. Other colours are produced by adding light of these three in different intensities. It is used by devices that emit light, such as CRT, LCD and LED monitors, TVs and cameras.
- Represented as a unit cube in 3D space with R, G, B along the axes, each from 0 to 1 (or 0 to 255 in 8-bit form).
- Origin is black, is white, the diagonal between them are shades of gray.
- Red + Green = Yellow, Green + Blue = Cyan, Blue + Red = Magenta.
- With 8 bits per component, 24 bits per pixel gives million colours.
(b) 2D shear transformation
A shear distorts the shape of an object by sliding its layers in a direction, so that the shape looks slanted while area is preserved.
x-direction shear with shear factor : , .
y-direction shear with factor : , .
For example, shearing the unit square with gives .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 · 10 marks
Differentiate between boundary fill algorithm and flood fill algorithm in detail. Find the composite transformation matrix for anti-clockwise rotation of 60° about a point (2, 3). Use it to rotate a triangle ABC with vertices A (4, 3), (5, 5) and (8, 9).
Answer
Boundary fill vs flood fill
| Boundary fill | Flood fill |
|---|---|
| Fills an area bounded by pixels of one specified boundary colour | Fills an area whose interior pixels have one specified (old) colour |
| Inputs: seed point, fill colour, boundary colour | Inputs: seed point, fill colour, old (interior) colour |
| Spreads outward until it hits the boundary colour | Spreads to all connected pixels of the old colour |
| Pixel is filled if it is neither boundary colour nor fill colour already | Pixel is filled if its colour equals the old colour |
| Interior may have many colours, but boundary must be a single colour | Boundary may be multi-coloured, but interior must be one colour |
| Used for areas drawn with an outline | Used in paint programs for areas of one colour |
Both can be 4-connected or 8-connected, are recursive and need a stack, and both start from a seed point inside the region.
Composite matrix, rotation by anticlockwise about
With , :
, .
So , .
Rotating the triangle A(4, 3), B(5, 5), C(8, 9):
- A: , , so A'(3.00, 4.73)
- B: , , so B'(1.77, 6.60)
- C: , , so C'(-0.20, 11.20)
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 · 10 marks
What is visible surface detection? How object space method can be used for visible surface detection? Explain depth-sorting method for visible surface detection in detail.
Answer
Visible surface detection is the process of finding which surfaces (or parts of surfaces) of the objects in a 3D scene are visible from the viewing position, and removing those that are hidden, so that a realistic picture is produced. It is also called hidden surface removal.
Object space method. In object space methods the surfaces of the objects are compared with each other in the 3D world coordinates, to find which surface or part of it is nearer to the viewer, and only the visible parts are projected and displayed. For example, to find the visible parts of a polygon, it is compared with every other polygon, and the parts that are hidden are removed. Accuracy depends on the object definition and not on the screen resolution, but it is costly for complex scenes. Examples: back-face detection, depth sorting (painter's algorithm), area subdivision, BSP trees.
Depth-sorting (painter's) method. It uses both image-space and object-space operations: surfaces are sorted by depth (object space) and then painted onto the frame buffer in order (image space), in the way a painter paints distant objects first and nearer ones over them.
Steps
- Sort all polygon surfaces in descending order of depth, using for each the greatest (farthest) value of its vertices. The surface with the greatest depth is .
- Before painting , compare it with each surface whose depth range overlaps that of . If none of the following tests is true for the pair, the order may be wrong and the surfaces must be reordered:
- the bounding rectangles of and in the plane do not overlap;
- is completely behind the plane of (inside the side away from the viewer);
- is completely in front of the plane of ;
- the projections of the two surfaces on the view plane do not overlap.
- If a test is satisfied, can be painted. If all tests fail, swap and in the list and repeat the tests. If swapping causes a cycle, or surfaces that intersect, one surface is split along the plane of the other into two parts, and the process repeats.
- Paint the surfaces in order, from the farthest to the nearest, with each painted surface overwriting the pixels behind it.
Features: simple idea and easy to implement, but sorting is expensive, and cyclic overlap or intersecting surfaces need splitting. The method also wastes time painting surfaces that are later covered.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2023 · 10 marks
How region codes are used in Cohen-Sutherland algorithm to clip the line segments? Find the clipping coordinates for lines PQ and RS with P(20, 5), Q(40, 30) and R(20, 30), S(80, 60) against the window with left upper corner(10, 50) and right lower corner(50, 10).
Answer
Region codes in Cohen-Sutherland clipping. The plane is divided into nine regions by extending the window edges. Each end point is given a 4-bit code TBRL: bit 1 (Top) set if , bit 2 (Bottom) if , bit 3 (Right) if , bit 4 (Left) if . The inside region has code 0000.
- Both codes 0000: line completely inside, accepted.
- AND of the codes is not 0000: both end points lie on the outside of the same edge, so the line is rejected.
- Otherwise: the line is clipped, by finding the intersection with the window edge corresponding to a set bit of an outside end point, replacing that end point, and re-testing.
Numerical. Window: left upper (10, 50) and right lower (50, 10), so , , , .
Line PQ: P(20, 5), Q(40, 30)
- P: so bottom bit set, code 0100. Q: inside, code 0000.
- AND = 0000 and not both 0000, so clipping is needed.
- Slope . Intersection of the line with : .
- P becomes (24, 10), inside.
Clipped line PQ: (24, 10) to (40, 30).
Line RS: R(20, 30), S(80, 60)
- R: inside, 0000. S: right, top, so code 1010.
- Slope .
- First against the top edge : , so the point is (60, 50), which is outside to the right (code 0010).
- Then against the right edge : , giving (50, 45), which is inside (0000).
(Equivalently, as the right edge intersection (50, 45) lies inside the window, S is replaced directly by it.)
Clipped line RS: (20, 30) to (50, 45).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 · 5 marks
How raster scan display is different from vector scan display? What is the role of video controller in raster scan display system?
Answer
Raster scan vs vector (random) scan display
| Raster scan | Vector (random) scan |
|---|---|
| The beam sweeps the whole screen row by row, in a fixed pattern | The beam goes only to the parts of the screen where the picture is, drawing line by line |
| Picture is stored as pixel intensities in a frame buffer | Picture is stored as line-drawing commands in a display file |
| Pictures are built from pixels, so lines may show jaggedness (aliasing) | Lines are smooth, with high resolution |
| Good for filled areas, shading, realistic images and colour | Poor for filled areas and realistic scenes; mostly line drawings |
| Refresh time is constant and does not depend on picture complexity | Refresh time depends on the number of lines; complex pictures flicker |
| Needs a large amount of memory for the frame buffer | Needs less memory |
| Used in TVs, monitors, ordinary computers | Used in plotters and older CAD systems |
Role of the video controller in a raster scan system. The video controller is the hardware that reads the frame buffer and drives the display. Its roles are:
- It generates the x and y addresses of the pixels in synchrony with the beam scanning, and reads the corresponding intensity value from the frame buffer in each refresh cycle.
- It converts the pixel values (via a lookup table, if used, and a DAC) into the signals that control the beam intensity or colour.
- It produces the horizontal and vertical synchronisation and retrace signals to move the beam from one line to the next and from the bottom of the screen to the top.
- It repeats the refresh cycle 60 or more times per second, so that the picture is steady, and, in some systems, supports operations like zooming and mixing with other video sources.
In this way the CPU/display processor can update the frame buffer while the video controller independently refreshes the screen.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 · 5 marks
Define Pixel and resolution. Explain in brief about Back face detection algorithm.
Answer
Pixel: A pixel (picture element) is the smallest addressable point on a display screen that can be given an intensity and colour. An image on a raster screen is a grid of pixels, each stored in the frame buffer.
Resolution: Resolution is the number of pixels the display can show along the horizontal and vertical directions, e.g. . A higher resolution gives more pixels per unit area, so finer detail and smoother lines.
Back-face detection algorithm
It is an object-space method for removing the polygon faces of a solid that face away from the viewer, so they need not be processed further.
A polygon with plane equation has outward normal . Let be the vector from the polygon towards the viewer. If the viewer looks along the negative axis ( direction towards the viewer), then the polygon is a back face if
which for this view reduces to . Faces with (i.e. ) are front faces and are kept.
Steps:
- For each polygon compute its normal (from the plane coefficients or the cross product of two edges).
- Compute .
- If the value is negative, discard the polygon (back face); otherwise send it to the next stage.
For a single convex solid this removes about half of the polygons and gives the correct visible surfaces. For concave objects or overlapping objects, a further method such as the depth buffer is needed.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 · 5 marks
How flood fill algorithm can be used to fill a polygon? Explain.
Answer
Flood fill is a seed-fill method that fills a region whose interior pixels all have one colour (the old colour) and which is bounded by pixels of a different colour. It does not need the boundary to be a single colour, so it is suited to regions such as a polygon already drawn with differently coloured edges.
Method
- Choose a seed pixel inside the polygon.
- If the pixel has the old (interior) colour, set it to the fill colour.
- Recursively visit its neighbours: 4-connected , or 8-connected, which adds the four diagonal neighbours.
- Stop at pixels that do not have the old colour (the boundary or already filled pixels).
Algorithm
floodFill(x, y, oldColor, newColor):
if getPixel(x, y) == oldColor:
setPixel(x, y, newColor)
floodFill(x+1, y, oldColor, newColor)
floodFill(x-1, y, oldColor, newColor)
floodFill(x, y+1, oldColor, newColor)
floodFill(x, y-1, oldColor, newColor)
// for 8-connected, also the four diagonals
Notes
- 4-connected fill cannot leak through a diagonal gap in the boundary, whereas 8-connected fill can, so 8-connected fill needs a boundary that is 4-connected.
- The recursion depth can be large for big polygons, so a stack-based or scan-line version is used in practice.
- It works for polygons with holes, since the hole boundary stops the filling.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 · 5 marks
What is window to viewport transformation? Explain how mapping from window to viewport is achieved.
Answer
Window to viewport transformation
A window is a rectangular region of the world coordinate system that we want to display. A viewport is the rectangular region of the screen (device coordinates) where it is shown. The window-to-viewport transformation maps each point in the window to the corresponding point in the viewport, keeping its relative position.
Mapping
Let the window be to and the viewport be to . A window point maps to such that its relative position is the same:
Solving:
where
This is the same as three steps: translate the window corner to the origin, scale by , and translate to the viewport corner . If the object is stretched or squeezed; if shapes are preserved.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 · 5 marks
Use the Midpoint Circle drawing Algorithm to draw a circle with a radius of 7 units, centered at (5,5).
Answer
Midpoint circle algorithm with , centre .
First the circle is generated about the origin for the octant from to , starting at . Decision parameter:
- If : next point and .
- Otherwise: next point and .
| next | |||
|---|---|---|---|
| 0 | |||
| 1 | |||
| 2 | |||
| 3 | |||
| 4 | stop, since |
Octant points about the origin: .
Shifting each by gives the octant points . Using eight-way symmetry, each also gives and about the centre, so the complete set of pixels is:
- from :
- from :
- from :
- from :
- from :
- from :
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 · 5 marks
What is I3 in virtual reality? How immersive virtual reality is different from non-immersive virtual reality?
Answer
I3 in virtual reality
I3 stands for the three key features of a VR system: Immersion, Interaction and Imagination (sometimes called Interactivity and Imagination).
- Immersion: the feeling of being inside the virtual world, produced by head-mounted displays, 3D sound and tracking.
- Interaction: the user can act on the environment in real time (move, grab, change objects) and the world responds.
- Imagination: the virtual world is designed to solve problems or create experiences that need the user's creativity, such as training, design or simulation of places that do not exist.
Immersive vs non-immersive VR
| Point | Immersive VR | Non-immersive VR |
|---|---|---|
| Devices | HMD, data gloves, motion trackers, CAVE | Ordinary monitor, keyboard, mouse, joystick |
| Sense of presence | Very high, user is surrounded by the environment | Low, user views the world through a window |
| Interaction | Natural, with head and body movement | Through standard input devices |
| Cost | High | Low |
| Examples | Flight simulators, VR gaming, surgery training | Desktop 3D games, CAD walkthroughs, virtual tours on a PC |
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 · 5 marks
Write short notes (On Any two):
a) Polygon clipping
b) RGV vs. CMY
c) Designing animation sequences
Answer
(a) Polygon clipping
Polygon clipping removes the parts of a polygon lying outside a clip window and returns a polygon (or polygons) that can still be filled. Clipping each edge as a separate line would break the closed shape, so special algorithms are used.
The Sutherland-Hodgman algorithm clips the polygon against one window boundary at a time (left, right, bottom, top). The output list of one stage is the input of the next. For each edge from vertex to vertex against a boundary, there are four cases:
- both inside: output ;
- inside, outside: output the intersection point;
- both outside: output nothing;
- outside, inside: output the intersection point and .
It works well for convex polygons; for concave polygons it may produce extra connecting edges.
(b) RGB vs CMY
| Point | RGB | CMY |
|---|---|---|
| Primaries | Red, Green, Blue | Cyan, Magenta, Yellow |
| Model type | Additive (light is added) | Subtractive (light is absorbed by ink) |
| Black / White | black, white | black, white |
| Used in | Monitors, TVs, cameras | Colour printers |
Conversion: .
(c) Designing animation sequences
An animation is planned in stages: (1) storyboard, which outlines the action as a series of sketches; (2) object definition, which gives the shape and movement of each object; (3) keyframe specification, which defines the important positions at chosen times; (4) in-between generation, which computes the frames between keyframes (about 24 to 30 frames per second for film or video); (5) rendering and sound synchronisation.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 · 10 marks
What is scan conversion? Derive the decision parameter for Bresenham’s line drawing algorithm for m<1.
Answer
Scan conversion
Scan conversion (rasterisation) is the process of converting a geometric primitive such as a line, circle or polygon, given by mathematical equations, into the set of pixels on a raster display that best represents it.
Bresenham's line algorithm for
Let the line be from to with , , . We step one unit in each time. Having plotted , the next pixel is either or .
The line's actual at is
Distances to the two candidate pixels:
Difference:
Define the decision parameter by multiplying by (positive, so the sign is preserved):
where is a constant.
- If , then : choose (lower pixel).
- If : choose .
Recursive form. Writing and subtracting:
Since :
So if ( unchanged), and if ( increases by 1).
Initial value. At the point is on the line, so , giving . Substituting into :
Algorithm
- Plot ; compute and .
- For each from : if plot and ; else plot and .
- Repeat times.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 · 10 marks
Write transformation matrices for 3D scaling and shearing. If a triangle with vertices P(2, 3), Q(5,3) and R(6,8) is rotated clockwise 90º about the origin and then scaled by 2, what will be the transformed image?
Answer
3D scaling matrix (about the origin, factors ), in homogeneous coordinates:
3D shearing matrices. Shear along (depends on and with shear constants , ):
Along (constants , ) and along (constants , ):
Numerical part
Rotation by (clockwise):
so . Scaling by 2: . Composite: :
Applying to the vertices, using :
Transformed triangle: , , .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 · 10 marks
What is image space method for visible surface detection? Write the algorithm for depth buffer method and also explain how depth is used to find the visible surface.
Answer
Image-space method
An image-space method decides visibility at each pixel of the projection plane: for every pixel it finds which object surface is nearest to the viewer along the line of sight through that pixel. Its cost depends on the number of pixels and polygons. The depth-buffer (z-buffer) and the scan-line methods are image-space methods; back-face detection and the painter's algorithm are object-space methods.
Depth buffer (z-buffer) method
Two buffers of the same size as the screen are used:
- depth buffer : stores the depth of the nearest surface found so far at each pixel;
- refresh (frame) buffer : stores the colour of that surface.
Algorithm
1. For all pixels (x, y):
depthBuffer(x, y) = 1.0 // farthest value (or infinity)
frameBuffer(x, y) = backgroundColor
2. For each polygon in the scene:
for each pixel (x, y) covered by the polygon:
compute depth z of polygon at (x, y)
if z < depthBuffer(x, y): // nearer than stored (viewer at z = 0)
depthBuffer(x, y) = z
frameBuffer(x, y) = colour of polygon at (x, y)
3. Display frameBuffer.
How depth is found. For a polygon with plane equation :
Along a scan line, increases by 1, so the depth at the next pixel is found incrementally:
and for the next scan line (with decreasing by 1), down the left edge. This avoids recomputing the plane equation for each pixel.
Visible surface. For each pixel, the depth of every polygon covering it is compared with the stored value, and only the nearest one survives. After all polygons are processed, the frame buffer holds, at each pixel, the colour of the nearest surface, which is the visible surface. The method needs no sorting, handles intersecting polygons, and the order of polygons does not matter; its drawbacks are the extra memory and that it cannot handle transparency directly.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 · 2+3 marks
Define raster and random scan display systems. Draw and explain how each system renders a diagonal line.
Answer
Raster scan display: The screen is a matrix of pixels. The electron beam sweeps across the screen row by row (left to right, top to bottom), turning its intensity on or off to light pixels. The picture is stored in a frame buffer (refresh buffer) and refreshed typically 60 times per second. Example: TV and PC monitors.
Random scan (vector) display: The beam is moved directly from one end point of a line to another in any order, drawing only the lines of the picture. The picture is stored as a display list of line-drawing commands in a refresh buffer, and the beam redraws the lines repeatedly. Example: pen plotters and vector CRTs.
Rendering a diagonal line
Raster system. The ideal line from to does not pass exactly through pixel centres, so the line is scan converted (e.g. by DDA or Bresenham): for each column the nearest pixel is chosen and stored in the frame buffer. As the beam scans each row it lights those pixels, giving a staircase (jagged) approximation:
row 4: ██
row 3: ██
row 2: ██
row 1: ██
c1 c2 c3 c4
Random scan system. The display list contains one command, LINE (x1, y1, x2, y2). The deflection system moves the beam continuously from to along the straight path, so the line is smooth with no staircase:
/
/
/
/
Because only the line is drawn, it is quick for line drawings but cannot display filled, shaded regions easily.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 · 1+4 marks
Discuss the importance and workflow of area filling algorithms with diagrams. Explain how the flood fill algorithm works with 4-connected and 8-connected boundaries.
Answer
Importance of area filling
Area filling gives solid colour or pattern to the interior of a polygon or closed region. It makes the drawn shape look like a solid surface and is needed for shading, painting, solid modelling and rendering of 3D surfaces, charts and GUI graphics.
Workflow
- Define the closed region (polygon boundary or boundary colour).
- Choose the method: scan-line fill (works from the polygon's edge data), or seed fill (boundary fill, flood fill, which start from an interior seed pixel).
- Determine the interior pixels (by intersections with scan lines, or by spreading from the seed).
- Set the pixels in the frame buffer to the fill colour or pattern.
- Display the result.
boundary -> seed / scan lines -> interior pixels -> write colour -> display
Flood fill with 4- and 8-connected regions
Flood fill replaces all pixels having the old interior colour, starting from a seed, with the new colour. It stops at pixels of any other colour.
4-connected: from pixel the fill spreads to the four neighbours and only. It fills regions bounded by an 8-connected boundary and cannot pass through diagonal gaps.
8-connected: the fill also spreads to the diagonal neighbours . It fills regions with diagonal connections, but will leak through a diagonal gap in a boundary unless the boundary is 4-connected.
floodFill(x, y, old, new):
if getPixel(x, y) == old:
setPixel(x, y, new)
floodFill(x+1, y, ...); floodFill(x-1, y, ...)
floodFill(x, y+1, ...); floodFill(x, y-1, ...)
// 8-connected: also (x+1,y+1), (x+1,y-1), (x-1,y+1), (x-1,y-1)
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 · 5 marks
Derive the homogeneous matrix for reflection about the line y = x
Answer
Reflection about the line
Reflection about swaps the coordinates: . It can be derived as a composite of simple transformations, since the line passes through the origin at to the -axis.
- Rotate by so the line lies on the -axis:
- Reflect about the -axis:
- Rotate back by :
The composite is . With :
Since and :
Check: , as required.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 · 1+4 marks
Describe composite transformations. Prove that the order of transformations matters by applying rotation followed by translation vs. translation followed by rotation to a point.
Answer
Composite transformation
A composite (concatenated) transformation is a single transformation obtained by multiplying the matrices of a sequence of basic transformations (translation, rotation, scaling and so on). With homogeneous coordinates, applying and then to a point gives , so the whole sequence can be applied with one matrix. Matrix multiplication is not commutative, so the order matters.
Proof with an example
Take the point , rotation by about the origin, and translation by .
Rotation followed by translation:
Result: .
Translation followed by rotation:
Result: .
Since , . Hence the order of transformations changes the result. (In the general case because the rotation also rotates the translation vector.)
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 · 1+4 marks
Describe the purpose of window-to-viewport transformation. Derive the transformation equation and explain how aspect ratio is preserved.
Answer
Purpose
The window-to-viewport transformation maps a selected rectangular region of the world coordinate scene (the window) onto a rectangular region of the output device (the viewport). It allows us to view any part of the scene at any size and position on the screen, and gives zooming and panning.
Derivation
Window: to . Viewport: to . A window point is mapped to so that it has the same relative position in the viewport:
Solving for and :
In matrix form this is: translate by , scale by , translate by .
Aspect ratio
The aspect ratio is width divided by height. The window's is and the viewport's is . Shapes are preserved only when , which is equivalent to
If , the picture is stretched in one direction (a circle becomes an ellipse). To preserve it, the viewport (or window) is chosen with the same aspect ratio, or the same scale is used for both axes, leaving unused space in the viewport.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 · 3+2 marks
Explain the Back-Face Removal algorithm. What are its advantages and limitations?
Answer
Back-face removal algorithm
It is an object-space method for hidden surface removal that discards polygons facing away from the viewer.
A polygon with plane has outward normal . Let be the vector from the polygon to the viewing position. The polygon is a back face if
(the angle between them exceeds ). When the view direction is along the axis, this reduces to .
Steps:
- For each polygon compute the normal (cross product of two edge vectors, ordered so that it points outwards).
- Compute .
- If it is negative, discard the polygon; otherwise keep it for the next stages of rendering.
Advantages
- Very simple and fast, needing only one dot product per polygon.
- Removes roughly half of the polygons of a closed object, reducing later work.
- Needs no extra memory.
Limitations
- It works completely only for a single convex closed object. For concave objects, or when objects overlap, front faces may still be partially hidden by other front faces, so a further method (depth buffer, painter's algorithm) is required.
- It does not handle transparent or open surfaces, where the back faces should be visible.
- Polygons must have consistently oriented normals.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 · 5 marks
Write short notes on: (any two)
a. Keyframe Animation
b. Application of Computer Graphics
c. DDA algorithm
Answer
(a) Keyframe animation
In keyframe animation the animator specifies only the important frames (keyframes) that define the start and end of each motion, giving the object's position, orientation, scale or colour at selected times. The computer then generates the in-between frames (inbetweening or tweening) by interpolation, usually linear or spline-based.
For example, to move a ball from at frame 1 to at frame 11, the position at frame is found by linear interpolation:
This saves the animator from drawing every frame by hand and is used in cartoons, 3D character animation and motion graphics.
(b) Applications of computer graphics
- Computer-aided design (CAD) of buildings, machines and circuits.
- Entertainment: games, films, special effects and animation.
- Education and training: simulators for pilots and drivers, medical visualisation.
- Presentation graphics: charts, graphs and diagrams.
- GUI design: windows, icons and menus.
- Scientific visualisation, medical imaging (CT, MRI), GIS and mapping.
- Virtual reality and augmented reality.
(c) DDA algorithm
The Digital Differential Analyzer is a scan conversion method for lines based on incremental calculation. For a line from to :
Starting from , repeat times: , , and plot .
It is simple and faster than evaluating , since it avoids multiplication, but rounding of floating-point values accumulates error and drifts on long lines, and the rounding operations are slow compared with Bresenham's algorithm.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 · 7+3 marks
Derive the general formula for the decision parameter in Bresenham's algorithm. How does integer arithmetic help avoid floating-point operations?
Answer
Derivation of the decision parameter
Consider a line from to with , and slope (the other octants follow by symmetry). We step by 1 each time; at the next column, the pixel is either or .
On the line, . The vertical distances to the two pixels are
Multiplying by and using gives the decision parameter
with the constant .
- : the lower pixel is closer.
- the upper pixel is chosen.
Successive values. Subtracting from :
Hence
Initial value. For on the line, . Then cancels with the other terms and
Integer arithmetic
The original comparison vs involves the slope and the intercept , which are fractions needing floating-point numbers and rounding. By multiplying by we obtain whose sign carries the same information. Since , and the coordinates are integers, is an integer, and each update adds the integer constants or (precomputed once). Only integer addition, subtraction and sign tests are needed in the loop, with no multiplication, division or rounding. This is faster on simple hardware, and there is no accumulated rounding error as in DDA, so the plotted points are exact.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 · 5+3+2 marks
Create a scenario in which the Z-buffer and Painter's algorithm produce different results. Explain why the outputs differ and illustrate how the scene would be rendered using both methods. You can include diagrams or pseudocode to support your explanation. [Hint: Start with three overlapping polygons (e.g., triangles or rectangles) in 3D space such that: One is in front of another in some regions, And behind it in other regions (i.e., their Z-depths intersect or overlap).]
Answer
Scenario
Let the viewer look along the axis, with a smaller meaning nearer the viewer. Take three polygons, each covering the same screen region (viewed from the front):
- : plane (tilted; depth 0 at the left, 4 at the right).
- : plane (tilted the other way; depth 5 at the left, 1 at the right).
- : plane (flat, parallel to the screen).
and intersect where , i.e. at , so each is in front of the other in some regions.
Depth at each pixel (nearest wins)
| Range of | Depths | Nearest |
|---|---|---|
| , , | ||
| is less than and less than | ||
Z-buffer result. The buffer is initialised to and, for each pixel, keeps the smallest among the polygons. Whatever the order of drawing, the final image is on the left, in the middle strip and on the right, which is the correct image.
for each polygon in any order:
for each pixel (x, y) covered:
z = depth of polygon at (x, y)
if z < zbuf[x][y]: zbuf[x][y] = z; frame[x][y] = colour
Painter's algorithm result. Polygons are sorted by one depth value per polygon (e.g. the average ) and drawn from farthest to nearest. Average depths: , , . Drawing order (far to near): , then , then . So is painted last and completely covers the others, and the picture shows over the whole area.
sort polygons by average z, farthest first
for each polygon in that order: draw it completely
Why they differ. The painter's algorithm assumes that one polygon is wholly in front of or behind another, so a single polygon-level depth is enough. When polygons intersect or overlap cyclically, none of the orderings is correct, and the algorithm paints over the region where it is actually behind and . The z-buffer compares depths per pixel, so it handles intersection correctly (at the cost of a depth buffer). The painter's algorithm would need to split the polygons along the intersection line to be correct.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2025 · 2+8 marks
What is Virtual Reality (VR)? Explain the components of a typical VR system and list its uses in modern animation and simulation.
Answer
Virtual Reality (VR)
Virtual reality is a computer-generated three-dimensional environment that a user can explore and interact with in real time, giving the feeling of being physically present in it. It uses special input and output devices that respond to the user's movements.
Components of a typical VR system
- Input devices: gather the user's actions: head and body trackers, data gloves, 3D mice, joysticks, treadmills, and controllers. Tracking gives the position and orientation of the head and hands.
- Output (display) devices: head-mounted display (HMD) giving stereoscopic views, CAVE projection rooms or stereo glasses with large screens; audio devices for 3D spatial sound; haptic devices for force and touch feedback.
- Computer / graphics engine (VR engine): a powerful processor and graphics hardware (GPU) that renders the scene at high frame rates (about 60 to 90 fps or higher) with low latency, and handles physics and collision detection.
- Software and database: modelling tools and a VR software environment (e.g. Unity, Unreal) with the geometry, textures, behaviours and sound of the virtual world, together with the application logic.
- The user: whose movements form the feedback loop: track, compute, render, display.
Uses in modern animation and simulation
- Motion capture for realistic character animation, and previewing scenes directly in VR.
- Immersive 3D modelling, sculpting and set design for films and games.
- Virtual production, where actors are filmed in virtual sets.
- Flight, driving and military training simulators.
- Medical simulation and surgical training.
- Architecture and engineering walkthroughs and design review.
- Gaming and entertainment, virtual tourism, education and therapy.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
Questions from TU BCA 2020 Fifth Semester Computer Networking (TU board exam, 2020), TU BCA 2021 Fifth Semester Computer Networking (TU board exam, 2021), TU BCA 2022 Fifth Semester Computer Networking (TU board exam, 2022), TU BCA 2023 Fifth Semester Computer Networking (TU board exam, 2023), TU BCA 2024 Fifth Semester Computer Networking (TU board exam, 2024), TU BCA 2025 Fifth Semester Computer Networking (TU board exam, 2025), TU BCA 2020 Fifth Semester Computer Graphics and Animation (TU board exam, 2020), TU BCA 2021 Fifth Semester Computer Graphics and Animation (TU board exam, 2021), TU BCA 2022 Fifth Semester Computer Graphics and Animation (TU board exam, 2022), TU BCA 2023 Fifth Semester Computer Graphics and Animation (TU board exam, 2023), TU BCA 2024 Fifth Semester Computer Graphics and Animation (TU board exam, 2024), TU BCA 2025 Fifth Semester Computer Graphics and Animation (TU board exam, 2025), TU BCA 2020 Fifth Semester .NET Technology (TU board exam, 2020), TU BCA 2021 Fifth Semester .NET Technology (TU board exam, 2021), TU BCA 2022 Fifth Semester .NET Technology (TU board exam, 2022), TU BCA 2023 Fifth Semester .NET Technology (TU board exam, 2023), TU BCA 2024 Fifth Semester .NET Technology (TU board exam, 2024), TU BCA 2025 Fifth Semester .NET Technology (TU board exam, 2025), TU BCA 2020 Fifth Semester Introduction to Management (TU board exam, 2020), TU BCA 2021 Fifth Semester Introduction to Management (TU board exam, 2021), TU BCA 2022 Fifth Semester Introduction to Management (TU board exam, 2022), TU BCA 2023 Fifth Semester Introduction to Management (TU board exam, 2023), TU BCA 2024 Fifth Semester Introduction to Management (TU board exam, 2024), TU BCA 2025 Fifth Semester Introduction to Management (TU board exam, 2025), TU BCA 2020 Fifth Semester MIS and E-Business (TU board exam, 2020), TU BCA 2021 Fifth Semester MIS and E-Business (TU board exam, 2021), TU BCA 2022 Fifth Semester MIS and E-Business (TU board exam, 2022), TU BCA 2023 Fifth Semester MIS and E-Business (TU board exam, 2023), TU BCA 2024 Fifth Semester MIS and E-Business (TU board exam, 2024) and TU BCA 2025 Fifth Semester MIS and E-Business (TU board exam, 2025). Answers are written for this site; check them against your class notes.