Created
March 5, 2017 13:26
-
-
Save donaldmunro/38841d72c65a1c32f2bf83a4a00a2c9a to your computer and use it in GitHub Desktop.
Display/print a GLM mat or vec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <glm/gtx/string_cast.hpp> | |
.. | |
.. | |
glm::mat4 mat; | |
.. | |
.. | |
std::cout << glm::to_string(mat) << std::endl; |
Thank you so much for sharing this method.
Very handy, thanks!
useful, thanks
Thank you!
im getting this error...any idea why?
No member named 'call' in 'glm::detail::compute_to_string<std::vector<glm::mat<4, 4, float, glm::packed_highp>>>'
really helpful! thanks google bring me here
why i got "No member named 'to_string' in namespace 'glm'"
Thanks!!
why i got "No member named 'to_string' in namespace 'glm'"
bro go ahead and #include <glm/gtx/string_cast.hpp>
Thanks!!
Use built-in <<
overload
#include <glm/gtx/io.hpp>
auto mat = glm::ortho(0.0f, 800.0f, 0.0f, 600.0f, 0.1f, 100.0f);
cout << mat << endl;
Gives
[[ 0.002, 0.000, 0.000, -1.000]
[ 0.000, 0.003, 0.000, -1.000]
[ 0.000, 0.000, -0.020, -1.002]
[ 0.000, 0.000, 0.000, 1.000]]
im getting this error...any idea why?
No member named 'call' in 'glm::detail::compute_to_string<std::vector<glm::mat<4, 4, float, glm::packed_highp>>>'
It's confused between std::to_string
and glm::to_string
.
how do u resolve this confusion?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! It helps