![glm](/doc/manual/logo-mini.png)
[OpenGL Mathematics](http://glm.g-truc.net/) (*GLM*) is a header only C++ mathematics library for graphics software based on the [OpenGL Shading Language (GLSL) specifications](https://www.opengl.org/registry/doc/GLSLangSpec.4.50.diff.pdf).
*GLM* provides classes and functions designed and implemented with the same naming conventions and functionality than *GLSL* so that anyone who knows *GLSL*, can use *GLM* as well in C++.
This project isn't limited to *GLSL* features. An extension system, based on the *GLSL* extension conventions, provides extended capabilities: matrix transformations, quaternions, data packing, random numbers, noise, etc...
This library works perfectly with *[OpenGL](https://www.opengl.org)* but it also ensures interoperability with other third party libraries and SDK. It is a good candidate for software rendering (raytracing / rasterisation), image processing, physics simulations and any development context that requires a simple and convenient mathematics library.
*GLM* is written in C++98 but can take advantage of C++11 when supported by the compiler. It is a platform independent library with no dependence and it officially supports the following compilers:
- [*GCC*](http://gcc.gnu.org/) 4.7 and higher
- [*Intel C++ Compose*](https://software.intel.com/en-us/intel-compilers) XE 2013 and higher
- [*Clang*](http://llvm.org/) 3.4 and higher
- [*Apple Clang 6.0*](https://developer.apple.com/library/mac/documentation/CompilerTools/Conceptual/LLVMCompilerOverview/index.html) and higher
- [*Visual C++*](http://www.visualstudio.com/) 2013 and higher
- [*CUDA*](https://developer.nvidia.com/about-cuda) 9.0 and higher (experimental)
- [*SYCL*](https://www.khronos.org/sycl/) (experimental: only [ComputeCpp](https://codeplay.com/products/computesuite/computecpp) implementation has been tested).
- Any C++11 compiler
For more information about *GLM*, please have a look at the [manual](manual.md) and the [API reference documentation](http://glm.g-truc.net/0.9.8/api/index.html).
The source code and the documentation are licensed under either the [Happy Bunny License (Modified MIT) or the MIT License](manual.md#section0).
Thanks for contributing to the project by [submitting pull requests](https://github.com/g-truc/glm/pulls).
```cpp
#include <glm/vec3.hpp> // glm::vec3
#include <glm/vec4.hpp> // glm::vec4
#include <glm/mat4x4.hpp> // glm::mat4
#include <glm/ext/matrix_transform.hpp> // glm::translate, glm::rotate, glm::scale
#include <glm/ext/matrix_clip_space.hpp> // glm::perspective
#include <glm/ext/scalar_constants.hpp> // glm::pi
glm::mat4 camera(float Translate, glm::vec2 const& Rotate)
{
glm::mat4 Projection = glm::perspective(glm::pi<float>() * 0.25f, 4.0f / 3.0f, 0.1f, 100.f);
glm::mat4 View = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate));
View = glm::rotate(View, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f));
View = glm::rotate(View, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f));
glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f));
return Projection * View * Model;
}
```
## [Lastest release](https://github.com/g-truc/glm/releases/latest)
## Project Health
| Service | System | Compiler | Status |
| ------- | ------ | -------- | ------ |
| [Travis CI](https://travis-ci.org/g-truc/glm)| MacOSX, Linux 64 bits | Clang 3.6, Clang 5.0, GCC 4.9, GCC 7.3 | [![Travis CI](https://travis-ci.org/g-truc/glm.svg?branch=master)](https://travis-ci.org/g-truc/glm)
| [AppVeyor](https://ci.appveyor.com/project/Groovounet/glm)| Windows 32 and 64 | Visual Studio 2013, Visual Studio 2015, Visual Studio 2017 | [![AppVeyor](https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva?svg=true)](https://ci.appveyor.com/project/Groovounet/glm)
## Release notes
### [GLM 0.9.9.9](https://github.com/g-truc/glm/releases/tag/0.9.9.9) - 2020-XX-XX
#### Features:
- Added *GLM_EXT_scalar_reciprocal* with tests
- Added *GLM_EXT_vector_reciprocal* with tests
- Added `glm::iround` and `glm::uround` to *GLM_EXT_scalar_common* and *GLM_EXT_vector_common*
- Added *GLM_EXT_matrix_integer* with tests
#### Improvements:
- Added `constexpr` qualifier for `cross` product #1040
- Added `constexpr` qualifier for `dot` product #1040
#### Fixes:
- Fixed incorrect assertion for `glm::min` and `glm::max` #1009
- Fixed quaternion orientation in `glm::decompose` #1012
- Fixed singularity in quaternion to euler angle roll conversion #1019
- Fixed `quat` `glm::pow` handling of small magnitude quaternions #1022
- Fixed `glm::fastNormalize` build error #1033
- Fixed `glm::isMultiple` build error #1034
- Fixed `glm::adjugate` calculation #1035
- Fixed `glm::angle` discards the sign of result for angles in range (2*pi-1, 2*pi) #1038
- Removed ban on using `glm::string_cast` with *CUDA* host code #1041
### [GLM 0.9.9.8](https://github.com/g-truc/glm/releases/tag/0.9.9.8) - 2020-04-13
#### Features:
- Added *GLM_EXT_vector_intX* and *GLM_EXT_vector_uintX* extensions
- Added *GLM_EXT_matrix_intX* and *GLM_EXT_matrix_uintX* extensions
#### Improvements:
- Added `glm::clamp`, `glm::repeat`, `glm::mirrorClamp` and `glm::mirrorRepeat` function to `GLM_EXT_scalar_commond` and `GLM_EXT_vector_commond` extensions with tests
#### Fixes:
- Fixed unnecessary warnings from `matrix_projection.inl` #995
- Fixed quaternion `glm::slerp` overload which interpolates with extra spins #996
- Fixed for `glm::length` using arch64 #992
- Fixed singularity check for `glm::quatLookAt` #770
### [GLM 0.9.9.7](https://github.com/g-truc/glm/releases/tag/0.9.9.7) - 2020-01-05
#### Improvements:
- Improved *Neon* support with more functions optimized #950
- Added *CMake* *GLM* interface #963
- Added `glm::fma` implementation based on `std::fma` #969
- Added missing quat constexpr #955
- Added `GLM_FORCE_QUAT_DATA_WXYZ` to store quat data as w,x,y,z instead of x,y,z,w #983
#### Fixes:
- Fixed equal *ULP* variation when using negative sign #965
- Fixed for intersection ray/plane and added related tests #953
- Fixed ARM 64bit detection #949
- Fixed *GLM_EXT_matrix_clip_space* warnings #980
- Fixed Wimplicit-int-float-conversion warnings with clang 10+ #986
- Fixed *GLM_EXT_matrix_clip_space* `perspectiveFov`
### [GLM 0.9.9.6](https://github.com/g-truc/glm/releases/tag/0.9.9.6) - 2019-09-08
#### Features:
- Added *Neon* support #945
- Added *SYCL* support #914
- Added *GLM_EXT_scalar_integer* extension with power of two and multiple scalar functions
- Added *GLM_EXT_vector_integer* extension with power of two and multiple vector functions
#### Improvements:
- Added *Visual C++ 2019* detection
- Added *Visual C++ 2017* 15.8 and 15.9 detection
- Added missing genType check for `glm::bitCount` and `glm::bitfieldReverse` #893
#### Fixes:
- Fixed for g++6 where -std=c++1z sets __cplusplus to 201500 instead of 201402 #921
- Fixed hash hashes qua instead of tquat #919
- Fixed `.natvis` as structs renamed #915
- Fixed `glm::ldexp` and `glm::frexp` declaration #895
- Fixed missing const to quaternion conversion operators #890
- Fixed *GLM_EXT_scalar_ulp* and *GLM_EXT_vector_ulp* API coding style
- Fixed quaternion componant order: `w, {x, y, z}` #916
- Fixed `GLM_HAS_CXX11_STL` broken on Clang with Linux #926
- Fixed *Clang* or *GCC* build due to wrong `GLM_HAS_IF_CONSTEXPR` definition #907
- Fixed *CUDA* 9 build #910
#### Deprecation:
- Removed CMake install and uninstall scripts
### [GLM 0.9.9.5](https://github.com/g-truc/glm/releases/tag/0.9.9.5) - 2019-04-01
#### Fixes:
- Fixed build errors when defining `GLM_ENABLE_EXPERIMENTAL` #884 #883
- Fixed `if constexpr` warning #887
- Fixed missing declarations for `glm::frexp` and `glm::ldexp` #886
### [GLM 0.9.9.4](https://github.com/g-truc/glm/releases/tag/0.9.9.4) - 2019-03-19
#### Features:
- Added `glm::mix` implementation for matrices in *GLM_EXT_matrix_common/ #842
- Added *CMake* `BUILD_SHARED_LIBS` and `BUILD_STATIC_LIBS` build options #871
#### Improvements:
- Added GLM_FORCE_INTRINSICS to ena
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
opengl 和 imgui项目模板 (717个子文件)
glad.c 655KB
x11_window.c 104KB
wl_window.c 97KB
triangle-vulkan.c 79KB
win32_window.c 76KB
x11_init.c 68KB
input.c 40KB
glfwinfo.c 40KB
wl_init.c 40KB
particles.c 35KB
window.c 34KB
egl_context.c 29KB
win32_init.c 27KB
win32_joystick.c 26KB
wgl_context.c 26KB
context.c 25KB
glx_context.c 23KB
xkb_unicode.c 23KB
events.c 22KB
x11_monitor.c 19KB
boing.c 19KB
null_window.c 18KB
window.c 17KB
win32_monitor.c 16KB
heightmap.c 16KB
monitor.c 15KB
splitview.c 15KB
init.c 15KB
cursor.c 14KB
null_init.c 13KB
tinycthread.c 13KB
linux_joystick.c 12KB
vulkan.c 12KB
osmesa_context.c 12KB
wave.c 12KB
joysticks.c 11KB
gears.c 10KB
inputlag.c 9KB
wl_monitor.c 9KB
iconify.c 8KB
getopt.c 8KB
monitors.c 8KB
tearing.c 7KB
sharing.c 7KB
reopen.c 7KB
msaa.c 6KB
platform.c 6KB
gamma.c 6KB
null_monitor.c 5KB
triangle-opengles.c 5KB
triangle-opengl.c 5KB
offscreen.c 5KB
threads.c 4KB
allocator.c 4KB
icon.c 4KB
clipboard.c 4KB
empty.c 3KB
posix_thread.c 3KB
win32_thread.c 3KB
posix_poll.c 3KB
windows.c 3KB
timeout.c 3KB
posix_time.c 2KB
title.c 2KB
win32_time.c 2KB
cocoa_time.c 2KB
win32_module.c 2KB
posix_module.c 2KB
null_joystick.c 2KB
GenerateMappings.cmake 2KB
FindEpollShim.cmake 747B
x86_64-w64-mingw32-clang.cmake 606B
x86_64-w64-mingw32.cmake 598B
i686-w64-mingw32-clang.cmake 596B
i686-w64-mingw32.cmake 588B
FindOSMesa.cmake 445B
CODEOWNERS 175B
imgui.cpp 1.01MB
imgui_demo.cpp 428KB
imgui_widgets.cpp 425KB
imgui_tables.cpp 217KB
imgui_draw.cpp 214KB
TextEditor.cpp 94KB
TextEditor.cpp 94KB
imgui_impl_glfw.cpp 67KB
imgui_impl_opengl3.cpp 47KB
main.cpp 18KB
InputCtl.cpp 10KB
glm.cpp 8KB
check_gl.cpp 5KB
OBJ.cpp 3KB
Image.cpp 3KB
Game.cpp 2KB
extra.css 7KB
autoexp.vc2010.dat 126KB
usertype.dat 3KB
window.dox 58KB
input.dox 33KB
intro.dox 23KB
moving.dox 20KB
共 717 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
qq_41859084
- 粉丝: 3
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功