Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float aspectRatio = (float)854 / (float)480;
- float y_scale = (float)((1.0f / tan(degToRad(FOV / 2.0f))));
- float x_scale = y_scale / aspectRatio;
- float frustum_length = FAR_PLANE - NEAR_PLANE;
- projection[0][0] = x_scale;
- projection[1][1] = y_scale;
- projection[2][2] = -((FAR_PLANE + NEAR_PLANE) / frustum_length);
- projection[2][3] = -1;
- projection[3][2] = -((2 * NEAR_PLANE * FAR_PLANE) / frustum_length);
- projection[3][3] = 0;
- view[0][0] = 1;
- view[1][1] = 1;
- view[2][2] = 1;
- view[3][3] = 1;
- model[0][0] = 1;
- model[1][1] = 1;
- model[2][2] = 1;
- model[3][3] = 1;
- model[1][3] = 10 * sin(t);
- model[2][3] = -10;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement