![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, physic 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:
- [Apple Clang 6.0](https://developer.apple.com/library/mac/documentation/CompilerTools/Conceptual/LLVMCompilerOverview/index.html) and higher
- [GCC](http://gcc.gnu.org/) 4.7 and higher
- [Intel C++ Composer](https://software.intel.com/en-us/intel-compilers) XE 2013 and higher
- [LLVM](http://llvm.org/) 3.4 and higher
- [Visual C++](http://www.visualstudio.com/) 2013 and higher
- [CUDA](https://developer.nvidia.com/about-cuda) 7.0 and higher (experimental)
- 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 both the [Happy Bunny License (Modified MIT) or the MIT License](manual.md#section0).
Thanks for contributing to the project by [submitting issues](https://github.com/g-truc/glm/issues) for bug reports and feature requests. Any feedback is welcome at [glm@g-truc.net](mailto://glm@g-truc.net).
```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/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.6](https://github.com/g-truc/glm/tree/master)
#### Improvements:
- Added Visual C++ 2019 detection
- Added Visual C++ 2017 15.8 and 15.9 detection
### [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 frexp and ldexp #886
### [GLM 0.9.9.4](https://github.com/g-truc/glm/releases/tag/0.9.9.4) - 2019-03-19
#### Features:
- Added mix implementation for matrices in EXT_matrix_common #842
- Added BUILD_SHARED_LIBS and BUILD_STATIC_LIBS build options #871
#### Improvements:
- Added GLM_FORCE_INTRINSICS to enable SIMD instruction code path. By default, it's disabled allowing constexpr support by default. #865
- Optimized inverseTransform #867
#### Fixes:
- Fixed in mat4x3 conversion #829
- Fixed constexpr issue on GCC #832 #865
- Fixed mix implementation to improve GLSL conformance #866
- Fixed int8 being defined as unsigned char with some compiler #839
- Fixed vec1 include #856
- Ignore .vscode #848
### [GLM 0.9.9.3](https://github.com/g-truc/glm/releases/tag/0.9.9.3) - 2018-10-31
#### Features:
- Added equal and notEqual overload with max ULPs parameters for scalar numbers #121
- Added GLM_FORCE_SILENT_WARNINGS to silent GLM warnings when using language extensions but using W4 or Wpedantic warnings #814 #775
- Added adjugate functions to GTX_matrix_operation #151
- Added GLM_FORCE_ALIGNED_GENTYPES to enable aligned types and SIMD instruction are not enabled. This disable constexpr #816
#### Improvements:
- Added constant time ULP distance between float #121
- Added GLM_FORCE_SILENT_WARNINGS to suppress GLM warnings #822
#### Fixes:
- Fixed simplex noise build with double #734
- Fixed bitfieldInsert according to GLSL spec #818
- Fixed refract for negative 'k' #808
### [GLM 0.9.9.2](https://github.com/g-truc/glm/releases/tag/0.9.9.2) - 2018-09-14
#### Fixes:
- Fixed GLM_FORCE_CXX** section in the manual
- Fixed default initialization with vector and quaternion types using GLM_FORCE_CTOR_INIT #812
### [GLM 0.9.9.1](https://github.com/g-truc/glm/releases/tag/0.9.9.1) - 2018-09-03
#### Features:
- Added bitfieldDeinterleave to GTC_bitfield
- Added missing equal and notEqual with epsilon for quaternion types to GTC_quaternion
- Added EXT_matrix_relational: equal and notEqual with epsilon for matrix types
- Added missing aligned matrix types to GTC_type_aligned
- Added C++17 detection
- Added Visual C++ language standard version detection
- Added PDF manual build from markdown
#### Improvements:
- Added a section to the manual for contributing to GLM
- Refactor manual, lists all configuration defines
- Added missing vec1 based constructors
- Redesigned constexpr support which excludes both SIMD and constexpr #783
- Added detection of Visual C++ 2017 toolsets
- Added identity functions #765
- Splitted headers into EXT extensions to improve compilation time #670
- Added separated performance tests
- Clarified refract valid range of the indices of refraction, between -1 and 1 inclusively #806
#### Fixes:
- Fixed SIMD detection on Clang and GCC
- Fixed build problems due to printf and std::clock_t #778
- Fixed int mod
- Anonymous unions require C++ language extensions
- Fixed ortho #790
- Fixed Visual C++ 2013 warnings in vector relational code #782
- Fixed ICC build errors with constexpr #704
- Fixed defaulted operator= and constructors #791
- Fixed invalid conversion from int scalar with vec4 constructor when using SSE instruction
- Fixed infinite loop in random functions when using negative radius values using an assert #739
### [GLM 0.9.9.0](https://github.com/g-truc/glm/releases/tag/0.9.9.0) - 2018-05-22
#### Features:
- Added RGBM encoding in GTC_packing #420
- Added GTX_color_encoding extension
- Added GTX_vec_swizzle, faster compile time swizzling then swizzle operator #558
- Added GTX_exterior_product with a vec2 cross implementation #621
- Added GTX_matrix_factorisation to factor matrices in various forms #654
- Added [GLM_ENABLE_EXPERIMENTAL](manual.md#section7_4) to enable experimental features.
- Added packing functions for integer vectors #639
- Added conan packaging configuration #643 #641
- Added quatLookAt to GT
没有合适的资源?快使用搜索试试~ 我知道了~
glm-master.zip
共1512个文件
html:772个
hpp:232个
cpp:163个
需积分: 10 6 下载量 32 浏览量
2019-06-02
18:18:24
上传
评论
收藏 5.82MB ZIP 举报
温馨提示
OpenGL Mathematics (GLM) is a C++ mathematics library based on the OpenGL Shading Language (GLSL) specification. GLM emulates GLSL's approach to vector/matrix operations whenever possible. To use GLM, include glm/glm.hpp. Example from GLM manual: #include <glm/glm.hpp> int foo() { glm::vec4 Position = glm::vec4( glm::vec3( 0.0 ), 1.0 ); glm::mat4 Model = glm::mat4( 1.0 ); Model[3] = glm::vec4( 1.0, 1.0, 0.0, 1.0 ); glm::vec4 Transformed = Model * Position; return 0; }
资源推荐
资源详情
资源评论
收起资源包目录
glm-master.zip (1512个子文件)
CMakePackageConfigHelpers.cmake 11KB
GNUInstallDirs.cmake 7KB
core_func_integer.cpp 39KB
core_func_common.cpp 36KB
gtc_type_precision.cpp 27KB
gtc_bitfield.cpp 27KB
gtx_euler_angle.cpp 22KB
core_type_vec4.cpp 21KB
core_cpp_constexpr.cpp 19KB
gtc_packing.cpp 18KB
core_type_vec3.cpp 18KB
gtx_fast_trigonometry.cpp 17KB
core_func_integer_find_msb.cpp 13KB
gtc_matrix_access.cpp 11KB
core_func_integer_find_lsb.cpp 11KB
core_force_pure.cpp 10KB
gtc_random.cpp 10KB
ext_vector_common.cpp 10KB
core_func_matrix.cpp 9KB
core_type_vec2.cpp 9KB
gtc_round.cpp 9KB
gtx_simd_mat4.cpp 9KB
glm.cpp 8KB
core_func_integer_bit_count.cpp 8KB
gtc_quaternion.cpp 7KB
ext_scalar_common.cpp 7KB
gtc_type_ptr.cpp 7KB
gtx_io.cpp 7KB
ext_vector_relational.cpp 7KB
core_type_ctor.cpp 6KB
gtx_dual_quaternion.cpp 6KB
gtx_wrap.cpp 5KB
core_type_mat4x4.cpp 5KB
gtc_integer.cpp 5KB
core_func_geometric.cpp 5KB
ext_matrix_relational.cpp 5KB
core_func_exponential.cpp 5KB
gtx_scalar_relational.cpp 5KB
ext_vector_integer.cpp 5KB
perf_matrix_mul_vector.cpp 5KB
perf_vector_mul_matrix.cpp 5KB
core_setup_message.cpp 5KB
perf_matrix_mul.cpp 4KB
perf_matrix_div.cpp 4KB
ext_vector_iec559.cpp 4KB
gtc_type_aligned.cpp 4KB
core_type_mat3x3.cpp 4KB
perf_matrix_transpose.cpp 4KB
perf_matrix_inverse.cpp 4KB
gtx_string_cast.cpp 4KB
gtx_common.cpp 4KB
core_type_mat2x2.cpp 3KB
core_func_vector_relational.cpp 3KB
core_func_packing.cpp 3KB
core_type_vec1.cpp 3KB
core_type_cast.cpp 3KB
core_force_ctor_init.cpp 3KB
ext_vec1.cpp 3KB
gtx_matrix_factorisation.cpp 3KB
ext_quaternion_type.cpp 3KB
core_cpp_defaulted_ctor.cpp 3KB
gtx_component_wise.cpp 3KB
core_func_swizzle.cpp 3KB
core_type_mat3x4.cpp 3KB
core_type_mat4x3.cpp 3KB
core_type_mat2x4.cpp 3KB
gtx_random.cpp 3KB
core_type_mat4x2.cpp 3KB
gtc_noise.cpp 3KB
core_type_mat3x2.cpp 3KB
core_type_mat2x3.cpp 3KB
gtx_extended_min_max.cpp 3KB
gtx_load.cpp 2KB
core_type_aligned.cpp 2KB
gtx_simd_vec4.cpp 2KB
ext_quaternion_exponential.cpp 2KB
gtx_quaternion.cpp 2KB
gtc_color_space.cpp 2KB
ext_vector_ulp.cpp 2KB
gtx_type_aligned.cpp 2KB
ext_vector_bool1.cpp 2KB
gtx_spline.cpp 2KB
core_type_length.cpp 2KB
gtx_vector_angle.cpp 2KB
ext_scalar_relational.cpp 2KB
gtx_integer.cpp 2KB
gtx_rotate_vector.cpp 2KB
gtc_epsilon.cpp 2KB
ext_scalar_ulp.cpp 2KB
gtc_ulp.cpp 2KB
ext_quaternion_geometric.cpp 2KB
ext_quaternion_transform.cpp 2KB
gtx_extented_min_max.cpp 2KB
core_setup_precision.cpp 2KB
ext_quaternion_common.cpp 1KB
gtx_fast_square_root.cpp 1KB
gtx_intersect.cpp 1KB
gtx_color_encoding.cpp 1KB
gtx_matrix_interpolation.cpp 1KB
gtx_vector_query.cpp 1KB
共 1512 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16
资源评论
及拉
- 粉丝: 0
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 华为OD+真题及解析+智能驾驶
- jQuery信息提示插件
- 基于stm32的通信系统,sim800c与服务器通信,无线通信监测,远程定位,服务器通信系统,gps,sim800c,心率,温度,stm32 由STM32F103ZET6单片机核心板电路、DS18B2
- 充电器检测9-YOLO(v5至v11)、COCO、Create充电器检测9L、Paligemma、TFRecord、VOC数据集合集.rar
- 华为OD+考试真题+实现过程
- 保险箱检测51-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- 五相电机邻近四矢量SVPWM模型-MATLAB-Simulink仿真模型包括: (1)原理说明文档(重要):包括扇区判断、矢量作用时间计算、矢量作用顺序及切时间计算、PWM波的生成; (2)输出部分仿
- 一对一MybatisProgram.zip
- 时变动态分位数CoVaR、delta-CoVaR,分位数回归 △CoVaR测度 溢出效应 动态 Adrian2016基于分位数回归方法计算动态条件在险价值 R语言代码,代码更数据就能用,需要修改的
- 人物检测37-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功