After reading on the coordinate systems in OpenGL, I figured to move the camera around the world I just need to translate the view coordinates. If I say use view = glm::translate(view, glm::vec3(0, 0, -50));, I'm translating the camera 50 units back (by translating the world 50 units forward). After thinking I had it figured out, I encounter LookAt function. I can't understand why I would need to use this function, if I just can move around my camera by translating and rotating the view. The whole thing is a bit hard to wrap the head around, so I'm sorry if this doesn't make much sense!
2
votes
1 Answers
0
votes
glm::LookAt or mat4x4_look_at of linmath.h or gluLookAt, and so on, are all just there for your (= the programmer's) convenience. That's all.
If you want to setup the view portion of the modelview transform with a different method, because it suits you better, then by all means you should to that then.
std::sort, since they can implement a quick-sort just fine themselves. And why do you think "I just can move around my camera by translating and rotating the view" is not literally what the function does? - Nicol BolasLookAtnot the GLU nor the GLM version ... in fact I never used GLM (as I got my own math that predates GLM and suite my needs much better) and the only stuff I use from GLU isgluPerspectiveand lately not even that ... TheLookAtfunction is usually used by rookies as an shortcut for those they do not understand the matrix math preventing them from simple implementation of advanced camera stuff later on ... - SpektrelookAtis overused, and is more often than not can be better expressed by composing rotations and translations. - Yakov Galka