Devember devlog #2

Another day gone. It’s too late and, in fact, where I live is already day 3, but I haven’t gone to sleep, so I think that the work is valid for day 2 (and I will work again in this after getting some sleep for day 3, so…).

I haven’t advanced too much, but here’s my progress:

  • I’ve saved the image I create to a .ppm file, so I can show it in the same execution. No more writing to stdout or having an existing image with the expected name before execution.
  • I’ve created some structs for a vector with three components, a ray and a sphere.
  • I’ve created a function that calculates the dot product of two vectors and I’ve written a first prototype for the ray-sphere intersection test (I had to write the test in paper first in order to remember the “theory”, but the code is still pretty ugly. I promise I will change it).

I’m not using the ray-sphere intersection test yet, as I have to create the ray for each pixel (this is the main task for tomorrow), so the output of the program is the same than yesterday.

You can check the changes in the code at my github repo [0].

That’s all for today. See you “tomorrow”! :)

[0]: https://github.com/ralntdir/devember2016