Learning OpenGL for N-body Sims #4 - WASD control of camera
Camera control using the keyboard (WASD), we add a file controls.cpp that uses to update our camera viewpoint.

Source code on Github
// Move forward if (glfwGetKey( window, GLFW_KEY_UP ) == GLFW_PRESS){ | |
position += direction * deltaTime * speed; | |
} | |
// Move backward | |
if (glfwGetKey( window, GLFW_KEY_DOWN ) == GLFW_PRESS){ | |
position -= direction * deltaTime * speed; | |
} | |
// Strafe right | |
if (glfwGetKey( window, GLFW_KEY_RIGHT ) == GLFW_PRESS){ | |
position += right * deltaTime * speed; | |
} | |
// Strafe left | |
if (glfwGetKey( window, GLFW_KEY_LEFT ) == GLFW_PRESS){ | |
position -= right * deltaTime * speed; | |
} |

Source code on Github