-
-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inverted clip space handedness terminology #435
Comments
Hi @master30f,
You can check ...
CGLM_INLINE
void
glm_ortho_aabb(vec3 box[2], mat4 dest) {
#if CGLM_CONFIG_CLIP_CONTROL == CGLM_CLIP_CONTROL_LH_ZO
glm_ortho_aabb_lh_zo(box, dest);
#elif CGLM_CONFIG_CLIP_CONTROL == CGLM_CLIP_CONTROL_LH_NO
glm_ortho_aabb_lh_no(box, dest);
#elif CGLM_CONFIG_CLIP_CONTROL == CGLM_CLIP_CONTROL_RH_ZO
glm_ortho_aabb_rh_zo(box, dest);
#elif CGLM_CONFIG_CLIP_CONTROL == CGLM_CLIP_CONTROL_RH_NO
glm_ortho_aabb_rh_no(box, dest);
#endif
}
... Also like CGLM_INLINE
void
glm_lookat(vec3 eye, vec3 center, vec3 up, mat4 dest) {
#if CGLM_CONFIG_CLIP_CONTROL & CGLM_CLIP_CONTROL_LH_BIT
glm_lookat_lh(eye, center, up, dest);
#elif CGLM_CONFIG_CLIP_CONTROL & CGLM_CLIP_CONTROL_RH_BIT
glm_lookat_rh(eye, center, up, dest);
#endif
} RH/LH_BIT used to select RH or LH impl. There maybe other places to take into account, see: #322 |
Hi @recp, thanks for the reply. I don't think I got my point across very well. I understand that the flags are used to control whether to use functions made for a left or right handed clip space. The problem lies in their names. The flag which is to be used with Vulkan is, if I'm not mistaken, |
@master30f thanks for the suggestion, The definitions are the same as in https://github.com/g-truc/glm/blob/master/glm/detail/setup.hpp#L566. RH/LH flags are mostly used to define world/view space handedness, not NDC. The default implementation of these functions is RH, which can be switched using these flags/bits. I don’t see a strong reason to flip them. Let’s wait for more feedback |
CGLM_CLIP_CONTROL_LH_BIT
has a comment that says it's for Vulkan andCGLM_CLIP_CONTROL_RH_BIT
says it's for OpenGL, even though Vulkan uses right-handed clip space coordinates while OpenGL uses left-handed ones, so I'm not sure whether to believe the names or the comments...The text was updated successfully, but these errors were encountered: