From af812e86ebc06aca69d27a058bcd6e5d4ec52923 Mon Sep 17 00:00:00 2001 From: Recep Aslantas Date: Tue, 29 May 2018 11:30:38 +0300 Subject: [PATCH] add a note to clarify up vector restriction for glm_lookat and glm_look --- docs/source/cam.rst | 12 ++++++++---- include/cglm/cam.h | 6 ++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/source/cam.rst b/docs/source/cam.rst index a9f1ce7..79b2bd4 100644 --- a/docs/source/cam.rst +++ b/docs/source/cam.rst @@ -167,11 +167,13 @@ Functions documentation | set up view matrix + **NOTE:** The UP vector must not be parallel to the line of sight from the eye point to the reference point. + Parameters: - | *[in]* **eye** eye vector - | *[in]* **center** center vector - | *[in]* **up** up vector - | *[out]* **dest** result matrix + | *[in]* **eye** eye vector + | *[in]* **center** center vector + | *[in]* **up** up vector + | *[out]* **dest** result matrix .. c:function:: void glm_look(vec3 eye, vec3 dir, vec3 up, mat4 dest) @@ -181,6 +183,8 @@ Functions documentation target self then this might be useful. Because you need to get target from direction. + **NOTE:** The UP vector must not be parallel to the line of sight from the eye point to the reference point. + Parameters: | *[in]* **eye** eye vector | *[in]* **center** direction vector diff --git a/include/cglm/cam.h b/include/cglm/cam.h index 28b8a7d..6e5fc16 100644 --- a/include/cglm/cam.h +++ b/include/cglm/cam.h @@ -321,6 +321,9 @@ glm_perspective_resize(float aspect, /*! * @brief set up view matrix * + * NOTE: The UP vector must not be parallel to the line of sight from + * the eye point to the reference point + * * @param[in] eye eye vector * @param[in] center center vector * @param[in] up up vector @@ -364,6 +367,9 @@ glm_lookat(vec3 eye, * convenient wrapper for lookat: if you only have direction not target self * then this might be useful. Because you need to get target from direction. * + * NOTE: The UP vector must not be parallel to the line of sight from + * the eye point to the reference point + * * @param[in] eye eye vector * @param[in] dir direction vector * @param[in] up up vector