Linked lists and Spheres
I made a lot of progress on the Weekend Ray Tracer. I’m on chapter 9 and I’ve learned a lot about image processing:
- I’ve created a robust linear algebra library full of utility functions.
- I’ve abstracted many of the functions of a ray tracer in modules (rays, camera, color, geometry, hit record, math, random numbers, etc.)
- I learned how to color surfaces by the normal of the intersection with the ray, which really grooves-up the effects:


- I learned how to handle multiple objects in a scene using only linked list, my record being 3000!

- I’ve implemented anti-aliasing, sampling and gamma correction.
- I learned about hidden surfaces and the associated effects we use to render them, like diffusing rays to create matte surfaces.

I could go on longer, but you get the point: the project is very involved and very rewarding.
It’s a bit of a challenge “transpiling” all the C++ examples to C while at the same time managing the restrictions imposed by the final project. With a few exceptions I can’t use any external functions or libraries, and everything has to follow 42’s Norme.
This restrictions are really sharpening my skills, and I can tell that my code is getting better by the hour. I realize now how C++ is relatively high in abstraction compared to C; There’s a bunch of simple operations with vectors that take 5+ lines to implement, and all the C++ headers and classes would cut some of my functions by half.
I’m really enjoying miniRT project so far,
and I’m enjoying it a lot more than printf.
I’ve messed with the effects for hours and generated a hundreds of cool images.
Today I’m gonna plow through the new module of the Elixir bootcamp I’m doing. It’ll probably take me a couple of days to do all the classes and challenges.