COMP 413 COMPUTER VISUALIZATION
3D viewing transformations are the mathematical processes that convert three-dimensional
objects into two-dimensional images displayed on a screen.
They form a core part of the computer graphics pipeline and are essential in:
Engineering design (CAD/CAM)
Scientific visualization
Simulation and animation
Virtual reality systems
The goal is to simulate how a virtual camera views a 3D scene.
1.2. Coordinate Systems in 3D Graphics
Multiple coordinate systems are used to systematically transform objects from their local
definition to final screen display.
a. Object (Model) Coordinates
Coordinates are defined relative to the object itself
Each object has its own local coordinate system
Example: a gear defined around its center
Used during object creation and modeling
b. World Coordinates
A global coordinate system
All objects are placed together in a single scene
Defines the spatial relationship between objects
Used to assemble complete scenes
c. View (Eye / Camera) Coordinates
Coordinates are expressed relative to the camera
Camera is usually placed at the origin looking down a specific axis
Orientation defined by:
o View reference point (VRP)
o View direction
o Up vector
Simulates the observer’s viewpoint
Page 1 of 44
d. Normalized Device Coordinates (NDC)
Coordinates normalized to a standard cube (typically −1 to +1)
Independent of device resolution
Ensures device-independent rendering
e. Screen (Device) Coordinates
Final pixel positions on the display
Dependent on screen resolution and viewport size
1.3. The 3D Viewing Transformation Pipeline
The pipeline applies transformations in a fixed sequence:
Object Coordinates
↓ (Modeling Transformation)
World Coordinates
↓ (Viewing Transformation)
View Coordinates
↓ (Projection Transformation)
Normalized Device Coordinates
↓ (Viewport Transformation)
Screen Coordinates
Each stage serves a specific purpose.
1.4. Modeling Transformation
Purpose
Position, orient, and scale objects within the world
Common Transformations
1. Translation – moves objects
2. Rotation – rotates objects
3. Scaling – resizes objects
Homogeneous Coordinates
Use 4×4 matrices
Enable combining transformations into a single matrix
Efficient and mathematically consistent
Page 2 of 44
1.5. Viewing Transformation (Camera Transformation)
The viewing transformation positions and orients the camera.
Key Components
Eye (camera) position
Look-at point (target)
Up direction
Viewing Coordinate Axes
n-axis → viewing direction
u-axis → right direction
v-axis → upward direction
Transforms world coordinates into camera coordinates
1.6. Projection Transformation
Projection transformation maps 3D view coordinates onto a 2D plane.
a. Parallel (Orthographic) Projection
Characteristics
Projection lines are parallel
No depth distortion
Object size remains constant regardless of distance
Types
Orthographic projection
Oblique projection
Applications
Engineering drawings
CAD systems
Architectural plans
Accurate measurements
Unrealistic appearance
b. Perspective Projection
Page 3 of 44
Characteristics
Projection lines converge at a center of projection
Distant objects appear smaller
Mimics human vision
Parameters
Field of view (FOV)
Aspect ratio
Near and far clipping planes
Applications
Scientific visualization
Simulation
Virtual reality
Realistic depth perception
Measurements distorted
1.7. View Volume and Clipping
View Volume
Defines the region of space visible to the camera.
Orthographic view volume → rectangular box
Perspective view volume → truncated pyramid (frustum)
Clipping
Removes objects or object parts outside the view volume
Improves efficiency
Prevents rendering artifacts
Performed before rasterization
1.8. Viewport Transformation
Purpose
Maps normalized coordinates to actual screen pixels.
Functions
Page 4 of 44
Scales NDC to viewport size
Translates coordinates to screen location
Final step before display
1.9. Order of Transformations (Critical Concept)
Matrix multiplication is not commutative.
Correct order:
1. Modeling
2. Viewing
3. Projection
4. Viewport
Wrong order leads to:
Incorrect object placement
Distorted views
Unrealistic rendering
1.10. Use of Homogeneous Coordinates
Why Homogeneous Coordinates?
Combine translation, rotation, scaling
Enable perspective projection
Support efficient matrix pipelines
4D Representation
(x,y,z)→(x,y,z,1)(x, y, z) \rightarrow (x, y, z, 1)(x,y,z)→(x,y,z,1)
1.11. Applications of 3D Viewing Transformations
Finite Element Analysis (FEA): viewing stress and strain
Computational Fluid Dynamics (CFD): flow visualization
Medical Imaging: CT/MRI reconstruction
Robotics: motion simulation
Virtual Reality: immersive environments
2. OBJECT HIERARCHY AND 3D GRAPHICS STANDARDS
Page 5 of 44
2.1. Introduction
Modern 3D graphics systems manage complex scenes composed of many objects.
To handle this complexity efficiently, two core ideas are used:
a. Object hierarchy – organizing objects in structured relationships
b. Graphics standards – standardized APIs and systems for rendering and interaction
These concepts are fundamental in:
Scientific visualization
CAD/CAM
Simulation and animation
Virtual and augmented reality
2.2. Object Hierarchy in 3D Graphics
Definition
An object hierarchy is a structured representation of a scene where objects are organized in
parent–child relationships.
Each object’s position, orientation, and scale are defined relative to its parent.
This hierarchical organization is often implemented using a scene graph.
Scene Graph Structure
A scene graph is a directed acyclic graph (often a tree) that represents:
Geometric objects
Transformations
Rendering attributes
Grouping information
Typical Nodes in a Scene Graph
Transformation nodes (translation, rotation, scaling)
Geometry nodes (meshes, curves, surfaces)
Group nodes (logical grouping)
Attribute nodes (color, material, texture)
Parent–Child Transformation Propagation
Transformations applied to a parent affect all its children
Page 6 of 44
Child objects maintain their local coordinate systems
Example:
A robotic arm:
Base → Shoulder → Elbow → Wrist
Rotating the shoulder automatically moves the elbow and wrist.
This makes animation and modeling intuitive and efficient.
Advantages of Object Hierarchy
Simplifies modeling of complex systems
Enables reuse of components
Efficient animation
Logical scene organization
Reduces redundancy
Applications of Object Hierarchy
Mechanical assemblies
Human and animal animation
Articulated structures
Engineering simulations
2.3. Retained Mode vs Immediate Mode Graphics
Graphics systems are often classified by how scene data is handled.
Immediate Mode
Commands are executed as they are issued
Application controls all rendering
Minimal storage by graphics system
Retained Mode
Graphics system stores scene description
Application modifies stored objects
Supports hierarchy naturally
2.4. 3D Graphics Standards
Graphics standards define how applications communicate with graphics hardware.
They ensure portability, efficiency, and consistency.
Page 7 of 44
2.5. OpenGL (GL)
Overview
OpenGL (Open Graphics Library) is a widely used, cross-platform graphics API.
Procedural, low-level API
Originally developed by Silicon Graphics
Supports 2D and 3D graphics
OpenGL Architecture
OpenGL follows a graphics pipeline:
a. Vertex specification
b. Transformation
c. Lighting and shading
d. Rasterization
e. Fragment processing
Characteristics of OpenGL
Immediate mode–based (historically)
Modern OpenGL uses programmable shaders
Supports:
o Transformations
o Texture mapping
o Lighting
o Depth buffering
Strengths of OpenGL
High performance
Hardware accelerated
Cross-platform
Widely supported
Limitations of OpenGL
No built-in scene graph
Application must manage hierarchy
Steep learning curve for advanced features
Applications of OpenGL
Scientific visualization
Page 8 of 44
Engineering simulations
CAD systems
Games and VR
2.6. PHIGS (Programmer’s Hierarchical Interactive Graphics System)
Overview
PHIGS is a retained-mode, hierarchical graphics standard designed to support complex
scenes.
Stores graphical objects in a structured database
Emphasizes object hierarchy
PHIGS Structure
Graphics are stored as structures
Structures can reference other structures
Enables hierarchical modeling
Key Features of PHIGS
Built-in hierarchy support
High-level primitives
Interactive input handling
Device independence
Advantages of PHIGS
Natural support for object hierarchy
Easier scene management
Suitable for complex engineering models
Limitations of PHIGS
Less flexible than OpenGL
Performance overhead
Largely obsolete in modern systems
2.7. Other 3D Graphics Standards and APIs
DirectX (Direct3D)
Microsoft’s graphics API
Optimized for Windows platforms
Strong support for games and real-time graphics
Page 9 of 44
Vulkan
Modern, low-level API
Explicit control over GPU resources
High performance and scalability
WebGL
JavaScript-based OpenGL ES binding
Enables 3D graphics in web browsers
Used for online visualization
Scene Graph Libraries
Built on top of graphics APIs:
OpenSceneGraph
Unity
Unreal Engine
2.8. Comparison of OpenGL and PHIGS
Feature OpenGL PHIGS
Mode Immediate Retained
Hierarchy Application-managed Built-in
Performance High Moderate
Flexibility High Limited
Usage Modern Historical
2.9 Object Hierarchy in Modern Graphics Systems
Modern systems combine:
Low-level APIs (OpenGL, Vulkan)
High-level scene graph frameworks
This provides:
Performance
Ease of modeling
Scalability
2.10. Engineering and Scientific Relevance
Page 10 of 44
Object hierarchy simplifies mechanical assemblies
Graphics standards ensure portability
Enables real-time analysis and visualization
3. Parametric Curves, Surfaces and Solid Modelling
3.1 Introduction to Parametric Modelling
Parametric modelling represents geometric entities using one or more independent parameters
rather than explicit functions.
This approach allows the modeling of complex shapes that cannot easily be described using
Cartesian equations.
Advantages of parametric representation:
Handles complex and free-form shapes
Independent of coordinate orientation
Suitable for animation and interpolation
Widely used in CAD and scientific visualization
3.2 Parametric Curves
A parametric curve in 3D space is defined as:
P(t)=(x(t),y(t),z(t)),t∈[t0,t1]P(t) = (x(t), y(t), z(t)), \quad t \in [t_0, t_1]P(t)=(x(t),y(t),z(t)),t∈[t0
,t1]
Where:
ttt is the parameter
x(t),y(t),z(t)x(t), y(t), z(t)x(t),y(t),z(t) are coordinate functions
3.2.1 Properties of Parametric Curves
Direction is determined by increasing parameter ttt
Curve continuity depends on the degree of the defining functions
Local and global control affect shape manipulation
3.2.2 Bezier Curves
Bezier curves are defined using a set of control points and Bernstein basis functions.
Mathematical Representation:
B(t)=∑i=0nPi⋅bi,n(t)B(t) = \sum_{i=0}^{n} P_i \cdot b_{i,n}(t)B(t)=i=0∑nPi⋅bi,n(t)
Page 11 of 44
Where:
PiP_iPi are control points
bi,n(t)b_{i,n}(t)bi,n(t) are Bernstein polynomials
Characteristics:
Passes through the first and last control points
Entire curve affected when any control point changes (global control)
Always lies within the convex hull of control points
Applications:
CAD systems
Font design
Computer animation paths
3.2.3 B-Spline Curves
B-Splines (Basis Splines) generalize Bezier curves.
Key Features:
Defined by control points and a knot vector
Piecewise polynomial
Local control over curve shape
Advantages over Bezier Curves:
Changing one control point affects only a local region
Suitable for complex models
Supports higher continuity
Applications:
Automotive and aerospace design
Surface fitting
Industrial CAD systems
3.2.4 Comparison: Bezier vs B-Spline Curves
Feature Bezier B-Spline
Control Global Local
Complexity Simple More complex
Flexibility Moderate High
Page 12 of 44
Feature Bezier B-Spline
Usage Small shapes Complex surfaces
3.3 Parametric Surfaces
Parametric surfaces extend parametric curves by using two parameters.
S(u,v)=(x(u,v),y(u,v),z(u,v))S(u,v) = (x(u,v), y(u,v), z(u,v))S(u,v)=(x(u,v),y(u,v),z(u,v))
Where:
u,vu, vu,v define the surface domain
3.3.1 Bezier Surfaces
Defined by a grid of control points
Constructed using tensor products of Bezier curves
Properties:
Smooth and continuous
Global control
Computationally expensive for large models
3.3.2 B-Spline Surfaces
Generalization of B-spline curves
Provide local surface control
More efficient for complex shapes
Applications:
Industrial design
Aircraft and automobile bodies
3.4 Solid Modelling
Solid modelling represents complete three-dimensional objects with well-defined interior and
exterior.
Importance:
Enables mass, volume, and structural analysis
Essential for manufacturing and simulation
3.4.1 Boundary Representation (B-Rep)
Page 13 of 44
Defines a solid using its bounding surfaces.
Components:
Vertices
Edges
Faces
Advantages:
Precise visualization
Suitable for rendering
Limitations:
Complex data structures
Topological consistency required
3.4.2 Constructive Solid Geometry (CSG)
Represents solids by combining primitive shapes using Boolean operations.
Operations:
Union
Intersection
Difference
Advantages:
Simple and intuitive
Easy modification
Limitations:
Less flexible for free-form shapes
3.4.3 Sweep Representations
Create solids by sweeping a 2D shape
Types:
o Translational sweep
o Rotational sweep
Used in:
Page 14 of 44
Mechanical part modeling
Pipe and shaft design
3.5 Applications of Parametric and Solid Modelling
CAD/CAM systems
Finite Element Analysis (FEA)
Computer animation
Industrial and product design
Scientific visualization
3.6 Engineering and Scientific Relevance
Parametric curves and surfaces provide:
Accuracy in modeling
Flexibility in design
Smooth representations of physical objects
Solid modelling enables:
Structural analysis
Manufacturing simulations
Real-world engineering validation
4. Visible Surface Determination
4.1 Introduction
Visible Surface Determination (VSD) is the process of identifying which surfaces or parts of
objects in a 3D scene are visible from a given viewpoint and which are hidden behind other
surfaces.
It is a fundamental problem in:
Computer graphics
Scientific visualization
CAD systems
Real-time rendering
Without visible surface determination, rendered scenes would appear confusing and unrealistic.
4.2 Importance of Visible Surface Determination
Enhances realism by removing hidden surfaces
Reduces rendering computation
Page 15 of 44
Improves performance in real-time systems
Essential for accurate scientific and engineering visualization
4.3 Classification of VSD Algorithms
Visible surface algorithms are broadly classified into:
1. Object-space methods
o Operate on geometric objects
o Compare surfaces directly
2. Image-space methods
o Operate on pixels on the screen
o Determine visibility per pixel
4.4 Object-Space Methods
4.4.1 Back-Face Culling
Concept:
Removes polygons facing away from the viewer
Based on polygon orientation
Technique:
Compute surface normal
If normal points away from viewer → discard polygon
Advantages:
Very fast
Reduces rendering workload
Limitations:
Only works for closed, convex objects
Does not handle occlusion between objects
4.4.2 Painter’s Algorithm
Concept:
Draw objects from farthest to nearest
Overwrite distant objects with nearer ones
Steps:
Page 16 of 44
1. Sort surfaces by depth
2. Render from back to front
Advantages:
Simple to implement
Useful for static scenes
Limitations:
Fails with intersecting or cyclic surfaces
Sorting overhead for complex scenes
4.5 Image-Space Methods
4.5.1 Z-Buffer (Depth Buffer) Algorithm
Concept:
Stores depth value for each pixel
Displays surface with smallest depth value
Steps:
1. Initialize Z-buffer with maximum depth
2. For each pixel:
o Compare current depth with stored depth
o Update if closer
Advantages:
Simple and robust
Handles complex scenes
Widely supported in hardware
Limitations:
Memory intensive
Precision issues (Z-fighting)
4.5.2 A-Buffer Algorithm
Concept:
Extension of Z-buffer
Handles transparency and anti-aliasing
Page 17 of 44
Features:
Stores multiple fragments per pixel
Maintains depth and opacity information
Applications:
High-quality rendering
Scientific visualization
4.5.3 Scan-Line Algorithm
Concept:
Processes one horizontal line of pixels at a time
Determines visible surfaces per scan line
Advantages:
Efficient for polygon rendering
Handles intersecting surfaces
Limitations:
Complex implementation
Less suitable for dynamic scenes
4.6 Comparison of VSD Algorithms
Algorithm Space Speed Complexity Hardware Support
Back-face culling Object Very high Low Yes
Painter’s Object Medium Low No
Z-buffer Image High Medium Yes
A-buffer Image Medium High Limited
Scan-line Image Medium High Rare
4.7 Depth Precision and Z-Fighting
Z-Fighting:
Occurs when two surfaces have nearly identical depth values.
Causes:
Page 18 of 44
Limited depth buffer precision
Poor near/far plane settings
Solutions:
Adjust near and far clipping planes
Increase depth buffer precision
Use depth bias
4.8 Engineering and Scientific Applications
Visible surface determination is used in:
Finite element analysis visualization
Computational fluid dynamics
Medical imaging
CAD model rendering
Virtual reality systems
5. Colour Models and Shading
5.1 Introduction
Colour models and shading techniques are essential in computer visualization for creating
realistic, meaningful, and interpretable images.
Colour models define how colours are represented mathematically, while shading determines
how light interacts with surfaces to produce visual effects such as depth, texture, and realism.
5.2 Fundamentals of Colour Perception
Human colour perception is based on:
Hue – the type of colour (red, green, blue, etc.)
Saturation – purity or intensity of the colour
Brightness (Luminance) – perceived lightness or darkness
Computer systems approximate human vision using numerical colour models.
5.3 Colour Models
A colour model is a mathematical representation of colours as tuples of numbers.
5.3.1 RGB Colour Model
Page 19 of 44
Description:
Based on Red, Green, and Blue primary colours
Additive colour model
Used in monitors, cameras, and projectors
Representation:
(R,G,B),0≤R,G,B≤1 or 0–255(R, G, B), \quad 0 \le R,G,B \le 1 \text{ or } 0–
255(R,G,B),0≤R,G,B≤1 or 0–255
Characteristics:
Black = (0,0,0)
White = (1,1,1)
Colours formed by mixing intensities
Advantages:
Simple and hardware-friendly
Widely used in graphics APIs (OpenGL, DirectX)
Limitations:
Not perceptually uniform
Poor for colour-based analysis
5.3.2 CMY and CMYK Colour Models
Description:
Cyan, Magenta, Yellow
Subtractive colour model
Used in printing
CMYK:
Adds Black (K) to improve depth and ink efficiency
Applications:
Hardcopy visualization
Scientific publishing
5.3.3 HSV / HSL Colour Models
Page 20 of 44
Description:
Based on human perception
Components:
o Hue
o Saturation
o Value (or Lightness)
Advantages:
Intuitive colour selection
Useful in user interfaces and visualization tools
Applications:
Medical imaging
Data visualization colour mapping
5.3.4 CIE Colour Models (CIE XYZ, CIELAB)
Description:
Defined by the Commission Internationale de l'Éclairage
Device-independent models
Features:
Based on human visual experiments
Perceptually uniform (especially CIELAB)
Applications:
Colour calibration
Scientific visualization
Accurate colour comparison
5.4 Colour Mapping in Visualization
Colour mapping assigns data values to colours.
Types:
Scalar colour mapping (temperature, pressure)
Pseudo-colour mapping
False colour representation
Page 21 of 44
Importance:
Enhances data interpretation
Reveals patterns and anomalies
5.5 Shading Fundamentals
5.5.1 Shading
Shading is the process of computing the colour of a surface point based on:
Light sources
Surface properties
Viewing position
Purpose:
Create depth
Show curvature
Enhance realism
5.6 Illumination Models
5.6.1 Ambient Lighting
Represents indirect background light
Prevents completely dark areas
Iambient=kaIaI_{ambient} = k_a I_aIambient=kaIa
5.6.2 Diffuse Reflection (Lambert’s Law)
Light scattered equally in all directions
Depends on angle between light and surface normal
Idiffuse=kdILcosθI_{diffuse} = k_d I_L \cos \thetaIdiffuse=kdILcosθ
5.6.3 Specular Reflection
Produces shiny highlights
Depends on viewer position
Ispecular=ksIL(cosα)nI_{specular} = k_s I_L (\cos \alpha)^nIspecular=ksIL(cosα)n
Page 22 of 44
5.6.4 Phong Illumination Model
Combines all components:
I=Iambient+Idiffuse+IspecularI = I_{ambient} + I_{diffuse} + I_{specular}I=Iambient+Idiffuse
+Ispecular
Widely used due to balance between realism and efficiency.
5.7 Shading Techniques
5.7.1 Flat Shading
One colour per polygon
Normal computed once per face
Advantages:
Fast
Simple
Disadvantages:
Faceted appearance
5.7.2 Gouraud Shading
Normals computed at vertices
Colours interpolated across polygon
Advantages:
Smooth appearance
Efficient
Disadvantages:
Misses specular highlights
5.7.3 Phong Shading
Normals interpolated per pixel
Illumination computed per pixel
Advantages:
Page 23 of 44
High realism
Accurate highlights
Disadvantages:
Computationally expensive
5.8 Shading in OpenGL
Fixed-function pipeline (legacy):
o glShadeModel(GL_FLAT / GL_SMOOTH)
Modern OpenGL:
o Shading implemented using GLSL shaders
o Vertex shaders and fragment shaders
5.9 Engineering and Scientific Applications
Stress and strain visualization
Heat distribution mapping
Medical imaging (CT, MRI)
Fluid flow visualization
Terrain and geological modelling
5.10 Common Challenges
Colour banding
Poor contrast
Misleading colour scales
Colour blindness considerations
Solutions:
Use perceptually uniform colour maps
Avoid rainbow colour maps
Apply gamma correction
6. Texture Mapping and Imaging
6.1 Introduction
Texture mapping and imaging are techniques used to enhance the visual richness and realism of
3D models by applying 2D images (textures) onto the surfaces of 3D objects.
Instead of increasing geometric complexity, textures provide visual detail such as colour
variation, patterns, surface roughness, and material properties.
6.2 Concept of Texture Mapping
Page 24 of 44
6.2.1 Definition
Texture mapping is the process of:
Mapping a 2D image (texture) onto a 3D surface using texture coordinates.
It was first introduced by Edwin Catmull (1974) and is now a standard feature in all modern
graphics systems.
6.2.2 Why Texture Mapping is Important
Adds surface detail without increasing polygon count
Improves realism
Reduces computational cost
Essential in real-time rendering and visualization
6.3 Texture Coordinates
6.3.1 UV Mapping
Texture space uses coordinates (u, v)
Independent of object space (x, y, z)
Mapping process:
(x,y,z)→(u,v)(x, y, z) \rightarrow (u, v)(x,y,z)→(u,v)
Common mapping techniques:
Planar mapping
Cylindrical mapping
Spherical mapping
Automatic (unwrap) mapping
6.3.2 Texture Resolution and Texels
Texel: texture element (analogous to pixel)
High-resolution textures provide more detail
Low-resolution textures may cause blurring
6.4 Types of Texture Mapping
6.4.1 Image (Colour) Texture Mapping
Uses RGB images
Modulates surface colour
Page 25 of 44
Most common form
6.4.2 Procedural Texture Mapping
Textures generated mathematically
Examples: marble, wood, noise
Advantages:
Infinite resolution
Low memory usage
6.4.3 Bump Mapping
Simulates surface roughness
Alters surface normals
Does not modify geometry
6.4.4 Normal Mapping
Extension of bump mapping
Stores normals in texture
Produces realistic lighting effects
6.4.5 Displacement Mapping
Actually modifies surface geometry
Requires high tessellation
Used in high-quality rendering
6.5 Texture Filtering Techniques
Texture filtering improves image quality when textures are scaled.
6.5.1 Nearest-Neighbor Filtering
Chooses closest texel
Fast but blocky appearance
6.5.2 Bilinear Filtering
Interpolates four surrounding texels
Smoother results
6.5.3 Trilinear Filtering
Page 26 of 44
Uses mipmaps
Smooth transitions between texture levels
6.6 Mipmapping
6.6.1 Concept
Mipmapping stores multiple pre-filtered versions of a texture at different resolutions.
Benefits:
Reduces aliasing
Improves performance
6.6.2 Level of Detail (LOD)
Selects appropriate mipmap level based on distance
Critical for real-time visualization
6.7 Texture Mapping in OpenGL
6.7.1 Texture Pipeline Overview
Steps:
1. Load texture image
2. Generate texture object
3. Assign texture coordinates
4. Apply texture in fragment shader
Key OpenGL concepts:
GL_TEXTURE_2D
Texture samplers
GLSL fragment shaders
6.7.2 Texture Compositing
Combining multiple textures
Techniques:
o Modulation
o Decaling
o Blending
Applications:
Page 27 of 44
Terrain visualization
Multi-layer materials
6.8 Imaging in Computer Visualization
6.8.1 Image Acquisition
Sources:
Digital cameras
Medical scanners (CT, MRI)
Satellites
Scientific sensors
7. Ray Tracing and Radiosity
7.1 Introduction
Ray tracing and radiosity are global illumination techniques used in computer visualization to
simulate realistic light behavior in 3D scenes.
Unlike local illumination models (e.g., Phong), these methods account for light interactions
between objects, producing effects such as reflections, refractions, and soft shadows.
7.2 Ray Tracing
7.2.1 Basic Concept
Ray tracing simulates the physical behavior of light by tracing the path of rays:
From the viewer (eye) into the scene
Through pixels on the image plane
Interacting with objects via reflection, refraction, and absorption
7.2.2 Ray Tracing Process
1. Cast a primary ray from the eye through each pixel
2. Find the nearest object intersection
3. Compute local illumination at the intersection
4. Generate secondary rays:
o Reflection ray
o Refraction ray
o Shadow ray
5. Accumulate colour contributions recursively
7.2.3 Recursive Ray Tracing
Page 28 of 44
Recursive ray tracing allows rays to spawn new rays at each surface interaction.
I=Ilocal+krIreflected+ktIrefractedI = I_{local} + k_r I_{reflected} + k_t I_{refracted}I=Ilocal
+krIreflected+ktIrefracted
Where:
krk_rkr = reflection coefficient
ktk_tkt = transmission coefficient
7.2.4 Ray–Object Intersection
Ray Equation:
R(t)=O+tDR(t) = O + tDR(t)=O+tD
Where:
OOO = ray origin
DDD = direction vector
t>0t > 0t>0
Ray–Sphere Intersection (Example)
Solve:
∣O+tD−C∣2=r2|O + tD - C|^2 = r^2∣O+tD−C∣2=r2
Where:
CCC = sphere center
rrr = radius
Results:
No solution → no intersection
One solution → tangent
Two solutions → entry and exit points
7.2.5 Advantages of Ray Tracing
Produces highly realistic images
Accurately models reflections and refractions
Handles complex lighting scenarios
7.2.6 Limitations of Ray Tracing
Page 29 of 44
Computationally expensive
Not ideal for real-time rendering (without acceleration)
High memory and processing requirements
7.2.7 Acceleration Techniques
Bounding volume hierarchies (BVH)
Spatial subdivision (octrees, KD-trees)
Parallel processing (GPU ray tracing)
7.3 Radiosity
7.3.1 Basic Concept
Radiosity is a global illumination technique focused on:
Diffuse inter-reflection of light
Energy exchange between surfaces
It is view-independent and based on energy conservation.
7.3.2 Radiosity Assumptions
All surfaces are perfectly diffuse (Lambertian)
Light energy is uniformly distributed
Scene is subdivided into small patches
7.3.3 Radiosity Equation
Bi=Ei+ρi∑j=1nBjFjiB_i = E_i + \rho_i \sum_{j=1}^{n} B_j F_{ji}Bi=Ei+ρij=1∑nBjFji
Where:
BiB_iBi = radiosity of patch iii
EiE_iEi = emitted energy
ρi\rho_iρi = reflectivity
FjiF_{ji}Fji = form factor
7.3.4 Form Factors
Form factors represent the fraction of energy transferred from one patch to another.
Properties:
Reciprocity
Conservation of energy
Page 30 of 44
Geometric dependence
7.3.5 Radiosity Algorithm Steps
1. Subdivide scene into patches
2. Compute form factors
3. Solve system of linear equations
4. Assign colour intensity to patches
5. Render from any viewpoint
7.3.6 Advantages of Radiosity
Produces soft shadows
Accurate diffuse lighting
View-independent lighting solution
7.3.7 Limitations of Radiosity
Very computationally expensive
Poor handling of specular reflection
Requires heavy preprocessing
7.4 Comparison: Ray Tracing vs Radiosity
Feature Ray Tracing Radiosity
Light behavior Specular & diffuse Diffuse only
View dependency View-dependent View-independent
Shadows Sharp Soft
Reflections Accurate Poor
Real-time use Limited Rare
7.5 Hybrid Techniques
Modern rendering systems combine both methods:
Radiosity for diffuse lighting
Ray tracing for reflections and refractions
Examples:
Photon mapping
Path tracing
7.6 Engineering and Scientific Applications
Architectural lighting simulation
Page 31 of 44
Optical system analysis
Medical visualization
Scientific simulations
Film and animation production
8. Advanced Animation Techniques
8.1 Introduction
Advanced animation techniques are used to create complex, realistic, and expressive motion in
computer graphics.
Unlike basic keyframe animation, advanced techniques simulate physical laws, biological
motion, and intelligent behavior, making them essential in engineering visualization, scientific
simulations, films, games, and virtual environments.
8.2 Keyframe Animation Revisited
8.2.1 Limitations of Basic Keyframing
Requires manual specification of motion
Poor handling of complex dynamics
Time-consuming for realistic animation
Advanced techniques overcome these limitations.
8.3 Interpolation Techniques
8.3.1 Linear Interpolation
Simple straight-line motion
Produces unnatural movement
8.3.2 Spline-Based Interpolation
Uses smooth curves for motion control.
Types:
Bézier curves
B-splines
Catmull–Rom splines
Advantages:
Smooth motion
Continuous velocity and acceleration
Page 32 of 44
8.4 Procedural Animation
8.4.1 Concept
Procedural animation generates motion using algorithms instead of explicit keyframes.
Examples:
Wave motion
Particle motion
Crowd movement
Advantages:
Compact representation
Reusable motion logic
Suitable for natural phenomena
8.5 Physically Based Animation
8.5.1 Rigid Body Dynamics
Simulates motion using Newton’s laws:
F=maF = maF=ma
Applications:
Mechanical simulations
Engineering analysis
Collision response
8.5.2 Particle Systems
Models objects as collections of particles.
Characteristics:
Each particle has position, velocity, lifetime
Motion governed by forces
Applications:
Smoke
Fire
Fluids
Page 33 of 44
Explosions
8.5.3 Soft Body Animation
Simulates deformable objects:
Cloth
Rubber
Biological tissues
Methods:
Mass–spring systems
Finite element methods (FEM)
8.6 Inverse Kinematics (IK)
8.6.1 Definition
Inverse kinematics computes joint angles to achieve a desired end-effector position.
Used in:
Character animation
Robotics
Human motion simulation
Advantages:
Natural joint movement
Easier motion control
8.7 Motion Capture (MoCap)
8.7.1 Overview
Motion capture records real human or object motion and maps it to digital characters.
Types:
Optical
Magnetic
Inertial
Advantages:
Page 34 of 44
High realism
Accurate human motion
Challenges:
Noise and cleanup
High cost
8.8 Behavioral and Crowd Animation
8.8.1 Behavioral Models
Rule-based animation
Autonomous agents
Examples:
Flocking behavior (Boids model)
Pedestrian simulation
8.8.2 Crowd Simulation
Used in:
Urban planning
Evacuation studies
Films and games
Techniques:
Agent-based models
Pathfinding algorithms
8.9 Facial Animation Techniques
8.9.1 Blend Shapes (Morph Targets)
Interpolate between facial expressions
Used for emotion and speech animation
8.9.2 Muscle-Based Models
Anatomically accurate
Used in high-end simulations
8.10 Animation in Scientific and Engineering Visualization
Page 35 of 44
Applications:
Molecular dynamics
Fluid flow visualization
Structural deformation
Medical simulations
8.11 Optimization and Real-Time Animation
Level of detail (LOD)
Motion blending
GPU acceleration
Parallel processing
8.12 Challenges in Advanced Animation
Computational complexity
Stability in physical simulations
Balancing realism and performance
9. Virtual Reality Issues and VRML
9.1 Introduction to Virtual Reality (VR)
Virtual Reality (VR) creates immersive 3D environments where users can interact with
simulated worlds.
VR applications include engineering simulations, medical training, scientific visualization, and
gaming.
Key Components of VR:
Head-Mounted Display (HMD)
Input devices (gloves, controllers, trackers)
Real-time rendering engines
Audio and haptic feedback
9.2 VR Issues and Challenges
1. Latency
o Delay between user action and system response
o Causes motion sickness if too high (>20 ms)
2. Tracking Accuracy
o Head, hand, and body tracking must be precise
o Errors reduce immersion
3. Real-Time Rendering
o High frame rates (90–120 FPS) are required for smooth experience
Page 36 of 44
o Complex scenes may require optimization
4. Field of View (FOV)
o Limited FOV reduces realism
5. User Comfort
o Avoiding visual fatigue and motion sickness
o Ergonomic design of HMDs and controllers
6. Interaction
o Natural manipulation of objects
o Gesture and voice recognition
9.3 VRML (Virtual Reality Modeling Language)
9.3.1 Overview
VRML is a standard for describing 3D interactive scenes for the web.
It uses text-based files (.wrl) to define geometry, appearance, and navigation.
9.3.2 Key Features
Defines 3D objects (Shape, IndexedFaceSet, Extrusion)
Supports viewpoint, lighting, and animation
Supports interaction (navigation, event handling)
Extensible to X3D (modern replacement)
9.3.3 Example VRML Structure
#VRML V2.0 utf8
Transform {
translation 0 0 0
children [
Shape {
geometry Box { size 1 1 1 }
appearance Appearance {
material Material { diffuseColor 1 0 0 }
}
}
]
}
9.3.4 Applications
Web-based 3D visualizations
Architectural walkthroughs
Educational simulations
Medical training
Page 37 of 44
9.4 Diagram: VR System Components
+----------------+
| Head-Mounted |
| Display |
+----------------+
|
v
+----------------+
| Rendering & |
| Graphics Engine|
+----------------+
|
v
+----------------+
| User Input & |
| Tracking |
+----------------+
|
v
+----------------+
| Haptic & Audio |
| Feedback |
+----------------+
10. Advanced Raster Algorithms and Modelling Techniques
10.1 Raster Graphics Overview
Represents images as a grid of pixels (raster)
Basis for texture mapping, ray tracing, and display rendering
10.2 Advanced Raster Techniques
1. Scan-Line Algorithms
o Efficiently renders polygons line by line
o Reduces pixel-by-pixel computation
2. Anti-Aliasing
o Reduces jagged edges
o Techniques: supersampling, multisampling
3. Z-Buffer Optimization
o Hierarchical Z-buffer
o Early depth testing
4. Marching Squares Algorithm
o Contour extraction in 2D scalar fields
o Forms isolines for visualization
Page 38 of 44
o Used in medical imaging, terrain maps
Diagram: Marching Squares Cases
+---+ +---+ +---+
| 1 | | 1 | | 0 |
| | => | | => | |
+---+ +---+ +---+
Each cell examined to create isoline segments
10.3 Modelling Techniques
Parametric Surfaces and Curves
o Bézier and B-Spline curves
o Smooth freeform shapes
Solid Modelling
o Constructive Solid Geometry (CSG)
o Boundary representation (B-Rep)
Procedural Modelling
o Algorithmic generation of geometry
o Example: trees, terrains
11. Texture Mapping, Compositing, Textures in OpenGL
11.1 Texture Mapping
Maps 2D images onto 3D surfaces
Uses UV coordinates
Techniques: planar, cylindrical, spherical
11.2 Texture Compositing
Combining multiple textures
Blending modes: additive, multiplicative, decal
Applications:
Terrain rendering
Multi-layer materials
11.3 Textures in OpenGL
Load texture image (glTexImage2D)
Bind texture object (glBindTexture)
Assign UV coordinates to vertices
Page 39 of 44
Use shaders for advanced effects (GLSL)
Diagram: OpenGL Texture Pipeline
Texture Image ---> Texture Unit ---> Fragment Shader --->
Framebuffer
12. Ray Tracing Advanced Topics
12.1 Recursive Ray Tracer
Supports reflections and refractions recursively
Formula:
I=Ilocal+krIreflected+ktIrefractedI = I_{local} + k_r I_{reflected} + k_t I_{refracted}I=Ilocal
+krIreflected+ktIrefracted
12.2 Ray–Sphere Intersection
Equation of sphere:
∣O+tD−C∣2=r2|O + tD - C|^2 = r^2∣O+tD−C∣2=r2
Solve quadratic for t to find intersections
12.3 Advantages
High realism
Accurate shadows, reflection, refraction
13. Parametric Curves and Surfaces (Review)
13.1 Bézier Curves and Surfaces
Defined by control points
Smooth and intuitive for designers
13.2 B-Splines
Local control
Piecewise polynomial
Widely used in CAD/CAM
14. Visualization and Interpolation
14.1 Visualization Techniques
Page 40 of 44
2D plots
3D surface rendering
Isosurfaces using marching squares/cubes
14.2 Interpolation Methods
Linear, spline-based
Used for animation, surface reconstruction, and data smoothing
15. Marching Squares Algorithm
15.1 Concept
Generates contours for scalar fields
Works on a cell-by-cell basis
Each cell has 16 possible configurations
15.2 Applications
Medical imaging (CT/MRI slices)
Terrain mapping
Fluid visualization
15.3 Diagram: Marching Squares Example
Cell Values: Resulting Line:
(1 0 ─)
0 1
Each configuration produces a segment; combine for contours
9. Virtual Reality (VR) Issues and VRML
Definition: VR creates immersive 3D environments for interaction and visualization.
Components: HMD, input devices, real-time rendering, audio & haptic feedback.
VR Issues:
Latency → causes motion sickness
Tracking accuracy → affects immersion
Real-time rendering → high FPS required
FOV limitations → reduces realism
User comfort → fatigue & motion sickness
Interaction → natural manipulation
Page 41 of 44
VRML (Virtual Reality Modeling Language):
Text-based 3D scene definition for the web
Supports geometry, lighting, viewpoint, interaction
Example:
Transform {
translation 0 0 0
children [Shape { geometry Box { size 1 1 1 } }]
}
Applications: Web 3D, architectural walkthroughs, medical simulations
Diagram – VR System Components:
Head-Mounted Display
|
Rendering Engine
|
User Input & Tracking
|
Haptic & Audio Feedback
10. Advanced Raster Algorithms and Modelling Techniques
Raster Graphics: Images as a grid of pixels; basis for texture mapping and rendering.
Advanced Techniques:
Scan-line rendering → efficient per line
Anti-aliasing → reduces jagged edges (supersampling, multisampling)
Z-buffer optimization → hierarchical Z, early depth testing
Marching Squares → contour extraction in 2D scalar fields
Diagram – Marching Squares Concept:
Cell Values: Result:
1 0 ─
0 1
Modelling Techniques:
Parametric curves/surfaces (Bézier, B-spline)
Solid modeling: CSG, B-Rep
Procedural modeling: algorithmic geometry generation
Page 42 of 44
11. Texture Mapping, Compositing, Textures in OpenGL
Texture Mapping: 2D image → 3D surface using UV coordinates
Mapping types: planar, cylindrical, spherical
Texture Compositing: Combining multiple textures (blend, decal, additive)
OpenGL Pipeline:
Texture Image → Texture Unit → Fragment Shader → Framebuffer
Applications: Terrain rendering, multi-layer materials, scientific visualization
12. Ray Tracing – Advanced Topics
Concept: Simulate light paths for realistic images (reflection, refraction, shadows)
Recursive Ray Tracer:
I=Ilocal+krIreflected+ktIrefractedI = I_{local} + k_r I_{reflected} + k_t I_{refracted}I=Ilocal
+krIreflected+ktIrefracted
Ray-Sphere Intersection: Solve
∣O+tD−C∣2=r2|O + tD - C|^2 = r^2∣O+tD−C∣2=r2
Advantages: Realism, shadows, reflections
Limitations: Expensive computationally; uses acceleration techniques (BVH, KD-trees, GPU)
13. Parametric Curves and Surfaces
Bézier Curves/Surfaces:
Defined by control points, smooth, easy to manipulate
B-Splines:
Piecewise polynomial, local control, CAD/CAM applications
Applications: Freeform modeling, animation paths, surface design
14. Visualization and Interpolation
Visualization:
Page 43 of 44
2D plots, 3D surfaces, isosurfaces
Interpolation Methods:
Linear, spline-based
Used for animation, surface reconstruction, data smoothing
Diagram – Spline Interpolation Example:
Control Points: • • • •
Spline Curve: ────◦────◦────
15. Marching Squares Algorithm
Concept:
Generates contours in scalar fields cell-by-cell
16 possible configurations per cell
Applications:
Medical imaging (CT/MRI slices)
Terrain mapping
Fluid visualization
Diagram – Marching Squares Example:
Cell:
1 0
0 1
→ Draw line connecting midpoints
Page 44 of 44