Learning C, Day 21 (“Look At” Camera)

Today I spent about two and a half hours implementing a “look at” camera. It’s pretty cool: instead of moving the camera, I move the world by the opposite amount the camera would have moved. And it’s the same for rotation. I also added delta time so that the movement and rotation each fame are independent of the frame rate. Now it doesn’t matter if the renderer runs at 60 FPS or 30 FPS, the movement will be the same.

Model by Bohdan Lvov, licensed under CC-BY 4.0

Tomorrow I should have a first person camera!

Leave a comment

Your email address will not be published. Required fields are marked *

Your data is processed in accordance with my privacy policy. Comments are manually approved and may take a while to appear.