| |
| |
Preface | |
| |
| |
| |
Introduction to Computer Graphics | |
| |
| |
| |
What is Computer Graphics? | |
| |
| |
| |
Where Computer Generated Pictures are Used | |
| |
| |
| |
Art, Entertainment, and Publishing | |
| |
| |
| |
Computer Graphics and Image Processing | |
| |
| |
| |
Monitoring a Process | |
| |
| |
| |
Displaying Simulations | |
| |
| |
| |
Computer-aided Design | |
| |
| |
| |
Scientific Analysis and Visualization | |
| |
| |
| |
Elements of Pictures created in Computer Graphics | |
| |
| |
| |
Polylines | |
| |
| |
| |
Text | |
| |
| |
| |
Filled Regions | |
| |
| |
| |
Raster Images | |
| |
| |
| |
Representation of Gray Shades and Color for Raster Graphics | |
| |
| |
| |
Graphics Display Devices | |
| |
| |
| |
Line Drawing Displays | |
| |
| |
| |
Raster Displays | |
| |
| |
| |
Indexed Color and the LUT | |
| |
| |
| |
Other Raster Display Devices | |
| |
| |
| |
Hard Copy Raster Devices | |
| |
| |
| |
Graphics Input Primitives and Devices | |
| |
| |
| |
Types of Input Graphics Primitives | |
| |
| |
| |
Types of Physical Input Devices | |
| |
| |
| |
Summary | |
| |
| |
| |
Further Reading | |
| |
| |
| |
Getting Started Drawing Figures | |
| |
| |
| |
Getting Started Making Pictures | |
| |
| |
| |
Device-independent Programming, and OpenGL | |
| |
| |
| |
Windows-based Programming | |
| |
| |
| |
Opening a Window for Drawing | |
| |
| |
| |
Drawing Basic Graphics Primitives | |
| |
| |
| |
Examples of Drawing Dot Constellations | |
| |
| |
| |
Making Line Drawings | |
| |
| |
| |
Drawing Polylines and Polygons | |
| |
| |
| |
Line Drawing using moveto() and lineto() | |
| |
| |
| |
Drawing Aligned Rectangles | |
| |
| |
| |
Aspect Ratio of an Aligned Rectangle | |
| |
| |
| |
Filling Polygons | |
| |
| |
| |
Other Graphics Primitives in OpenGL | |
| |
| |
| |
Simple Interaction with the Mouse and Keyboard | |
| |
| |
| |
Mouse Interaction | |
| |
| |
| |
Keyboard Interaction | |
| |
| |
| |
More Drawing Tools | |
| |
| |
| |
Introduction | |
| |
| |
| |
World Windows and Viewports | |
| |
| |
| |
The Mapping from the Window to the Viewport | |
| |
| |
| |
Setting the Window and Viewport Automatically | |
| |
| |
| |
Clipping Lines | |
| |
| |
| |
Clipping a Line | |
| |
| |
| |
The Cohen-Sutherland Clipping Algorithm | |
| |
| |
| |
Developing the Canvas Class | |
| |
| |
| |
Some useful Supporting Classes | |
| |
| |
| |
Declaration of Class Canvas | |
| |
| |
| |
Implementation of Class Canvas | |
| |
| |
| |
Relative Drawing | |
| |
| |
| |
Developing moveRel() and lineRel() | |
| |
| |
| |
TurtleGraphics | |
| |
| |
| |
Figures Based on Regular Polygons | |
| |
| |
| |
The Regular Polygons | |
| |
| |
| |
Variations on n-Gons | |
| |
| |
| |
Drawing Circles and Arcs | |
| |
| |
| |
Drawing arcs | |
| |
| |
| |
Using the Parametric Form of a Curve | |
| |
| |
| |
Parametric Forms for Curves | |
| |
| |
| |
Drawing Curves Represented Parametrically | |
| |
| |
| |
Superellipses | |
| |
| |
| |
Polar Coordinate Shapes | |
| |
| |
| |
3D Curves | |
| |
| |
| |
Vector Tools for Graphics | |
| |
| |
| |
Introduction | |
| |
| |
| |
Review of Vectors | |
| |
| |
| |
Operations with Vectors | |
| |
| |
| |
Linear Combinations of Vectors | |
| |
| |
| |
The Magnitude of a Vector, and Unit Vectors | |
| |
| |
| |
The Dot Product | |
| |
| |
| |
Properties of the Dot Product | |
| |
| |
| |
The Angle Between two Vectors | |
| |
| |
| |
The Sign of b-c; Perpendicularity | |
| |
| |
| |
The 2D "Perp" Vector | |
| |
| |
| |
Orthogonal Projections, and the Distance from a Point to a Line | |
| |
| |
| |
Applications of Projection: Reflections | |
| |
| |
| |
The Cross Product of Two Vectors | |
| |
| |
| |
Geometric Interpretation of the Cross Product | |
| |
| |
| |
Finding the Normal to a Plane | |
| |
| |
| |
Representations of Key Geometric Objects | |
| |
| |
| |
Coordinate Systems and Coordinate Frames | |
| |
| |
| |
Affine Combinations of Points | |
| |
| |
| |
Linear Interpolation of Two Points | |
| |
| |
| |
"Tweening" for Art and Animation | |
| |
| |
| |
Preview: Quadratic and Cubic Tweening, and Bezier Curves | |
| |
| |
| |
Representing Lines and Planes | |
| |
| |
| |
Finding the Intersection of Two Line Segments | |
| |
| |
| |
Application of Line Intersections: the Circle Through Three Points | |
| |
| |
| |
Intersections of Lines with Planes, and Clipping | |
| |
| |
| |
Polygon Intersection Problems | |
| |
| |
| |
Working with Convex Polygons and Polyhedra | |
| |
| |
| |
Ray Intersections and Clipping for Convex Polygons | |
| |
| |
| |
The Cyrus-Beck Clipping Algorithm | |
| |
| |
| |
Clipping against Arbitrary Polygons | |
| |
| |
| |
More Advanced Clipping | |
| |
| |
| |
Transformations of Objects | |
| |
| |
| |
Introduction | |
| |
| |
| |
Introduction to Transformations | |
| |
| |
| |
Transforming Points and Objects | |
| |
| |
| |
The Affine Transformations | |
| |
| |
| |
Geometric Effects of elementary 2D Affine Transformations | |
| |
| |
| |
The Inverse of an Affine Transformation | |
| |
| |
| |
Composing Affine Transformations | |
| |
| |
| |
Examples of Composing 2D Transformations | |
| |
| |
| |
Some Useful Properties of Affine Transformations | |
| |
| |
| |
3D Affine Transformations | |
| |
| |
| |
The Elementary 3D Transformations | |
| |
| |
| |
Composing 3D Affine Transformations | |
| |
| |
| |
Combining Rotations | |
| |
| |
| |
Summary of Properties of 3D Affine Transformations | |
| |
| |
| |
Changing Coordinate Systems | |
| |
| |
| |
Using Affine Transformations in a Program | |
| |
| |
| |
Saving the CT for Later Use | |
| |
| |
| |
Drawing 3D Scenes with OpenGL | |
| |
| |
| |
An Overview of the Viewing Process and the Graphics Pipeline | |
| |
| |
| |
Some OpenGL tools for Modeling and Viewing | |
| |
| |
| |
Drawing Elementary Shapes Provided by OpenGL | |
| |
| |
| |
Reading a Scene Description from a File | |
| |
| |
| |
Modeling Shapes with Polygonal Meshes | |
| |
| |
| |
Introduction | |
| |
| |
| |
Introduction to Solid Modeling with Polygonal Meshes | |
| |
| |
| |
Defining a Polygonal Mesh | |
| |
| |
| |
Finding the Normal Vectors | |
| |
| |
| |
Properties of Meshes | |
| |
| |
| |
Mesh Models for Nonsolid Objects | |
| |
| |
| |
Working with Meshes in a Program | |
| |
| |
| |
Polyhedra | |
| |
| |
| |
Prisms and Antiprisms | |
| |
| |
| |
The Platonic Solids | |
| |
| |
| |
Other Interesting Polyhedra | |
| |
| |
| |
Extruded Shapes | |
| |
| |
| |
Creating Prisms | |
| |
| |
| |
Arrays of Extruded Prisms: "Bricklaying" | |
| |
| |
| |
Extrusions with a "Twist" | |
| |
| |
| |
Building Segmented Extrusions: Tubes and Snakes | |
| |
| |
| |
"Discretely" Swept Surfaces of Revolution | |
| |
| |
| |
Mesh Approximations to Smooth Objects | |
| |
| |
| |
Representations for Surfaces | |
| |
| |
| |
The Normal Vector to a Surface | |
| |
| |
| |
The Effect of an Affine Transformation | |
| |
| |
| |
Three "Generic" Shapes: the Sphere, Cylinder, and Cone | |
| |
| |
| |
Forming a Polygonal Mesh for a Curved Surface | |
| |
| |
| |
Ruled Surfaces | |
| |
| |
| |
Surfaces of Revolution | |
| |
| |
| |
The Quadric Surfaces | |
| |
| |
| |
The Superquadrics | |
| |
| |
| |
Tubes Based on 3D Curves | |
| |
| |
| |
Surfaces Based on Explicit Functions of Two Variables | |
| |
| |
| |
Three-Dimensional Viewing | |
| |
| |
| |
Introduction | |
| |
| |
| |
The Camera Revisited | |
| |
| |
| |
Setting the View Volume | |
| |
| |
| |
Positioning and Pointing the Camera | |
| |
| |
| |
Building a Camera in a Program | |
| |
| |
| |
"Flying" the Camera | |
| |
| |
| |
Perspective Projections of 3D Objects | |
| |
| |
| |
Perspective Projection of a Point | |
| |
| |
| |
Perspective Projection of a Line | |
| |
| |
| |
Incorporating Perspective in the Graphics Pipeline | |
| |
| |
| |
Producing Stereo Views | |
| |
| |
| |
Taxonomy of Projections | |
| |
| |
| |
One-, Two-, and Three-Point Perspective | |
| |
| |
| |
Types of Parallel Projections | |
| |
| |
| |
Rendering Faces for Visual Realism | |
| |
| |
| |
Introduction | |
| |
| |
| |
Introduction to Shading Models | |
| |
| |
| |
Geometric Ingredients for Finding Reflected Light | |
| |
| |
| |
Computing the Diffuse Component | |
| |
| |
| |
Specular Reflection | |
| |
| |
| |
The Role of Ambient Light | |
| |
| |
| |
Combining Light Contributions | |
| |
| |
| |
Adding Color | |
| |
| |
| |
Shading and the Graphics Pipeline | |
| |
| |
| |
Using Light Sources in OpenGL | |
| |
| |
| |
Working with Material Properties in OpenGL | |
| |
| |
| |
Shading of Scenes Specified by SDL | |
| |
| |
| |
Flat Shading and Smooth Shading | |
| |
| |
| |
Flat Shading | |
| |
| |
| |
Smooth Shading | |
| |
| |
| |
Removing Hidden Surfaces | |
| |
| |
| |
The Depth Buffer Approach | |
| |
| |
| |
Adding Texture to Faces | |
| |
| |
| |
Pasting the Texture onto a Flat Surface | |
| |
| |
| |
Rendering the Texture | |
| |
| |
| |
What Does a Texture Modulate? | |
| |
| |
| |
A Texture Example Using OpenGL | |
| |
| |
| |
Wrapping Texture on Curved Surfaces | |
| |
| |
| |
Reflection Mapping | |
| |
| |
| |
Adding Shadows of Objects | |
| |
| |
| |
Shadows as Texture | |
| |
| |
| |
Creating Shadows with the Use of a Shadow Buffer | |
| |
| |
| |
Approaches to Infinity | |
| |
| |
| |
Introduction | |
| |
| |
| |
Fractals and Self-Similarity | |
| |
| |
| |
Successive Refinement of Curves | |
| |
| |
| |
Drawing Koch Curves and Snowflakes | |
| |
| |
| |
Fractional Dimension | |
| |
| |
| |
String Production and Peano Curves | |
| |
| |
| |
Producing Recursively and Drawing in a Program | |
| |
| |
| |
Allowing Branching | |
| |
| |
| |
Tiling the Plane | |
| |
| |
| |
Monohedral Tilings | |
| |
| |
| |
Dihedral Tilings | |
| |
| |
| |
Drawing Tilings | |
| |
| |
| |
Reptiles | |
| |
| |
| |
Creating an Image by Means of Iterated Functions Systems | |
| |
| |
| |
An Experimental Copier | |
| |
| |
| |
Some Underlying theory of the Copying Process | |
| |
| |
| |
Drawing the k-th Iterate | |
| |
| |
| |
The Chaos Game | |
| |
| |
| |
Finding the IFS, Fractal Image Compression | |
| |
| |
| |
The Mandelbrot Set | |
| |
| |
| |
Mandelbrot Sets and Iterated Functions Systems | |
| |
| |
| |
Defining the Mandelbrot Set | |
| |
| |
| |
Computing whether the point c is in the Mandelbrot Set | |
| |
| |
| |
Drawing the Mandelbrot Set | |
| |
| |
| |
Some Notes on the Mandelbrot Set | |
| |
| |
| |
Julia Sets | |
| |
| |
| |
The Filled-in Julia Set K[subscript c] | |
| |
| |
| |
Drawing Filled-in Julia Sets | |
| |
| |
| |
Some Notes on Fixed points and Basins of Attraction | |
| |
| |
| |
The Julia Set J[subscript c] | |
| |
| |
| |
Random Fractals | |
| |
| |
| |
Fractalizing a Segment | |
| |
| |
| |
Controlling the Spectral Density of the Fractal Curve | |
| |
| |
| |
Tools for Raster Displays | |
| |
| |
| |
Introduction | |
| |
| |
| |
Manipulating Pixmaps | |
| |
| |
| |
Operations of Interest for Pixmaps | |
| |
| |
| |
Useful Data Types for Pixmaps | |
| |
| |
| |
Scaling and Rotating Images | |
| |
| |
| |
Combining Pixmaps | |
| |
| |
| |
The Read-Modify-Write Cycle | |
| |
| |
| |
The Alpha Channel and Image Blending | |
| |
| |
| |
Logical Combinations of Pixmaps | |
| |
| |
| |
The BitBlt operation | |
| |
| |
| |
Do-It-Yourself Line Drawing: Bresenham's Algorithm | |
| |
| |
| |
Bresenham's Line-Drawing Algorithm | |
| |
| |
| |
Defining and Filling Regions of Pixels | |
| |
| |
| |
Defining Regions | |
| |
| |
| |
Pixel-Defined Regions | |
| |
| |
| |
A Recursive Flood-Fill Algorithm | |
| |
| |
| |
Filling Regions with Patterns | |
| |
| |
| |
Using Coherence: Region Filling Based on Runs of Pixels | |
| |
| |
| |
Manipulating Symbolically Defined Reigions | |
| |
| |
| |
Rectangle-defined Regions | |
| |
| |
| |
Path-defined Regions | |
| |
| |
| |
Filling Polygon-Defined Regions | |
| |
| |
| |
Which Pixels on an Edge Belong to a Polygon? | |
| |
| |
| |
Improving the Algorithm's Performance | |
| |
| |
| |
Aliasing; Antialiasing Techniques | |
| |
| |
| |
Antialiasing Techniques | |
| |
| |
| |
Antialiasing of Texture | |
| |
| |
| |
Antialiasing Using OpenGL | |
| |
| |
| |
Creating More Shades and Colors | |
| |
| |
| |
Ordered Dither | |
| |
| |
| |
Error Diffusion | |
| |
| |
| |
Curve and Surface Design | |
| |
| |
| |
Introduction | |
| |
| |
| |
Parametric Curves as Trajectories | |
| |
| |
| |
Smoothness of Motion | |
| |
| |
| |
Describing Curves by Means of Polynomials | |
| |
| |
| |
On Interactive Curve Design | |
| |
| |
| |
Bezier Curves for Curve Design | |
| |
| |
| |
The de Casteljau Algorithm | |
| |
| |
| |
Properties of Bezier Curves | |
| |
| |
| |
Finding Better Blending Functions | |
| |
| |
| |
The Problem of Local Control | |
| |
| |
| |
Wish List for a Set of Blending Functions | |
| |
| |
| |
Piecewise Polynomial Curves and Splines | |
| |
| |
| |
Building a set of Blending Functions Out of g(t) | |
| |
| |
| |
Spline Curves and Basis Functions | |
| |
| |
| |
The B-Spline Basis Functions | |
| |
| |
| |
Definition of B-Spline Functions | |
| |
| |
| |
Using Multiple Knots in the Knot Vector | |
| |
| |
| |
Open B-Spline Curves: Standard Knot Vector | |
| |
| |
| |
Useful Properties of B-Spline Curves for Design | |
| |
| |
| |
Using Multiple Control Points | |
| |
| |
| |
Rational Splines and NURBS Curves | |
| |
| |
| |
A Glimpse at Interpolation | |
| |
| |
| |
Interpolation Using Piecewise Cubic Polynomials | |
| |
| |
| |
Hermite Interpolation | |
| |
| |
| |
The Natural Cubic Spline | |
| |
| |
| |
Computing the Slopes in Cubic Interpolation | |
| |
| |
| |
Specifying the Tangent Vectors Interactively | |
| |
| |
| |
Modeling Curved Surfaces | |
| |
| |
| |
Ruled Surfaces Based on B-Splines | |
| |
| |
| |
Surfaces of Revolution Based on B-Splines | |
| |
| |
| |
Bezier Surface Patches | |
| |
| |
| |
Patching Together Bezier Patches | |
| |
| |
| |
B-Spline Patches | |
| |
| |
| |
NURBS Surfaces | |
| |
| |
| |
Color Theory | |
| |
| |
| |
Introduction | |
| |
| |
| |
Describing Colors | |
| |
| |
| |
Dominant Wavelength | |
| |
| |
| |
Color Matching | |
| |
| |
| |
The International Commission on Illumination Standard | |
| |
| |
| |
Constructing the CIE Chart | |
| |
| |
| |
Using the CIE Chromaticity Diagram | |
| |
| |
| |
Color Gamuts | |
| |
| |
| |
Color Spaces | |
| |
| |
| |
The RGB and CMY Color Spaces | |
| |
| |
| |
Additive and Subtractive Color Systems | |
| |
| |
| |
The HLS Color Model | |
| |
| |
| |
Color Quantization | |
| |
| |
| |
Uniform Quantization | |
| |
| |
| |
The Popularity Algorithm | |
| |
| |
| |
The Median-cut Algorithm | |
| |
| |
| |
Octree Quantization | |
| |
| |
| |
Hidden Surface Removal | |
| |
| |
| |
Introduction | |
| |
| |
| |
Object Precision versus Image Precision Approaches | |
| |
| |
| |
Description of the Polygon Mesh Data | |
| |
| |
| |
The Depth Buffer Algorithm Revisited | |
| |
| |
| |
List Priority HSR Methods | |
| |
| |
| |
The Heedless Painter's Algorithm | |
| |
| |
| |
HSR Using Binary Space Partition Trees | |
| |
| |
| |
The Depth Sort Algorithm | |
| |
| |
| |
A Scan-Line HSR Method | |
| |
| |
| |
Area Subdivision Approaches | |
| |
| |
| |
Quadrant Subdivision | |
| |
| |
| |
Other Definitions of a Simple Region | |
| |
| |
| |
On Hidden Line Removal Methods | |
| |
| |
| |
The Geometric Testing in edgeTest() | |
| |
| |
| |
HSR Methods for Curved Surfaces | |
| |
| |
| |
Ray Tracing | |
| |
| |
| |
Introduction | |
| |
| |
| |
Setting Up the Geometry of Ray Tracing | |
| |
| |
| |
Overview of the Ray-Tracing Process | |
| |
| |
| |
Intersection of a Ray with an Object | |
| |
| |
| |
Intersection of a Ray with a Generic Plane | |
| |
| |
| |
Intersection with a Generic Sphere | |
| |
| |
| |
Intersection of the Ray with Transformed Objects | |
| |
| |
| |
Organizing a Ray Tracer Application | |
| |
| |
| |
A Routine to Compute Ray-Sphere Intersections | |
| |
| |
| |
A Complete Ray Tracer for Emissive-Sphere Scenes | |
| |
| |
| |
Intersecting Rays with Other Primitives | |
| |
| |
| |
Intersecting with a Square | |
| |
| |
| |
Intersecting with a Tapered Cylinder | |
| |
| |
| |
Intersecting with a Cube (or any Convex Polyhedron) | |
| |
| |
| |
Adding More Primitives | |
| |
| |
| |
Drawing Shaded Pictures of Scenes | |
| |
| |
| |
Finding the Normal at the Hit Spot | |
| |
| |
| |
Coloring Objects According to their Surface Materials | |
| |
| |
| |
Physically-based Shading Models: Cook-Torrance Shading | |
| |
| |
| |
Adding Surface Texture | |
| |
| |
| |
Solid Texture | |
| |
| |
| |
Pasting Images onto Surfaces | |
| |
| |
| |
Antialiasing Ray Tracings | |
| |
| |
| |
Using Extents | |
| |
| |
| |
Box and Sphere Extents | |
| |
| |
| |
Using Projection Extents | |
| |
| |
| |
Adding Shadows for Greater Realism | |
| |
| |
| |
Reflections and Transparency | |
| |
| |
| |
The Refraction of Light | |
| |
| |
| |
Dealing with Refraction in shade() | |
| |
| |
| |
Compound Objects: Boolean Operations on Objects | |
| |
| |
| |
Ray Tracing CSG Objects | |
| |
| |
| |
Data Structure for Boolean Objects | |
| |
| |
| |
Intersecting Rays with Boolean Objects | |
| |
| |
| |
Building and Using Extents for CSG Objects | |
| |
| |
Appendixes | |
| |
| |
| |
Graphics Tools - Obtaining OpenGL | |
| |
| |
| |
Obtaining and Installing OpenGL | |
| |
| |
| |
Some Mathematics for Computer Graphics | |
| |
| |
| |
Some Key Definitions for Matrices and their Operations | |
| |
| |
| |
Some Properties of Vectors and their Operations | |
| |
| |
| |
The Arithmetic of Complex Numbers | |
| |
| |
| |
Spherical Coordinates and Direction Cosines | |
| |
| |
| |
Some Useful Classes and Utility Routines | |
| |
| |
Classes for 2D Graphis | |
| |
| |
RGBPixmap Class | |
| |
| |
The Scene and Supporting Classes | |
| |
| |
Noise Class | |
| |
| |
Some Classes that are Useful for Ray Tracing | |
| |
| |
| |
An Introduction to PostScript | |
| |
| |
| |
About the PostScript Language | |
| |
| |
| |
Graphics Operators in PostScript | |
| |
| |
| |
Drawing Text in PostScript | |
| |
| |
| |
Defining New Variables and Procedures | |
| |
| |
| |
Decisions and Iterations | |
| |
| |
| |
Printing Values | |
| |
| |
| |
Drawing Gray-scale Image | |
| |
| |
| |
An Introduction to SDL | |
| |
| |
| |
Syntax of SDL | |
| |
| |
| |
Macros in SDL | |
| |
| |
| |
Extending SDL | |
| |
| |
References | |
| |
| |
Index | |