FPS Camera in OpenGL and glm

I read tutorial 6 in opengl-tutorial.org. Here’s the link.

http://www.opengl-tutorial.org/beginners-tutorials/tutorial-6-keyboard-and-mouse/

But I don’t understand with this part:


horizontalAngle += mouseSpeed * deltaTime * float(1024/2 - xpos );
verticalAngle   += mouseSpeed * deltaTime * float( 768/2 - ypos );

Why is the vector becomes an increment of horizontal and vertical angle???

Kinda looks like they’re trying to implement a virtual trackball. That is, where horizontal mouse motion modifies a horizontal rotation angle and vertical mouse motion modifies a vertical rotation angle.

Yes but why the the delta of x becomes an increment of horizontal angle and delta of y becomes an increment of vertical???

Do you have virtual trackball tutorial (theory) link???

Try looking under “arcball”