Highly Optimized Graphics Math (glm) for C
📚 Documentation
Almost all functions (inline versions) and parameters are documented inside the corresponding headers.
Complete documentation: http://cglm.readthedocs.io
📌 Note for previous versions:
- _dup (duplicate) is changed to _copy. For instance
glm_vec_dup -> glm_vec3_copy
- OpenGL related functions are dropped to make this lib platform/third-party independent
- make sure you have latest version and feel free to report bugs, troubles
- [bugfix] euler angles was implemented in reverse order (extrinsic) it was fixed, now they are intrinsic. Make sure that
you have the latest version
- [major change] by starting v0.4.0, quaternions are stored as [x, y, z, w], it was [w, x, y, z] in v0.3.5 and earlier versions
- [api rename] by starting v0.4.5, glm_simd functions are renamed to glmm_
- [new option] by starting v0.4.5, you can disable alignment requirement, check options in docs.
- [major change] by starting v0.5.0, vec3 functions use glm_vec3_ namespace, it was glm_vec_ until v0.5.0
- [major change] by starting v0.5.1, built-in alignment is removed from vec3 and mat3 types
- [major change] by starting v0.7.3, inline print functions are disabled in release/production mode to eliminate print costs (see options in documentation). Print output also improved. You can disable colors if you need (see documentation)
- [major change] by starting v0.8.3, cglm supports alternative clipspace configuations e.g. Left Handed, Zero-to-One (_zo)...
CGLM_FORCE_DEPTH_ZERO_TO_ONE and CGLM_FORCE_LEFT_HANDED is provided to control clipspace. You should be able to use cglm with Vulkan, DirectX and Metal now... see https://cglm.readthedocs.io/en/latest/opt.html#clipspace-option-s
Reviews
Builds
| toolchain |
public-0.18.1 |
| target |
x86_64-w64-mingw32 |
| tgt config |
windows_10-gcc_15.2_mingw_w64-static_O2 |
| timestamp |
2026-05-08 11:29:12 UTC (02 04:56:25 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-w64-mingw32 |
| tgt config |
windows_10-gcc_15.2_mingw_w64-O2 |
| timestamp |
2026-05-08 11:28:37 UTC (02 04:57:00 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-w64-mingw32 |
| tgt config |
windows_10-gcc_15.2_mingw_w64 |
| timestamp |
2026-05-08 11:28:18 UTC (02 04:57:19 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_ubuntu_26.04-gcc_15-bindist |
| timestamp |
2026-05-08 11:19:58 UTC (02 05:05:39 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_fedora_44-gcc_16-bindist |
| timestamp |
2026-05-04 15:20:35 UTC (06 01:05:02 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-apple-darwin23.5.0 |
| tgt config |
macos_14-gcc_14_homebrew-static_O3 |
| timestamp |
2026-04-29 21:30:18 UTC (10 18:55:19 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-apple-darwin23.5.0 |
| tgt config |
macos_14-gcc_14_homebrew-O3 |
| timestamp |
2026-04-29 21:29:26 UTC (10 18:56:11 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-apple-darwin23.5.0 |
| tgt config |
macos_14-gcc_14_homebrew |
| timestamp |
2026-04-29 21:28:34 UTC (10 18:57:03 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-apple-darwin23.5.0 |
| tgt config |
macos_14-clang_15.0-static_O3 |
| timestamp |
2026-04-29 13:42:39 UTC (11 02:42:58 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-apple-darwin23.5.0 |
| tgt config |
macos_14-clang_15.0-O3 |
| timestamp |
2026-04-29 13:41:47 UTC (11 02:43:50 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-apple-darwin23.5.0 |
| tgt config |
macos_14-clang_15.0 |
| timestamp |
2026-04-29 13:40:56 UTC (11 02:44:42 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-clang_22_libc++-static_O3 |
| timestamp |
2026-04-29 13:20:09 UTC (11 03:05:28 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-microsoft-win32-msvc14.5 |
| tgt config |
windows_10-msvc_18.3-static_O2 |
| timestamp |
2026-04-29 13:19:51 UTC (11 03:05:46 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-gcc_16-static_O3 |
| timestamp |
2026-04-29 13:19:40 UTC (11 03:05:57 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-clang_22_libc++-O3 |
| timestamp |
2026-04-29 13:19:34 UTC (11 03:06:03 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-microsoft-win32-msvc14.5 |
| tgt config |
windows_10-clang_21_msvc_18.3-static_O2 |
| timestamp |
2026-04-29 13:19:31 UTC (11 03:06:06 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_ubuntu_24.04-gcc_13-bindist |
| timestamp |
2026-04-29 13:19:25 UTC (11 03:06:12 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-clang_22_libc++ |
| timestamp |
2026-04-29 13:19:23 UTC (11 03:06:14 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-gcc_16-ndebug_O3 |
| timestamp |
2026-04-29 13:19:16 UTC (11 03:06:22 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-gcc_15-static_O3 |
| timestamp |
2026-04-29 13:19:15 UTC (11 03:06:22 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-clang_21_libc++ |
| timestamp |
2026-04-29 13:19:11 UTC (11 03:06:26 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-apple-darwin22.5.0 |
| tgt config |
macos_13-clang_15.0 |
| timestamp |
2026-04-29 13:19:09 UTC (11 03:06:28 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-gcc_15-ndebug_O3 |
| timestamp |
2026-04-29 13:19:07 UTC (11 03:06:31 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-gcc_16 |
| timestamp |
2026-04-29 13:18:59 UTC (11 03:06:38 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-gcc_16-O3 |
| timestamp |
2026-04-29 13:18:57 UTC (11 03:06:41 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-clang_22-static_O3 |
| timestamp |
2026-04-29 13:18:50 UTC (11 03:06:47 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-gcc_14-bindist |
| timestamp |
2026-04-29 13:18:48 UTC (11 03:06:49 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-clang_22-O3 |
| timestamp |
2026-04-29 13:18:40 UTC (11 03:06:57 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_fedora_43-gcc_15-bindist |
| timestamp |
2026-04-29 13:18:34 UTC (11 03:07:03 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-gcc_15-O3 |
| timestamp |
2026-04-29 13:18:32 UTC (11 03:07:05 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-gcc_15 |
| timestamp |
2026-04-29 13:18:31 UTC (11 03:07:06 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-clang_22 |
| timestamp |
2026-04-29 13:18:27 UTC (11 03:07:10 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_13-clang_21 |
| timestamp |
2026-04-29 13:18:23 UTC (11 03:07:14 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_12-gcc_14-O3 |
| timestamp |
2026-04-29 13:17:48 UTC (11 03:07:50 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-freebsd15.0 |
| tgt config |
freebsd_15-clang_19-static_O3 |
| timestamp |
2026-04-29 13:17:47 UTC (11 03:07:50 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-freebsd15.0 |
| tgt config |
freebsd_15-clang_19-O3 |
| timestamp |
2026-04-29 13:17:28 UTC (11 03:08:09 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-linux-gnu |
| tgt config |
linux_debian_12-gcc_14 |
| timestamp |
2026-04-29 13:17:16 UTC (11 03:08:21 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-freebsd15.0 |
| tgt config |
freebsd_15-clang_19 |
| timestamp |
2026-04-29 13:17:03 UTC (11 03:08:35 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-freebsd14.1 |
| tgt config |
freebsd_14-clang_18 |
| timestamp |
2026-04-29 13:16:54 UTC (11 03:08:43 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
aarch64-linux-gnu |
| tgt config |
linux_debian_12-clang_18_libc++-static_O3 |
| timestamp |
2026-04-29 12:01:02 UTC (11 04:24:35 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
aarch64-linux-gnu |
| tgt config |
linux_debian_12-clang_18_libc++-O3 |
| timestamp |
2026-04-29 12:00:57 UTC (11 04:24:40 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
aarch64-linux-gnu |
| tgt config |
linux_debian_12-clang_18_libc++ |
| timestamp |
2026-04-29 12:00:18 UTC (11 04:25:20 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
aarch64-linux-gnu |
| tgt config |
linux_debian_12-clang_18-static_O3 |
| timestamp |
2026-04-29 12:00:14 UTC (11 04:25:23 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
aarch64-linux-gnu |
| tgt config |
linux_debian_12-clang_18-O3 |
| timestamp |
2026-04-29 11:59:39 UTC (11 04:25:58 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
aarch64-linux-gnu |
| tgt config |
linux_debian_12-clang_18 |
| timestamp |
2026-04-29 11:59:35 UTC (11 04:26:03 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
aarch64-linux-gnu |
| tgt config |
linux_debian_12-gcc_14-static_O3 |
| timestamp |
2026-04-29 11:37:34 UTC (11 04:48:03 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
aarch64-linux-gnu |
| tgt config |
linux_debian_12-gcc_14-ndebug_O3 |
| timestamp |
2026-04-29 11:37:24 UTC (11 04:48:13 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
aarch64-linux-gnu |
| tgt config |
linux_debian_12-gcc_14-O3 |
| timestamp |
2026-04-29 11:36:53 UTC (11 04:48:44 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
aarch64-linux-gnu |
| tgt config |
linux_debian_12-gcc_14 |
| timestamp |
2026-04-29 11:36:36 UTC (11 04:49:01 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
aarch64-linux-gnu |
| tgt config |
linux_debian_12-gcc_13 |
| timestamp |
2026-04-29 11:12:59 UTC (11 05:12:39 days ago) |
| result |
success | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-microsoft-win32-msvc14.5 |
| tgt config |
windows_10-msvc_18.3-O2 |
| timestamp |
2026-04-29 10:59:06 UTC (11 05:26:31 days ago) |
| result |
warning (update) | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-microsoft-win32-msvc14.5 |
| tgt config |
windows_10-msvc_18.3 |
| timestamp |
2026-04-29 10:58:57 UTC (11 05:26:40 days ago) |
| result |
warning (update) | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-microsoft-win32-msvc14.5 |
| tgt config |
windows_10-clang_21_msvc_18.3-O2 |
| timestamp |
2026-04-29 10:58:43 UTC (11 05:26:54 days ago) |
| result |
warning (update) | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-microsoft-win32-msvc14.5 |
| tgt config |
windows_10-clang_21_msvc_18.3 |
| timestamp |
2026-04-29 10:58:18 UTC (11 05:27:20 days ago) |
| result |
warning (update) | log | rebuild |
| toolchain |
public-0.18.1 |
| target |
x86_64-microsoft-win32-msvc14.3 |
| tgt config |
windows_10-msvc_17.14 |
| timestamp |
2026-04-29 10:58:01 UTC (11 05:27:37 days ago) |
| result |
warning (update) | log | rebuild |