There’s not much cooler than Raytracing. Making photoeralistic (or a little too perfect-istic) images on you computer is definitely cool.
A bagillion years ago, I dove into raytracing and made my own. It was AP Calculus in high school when I realized that gradients lead to surface normals. Shocker!
Anyway, I dug out the old codebase and dusted it off (turns out Turbo C++ is a little different from gcc 10). Substituted OpenCV for BGI and BAM, Raytracer Resurrection.
Still got it.
Let the images speak for themselves:
![](http://punchedtapemedia.com/wp-content/uploads/2023/05/REFR.SCN_.png)
I can VIVIDLY remember the night I got it working. To see the shaded ellipsoidal surface that took several minutes to draw was a pretty cool feeling. Yeah, it was an ellipsoid (technically a prolate ellipsoid), not a sphere.
![](http://punchedtapemedia.com/wp-content/uploads/2023/05/REFR1.SCN_.png)
Here’s the refracted version:
![](http://punchedtapemedia.com/wp-content/uploads/2023/05/REFR1.SCN_refracted-1024x576.png)
Recursive reflection kind of falls out naturally
![](http://punchedtapemedia.com/wp-content/uploads/2023/05/MY.SCN_.png)
Leave a Reply