![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 5.0](https://developer.apple.com/library/mac/documentation/CompilerTools/Conceptual/LLVMCompilerOverview/index.html) and higher
- [GCC](http://gcc.gnu.org/) 4.6 and higher
- [Intel C++ Composer](https://software.intel.com/en-us/intel-compilers) XE 2013 and higher
- [LLVM](http://llvm.org/) 3.2 and higher
- [Visual C++](http://www.visualstudio.com/) 2010 and higher
- [CUDA](https://developer.nvidia.com/about-cuda) 7.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.9.0](https://github.com/g-truc/glm/releases/latest) - 2017-XX-XX
##### Features:
- Added RGBM encoding in GTC_packing #420
- Added GTC_color_encoding extension
##### Improvements:
- Added lowp variant of GTC_colorspace convertLinearToSRGB #419
##### Fixes:
##### Deprecation:
- Removed GLM_GTX_simd_vec4 extension
- Removed GLM_GTX_simd_mat4 extension
- Removed GLM_GTX_simd_quat extension
- Removed GLM_SWIZZLE, use GLM_FORCE_SWIZZLE instead
- Removed GLM_MESSAGES, use GLM_FORCE_MESSAGES instead
- Removed GLM_DEPTH_ZERO_TO_ONE, use GLM_FORCE_DEPTH_ZERO_TO_ONE instead
- Removed GLM_LEFT_HANDED, use GLM_FORCE_LEFT_HANDED instead
#### [GLM 0.9.8.2](https://github.com/g-truc/glm/releases/tag/0.9.8.2) - 2016-11-01
##### Improvements:
- Added Visual C++ 15 detection
- Added Clang 4.0 detection
- Added warning messages when using GLM_FORCE_CXX** but the compiler
is known to not fully support the requested C++ version #555
- Refactored GLM_COMPILER_VC values
- Made quat, vec, mat type component length() static #565
##### Fixes:
- Fixed Visual C++ constexpr build error #555, #556
#### [GLM 0.9.8.1](https://github.com/g-truc/glm/releases/tag/0.9.8.1) - 2016-09-25
##### Improvements:
- Optimized quaternion log function #554
##### Fixes:
- Fixed GCC warning filtering, replaced -pedantic by -Wpedantic
- Fixed SIMD faceforward bug. #549
- Fixed GCC 4.8 with C++11 compilation option #550
- Fixed Visual Studio aligned type W4 warning #548
- Fixed packing/unpacking function fixed for 5_6_5 and 5_5_5_1 #552
#### [GLM 0.9.8.0](https://github.com/g-truc/glm/releases/tag/0.9.8.0) - 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 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) #52
没有合适的资源?快使用搜索试试~ 我知道了~
OpenGL glm库
共878个文件
html:382个
hpp:157个
inl:131个
5星 · 超过95%的资源 需积分: 50 43 下载量 79 浏览量
2018-07-16
19:27:59
上传
评论
收藏 2.87MB ZIP 举报
温馨提示
OpenGL Mathematics (GLM) 是基于OpenGL着色语言(GLSL)规范的图形软件的头文件C ++数学库
资源推荐
资源详情
资源评论
收起资源包目录
OpenGL glm库 (878个子文件)
CMakePackageConfigHelpers.cmake 11KB
GNUInstallDirs.cmake 7KB
core_func_integer.cpp 39KB
core_func_common.cpp 33KB
gtc_type_precision.cpp 27KB
gtc_bitfield.cpp 17KB
gtc_packing.cpp 15KB
gtx_fast_trigonometry.cpp 14KB
core_type_vec3.cpp 13KB
core_func_integer_find_msb.cpp 13KB
gtx_euler_angle.cpp 12KB
core_type_vec4.cpp 11KB
core_func_integer_find_lsb.cpp 11KB
gtc_random.cpp 9KB
core_type_mat4x4.cpp 9KB
gtc_round.cpp 9KB
core_force_pure.cpp 9KB
gtc_matrix_access.cpp 9KB
gtx_simd_mat4.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
gtx_dual_quaternion.cpp 6KB
core_type_vec2.cpp 6KB
core_type_ctor.cpp 6KB
gtc_noise.cpp 6KB
dummy.cpp 5KB
gtx_wrap.cpp 5KB
core_type_aligned.cpp 5KB
gtc_type_ptr.cpp 5KB
core_setup_message.cpp 5KB
gtc_integer.cpp 5KB
core_func_geometric.cpp 5KB
core_type_mat3x3.cpp 4KB
gtx_scalar_relational.cpp 4KB
core_func_packing.cpp 3KB
gtx_string_cast.cpp 3KB
core_type_mat2x2.cpp 3KB
core_type_vec1.cpp 3KB
gtx_component_wise.cpp 3KB
core_type_cast.cpp 3KB
gtc_type_aligned.cpp 3KB
gtx_random.cpp 3KB
gtx_common.cpp 3KB
core_type_mat4x3.cpp 3KB
core_type_mat3x4.cpp 3KB
core_func_exponential.cpp 2KB
core_type_mat4x2.cpp 2KB
gtx_simd_vec4.cpp 2KB
core_type_mat2x4.cpp 2KB
core_type_mat3x2.cpp 2KB
core_type_mat2x3.cpp 2KB
gtx_quaternion.cpp 2KB
gtx_spline.cpp 2KB
core_type_length.cpp 2KB
gtx_rotate_vector.cpp 2KB
gtx_type_aligned.cpp 2KB
gtc_epsilon.cpp 2KB
gtx_vector_angle.cpp 2KB
gtc_color_space.cpp 2KB
gtx_extented_min_max.cpp 2KB
gtx_fast_square_root.cpp 2KB
gtc_ulp.cpp 2KB
core_setup_precision.cpp 2KB
gtc_color_encoding.cpp 1KB
gtx_vector_query.cpp 1KB
gtx_integer.cpp 1KB
gtx_log_base.cpp 1KB
core_func_swizzle.cpp 1KB
gtc_matrix_inverse.cpp 1KB
gtc_matrix_transform.cpp 953B
gtx_matrix_query.cpp 944B
core_type_int.cpp 888B
gtx_range.cpp 765B
gtc_user_defined_types.cpp 753B
gtx_scalar_multiplication.cpp 745B
gtx_int_10_10_10_2.cpp 648B
gtx_mixed_product.cpp 648B
gtc_functions.cpp 594B
core_func_vector_relational.cpp 552B
gtx_gradient_paint.cpp 539B
core_type_float.cpp 533B
gtx_compatibility.cpp 484B
gtc_constants.cpp 383B
gtx_matrix_decompose.cpp 302B
gtx_color_space.cpp 245B
core_func_noise.cpp 194B
bug_ms_vec_static.cpp 160B
gtx_associated_min_max.cpp 127B
core_setup_force_cxx98.cpp 118B
core_force_unrestricted_gentype.cpp 112B
gtx_type_trait.cpp 110B
gtx_handed_coordinate_space.cpp 94B
gtx_matrix_interpolation.cpp 93B
gtx_rotate_normalized_axis.cpp 93B
gtx_matrix_cross_product.cpp 91B
gtx_matrix_major_storage.cpp 91B
gtx_matrix_transform_2d.cpp 90B
共 878 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
- 冥零闪电ZZ2018-11-13还不错可以用
qq_42675184
- 粉丝: 3
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功