-
-
Save adragomir/d726d7793cb5e99b054079ea675f6037 to your computer and use it in GitHub Desktop.
This file contains hidden or 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); | |
//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