Create orthographic projection function
This commit is contained in:
1 parent
6e37b45f28
commit
a73975a766
3 files changed
+14
-1
No files matched your search
@@ -100,6 +100,16 @@ mat4_t mat4_perspective(float aspect, float fov, float near, float far)
|
||||
};
|
||||
}
|
||||
|
||||
mat4_t mat4_orthographic(float width, float height, float near, float far)
|
||||
{
|
||||
return (mat4_t) {
|
||||
{ 1 / width, 0, 0, 0 },
|
||||
{ 0, -1 / height, 0, 0 },
|
||||
{ 0, 0, 1 / (far - near), 0 },
|
||||
{ 0, 0, -near / (far - near), 1 },
|
||||
};
|
||||
}
|
||||
|
||||
mat4_t mat4_translate_vec3(vec3_t v)
|
||||
{
|
||||
return (mat4_t) {
|
||||
|
||||
Reference in new issue
Block a user