Created
May 9, 2013 00:43
-
-
Save sherief/5544762 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Projection Matrix | |
mat4x4 mP = perspective_matrix(45.0, 1, 0.1, 100); | |
mP = transpose(mP); | |
//Translation | |
mat4x4 mT = mat4x4::translation(float3(0, 0, -14)); | |
//Rotation | |
mat4x4 mR = rotation_matrix_degrees(Rotation, float3(0, 1, 0)); | |
//View matrix | |
mat4x4 mV = lookat_matrix(float3(0.0, 0.0, -3.0), float3(0, 0, -3), float3(0, 1, 0)); | |
mV = transpose(mV); | |
//WorldViewProjection | |
mat4x4 mWVP; | |
//World Matrix - object to world space. | |
mat4x4 mW = mT * mR; | |
//WVP construction | |
mWVP = mP * mW; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment