Here’s my review of 3D Graphics Programming from Scratch by Gustavo Pezzi. TL;DR: It’s amazing 11/10, just buy it already. I can confirm the other positive reviews are all true. So in this review I’ll focus on things the other reviewers haven’t already said. Cue the montage! How I started: And here’s some things I’ve…
Tag: Pikuma 3D Graphics Course
Learning C, Day 28 “End of the 3D Graphics Course”
Today I finished the 3D graphics course! I’m super happy with how everything turned out. I’m a little sad that it’s over, but mostly excited to do more projects. I started making a 3D meme for this post, but it took way longer than I expected so I’ll probably finish it tomorrow. I’ll also post…
Learning C, Day 27 “Camera Controls”
Today I updated the camera to use the mouse and WASD! The renderer is really starting to feel finished. I also made the camera able to look up and down, cleaned the code, and added a method to simulate low resolution displays, all of which took about two and a half hours. Next up is…
Learning C, Day 26 (Camera Clipping 4)
Camera clipping UV coordinate interpolation! It only took like an hour to add and it was really simple. I used linear interpolation between the polygon points on either side of the clipping plane to get the UV coordinates of the new point. I thought I might need barycentric coordinates to interpolate the values, but because…
Learning C, Day 25 (Camera Clipping 3)
Today I spent about two and a half hours implementing camera clipping. Now the renderer doesn’t crash when objects go off screen! I have yet to interpolate the UV coordinates, though. Textures look broken right now because the new points use the old UV coordinates. The method for creating triangles from polygons ended up being…
Learning C, Day 24 (Camera Clipping 2)
Today I spent another hour on camera clipping and I’m almost ready to start implementing it. My idea of using dot product to check whether points are inside a plane was correct 🥳. I do have some questions, though. If I’m clipping triangles by creating new vertices, the resulting polygon may not be a triangle.…
Learning C, Day 23 (Camera Clipping)
Today I spent an hour on preliminary setup for clipping planes. The idea here is to not render triangles outside the camera view and to clip triangles which extend outside the view. To do that, I need planes defining the bounds of the camera view and a way to check whether points are inside the…
Learning C, Day 22 (First Person Camera)
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…
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…
Learning C, Day 20 (Z-Buffer)
Z-buffer! It was really quick to add (1 hour). I already had per-pixel Z values from the texture perspective correction code. It looks really cool if I intentionally display the pixels backwards: Tomorrow I should be implementing a better camera!
Learning C, Day 19 (Loading UV Coordinates)
Today is the day. Behold the crab. (Best viewed while listening to Crab Rave.) So today I got UV coordinates from OBJ files in the usual two hours! Now I can load any OBJ file with a texture and render it. I also finally replaced my file loading code and sort of fixed a segmentation…
Learning C, Day 18 (PNG Textures)
A really short day today: I just spent half an hour to get the renderer loading PNG textures.See you tomorrow!
Learning C, Day 17 (Texture Mapping 3)
Today I fixed the cube texture warping: The perspective correction uses interpolated Z values to do a sort of perspective divide in the texture space. I don’t entirely understand how it works yet, so I’ll add a note here if this is all wrong.Here’s what I have so far: The problem is that the texture…
Learning C, Day 16 (Texture Mapping 2)
Barycentric coordinates: they’re great for squishing squares into triangles. Here’s a wobbly textured cube: An overview of how it works The goal is to draw a triangle on the screen with pixels from a texture. I have three vertices and a texture in memory. The vertices describe two triangles: a triangle in the screen with…
Learning C, Day 15 (Texture Mapping 1)
Today I worked on adding texture mapping to the renderer so that it can display textured objects, which took about two and a half hours. It isn’t done yet, though, so here’s the classic missing texture color using the new code: Right now the code loops through each pixel of each screen space triangle and…
Learning C, Day 14 (Perspective Matrix)
Today I spent about two and a half hours implementing the perspective matrix and better flat shading. Now the renderer supports different aspect ratios and fields of view: At one point I messed up the color shading code and this happened (warning, flashing colors): Also, the site now has an icon and dark mode! I…
Learning C, Day 13 (More Matrix Math)
More matrix math today. I spent about an hour and a half implementing matrix rotation and scaling: Perspective matrix is up next, I’ll see you tomorrow!
Learning C, Day 12 (Matrix Math)
Matrix math. I added types and functions for matrix scaling and translation, which took about two hours. I’m thinking I might not use matrices in the PICO-8 port because they seem to add a bunch of overhead. I guess I’ll see. An update on Vim: sometimes I find myself pressing “j” to go down in…