CPSC362A
Video Game Development

Activity 8

First-person Camera Rotation

Create an OpengGL program where the user can control the camera orientation with the mouse.

Details

  1. The program should draw a bunch of stars at random x and y locations.

  2. The user should be able to use the cursor position to turn the camera’s yaw and pitch. Use the function glfwGetCursorPos to get the cursor’s location in the window. Cursor positions should coorespond to the following orientations:

    1. cursor at the top of the window is a pitch up 90 °

    2. cursor at the botton of the window is a ptich down 90 °

    3. cursor at the left of the window is a yaw left 90 °

    4. cursor at the right of the window is a yaw right 90 °

  3. (Optional) Draw a checker board pattern of squares as a floor.

Example