I've looked around and have never seen, nailed down, exactly what each matrix does and what operations form them (so the actual eigen function calls). This is what I'm looking for. Or at least a description of the process and a couple examples with eigen functions to see generally how to do it! Anyway, here's some details in case they are useful:
I'm setting up a top-down perspective game (so the camera is fixed downward but can rotate and move along the XY plane), but since I'll have some 3D elements (along with some things that are strictly 2D) I think a perspective projection would work well. But I do wonder what commands would be necessary to form an orthographic projection...
I sorta understand view, which would be done by translating the camera coords to the origin, rotating by camera rotation, translating them back to where they were, then scaling for zoom? But exactly what functions and objects would be involved, I'm not sure.
And for storing the rotation of any given object, a quaternion appears to be the be the best choice. So would that determine the model projection? If I manage to get my rotation simplified to the 2D case of one angle, would quaternions then be wasteful?
And do these matrices need to all be regenerated from identity each frame? Or can they be altered somehow to fit the new data?
I would really prefer to use eigen for this instead of a hand-holding library, but I need something to work with to figure out exactly what is going on... I have all the GLSL setup and the uniform matrices being fed into the rendering with my VAOs, I just need to understand and make them.
edit:
My vertex shader uses this standard setup with 3 uniform mat4s being multiplied with a position vec3:
gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(in_Position, 1.0);
Can mat3s and a vec2 be used for position to achieve better performance in purely 2D cases?
gl_Position = projectionMatrix * modelMatrix * viewMatrix
- This doesn't look like any standard I've ever seen. Generally it's proj * view * model, yours looks backward. – Tim