I’ve been looking into OpenGL the past few days, and have been using LWJGL to make some simple displays of cubes and so forth. I’m very interested and see that there’s a lot to learn (which is not a bad thing).
First, though, I thought I should learn how I can move around the world. I had a kind of hackish system put together where all objects would move in the opposite direction of user input (implemented with glTranslatef()). After looking around the 'Net, I learned that it is better practice to employ matrices instead. Plenty of websites discussed that the camera does not move through the world, and coordinates are in the modelView matrix and so forth, but very few touched on how to actually use this knowledge to create a functional camera. The ones that did were vague and unhelpful.
I understand what matrices are- I have used them in math- but do not understand why matrix multiplication is necessary or useful in OpenGL. One website mentioned that it allows the GPU to asynchronously calculate all sixteen new values for the modelView matrix simultaneously, but I still don’t understand why it’s necessary to change several values when the “camera” has, for example, only moved a couple units on one axis. I’m sure there is good reason, but I have not seen it.
Could someone enlighten me about this? An explanation here or a link to a resource that actually thoroughly explains how to use matrices to create a basic first person perspective (with keyboard motion and mouselook, the typical style) would be greatly appreciated.
Thanks in advance for your assistance.