OpenGL Mathematics

OpenGL Mathematics

GLM (OpenGL Mathematics) est une bibliothèque libre utilitaire d'OpenGL apportant au programmeur C++ tout un ensemble de classes et de fonctions permettant de manipuler les données pour OpenGL.

Une spécificité de GLM, par rapport aux autres bibliothèques mathématiques, repose sur le fait que son implémentation est basée sur les spécifications de GLSL (OpenGL Shading Language) de manière très stricte offrant ainsi un confort d'utilisation similaire sans nécessiter d'apprendre une nouvelle API.

Le code source est disponible sous MIT.

Exemple

#include <glm/glm.h>
 
using namespace glm;
 
enum
{
    PLANE_LEFT,
    PLANE_RIGHT,
    PLANE_BOTTOM,
    PLANE_TOP,
    PLANE_NEAR,
    PLANE_FAR,
    PLANE_MAX
};
 
vec4 planes[PLANE_MAX];
 
void createFrustumPlanes(const mat4& Model, const mat4& View, const mat4& Projection)
{
    mat4 mvp = transpose(Projection * View * Model);
 
    planes[PLANE_LEFT]   = normalize(mvp[3] + mvp[0]);
    planes[PLANE_RIGHT]  = normalize(mvp[3] - mvp[0]);
    planes[PLANE_BOTTOM] = normalize(mvp[3] + mvp[1]);
    planes[PLANE_TOP]    = normalize(mvp[3] - mvp[1]);
    planes[PLANE_NEAR]   = normalize(mvp[3] + mvp[2]);
    planes[PLANE_FAR]    = normalize(mvp[3] - mvp[2]);
}

Lien externe


Wikimedia Foundation. 2010.

Contenu soumis à la licence CC-BY-SA. Source : Article OpenGL Mathematics de Wikipédia en français (auteurs)

Игры ⚽ Поможем решить контрольную работу

Regardez d'autres dictionnaires:

  • OpenGL Mathematics — GLM (OpenGL Mathematics математика для OpenGL) библиотека для OpenGL, предоставляющая программисту на C++ классы и функции, позволяющие использовать данные для OpenGL [1]. Одна из особенностей GLM состоит в том, что его реализация основана на… …   Википедия

  • OpenGL Mathematics — GLM (OpenGL Mathematics) is an OpenGL utility library providing to C++ programmer all classes and functions allowing to use data for OpenGL [1]. One GLM characteristic is that GLM implementation is based on GLSL (OpenGL Shading Language)… …   Wikipedia

  • OpenGL — Тип API Раз …   Википедия

  • OpenGL — Original author(s) Silicon Graphics Developer(s) Khronos Group Stable release 4.2 …   Wikipedia

  • Список программ, использующих лицензию MIT — Это список программ, использующих Лицензии MIT. Arctic Torrent Banshee  музыкальный проигрыватель BarsWF CUDA и SSE2 brute force взломщик md5 Bitcoin электронная пиринговая криптовалюта Bouncy Castle  криптографический API CakePHP… …   Википедия

  • GLM — The three letter acronym GLM may refer to:*general linear model *generalized linear model * gigabit linking module (for fast data transfer via a network interface card) *Gilman (Amtrak station), Illinois, United States; Amtrak station code GLM… …   Wikipedia

  • Список программ — Список программ, использующих лицензию MIT Это список программ, использующих Лицензии MIT. Arctic Torrent Banshee  музыкальный проигрыватель Bouncy Castle  криптографический API CakePHP CLiki  вики движок Chord project Compiz  …   Википедия

  • Quaternion — Quaternions, in mathematics, are a non commutative extension of complex numbers. They were first described by the Irish mathematician Sir William Rowan Hamilton in 1843 and applied to mechanics in three dimensional space. They find uses in both… …   Wikipedia

  • Spherical harmonics — In mathematics, the spherical harmonics are the angular portion of an orthogonal set of solutions to Laplace s equation represented in a system of spherical coordinates. Spherical harmonics are important in many theoretical and practical… …   Wikipedia

  • Z-buffering — Z buffer data In computer graphics, z buffering is the management of image depth coordinates in three dimensional (3 D) graphics, usually done in hardware, sometimes in software. It is one solution to the visibility problem, which is the problem… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”