I'm new to 3D math, and am experimenting with 3D via SFML+OpenGL.
The way my current camera system is set up is I have two 3D vectors (the mathematical vectors), one for the camera position and the other for the camera rotation. That's p.x, p.y, p.z, and r.x, r.y, r.z, respectively. r.x is rotation about the x axis, etc.
The camera controls I want are the ability to pan the screen left, right, up, down, and forward and backward. I have this implemented in terms or r.x and r.y here:
https://github.com/LB--/Recipe-Spelunker/blob/9b67ca6b27ee4479a2305459b7eddaf8d3fef1d1/src/client/main.cpp#L193
However, my implementation seems the hard way to do it, and I only slightly understand why it works - I got it mostly through trial and error. Now, I want to include r.z, rotation about the z axis, and this is proving to be too challenging for me.
Can someone explain the math to me and/or offer a more elegant solution?