Lecture 6
Monday, February 18, 2019
5:02 PM
Important Announcements
Grader office hours on website -- starts tomorrow
Coding resources - OpenGL on Windows guide
Soil on Mac setup
Install CMake ([link])
Download and copy over to Applications folder
Go to Github rep for SOIL and clone in folder called SOIL
Cd SOIL
Mkdir build
Cd build
/Applications/Cmake.app/Contents/bin/cmake ..
Make
Copy both images from Lecture 4 and compile those
Add -framework CoreFoundation in the command
The text in bold are the new commands added to the command instructions from the lecture
g++ -O3 [file] -o textures -lGLEW -lglfw -framework OpenGL -framework CoreFoundation -ldl -lm -std=c++11 -I ~/Code/SOIL/inc/SOIL/ -L ~/Code/SOIL/build/ -lsoil
Build system that is portable to any OS
Rigid Bodies
Defined by two state variables      
Position --> (x,y,z) coordinates
Orientation 
World Frame
Ultimate reference frame. All other frames are define with respect to the world frame
Not computationally optimal because many bottlenecks are created.    
Eg. If a cube is translated to (10k, 10k, 10k), any point would be 10k + Δ 
This would be computationally expensive to store
3 vectors --> 𝑥,𝑦,𝑧
Object/Material Frame
A frame directly attached to the object
An object in the material frame will have a position relative to the world frame
Origin of the frame is the origin of the object
z
𝑧′
𝑦′
0′
y
0
𝑥′
x
Each of the unit vecotrs in object frame can be represented in terms of unit vectors in the world frame
𝑥′ can be represented in relation to x, y, and z
Similarly, 
The non-bold values are scalar quantities (real numbers) 𝜖ℝ
The bold values  are vectors 𝜖ℝ3
They can also be represented in matrix form
Rotation Matrix (R)
The nine number in the rotation matrix are not independent of each other. Namely:
The 3 vectors in the object form and the world frame are orthogonal to each other.
Therefore, orientation can be defined in 3 numbers rather than a 3 X 3 matrix
All vectors in the world and object frame are unit vectors. Thus,
Rotation matrix R Is an orthogonal matrix.
𝑅𝑇𝑅=𝐼 or 𝑅𝑇=𝑅−1
If you use the right handed coordinate system, 
det𝑅=𝑅=1
If you use the left handed coordinate system,
Elementary Rotation
This is when we are rotating by one axis. 
For example, what is the rotation matrix that defines x' and y' in terms of the world frame?
The rotation matrix that we get by rotating by z axis with angle α,
Similarly,
Because we know 𝑅𝑇𝑅=𝐼 or 𝑅𝑇=𝑅−1,
Inverse rotation is the same as actual rotation.
What is the relation between p and p' given that they are the same point in absolute space?
Therefore, the rotation matrix allows us to translate from p to p' as follows:
Length from 0 to p (the norm) is independent of which frame we are talking about.
Norm
Relation of one frame with respect to another frame:
𝑅𝑇𝑅=𝐼
Composition of Frames
𝑅𝑖𝑗 = Rotation matrix of frame i with respect to frame j
𝑝2 = point with coordinates with respect to frame 2
The subscript and superscript cancel and we are left with the final frame.
So,
Commutation of Operators
Two matrices A and B commute with each other if:
𝐴𝐵=𝐵𝐴
Rotation matrices do not commute.
Rotation about the current frame:
Rotation about a fixed frame:
   x
If you use only one axis, the rotations will commute. Otherwise, rotation matrices do not commute.