I’m trying to wrap my head around matrices, and how to utilize them (using glm). From what I’ve seen, it seems like a neat solution to mutate sprites purely by matrix transformations, like affine transformations mentioned here:
In a 2d game, suppose I have a sprite at location
glm::vec3(10.0f, 0.0f, 0.0f), so x=10 and y and z = 0.
But I also could store coordinates in a glm::map..to use glm::translate, I need a
1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0
Now I’m confused how to use all this, and where to store
y coordinates. Should I store them in a vector, and multiple/translate by a matrix? Or the other way around?
glm::translate() returns a new matrix, so I think my sprite data should be in a matrix to start with?
I hope someone can provide/link me to a basic example..haven’t had much luck with tutorials so far.