Honours Graphics 2008 Session 2
Today’s focus Vectors, matrices and associated math Transformations and concatenation 3D space
Vector and matrix 3D representation typically requires at least a 3- component representation for vertices and matrices:
Homogenous vectors and matrices …but in practise the use of 4 component homogenous vectors and matrices is common Allows affine transformations using only matrix multiplication (translation, scaling, rotation, etc)
Vector math Treated as 3-component vectors (ignore last component)
Vector math, dot product Definition Property
Vector math, cross product Definition Property
Transformations Rotations
Transformations Translation Scaling
Concatenation Transformations can be concatenated Apply from right to left Not commutative!
Coordinate spaces Typically all objects are defined in their own object coordinate space World coordinate space relates the various objects with each other by transforming each object as appropriate:
Coordinate spaces, cont. Camera space is similar to world space, but relative to the camera – defines what can be seen through the camera’s field of view Screen space (or homogenous coordinate representation of the screen) describes what is seen through projection of the camera space onto the visible plane
Homework Create “Hello World”-equivalents for 3D graphics, one program each for: drawing individual pixels, rendering a triangle, rendering a rotating cube For tomorrow