Moveable Camera and GLFW

Moveable Camera and GLFW

I’ve made lots of progress this week. I decided to switch out the GLUT library functionality for GLFW to prepare for a full move to modern OpenGL. Right now I’m using some deprecated OpenGL functions to draw my image to the window which is not ideal, but it works for now. I read a great series of tutorials on modern OpenGL at Learn OpenGL and I implemented a modified version of the described camera system into the HCamera class. At the moment all the controls are set up in the main.cpp file and passed to the camera, but in the future I would like to use a proper controller class but for now I will focus on further developing the rendering.

The camera set up to move in its local coordinate system by pressing the WASD keys, as well as moving up and down in the world coordinate system by pressing the space and left ctrl buttons respectively. The camera can also be rotated by pressing and holding down the right mouse button like in many CAD programs. The camera speed can be increased or decreased by scrolling the mouse wheel up or down and I plan to add more controls for things like aperture radius and focal distance soon.

Below a YouTube video showcasing the camera movement. It’s obvious that the application is not ready for real-time usage due to the noise, but it’s nice to be able to move around the scene to find a good angle for a rendering.

Moveable Camera Showcase