Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
Goals Coordinate-free representation of objects Homogeneous coordinates Distinction of an object from its representation
Scalars, Points, and Vectors Geometric View Mathematical View –Vector –Affine Spaces Computer-Science View Other issues –Geometric ADTs –Lines –Affine Sums –Convexity –Dot and Cross Products –Planes
Geometric View Point: a location in space Scalar: real number Vector: directed line segment Directed Line Segment That Connects Points
Identical Vectors
Combination of Directed Line Segments
A Dangerous Representation of a Vector
Mathematical View Vector space: vectors and scalars Operations –Scalar-vector multiplication –Vector-vector addition Affine space: vector space + point –Vector-point addition (or point-point subtraction) Euclidean space: affine space + measure of size or distance
Point-Point Subtraction
Computer-Science View Scalars, points, and vectors as abstract data types (ADTs) ADT –Object-oriented –Data and operations Object declarations vector u,v; point p,q; scalar a,b; q = p + a * v;
Use of the Head-to-Tail Axiom - - -
Lines The sum of a point and a vector (or subtraction of two points) leads to the notion of a line in an affine space.
Line in an Affine Space
Affine Operations In an affine space, scalar-vector multiplication vector-vector addition are defined. However, point-point addition and scalar-point multiplication are not. Affine addition has certain elements of the above two latter operations.
Affine Addition
Convexity A convex object is one for which any point lying on the line segment connecting any two points in the object is also in the object. Line segment that connects two points
Convex Hull Geometrically, a convex hull is the set of points that we form by stretching a tight fitting surface over the given set of points – shrink wrapping the points.
Dot Product and Projection u
Cross Product Right-handed coordinate system
Formation of a Plane Normal vector:
Three-Dimensional Primitives Three features characterize three-dimensional objects that fit well with existing graphics hardware and software: –Objects described by surfaces and hollow – 2D primitives modeling 3D primitives; –Objects can be specified through vertices – efficient implementation; –The objects either are composed of or can be approximated by flat convex polygons.
Primitives in Three Dimensions
Vector Derived From Three Basis Vectors w
Coordinate Systems
Changes of Coordinate Systems
Changes of Coordinate Systems (2)
Rotation and Scaling of a Basis The changes in basis leave the origin unchanged. We can use them to represent rotation and scaling of a set of basis vectors to derive another basis set.
Translation of a Basis However, a simple translation of the origin, or change of frame cannot be represented in this way. Homogeneous coordinates.
Example of Change of Representation
Homogeneous Coordinates Represent frame change (translation) Avoid point vs. vector confusion
Example of Change in Frames
Example (continued)
Camera and World Frames In OpenGL, the model-view matrix positions the world frame relative to the camera frame.
One Frame of Cube Animation Tasks: Modeling (8 vertices, 12 edges) Converting to the camera frame Clipping Projecting Removing hidden surfaces Rasterizing
Traversal of the Edges of a Polygon Counterclockwise: (0,3,2,1) (3,2,1,0) (2,1,0,3) (1,0,3,2) Outward facing
Vertex-List Representation of a Cube
Bilinear Interpolation
Projection of Polygon A polygon is first projected onto the two-dimensional plane and then filled with colors.
Scan-Line Interpolation OpenGL Approach
Transformation
Translation
Two-Dimensional Rotation
Rotation About a Fixed Point
Three-Dimensional Rotation
Non-Rigid Body Transformation
Uniform and Non-uniform Scaling
Effect of Scale Factor
Reflection
Shear
Computation of the Shear Matrix X’, y’
Application of Pipeline Transformation
Rotation of a Cube About Its Center
Rotation of a Cube About Its Center – Sequence of Transformation –
Rotation of a Cube About the z Axis
Rotation of a Cube About y Axis
Rotation of a Cube About The x Axis
Scene of Simple Objects Instance transformation Instead of defining each object and its size, position, orientation, we define the object types and create each instance with its size, position, orientation.
Instance Transformation
Rotation of a Cube About an Arbitrary Axis
Movement of The Fixed Point to Origin
Sequence of Rotations
Direction Angles
Computation of the x Rotation
Computation of the y Rotation
Current Transformation Matrix (CTM)
Model-View and Projection Matrices CTM: current transformation matrix
Symmetric Orientation of Cube Start with a cube centered at the origin and aligned with the coordinate axes. Find a rotation matrix that will orient the cube symmetrically, as shown here.