C
Header: cglm/cam.h
There are many convenient functions for camera. For instance :cglm_look
is just wrapper for :cglm_lookat
. Sometimes you only have direction instead of target, so that makes easy to build view matrix using direction. There is also :cglm_look_anyup
function which can help build view matrix without providing UP axis. It uses :cglm_vec3_ortho
to get a UP axis and builds view matrix.
You can also _default versions of ortho and perspective to build projection fast if you don't care specific projection values.
_decomp means decompose; these function can help to decompose projection matrices.
Note
Be careful when working with high range (very small near, very large far) projection matrices. You may not get exact value you gave. float type cannot store very high precision so you will lose precision. Also your projection matrix will be inaccurate due to losing precision
Functions:
- :c
glm_frustum
- :c
glm_ortho
- :c
glm_ortho_aabb
- :c
glm_ortho_aabb_p
- :c
glm_ortho_aabb_pz
- :c
glm_ortho_default
- :c
glm_ortho_default_s
- :c
glm_perspective
- :c
glm_persp_move_far
- :c
glm_perspective_default
- :c
glm_perspective_resize
- :c
glm_lookat
- :c
glm_look
- :c
glm_look_anyup
- :c
glm_persp_decomp
- :c
glm_persp_decompv
- :c
glm_persp_decomp_x
- :c
glm_persp_decomp_y
- :c
glm_persp_decomp_z
- :c
glm_persp_decomp_far
- :c
glm_persp_decomp_near
- :c
glm_persp_fovy
- :c
glm_persp_aspect
- :c
glm_persp_sizes
- Parameters:
[in] aspect aspect aspect ratio ( width / height )
[out] dest result matrix