linear SO... we will want to represent the geometr of points in space we will often want to perform (rigid) transformations to these objects to position them translate rotate or move them in an animation time varing tform position or move virtual camera we also ma use non-rigid tforms to specif shape scale an object squash a sphere into an ellipsoid. so we must understand how to manipulate 3d coordinates and transforms we must pa attention to order of tforms we must pa attention to the role of the coordinate sstem w.r.t. which we perform a tform we will look at linear and affine transformations at end of the da, our code will have vertices with 3d coords and we will use 4 b 4 matrices to describe properl manipulate them but to figure out what to code, we need to first do some thinking/paper-pencil work. Geometric data tpes we describe a point using a coordinate vector specifies position wrt an agreed upon coordinate sstem three agreed directions agreed origin if we change agreed upon c.s., we must change the coordinate vector so a point is specified with a coordinate sstem and a coordinate vector 4 geometric data tpes point: p represents place vector: v represents motion/offset between points coordinate vector: c coordinate sstem s t basis for vectors frame is for points 1
vectors vs coordinate vectors a vector is a geometric entit (motion/offset between points) in a real or virtual 3D world a coordinate vector is a set of numbers used to specif a vector given an agreed coordinate sstem vector space a set has an addition operation has a scalar multiplication some other rules addition is associative and commutative scalar mul must distribute across vector add α( v + w) = α v + α w eample vector spaces R 3 (triplets of numbers) pairs of elements of R 3, where two pairs are equivalent if the share their offset. in particular the vectors are not triplets of numbers, but bags of triplet pairs. this class: motion between points in our room. these vectors should not be thought of as numerical objects. coordinate sstem: basis a basis is a minimal set of vectors that we can use to get to all of the vectors using our ops. minimal == linearl independent dimension is number of basis elements needed for us it will be 3 so basis can be used to address all of the vectors uniquel using coordinates v = i c i bi so a basis (a non-numerical object) can be used to represent a vector (non-numerical) with a set of coordinates (a numerical object!). shorthand write this as even shorter linear transformation a linear tform L maps from V to V v = i c i bi = c 1 v = b t c 2
satisfies 2 rules L( v + u) = L( v) + L( u) L( αv) = αl( v) we will use the notation v L( v) book uses linear tforms and matrices linear transformation can be eactl specified b telling us its effect on the basis vectors. linear transforms can be epressed with matri multiplication Linearit implies v L( v) = L( i c i bi ) = i c i L( b i ) in our shorthand this is c 1 L( b 1 ) L( b 2 ) L( b 3 ) c 1 each L( b i ) can ultimatel be written as some linear combination of the original basis vectors using numbers M i,j L( b 1 ) L( b 2 ) L( b 3 ) = M 1,1 M 1,2 M 1,3 M 2,1 M 2,2 M 2,3 M 3,1 M 3,2 M 3,3 so a linear transform operating on a vector can be epressed as well defined ops vector to vector see fig c 1 M 1,1 M 1,2 M 1,3 M 2,1 M 2,2 M 2,3 M 3,1 M 3,2 M 3,3 b t c b t Mc c 1 basis to basis, L( b 1 ) L( b 2 ) L( b 3 ) so this can be written as b t b t M see fig 3
coordinate vector to coordinate vector (this is the one we will see in code, but not until then). identit and inverse the identit matri I implements to do nothing transform an inverse matri has the propert MM 1 = M 1 M = I c Mc not ever matri has an inverse, but nice ones do, and all of our matrices are nice. matrices for change of basis dot we just saw as an intermediate result an epression of the form a1 a 2 a 3 = M 1,1 M 1,2 M 1,3 M 2,1 M 2,2 M 2,3 M 3,1 M 3,2 M 3,3 ortho or in shorthand this is not a transformation. a t = b t M a t M 1 = b t we have used a matri to epress one named basis with respect to another. this will be useful too. we can also use this to have different epressions for the same vector e 2.1 and 2.2 v = b t c = a t M 1 c our vectors come equipped with a (bilinear) dot product operation v w allows us to define the squared length (also called squared norm) v 2 := v v The dot product is related to the angle θ 0..π between two vectors 2 vectors are orthogonal if v w = 0. orthonormal basis right handed (cclicall-ordered) basis cos(θ) = v w v w 4
dot product in orthonormal basis b t c b t d = ( c i bi ) ( d j bj ) i j = c i d j ( b i b j ) i j = i c i d i cross the output is the vector v w := v w sin(θ) n in a r.h. o.n. basis, the coordinates of ( b t c) ( b t d) are d 3 d 2 d 1 c 1 d 3 c 1 d 2 d 1 rotations transform that preserves dot product between vector pairs preserves right handedness between ordered vector triples so maps r.h.o.n. basis to another in 3d, ever rotation fies an ais, and rotates some angles r.h. about that ais. comments rotations about different aes do not commute composition of two rots about two aes is a rotation about some third ais. 2D rotations though the identi of this third ais is not obvious. rotate b θ degrees counter clockwise about the origin b1 b2 b1 cos θ sin θ b2 sin θ cos θ and we can rotate the basis as b1 b2 b1 cos θ sin θ b2 sin θ cos θ 3d rotations rotate a point b θ degrees around the ais of the basis c s 0 s c 0 0 0 1 5
where c cosθ, and s sinθ. fies points on ais for points in = k plane, it is like a 2D rotation basis is important ( direction) more 3d rotations around ais forward rotation around the ais arbitrar rotation can get an rotation b appling one,, can get an rotation b appling one,, called Euler angles visualie with set of gimbals 0 1 0 c 0 s s 0 c 1 0 0 0 c s 0 s c one can specif rotation with unit vector ais ˆk := k, k, k t and θ using matri kv 2 + c k k v k s k k v + k s k k v + k s kv 2 + c k k v k s k k v k s k k v + k s kv 2 + c where v 1 c other linear transforms uniform scales (common) non-uniform scales (used for modeling) shears (rare) a 0 0 0 a 0 0 0 a a 0 0 0 a 0 0 0 a 1 b 0 0 1 0 0 0 1 e 2.3, 2.4 6