COMPUTER GRAPHICS

USING OPEN GL SECOND EDITION

F. S. HILL, JR.

2.3.5 Filling Polygons

OpenGL supports filling general polygons with a pattern or color. The restriction is the the polygons must be convex.
DEFINITION: Convex polygon: A polygon is convex if a line connecting any two points of the polygon lies entirely within it.

CHAPTER 4: Vector Tools for Graphics

4.2
  REVIEW OF VECTORS

4.2.1 Operation with Vectors

4.2.2 Linear Combinations of Vectors

4.2.3 The Magnitude of a Vector; Unit Vectors

4.3
  THE DOT PRODUCT

4.3.2 The Angle Between Two Vectors

4.3.3 The Sign of b • c, and Perpendicularity

4.3.4 The 2D "Perp" Vector

4.3.5 Orthoganal Projections and the Distance from a Point to a Line

4.4
  THE CROSS PRODUCT OF TWO VECTORS

4.5.1 Coordinate Systems and Coordinate Frames

4.5.2 Affine Combinations of Points

4.5.3 Linear Interpolation of Two Points

The affine combination of points   P = A( 1 - t ) + tB    performs a linear interpolation between points A and B. The x, y, or z-component Pcomponent(t) provides a value that is fraction t of the way between A and B. This is a sufficently important enough operation to warrant a name, lerp, and a simple implementation: This leads to "tweening" or in-between points.

4.5.4 "Tweening" for Art and Animation

4.5.6 Representing Lines and Planes

4.6
  FINDING THE INTERSECTION OF TWO LINE SEGMENTS

4.6.1 The Circle through Three Points

4.7
  INTERSECTIONS OF LINES WITH PLANES; CLIPPING

A2.1.2 Multiplying Two Matrices

CHAPTER 5: Transformations of Objects

5.2.3 Geometric Effects of Elementary 2D Affine Transformations

5.2.4 The Inverse of an Affine Transformation

5.2.5 Composing Affine Transformations

5.2.6 Examples of Composing 2D Transformations

5.2.7 Some Useful Properties of Affine Transformations

5.3
  3D AFFINE TRANSFORMATIONS

P = γ + Pxi + Pyj + Pzk = (Px )
Py
Pz
1

5.3.1 The Elementary 3D Transformations

5.3.3 Combining Rotations

5.3.4 Summary of Properties of 3D Affine Transformations

5.4
  CHANGING COORDINATE SYSTEMS

5.5
  USING AFFINE TRANSFORMATIONS IN A PROGRAM

5.5.1 Saving the CT for Later Use

5.6
  DRAWING 3D SCENES WITH OPENGL

5.6.1 An Overview of the Viewing Process and the Graphics Pipeline.

5.6.2 Some OpenGL Tools for Modeling and Viewing

5.6.3 Drawing Elementary Shapes Provided by OpenGL

6.2.2 Finding the Normal Vectors

The normal of the face is the cross product of all the vectors, or for graphics, a more efficient way is to use Newell's method:
N-1
mx = Σ (yi - ynext(i))(zi + znext(i))
i=0
N-1
my = Σ (zi - znext(i))(xi + xnext(i))
i=0
N-1
mz = Σ (xi - xnext(i))(yi + ynext(i))
i=0
where next(j) = (j+1) mod N. This allows the wrap around from the last vertex to the first ( [0] ).

6.4.4 Building Segmented Extrusions: Tubes and Snakes

6.4.5 "Discretely" Swept Surfaces of Revolution

    If we employ pure rotations for the affine transformations and place all spine points at the origin, we are circularly sweeping a shape about an axis. This is called a surface of revolution.
    Here we show a profile and the resulting swept surface that approximates a martini glass.

6.5
  MESH APPROXIMATIONS TO SMOOTH OBJECTS

6.5.2 The Normal Vector to a Surface

6.5.7 Surfaces of Revolutions

CHAPTER 7: Three-Dimensional Viewing

7.2
  THE CAMERA REVISITED

7.2.1 Setting the View Volume

7.2.2 Positioning and Pointing the Camera

7.3
  BUILDING A CAMERA IN A PROGRAM

In order to have fine control over camera movements, we create and manipulate our own camera in a program, we create a Camera class.