Skip to content

Instantly share code, notes, and snippets.

@humbletim
Created February 23, 2015 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save humbletim/24f5ce7029b29aa096bd to your computer and use it in GitHub Desktop.
Save humbletim/24f5ce7029b29aa096bd to your computer and use it in GitHub Desktop.
GLM Example - C++11
#define GLM_FORCE_RADIANS 1
#include <glm/glm.hpp>
#include <glm/ext.hpp>
static auto mrot = glm::angleAxis(glm::radians(45.0f), glm::vec3(0,1,0));
auto m1 = glm::mat4(1.0f);
auto m2 = glm::mat4(2.0f);
int main() {
auto m3 = m1 * m2;
m3 *= glm::toMat4(mrot);
printf("%s\n", glm::to_string(m3).c_str());
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment