Computer graphics topics are algorithmic and diagram-heavy. PSC questions may ask raster scan, DDA/Bresenham line algorithm, circle drawing, 2D transformations, homogeneous coordinates, clipping, viewing pipeline, projection and rendering concepts.
Engineering Definitions
Raster graphics
Standard definition: Image representation as a grid of pixels.
Exam meaning: Image लाई pixels grid मा represent गर्ने method।
Transformation
Standard definition: A geometric operation that changes position, orientation, size or coordinate frame of an object.
Exam meaning: Object को position, rotation, scale वा coordinate बदल्ने operation।
Projection
Standard definition: Mapping 3D points onto a 2D viewing plane.
Exam meaning: 3D world लाई 2D screen/view plane मा map गर्ने process।
Rendering
Standard definition: The process of generating an image from scene geometry, materials, light and camera.
Exam meaning: Scene data बाट final image बनाउने process।
Concept Teaching
Graphics pipeline converts mathematical objects into pixels. Modeling defines objects, transformations place them, viewing and projection map them to screen, clipping removes invisible parts, rasterization fills pixels, and rendering/shading makes the image visually meaningful.
Raster Algorithms
Raster algorithms decide which pixels approximate ideal geometry.
- DDA line algorithm uses incremental slope calculation.
- Bresenham line algorithm uses integer decision parameter.
- Midpoint circle algorithm uses symmetry and decision parameter.
- Scan conversion turns geometric primitives into pixels.
- Aliasing creates jagged edges; anti-aliasing reduces visual artifacts.
2D and 3D Transformations
Transformations are usually represented by matrices.
| Transform | Effect | Key parameter |
|---|---|---|
| Translation | Moves object | tx, ty, tz |
| Scaling | Changes size | sx, sy, sz |
| Rotation | Changes orientation | angle and axis/center |
| Reflection | Mirror image | Axis/plane |
| Shear | Slants object | Shear factor |
Viewing, Clipping and Projection
Viewing pipeline maps world coordinates to display.
- Window selects world-coordinate region.
- Viewport selects screen region.
- Clipping removes primitives outside window/view volume.
- Orthographic projection preserves parallel lines.
- Perspective projection creates depth realism with convergence.
- Hidden surface removal decides visible surfaces.
Rendering and Shading
Rendering models light-object-camera interaction.
- Ambient, diffuse and specular components model lighting.
- Flat shading uses one normal per polygon.
- Gouraud shading interpolates vertex intensities.
- Phong shading interpolates normals for smoother highlights.
- Z-buffer stores nearest depth per pixel.
- Ray tracing simulates rays for reflection/shadow realism.
Engineering Mechanism
- Define object geometry.
- Apply modeling transformation.
- Transform to viewing coordinates.
- Clip against window/view volume.
- Project to 2D screen.
- Rasterize primitives into pixels.
- Shade/render using light/material/depth.
Diagrams / Models To Draw
- Draw graphics pipeline.
- Draw DDA/Bresenham line pixel selection.
- Draw 2D transformation matrix flow.
- Draw window-to-viewport mapping.
- Draw perspective vs orthographic projection.
- Draw Z-buffer concept.
Formulas, Algorithms and Rules
- 2D translation matrix uses homogeneous coordinates.
- Rotation: x'=x cos theta – y sin theta; y'=x sin theta + y cos theta.
- Scaling: x'=sx x, y'=sy y.
- Window-to-viewport mapping is linear scaling and translation.
- Perspective projection makes farther objects appear smaller.
| Concept | Purpose | Exam trap |
|---|---|---|
| DDA | Line rasterization | Floating/incremental |
| Bresenham | Line rasterization | Integer decision |
| Clipping | Remove invisible parts | Before rasterization |
| Orthographic | Parallel projection | No perspective depth |
| Perspective | Realistic depth | Parallel lines may converge |
| Z-buffer | Hidden surface removal | Stores depth |
Exam Point
- Bresenham is integer-based and efficient.
- Use homogeneous coordinates for combined transformations.
- Differentiate window and viewport.
- Orthographic and perspective projections differ by depth effect.
- Z-buffer solves visibility per pixel.
Worked Example
A square can be scaled, rotated and translated by multiplying its vertex coordinate vectors with transformation matrices. Order matters: rotate then translate gives a different final position than translate then rotate.
Subjective Answer Pattern
- Define raster graphics.
- Explain raster line/circle algorithms.
- Describe transformations and homogeneous coordinates.
- Explain viewing/clipping/projection.
- Discuss rendering/shading and hidden surface removal.
Common Engineering Mistakes
- Ignoring transformation order.
- Confusing clipping with cropping after rendering.
- Saying orthographic gives realistic perspective depth.
- Forgetting homogeneous coordinates for translation matrix.
- Mixing Gouraud and Phong shading.
MCQ Revision
- Which line algorithm uses integer decision parameter?
- What is viewport?
- Which projection has vanishing point?
- What does Z-buffer store?
- What is anti-aliasing?
- Which shading interpolates normals?
Final Summary
- Graphics pipeline turns geometry into pixels.
- Raster algorithms approximate primitives.
- Transformations position objects.
- Projection maps 3D to 2D.
- Rendering adds lighting, shading and visibility.