3.Transformations Flashcards
How is the camera simulated in OpenGL
By transformations on the model
If the transformation that moves the default camera to the desired position is Tc, what is the transformation that moves the object to the right position?
Tc^-1
How does opengl know how to compute this?
gluLookAt(E,C,V)
What kind of geometrical transformation is x’=x*sx?
Scaling
What transformation is x’=x+tx
Translation
What transformation is rotation in 2d about origin?
x’ =xcos9-ysin9
y’ = xcos9+ysin9
z’=z
How is rotation in 2d about an arbitrary point achieved?
- Translate by -coordinates of arbitrary point
- Do rotation about origin
- Translate by +coordinates of arbitrary point
Is rotating then shifting the same as shifting then rotating?
NOPE non-commutativity of matrix transformations
What does “homogenous coordinates” mean?
have SAME representation for Translation, Scale & Rotation (3d about z) (x,y,z,w)
Vertices -> Points
Matrices -> Transformations
Why do we introduce w’?
Translation: You can’t represent it in 3x3
SOLUTION: point->(x,y,z,1), Matrix-> 4x4
In which direction is P’ = P*T transformation read?
Right to left
If I show you the rotation matrix, how can you tell about which axis it is?
If it’s about x axis x row won’t have cos/sin terms
How many transformation matrices in OpenGL?
PVM: Modelling, Viewing (Camera) and Projection matrix
Rotation about an arbitrary 3d axis
M1:origin M2:XY plane M3:X axis M4:ROTATION M3^-1 M2^-1 M1^-1