Posts
Metals and Reflections
Yesterday I finished all the Elixir challenges from my bootcamp.
Today I’ll resume chapter 9 of The Weekend Ray Tracer Challenge, where I’ll learn how to trace and render reflective surfaces.
Posts
Tesla Bypass
Yesterday I started the Elixir challenges of my bootcamp. I learned how to use Tesla to handle API requests, and how to test them with Bypass.
I really liked Bypass because it creates a local server that handles http request during testing. It’s very easy to use: you just declare it in your tests and define the response of an arbitrary endpoint. This is way better than mocking or VCRing an API for tests since it actually makes the request and it’s not an ad-hoc solution.
Posts
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!
Posts
Rendering bitmaps
Yesterday I started the Ray Tracing in One Weekend challenge and I’m enjoying it a lot. It cuts through a lot of the fluff without dumbing it down too much: I’m 3 chapters in and I’m already generating gradients and tracing spheres.
All the code I’ve written so far can be found in this repo. I have a gallery full of eye candy, and I’m always adding new pictures.
Posts
Ray Tracer in a Weekend
Yesterday I studied Elixir and learned new syntax tricks like Comprehensions.
Today I’m refactoring and restructuring my projects. I’m also writing some pretty READMEs for each one.
I read the first part of The Ray Tracer Challenge book, and I think it’s a bit to dense to start with.
I’m gonna do Ray Tracing in One Weekend first because it’s shorter and has code examples. I’m gonna implement it all on C, and I’m gonna start with the 3dvector library.
Posts
Elixir in Action
Yesterday I finished the Elixir challenges of my bootcamp.
Today I’m gonna read a few chapters of Elixir in Action and get started on miniRT.
Posts
Phoenix
Yesterday I finished an Elixir module of the bootcamp I’m doing and its respective challenges: I created an Elixir web API with Phoenix.
Phonenix is an amazing web framework made with Elixir, and it follows many of the conventions that Rails established. If you’re a rails developer looking to get into functional programming you’re gonna love Phoenix and Elixir, I know I am.
Today I’m gonna finish the challenges and cleanup some of my git repos (add github actions, improve the READMEs, etc.
Posts
Ray Tracing Basics
Yesterday I finished some React challenges from the bootcamp I’m doing. I also learned about Bounding volume hierarchy and The Rendering Equation.
A Bounding volume hierarchy is a tree structure that delimits the objects we need to render in a scene. Each node in this tree is either an object that we might have to render, or a virtual object that contains more than one object.
If we cast a ray and we hit a node in the tree we know we only have check if the ray hits any of the objects below that node, reducing the amount of objects we need to check.
Posts
miniLibX
Yesterday I did all three evaluations and completed ft_printf. It was a big project and my first milestone in 42: It was the first time I felt properly challenged and out of my comfort zone.
I installed the official 42 VM, which we use on all our projects from here on out. It was way easier than I thought it would be. I’m not gonna use it for development since I run Ubuntu on my machine and the packages are completely compatible; I’m just gonna use it for tests and evaluations.
Posts
Finish printf
Yesterday I fixed all bugs on my printf. It’s now passing on all tests, and I’ll do my first evaluation today.
I learned many of the differences between Linux’s and MacOS’s implementations of printf:
Linux doesn’t handle precision for "(null)" string. Linux prints "(nil)" when the %p conversion receives a NULL pointer. Today I’ll plan on doing all of my printf’s evaluations and start researching the next project: MiniRT.
Posts
Formatting strings
Yesterday I implemented string formatting on my printf. I thought the string formatting was gonna take longer, but it was way easier than handling ints: The precision just delimits how many characters you print, and there are far less flag combinations to worry about.
It’s now passing 95% of tests. The ones that aren’t passing are mostly due to differences between the MacOS and Linux implementations of printf.
I’m currently debugging it in a MacOS environment through ssh, and I’m learning how to use debug tools from the command line.