πŸ–ΌοΈChapter 6 cover
Nepal Engineering Council Β· Registration ExaminationAItE Β· Ch 6
← Back to AItE Syllabus
6

Chapter 6

Computer Graphics and Multimedia System

AITE06Β·6 Sub-topicsΒ·60 MCQs
🎯 Read MCQs Mode
6.1

Introduction to Computer Graphics

AItE0601
1
Computer Graphics is the field concerned with generating, manipulating, and displaying visual images using computers. Applications: CAD, animation, games, medical imaging, scientific visualization.
2
Raster scan display (bitmap/pixel-based): screen is a grid of pixels scanned left-to-right, top-to-bottom. Used in TVs, monitors, LCDs. Images stored as pixel arrays in a frame buffer.
3
Vector scan display (calligraphic): electron beam draws lines directly along mathematical paths. Used in CAD/oscilloscopes. Sharp lines at any scale but slower for complex images.
4
A pixel (picture element) is the smallest addressable element of a raster display. Resolution = total number of pixels (e.g., 1920Γ—1080). Color depth = bits per pixel (8-bit=256 colors, 24-bit=16.7M colors).
5
The frame buffer (video RAM) stores the pixel values for the current screen image. Refreshed at the refresh rate (typically 60Hz or higher). Double buffering prevents screen tearing.
6
DDA (Digital Differential Analyzer) algorithm for line drawing: computes incremental floating-point steps (dx/steps, dy/steps). Simple but uses float arithmetic (rounding errors, slower).
7
Bresenham's Line Algorithm draws lines using integer arithmetic only β€” no division, no floating point. Uses a decision variable (error term) to decide whether to increment y. Faster and more accurate than DDA.
8
Bresenham's Circle Algorithm (Midpoint Circle) draws circles using integer operations. Uses 8-way symmetry β€” only computes 1/8 of the circle, mirrors to complete.
9
Area filling algorithms: Boundary fill (fills until hitting boundary color), Flood fill (fills all pixels of a specific color), Scan-line fill (fills horizontal spans between edge intersections β€” best for polygons).
10
OpenGL is a cross-platform, open-standard API for 2D and 3D graphics. Defines hardware-independent interface to the GPU. GLUT/GLFW are utility toolkits. WebGL is OpenGL ES for browsers.
6.2

Two and Three-Dimensional Transformations

AItE0602
1
2D Transformations: Translation (shift by tx, ty), Rotation (rotate by angle ΞΈ around origin), Scaling (scale by sx, sy), Reflection (flip across axis), Shear (slant in x or y direction).
2
Homogeneous Coordinates: extend 2D point (x,y) to (x,y,1) β€” a 3-element vector. This allows ALL transformations to be represented as matrix multiplication, enabling composition by matrix concatenation. Translation in homogeneous form: [1 0 tx; 0 1 ty; 0 0 1].
3
2D Rotation matrix: [cosΞΈ -sinΞΈ 0; sinΞΈ cosΞΈ 0; 0 0 1]. Positive ΞΈ = counterclockwise (in standard math). To rotate around an arbitrary point P: translate P to origin, rotate, translate back.
4
3D Transformations use 4Γ—4 matrices with homogeneous coordinates (x,y,z,1). Rotation in 3D: separate matrices for Rx (around X), Ry (around Y), Rz (around Z). 3D scaling: diag(sx,sy,sz,1).
5
Composite Transformations: concatenate matrices. M = M1 Γ— M2 Γ— M3. Order matters β€” matrix multiplication is not commutative. Apply right to left: M Γ— P applies M to point P.
6
Window to Viewport Transformation: Window = world coordinate region visible to user. Viewport = corresponding screen region. Formula: xv = ((xw - wxmin)/(wxmax - wxmin)) Γ— (vxmax - vxmin) + vxmin.
7
Parallel Projection: projects along parallel rays perpendicular to projection plane. Preserves true shape and size but no depth cues. Types: Orthographic (front/top/side views), Oblique (cavalier/cabinet).
8
Perspective Projection: converging rays from a center of projection. Produces foreshortening β€” farther objects appear smaller. More realistic but does not preserve shape. Used in games/3D rendering.
9
Cohen-Sutherland Line Clipping: assigns a 4-bit region code to each endpoint (Top/Bottom/Right/Left). Trivially accept (both codes 0000), trivially reject (AND β‰  0000), or clip against boundary. Efficient for mostly visible/invisible lines.
10
Sutherland-Hodgman Algorithm clips polygons against each clip boundary in turn. Outputs new polygon vertices by testing each edge against the current clip plane. Works for convex clip regions.
6.3

3D Object Representation and Visible Surface Detection

AItE0603
1
Bezier Curves are defined by n+1 control points for a degree-n curve. Key properties: the curve passes through only the FIRST and LAST control points, stays within the convex hull of control points, and is affinely invariant. Common: cubic Bezier (4 control points).
2
Hermite Curves are defined by two endpoints and two tangent vectors at those endpoints. The curve passes through both endpoints and the tangent direction controls shape at endpoints.
3
B-Spline Curves are generalizations of Bezier with local control β€” moving one control point affects only a portion of the curve, unlike Bezier where all points influence the whole curve. NURBS (Non-Uniform Rational B-Splines) are used in CAD.
4
Polygon meshes (wireframe, surface) are the most common 3D object representation. A mesh consists of vertices, edges, and faces. The cube has 8 vertices, 12 edges, 6 faces.
5
Z-buffer (Depth Buffer) algorithm: image-space hidden surface removal. Maintains a depth value for each pixel; when rendering, only the pixel with the smallest z (nearest to viewer) is kept. Simple, hardware-accelerated, handles any scene complexity.
6
Back-face culling: object-space optimization. Polygons facing away from the viewer (normal vector pointing away β€” dot product with view vector < 0) are culled before rendering. Reduces about 50% of polygon processing for closed objects.
7
Painter's Algorithm: sorts polygons farthest to nearest and paints in that order. Simple but has issues: cannot handle cyclic overlaps or intersecting polygons. O(n log n) sorting overhead.
8
A-buffer Algorithm: extends Z-buffer to handle transparency and anti-aliasing. Each pixel stores a linked list of fragments at different depths. Handles semi-transparent surfaces correctly.
9
Ray Casting / Ray Tracing: casts rays from the eye through each pixel; finds the closest surface intersection. Ray tracing also bounces rays for reflections, refractions, and shadows. Physically accurate but computationally expensive.
10
BSP Tree (Binary Space Partitioning): recursively partitions 3D space into two half-spaces. Enables back-to-front ordering for any viewpoint once tree is built. Used in early 3D games (Doom, Quake).
6.4

Illumination Models and Surface Rendering

AItE0604
1
The Phong Illumination Model (local model) computes light at a surface as: I = I_ambient + I_diffuse + I_specular. This decomposition captures three distinct physical lighting phenomena.
2
Ambient Light: uniform, non-directional background light. Represents indirect light scattered from all directions. Formula: I_a = k_a Γ— I_ambient. Without ambient, shadowed surfaces would be completely black.
3
Diffuse Reflection (Lambertian): light scattered equally in all directions from a matte surface. Intensity depends on angle between surface normal (N) and light direction (L). Formula: I_d = k_d Γ— I_light Γ— (NΒ·L). NΒ·L = cosΞΈ (Lambert's cosine law).
4
Specular Reflection: mirror-like highlights on shiny surfaces. Depends on angle between reflection vector (R) and viewer (V). Phong: I_s = k_s Γ— I_light Γ— (RΒ·V)^n where n = shininess. Higher n = sharper, smaller highlights.
5
Flat (Constant) Shading: assigns ONE color per polygon using the face normal. Fastest but produces a faceted (boxy) appearance for curved surfaces β€” adjacent faces have abrupt color changes.
6
Gouraud Shading: computes lighting at each VERTEX, then interpolates color (intensity) across the polygon. Smooth appearance but may miss highlights that fall between vertices. Most common in real-time graphics.
7
Phong Shading: interpolates NORMALS across the polygon, then computes lighting per pixel. Best quality β€” captures highlights accurately. More expensive than Gouraud. Not to be confused with the Phong lighting model.
8
Comparison of shading: Flat (fastest, faceted) β†’ Gouraud (smooth colors, misses highlights) β†’ Phong (best quality, per-pixel lighting, slowest).
9
Color models: RGB (additive β€” monitors, emitting light), CMY/CMYK (subtractive β€” printing, absorbing light), HSV/HSL (hue-saturation-value, intuitive for artists), YCbCr (luminance + chrominance, used in video/JPEG).
10
Texture Mapping: applies a 2D image (texture) to a 3D surface. UV coordinates (0-1 range) map texture pixels (texels) to surface points. Types: surface texture, bump mapping (simulates bumps via normal perturbation), environment mapping.
6.5

Introduction to Multimedia

AItE0605
1
Multimedia integrates text, image, audio, video, and animation into a single application. Interactive multimedia adds user control. Applications: e-learning, entertainment, digital advertising, virtual reality.
2
Analog to Digital Conversion: two steps β€” Sampling (measuring signal at discrete time intervals; sampling rate must be β‰₯ 2Γ— maximum frequency β€” Nyquist theorem) and Quantization (assigning digital values to sample amplitudes; more bits = more levels, less noise).
3
Audio formats: WAV (uncompressed PCM, Windows standard, large files), MP3 (lossy compression, MPEG Layer 3, removes frequencies inaudible to humans), AAC (better than MP3 at same bitrate), MIDI (stores musical instructions, not audio β€” pitch, duration, velocity β€” tiny files).
4
Image formats: BMP (uncompressed raster, large), JPEG (lossy compression using DCT, best for photos, no transparency), PNG (lossless compression with transparency support, best for graphics/screenshots), GIF (lossless, max 256 colors, supports animation), SVG (vector, scalable).
5
Video formats: AVI (Audio Video Interleave, Microsoft), MP4/H.264 (current standard, high compression), MOV (Apple QuickTime). Video = sequence of frames at frame rate (fps). Standard: 24fps (film), 30fps (TV), 60fps (gaming).
6
Compression types: Lossy (removes data permanently β€” JPEG, MP3, MPEG β€” smaller files but quality loss) vs Lossless (perfectly reconstructible β€” PNG, GIF, FLAC, ZIP β€” no quality loss).
7
Animation principles: Keyframe animation (animator defines key poses; software tweens in-between frames), Procedural animation (algorithms generate motion), Motion capture (records real movement). FPS determines smoothness.
8
Multimedia authoring tools: Adobe Director, Flash (deprecated), HTML5/CSS3 (current web standard). Delivery: CD-ROM, internet, streaming.
9
Streaming delivers media continuously without full download first. Progressive download buffers content. Live streaming requires real-time encoding. Protocols: RTSP, HLS (HTTP Live Streaming), DASH.
10
Color depth in images: 1-bit (2 colors), 8-bit (256 colors β€” GIF), 16-bit (65,536 colors), 24-bit (16.7M β€” True Color β€” JPEG/PNG), 32-bit (True Color + alpha/transparency channel).
6.6

Data Compression, User Interfaces and Applications

AItE0606
1
Lossless Compression: original data perfectly recoverable after decompression. Algorithms: Huffman Coding, RLE (Run-Length Encoding), LZW (Lempel-Ziv-Welch), Deflate (ZIP/PNG). Used where exact data recovery is required.
2
Lossy Compression: permanently removes data β€” smaller files but cannot restore original. Algorithms: JPEG (DCT), MP3 (perceptual audio coding), MPEG (spatial + temporal redundancy). Trade-off: compression ratio vs quality.
3
Huffman Coding: assigns shorter bit codes to more frequent symbols and longer codes to rare ones. Builds a binary tree bottom-up (smallest frequencies first). Prefix-free codes β€” no code is a prefix of another. Optimal for symbol-by-symbol encoding.
4
Run-Length Encoding (RLE): compresses consecutive repeated values as (count, value) pairs. Example: AAAAABBB β†’ (5,A)(3,B). Effective for images with large uniform areas (BMP, fax, PCX). Ineffective for non-repeating data.
5
LZW (Lempel-Ziv-Welch): builds a dictionary of recurring patterns. Replaces repeated strings with shorter dictionary codes. Used in GIF, TIFF, PDF, ZIP. No prior knowledge of symbol frequencies needed.
6
DCT (Discrete Cosine Transform): used in JPEG and MPEG. Transforms spatial domain to frequency domain. High-frequency components (fine detail) are quantized heavily (discarded) β€” human vision is less sensitive to them. Basis of most lossy image/video compression.
7
MPEG Video Compression exploits both: Spatial redundancy (within a frame β€” using JPEG-like DCT) and Temporal redundancy (between frames β€” only encodes differences between consecutive frames). Frame types: I-frame (full), P-frame (predicted), B-frame (bi-directional).
8
User Interface (UI) design principles: Consistency (predictable behavior), Feedback (response to user actions), Affordance (UI elements suggest their use), Minimalism (reduce clutter), Accessibility (usable by all). Goal: maximize usability and minimize errors.
9
Human-Computer Interaction (HCI) studies how people interact with computers. Key metrics: Efficiency (task completion speed), Effectiveness (accuracy), Satisfaction (user experience). Evaluation methods: usability testing, heuristic evaluation.
10
Web design principles: responsive design (adapts to screen size), semantic HTML, performance optimization, accessibility (WCAG standards), SEO. CSS frameworks: Bootstrap, Tailwind. JavaScript frameworks: React, Angular, Vue.