Coordinates and Positions Flashcards
Orthographic
Orthographic projection is a form of parallel projection, where every projection line runs orthogonal to the projection plane.
Name two vector interpretations of the numeric vector representation (2,3).
A position vector and a direction vector. The numeric representation is the same, but the two interpretations are different objects.
Describe the difference between position vectors and direction vectors in their 4-number representations in terms of xyzw.
Position vectors have W=1, direction vectors have W=0.
GLKMatrix4MakePerspective
Parameters: Field of View (Y) in Radians Aspect (height/width) Near Z Far Z Creates a perspective projection matrix (perspective, not orthographic)
Given XYZW, how do you get normalized coordinates?
Divide by W.
Describe the projection matrix mathematically.
It is a 4x4 matrix that performs a linear transformation in homogeneous space. It doesn’t actually perform the transformation, but it sets vector positions up for the next step.
What are the advantages of homogeneous coordinates?
They allow points at infinity to be represented with finite coordinates (w=0), and they allow all projective transformations (including affine transformations, such as translation) to be performed using matrix multiplications.
What is the effect of multiplying a homogeneous coordinate by a scalar?
The coordinate is not changed.
Give a 4x4 translation matrix.
1 0 0 0
0 1 0 0
0 0 1 0
tx ty tz 1
Give a 4x4 rotation matrix in terms of the original orthonormal basis x, y, z, and x’, y’, z’.
xx' yx' zx' 0 xy' yy' zy' 0 xz' yz' zz' 0 0 0 0 1 (dot products)
What is the dot product of two normal vectors?
Since the normal vectors have magnitude of one, the dot product is simply the cosine of the angle between them.
Describe skew or shear in terms of x,y, and z.
Skew adds an offset to one coordinate based on the magnitude of another coordinate. For example, an image could be shifted right at the top, shifted left at the bottom, and not shifted at all in the middle.
Give a 4x4 shear matrix skewing x and y in z.
1 0 0 0
0 1 0 0
kx ky 1 0
0 0 0 1
Give a 4x4 scale matrix.
a 0 0 0
0 a 0 0
0 0 a 0
0 0 0 1
Give a 4x4 projection matrix.
1 0 0 0 0 1 0 0 0 0 0 -1/E 0 0 0 1 where E = EyeZ, or the distance from the eye to the screen, or near clipping plane. This matrix transforms a vector into : x y 0 1-z/EyeZ So it scales them by that ratio. For example, with an EyeZ of 1 and a z of -10, the transformation of (x,y,z) would be (x/11, y/11, 1). So it brings far-away things into the center of the screen.