![glm](doc/logo.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 functionalities 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 4.0](https://developer.apple.com/library/mac/documentation/CompilerTools/Conceptual/LLVMCompilerOverview/index.html) and higher
- [GCC](http://gcc.gnu.org/) 4.2 and higher
- [Intel C++ Composer](https://software.intel.com/en-us/intel-compilers) XE 2013 and higher
- [LLVM](http://llvm.org/) 3.0 and higher
- [Visual C++](http://www.visualstudio.com/) 2010 and higher
- [CUDA](https://developer.nvidia.com/about-cuda) 4.0 and higher (experimental)
- Any conform C++98 or C++11 compiler
For more information about *GLM*, please have a look at the [manual](http://glm.g-truc.net/0.9.7/glm-0.9.7.pdf) and the [API reference documentation](http://glm.g-truc.net/0.9.7/api/index.html).
The source code and the documentation are licensed under the [Happy Bunny License (Modified MIT) or the MIT License](./copying.txt).
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).
```c++
#include <glm/vec3.hpp> // glm::vec3
#include <glm/vec4.hpp> // glm::vec4
#include <glm/mat4x4.hpp> // glm::mat4
#include <glm/gtc/matrix_transform.hpp> // glm::translate, glm::rotate, glm::scale, glm::perspective
#include <glm/gtc/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;
}
```
## Project Health
| Service | System | Compiler | Status |
| ------- | ------ | -------- | ------ |
| [Drone](https://drone.io/github.com/g-truc/glm) | Linux 64 bits | GCC 4.6.3 | [![Build Status](https://drone.io/github.com/g-truc/glm/status.png)](https://drone.io/github.com/g-truc/glm/latest) |
## [Lastest release](https://github.com/g-truc/glm/releases/latest)
## Release notes
#### [GLM 0.9.8.0](https://github.com/g-truc/glm/tree/0.9.8) - 2016-09-11
##### Features:
- Added right and left handed projection and clip control support #447 #415 #119
- Added compNormalize and compScale functions to GTX_component_wise
- Added packF3x9_E1x5 and unpackF3x9_E1x5 to GTC_packing for RGB9E5 #416
- Added (un)packHalf to GTC_packing
- Added (un)packUnorm and (un)packSnorm to GTC_packing
- Added 16bit pack and unpack to GTC_packing
- Added 8bit pack and unpack to GTC_packing
- Added missing bvec* && and || operators
- Added iround and uround to GTC_integer, fast round on positive values
- Added raw SIMD API
- Added 'aligned' qualifiers
- Added GTC_type_aligned with aligned *vec* types
- Added GTC_functions extension
- Added quaternion version of isnan and isinf #521
- Added lowestBitValue to GTX_bit #536
- Added GLM_FORCE_UNRESTRICTED_GENTYPE allowing non basic genType #543
##### Improvements:
- Improved SIMD and swizzle operators interactions with GCC and Clang #474
- Improved GTC_random linearRand documentation
- Improved GTC_reciprocal documentation
- Improved GLM_FORCE_EXPLICIT_CTOR coverage #481
- Improved OpenMP support detection for Clang, GCC, ICC and VC
- Improved GTX_wrap for SIMD friendliness
- Added constexpr for *vec*, *mat*, *quat* and *dual_quat* types #493
- Added NEON instruction set detection
- Added MIPS CPUs detection
- Added PowerPC CPUs detection
- Use Cuda built-in function for abs function implementation with Cuda compiler
- Factorized GLM_COMPILER_LLVM and GLM_COMPILER_APPLE_CLANG into GLM_COMPILER_CLANG
- No more warnings for use of long long
- Added more information to build messages
##### Fixes:
- Fixed GTX_extended_min_max filename typo #386
- Fixed intersectRayTriangle to not do any unintentional backface culling
- Fixed long long warnings when using C++98 on GCC and Clang #482
- Fixed sign with signed integer function on non-x86 architecture
- Fixed strict aliasing warnings #473
- Fixed missing vec1 overload to length2 and distance2 functions #431
- Fixed GLM test '/fp:fast' and '/Za' command-line options are incompatible
- Fixed quaterion to mat3 cast function mat3_cast from GTC_quaternion #542
- Fixed GLM_GTX_io for Cuda #547 #546
##### Deprecation:
- Removed GLM_FORCE_SIZE_FUNC define
- Deprecated GLM_GTX_simd_vec4 extension
- Deprecated GLM_GTX_simd_mat4 extension
- Deprecated GLM_GTX_simd_quat extension
- Deprecated GLM_SWIZZLE, use GLM_FORCE_SWIZZLE instead
- Deprecated GLM_MESSAGES, use GLM_FORCE_MESSAGES instead
--------------------------------------------------------------------------------
#### [GLM 0.9.7.6](https://github.com/g-truc/glm/releases/tag/0.9.7.6) - 2016-07-16
##### Improvements:
- Added pkg-config file #509
- Updated list of compiler versions detected
- Improved C++ 11 STL detection #523
##### Fixes:
- Fixed STL for C++11 detection on ICC #510
- Fixed missing vec1 overload to length2 and distance2 functions #431
- Fixed long long warnings when using C++98 on GCC and Clang #482
- Fixed scalar reciprocal functions (GTC_reciprocal) #520
--------------------------------------------------------------------------------
#### [GLM 0.9.7.5](https://github.com/g-truc/glm/releases/tag/0.9.7.5) - 2016-05-24
##### Improvements:
- Added Visual C++ Clang toolset detection
##### Fixes:
- Fixed uaddCarry warning #497
- Fixed roundPowerOfTwo and floorPowerOfTwo #503
- Fixed Visual C++ SIMD instruction set automatic detection in 64 bits
- Fixed to_string when used with GLM_FORCE_INLINE #506
- Fixed GLM_FORCE_INLINE with binary vec4 operators
- Fixed GTX_extended_min_max filename typo #386
- Fixed intersectRayTriangle to not do any unintentional backface culling
--------------------------------------------------------------------------------
#### [GLM 0.9.7.4](https://github.com/g-truc/glm/releases/tag/0.9.7.4) - 2016-03-19
##### Fixes:
- Fixed asinh and atanh warning with C++98 STL #484
- Fixed polar coordinates function latitude #485
- Fixed outerProduct defintions and operator signatures for mat2x4 and vec4 #475
- Fixed eulerAngles precision error, returns NaN #451
- Fixed undefined reference errors #489
- Fixed missing GLM_PLATFORM_CYGWIN declaration #495
- Fixed various undefined reference errors #490
--------------------------------------------------------------------------------
#### [GLM 0.9.7.3](https://github.com/g-truc/glm/releases/tag/0.9.7.3) - 2016-02-21
##### Improvements:
- Added AVX512 detection
没有合适的资源?快使用搜索试试~ 我知道了~
glm-0.9.8.0版本
共851个文件
html:382个
hpp:159个
inl:134个
需积分: 21 6 下载量 63 浏览量
2022-03-23
16:25:22
上传
评论
收藏 3.06MB 7Z 举报
温馨提示
glm-0.9.8.0版本
资源详情
资源评论
资源推荐
收起资源包目录
glm-0.9.8.0版本 (851个子文件)
CMakePackageConfigHelpers.cmake 11KB
GNUInstallDirs.cmake 7KB
core_func_integer.cpp 41KB
core_func_common.cpp 34KB
gtc_type_precision.cpp 27KB
gtc_bitfield.cpp 18KB
gtc_packing.cpp 15KB
gtx_fast_trigonometry.cpp 15KB
core_type_vec3.cpp 13KB
core_func_integer_find_msb.cpp 13KB
core_type_vec4.cpp 12KB
gtx_euler_angle.cpp 12KB
core_func_integer_find_lsb.cpp 11KB
gtc_random.cpp 10KB
gtc_round.cpp 9KB
gtc_matrix_access.cpp 9KB
gtx_simd_mat4.cpp 9KB
core_type_mat4x4.cpp 9KB
gtc_quaternion.cpp 9KB
glm.cpp 8KB
core_func_integer_bit_count.cpp 8KB
gtx_io.cpp 7KB
core_func_matrix.cpp 7KB
core_type_vec2.cpp 6KB
core_type_ctor.cpp 6KB
gtc_noise.cpp 6KB
gtx_dual_quaternion.cpp 6KB
dummy.cpp 6KB
gtx_wrap.cpp 6KB
core_setup_message.cpp 6KB
gtc_type_ptr.cpp 5KB
gtc_integer.cpp 5KB
core_func_geometric.cpp 5KB
gtx_scalar_relational.cpp 4KB
core_type_mat3x3.cpp 4KB
core_func_packing.cpp 4KB
gtx_string_cast.cpp 3KB
gtx_component_wise.cpp 3KB
core_type_cast.cpp 3KB
core_type_vec1.cpp 3KB
gtc_type_aligned.cpp 3KB
gtx_common.cpp 3KB
core_type_mat2x2.cpp 3KB
gtx_random.cpp 3KB
core_func_exponential.cpp 3KB
gtx_simd_vec4.cpp 3KB
core_type_mat4x3.cpp 2KB
core_type_mat3x4.cpp 2KB
core_type_mat4x2.cpp 2KB
core_type_mat2x4.cpp 2KB
core_type_mat3x2.cpp 2KB
gtx_quaternion.cpp 2KB
core_type_mat2x3.cpp 2KB
gtx_spline.cpp 2KB
core_type_length.cpp 2KB
gtx_type_aligned.cpp 2KB
gtx_rotate_vector.cpp 2KB
gtc_epsilon.cpp 2KB
gtx_vector_angle.cpp 2KB
gtx_extented_min_max.cpp 2KB
gtc_ulp.cpp 2KB
gtx_fast_square_root.cpp 2KB
core_setup_precision.cpp 2KB
gtx_vector_query.cpp 1KB
gtc_color_space.cpp 1KB
gtx_integer.cpp 1KB
gtx_log_base.cpp 1KB
core_func_swizzle.cpp 1KB
gtc_matrix_inverse.cpp 1KB
gtx_matrix_query.cpp 1009B
gtc_matrix_transform.cpp 1007B
core_type_int.cpp 931B
gtx_range.cpp 817B
gtc_user_defined_types.cpp 783B
gtx_scalar_multiplication.cpp 779B
gtx_int_10_10_10_2.cpp 666B
gtx_mixed_product.cpp 666B
gtc_functions.cpp 629B
core_func_vector_relational.cpp 594B
gtx_gradient_paint.cpp 572B
core_type_float.cpp 564B
gtx_compatibility.cpp 502B
gtc_constants.cpp 411B
gtx_matrix_decompose.cpp 320B
gtx_color_space.cpp 264B
gtx_associated_min_max.cpp 136B
core_setup_force_cxx98.cpp 128B
gtx_type_trait.cpp 122B
gtx_matrix_interpolation.cpp 103B
gtx_handed_coordinate_space.cpp 102B
gtx_rotate_normalized_axis.cpp 101B
gtx_matrix_cross_product.cpp 99B
gtx_matrix_major_storage.cpp 99B
gtx_matrix_transform_2d.cpp 98B
gtx_polar_coordinates.cpp 96B
gtx_color_space_YCoCg.cpp 96B
gtx_matrix_operation.cpp 95B
gtx_extended_min_max.cpp 95B
gtx_fast_exponential.cpp 95B
gtx_number_precision.cpp 95B
共 851 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
敲出十四行诗的幸运猴子
- 粉丝: 1874
- 资源: 32
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0