Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: FPS Camera in OpenGL and glm

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2013
    Posts
    10

    Question FPS Camera in OpenGL and glm

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

    http://www.opengl-tutorial.org/begin...ard-and-mouse/

    But I don't understand with this part:
    Code :
    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???

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,194
    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.

  3. #3
    Junior Member Newbie
    Join Date
    Oct 2013
    Posts
    10
    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???

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    Try looking under "arcball"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •