Learning C, Day 22 (First Person Camera)

Model by Bohdan Lvov, licensed under CC-BY 4.0

Today I worked on a first person camera for the 3D renderer. Right now it uses WASD to move forwards/backwards and turn left/right. Once I add clipping I’ll change it to use the mouse to look and WASD to move. I can’t wait to use this render to make 3D games and memes. It’s going to be so cool. I attempted to make a looping GIF for this article, but I mixed up the frame order, resulting in more of a meme than a camera demo (“*.png” doesn’t sort properly, I actually needed “ls -1v”). I think it’s a lot funnier than the perfect loop would’ve been, though.

I also improved my method of capturing the renderer’s output. I was previously screen recording it, but now I have a PNG encoding library so I can save the contents of the window to a PNG image. This is great for a bunch of reasons: my computer lags less, the final GIF is less compressed, the renderer doesn’t have to run in real time, and I don’t have the trim the video.

Next up is clipping, so that the renderer doesn’t crash when the model goes off-screen. See you tomorrow!

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.