Home | History | Annotate | Download | only in detail

Lines Matching refs:glm

2 /// OpenGL Mathematics (glm.g-truc.net)

24 /// @file glm/core/dummy.cpp
28 /// GLM is a header only library. There is nothing to compile.
34 #include "../glm.hpp"
39 glm::vec4 emission; // Ecm
40 glm::vec4 ambient; // Acm
41 glm::vec4 diffuse; // Dcm
42 glm::vec4 specular; // Scm
48 glm::vec4 ambient; // Acli
49 glm::vec4 diffuse; // Dcli
50 glm::vec4 specular; // Scli
51 glm::vec4 position; // Ppli
52 glm::vec4 halfVector; // Derived: Hi
53 glm::vec3 spotDirection; // Sdli
66 #include <glm/vec3.hpp>// glm::vec3
67 #include <glm/geometric.hpp>// glm::cross, glm::normalize
69 glm::vec3 computeNormal
71 glm::vec3 const & a,
72 glm::vec3 const & b,
73 glm::vec3 const & c
76 return glm::normalize(glm::cross(c - a, b - a));
84 #include <glm/vec3.hpp> // glm::vec3
85 #include <glm/vec4.hpp> // glm::vec4, glm::ivec4
86 #include <glm/mat4x4.hpp> // glm::mat4
87 #include <glm/gtc/matrix_transform.hpp> // glm::translate, glm::rotate, glm::scale, glm::perspective
88 #include <glm/gtc/type_ptr.hpp> // glm::value_ptr
89 void func(GLuint LocationMVP, float Translate, glm::vec2 const & Rotate)
91 glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.f);
92 glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate));
93 glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f));
94 glm::mat4 View = glm::rotate(ViewRotateX, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f));
95 glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f));
96 glm::mat4 MVP = Projection * View * Model;
97 glUniformMatrix4fv(LocationMVP, 1, GL_FALSE, glm::value_ptr(MVP));
101 #include <glm/vec2.hpp>// glm::vec2
102 #include <glm/packing.hpp>// glm::packUnorm2x16
103 #include <glm/integer.hpp>// glm::uint
104 #include <glm/gtc/type_precision.hpp>// glm::i8vec2, glm::i32vec2
107 std::size_t const PositionSizeF32 = VertexCount * sizeof(glm::vec2);
108 glm::vec2 const PositionDataF32[VertexCount] =
110 glm::vec2(-1.0f,-1.0f),
111 glm::vec2( 1.0f,-1.0f),
112 glm::vec2( 1.0f, 1.0f),
113 glm::vec2(-1.0f, 1.0f)
116 std::size_t const PositionSizeF16 = VertexCount * sizeof(glm::uint);
117 glm::uint const PositionDataF16[VertexCount] =
119 glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, -1.0f))),
120 glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, -1.0f))),
121 glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, 1.0f))),
122 glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, 1.0f)))
125 std::size_t const PositionSizeI8 = VertexCount * sizeof(glm::i8vec2);
126 glm::i8vec2 const PositionDataI8[VertexCount] =
128 glm::i8vec2(-1,-1),
129 glm::i8vec2( 1,-1),
130 glm::i8vec2( 1, 1),
131 glm::i8vec2(-1, 1)
134 std::size_t const PositionSizeI32 = VertexCount * sizeof(glm::i32vec2);
135 glm::i32vec2 const PositionDataI32[VertexCount] =
137 glm::i32vec2 (-1,-1),
138 glm::i32vec2 ( 1,-1),
139 glm::i32vec2 ( 1, 1),
140 glm::i32vec2 (-1, 1)
145 glm::vec4 position;
146 glm::vec3 normal;
151 #include <glm/vec3.hpp>// glm::vec3
152 #include <glm/geometric.hpp>// glm::normalize, glm::dot, glm::reflect
153 #include <glm/exponential.hpp>// glm::pow
154 #include <glm/gtc/random.hpp>// glm::vecRand3
155 glm::vec3 lighting
160 glm::vec3 const & View
163 glm::vec3 Color(0.0f);
164 glm::vec3 LightVertor(glm::normalize(
166 glm::vecRand3(0.0f, Light.inaccuracy));
170 float Diffuse = glm::dot(Intersection.normal, LightVector);
177 glm::vec3 Reflect(glm::reflect(
178 glm::normalize(-LightVector),
179 glm::normalize(Intersection.normal)));
180 float Dot = glm::dot(Reflect, View);
182 float Specular = glm::pow(Base, Material.exponent);