View Full Version : FPS Camera in OpenGL and glm

02-16-2014, 05:24 PM
I read tutorial 6 in opengl-tutorial.org. Here's the link.


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???

Dark Photon
02-16-2014, 05:55 PM
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.

02-16-2014, 06:00 PM
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???

02-16-2014, 11:33 PM
Try looking under "arcball"