I recently follow this site: https://learnopengl.com/ to learn OpenGL, then I found that in the glm::lootAt function, the article said the third parameter is usually (0.0, 1.0, 0.0), but why? I think to describe a position of an item like (x, y) and z be the height(up), isn't this way more intuitional?
Btw, I found in Blender, z is also the "up" direction. So I want to know why we use this kind of presentation ( or if I use my own style is OK?).
First: it's all about conventions. From a mathematical standpoint you could even use x
-up and it would be fine (though I would not recommend it unless you have an excellent reason to use it).
Most importantly, it's about sticking to the conventions you want to use, and in a consistent manner so your values and computation make sense. Whether you decide to use y
or z
as your up vector, you need to stick to that throughout your entire code.
As for why y
-up, you could also think "intuitionally" that x
and y
are the side and up vectors on your screen, and that z
, the third dimension, adds depth to the 2D space when added to these two dimensions.
Ultimately you can use whichever you want, but as long as you stick to it, and that you account for the whole pipeline as well. If you (or someone else) create a model in Blender or any other 3D modeling software, if the up vector in model space is different than what you use, you will have to take that into account.