Upload
nriaz469
View
60
Download
4
Tags:
Embed Size (px)
Citation preview
What is Graphics?
The collection of techniques used to take mathematical models and create images
Models are often 3D
Images are often 2D
What Math is Involved?Extensive linear algebra
Change of coordinate systems
Affine transformations
Homogeneous matrices
Geometry
Calculus
Discrete Mathematics
Mathematical Modeling
The Elements
Objects
Catalog of reusable models
Usually a represented as a polygonal mesh
The Scene
Camera
Computer Screen
Desirable Properties
Speed
A single frame can have more than a million pixels
Logical control of elements
Speed
Visual realism
Speed
Goal
Want to create a single matrix that:
Starts with points in a 3D object
Arranges them in a scene
Positions a camera in the scene
Projects a region of interest to 2D
Maps projected region of interest to the computer screen
Coordinate System Transforms
Start with points in object coordinates
Transform to world coordinates
Transform to camera coordinates
Project to 2D
Transform projected region of interest to screen coordinates
Coordinate Transformations
Coordinate systems transformations consist of three affine transformations
Rotation
Translation
Scaling
Shear is also affine
Used in one type of projection
RepresentationWe represent points in homogeneous coordinates
(x, y, z) -> (x, y, z, 1)
(x, y, z, 1) = (xw, yw, zw, w)
Vectors(x, y, z) -> (x, y, z, 0)
Distinguishing points and vectors is essential in graphics
Adding vectors is OK
Adding points isn’t
Translation
Homogeneous translations are multiplicative
1 0 0
0 1 0
0 0 1
1 0 0 0 1 1
x tx tx x
y ty ty y
z ty tz z
Perspective Matrix
x* = xN/z
y* = yN/z
z* = N (z/z)
0 0 0
0 0 0
0 0 0
0 0 1 0 1
xN N x
yN N y
zN N z
z