I only superficially understand the idea and I can't find any thorough explanation (partially because I can't find very good keywords to Google - English is not my first language):
Although I partially understand some things (next paragraph), my question is what data structure would you use to store a body's position and rotation and how does everything come together? I want to be able to translate that object to a (x, y) position, rotate it about the origin or about its centre (then fetch these things and draw a sprite using that position and rotation). Very similar to Unity's Transform
object.
From my understanding I will need (at least) a 2/3-dimensional vector and a quaternion and then I should be able to generate a model matrix from them. How? Multiply what to what and in what order? I certainly have no idea how to get a 4 x 4 matrix from a 2/3-dimensional vector and a quaternion. Then if I change the position, I should probably update the model matrix again.
I'm using OpenGL ES 2 on Android, but I wouldn't mind an agnostic answer.