Mathematical Tools in Computer Graphics with C# Implementations by Hardy Alexandre, Willi-Hans Steeb, World Scientific Publishing Company, Incorporated, 2008 Table of Contents List of Figures Notation xvii xiii Vectors, Matrices and Transforms 1 Vector Spaces 1 Points and Vectors 4 Homogeneous Coordinates 4 Representing Objects by Points 5 Affine Transformations 5 Introduction and Definitions 5 Scaling 6 Translation 7 Rotation 7 Concatenation of Transforms 10 Projection 11 Quaternions 13 C# Implementation 15 Lighting 23 Shading 23 Affine Transforms and Normal Vectors 24 Local Lighting Models 25
The Phong Lighting Model 25 Emissive Properties 26 Ambient Reflection 26 Diffuse Reflection 26 Specular Reflection 27 Multiple Colored Light Sources 28 Attenuation 29 Lights 30 Spot Lights 30 Transparent Objects 31 Cook-Torrance Model 31 Bidirectional Reflectivity 31 Cook-Torrance Model 32 Microfacet Distribution Term 33 Geometric Surface Occlusion Term 33 Fresnel Term 37 Beer-Lambert Law 38 C# Implementation 39 Rasterization 49 Pixels 49 Drawing Lines 49 Bresenham's Algorithm for Lines 50 Drawing Circles 51 Bresenham's Algorithm for Circles 51 Filling 53 Gouraud Shading 54 Rasterization in C# 55 Drawing Pixels 57 Bresenham's Algorithms in C# 57 Fractals 59 Mandelbrot Set 60 Julia Set 62 Iterated Function Systems 64 L-Systems and Fractals 65 Kronecker Product and Fractals 69 Definitions 69 Kronecker Product Fractals 71 Curves 75 Introduction 75 Affine Invariance 76 Convex Hull 77 Lagrange Interpolation 78 C# Implementation 79
Bezier Curves 83 Affine Invariance 83 Convex Hull 84 Derivative at Edges 84 Piecewise Continuous Bezier Curves 86 Rendering 87 Rational Bezier Curves 91 Bezier Curves: Conic Sections 91 C# Implementation 91 Catmull-Rom Splines 92 Bessel-Overhauser Splines 93 Tension-Continuity-Bias Splines 93 Uniform B-Splines 94 Affine Invariance 98 Convex Hull 98 Cox-de Boor Formula 98 C# Implementation 99 Non-Uniform B-Splines 99 Interpolating with B-Splines 100 Periodic Interpolation 102 Non-Uniform Rational B-Splines 104 Trigonometric Interpolation 104 METAPOST and Bezier Curves 108
METAPOST Example 110 Curvature and Torsion 112 Harmonic Interpolation 117 Interpolation 118 Odd Case 120 Even Case 122 Examples 125 Curvature Plots 132 Numerical Stability 136 Affine Invariance 138 Convex Hull Property 141 C# Implementation of Harmonic Interpolation 141 Chebyshev Polynomials 142 Odd Case 143 Even Case 144 Non-Uniform Harmonic Interpolation 144 Wavelets 153 Introduction 153 One-Dimensional Wavelets 154 Two-Dimensional Wavelets 158 Curves 162 C# Implementation 164
Surfaces 167 Parametric Surfaces 167 Tensor Product Surfaces 168 Bezier Surfaces 169 Tensor Product Bezier Surfaces 170 Triangular Bezier Surfaces 171 Rational Bezier Surfaces 173 Bezier Surface Interpolation 173 B-Spline Tensor Product Surfaces 173 B-Spline Surface Interpolation 174 Subdivision Surfaces 177 Loop Subdivision 180 Modified Butterfly Subdivision 183 [radical]3 Subdivision 185 Interpolating [radical]3 Subdivision 187 Catmull-Clark Subdivision 191 Doo-Sabin Subdivision 192 Comparison 195 Interpolation with Subdivision Surfaces 198 Curvature of Surfaces 200 Harmonic Surfaces 206 Tensor Product Surface 206
Harmonic Subdivision 207 Local Harmonic Subdivision 208 Local Harmonic Interpolation for Curves 209 Parametric Distance 210 Subdivision Rules 212 Irregular Vertices 214 Boundaries 217 Geometry Images and Parameterization 219 Cutting a Mesh into a Disk 219 Parameterization 222 Rasterization of the Geometry Image 228 Interpolation of Geometry Images 229 Geometry Images - Approximation 237 Rendering 238 Approximating Basis Functions 240 Combined Results 243 Curvature 245 C# Implementation 257 Raytracing 333 Raytracing Process 333 Representation of a Ray 338 Reflection 338 Refraction 339 Intersections 341
Sphere 342 Infinite Plane 342 Triangles 343 Effect of Transforms 344 C# Implementation of a Raytracer 344 Implicit Surfaces 368 Sphere Tracing 369 Distance Functions 371 C# Implementation 374 CSG Objects 376 C# Implementation 377 Parametric Surfaces 379 Interval Arithmetic 380 Interval Root Finding - Bisection 381 Interval Root Finding - Newton-Raphson 382 Ray Tracing Harmonic Surfaces 385 Lighting Models 386 Supersampling 386 Regular Supersampling 387 Stochastic Supersampling 387 Adaptive Supersampling 388 Ambient Occlusion 389 Ray Marching 392 Photon Mapping 393 Transport Notation 394 Path Tracing 394 Creating the Photon Map 395 Photon Tracing 396 Photon Map Data Structure 397 Radiance Estimate 399 C# Implementation 401 Radiosity 409 Light Transport Notation 409 Radiosity Matrix 410 Solving for Radiosity Values 411 Solving: Jacobi Method 411 Solving: Gauss-Seidel Iteration 411 Solving: Shooting Method 412 Form Factors 412 Numerical Solution 413 Raytracing Method 413
Hemicube Method 413 Rendering 415 C# Implementation 415 Animation 427 Traditional Animation Techniques 427 Keyframing 427 Motion Capture 428 Physics Models 428 Animation of Position 429 Arc length parameterization 430 Orientation 430 Articulated Structures (Kinematics) 431 Forward Kinematics 432 Vertex Blending 433 Inverse Kinematics 433 Mass Spring Systems 434 Particle Systems 435 Free Form Deformations 435 Fluids 436 Navier-Stokes Equations 438 Advection 439 Diffusion 440 Projection 440 Boundary Conditions 441 C# Implementation 441 Free Surface 449 C# Implementation of Free Surfaces 450 Bibliography 459 Index 471