
Building a Ray-Tracing 3D Renderer from Scratch - jamesmiller5
http://www.superjer.com/pixelmachine/
======
lomnakkus
Ray tracing was my introduction to CS-like "real" programming, i.e. not just
typing stuff in[1], but actually sitting down and thinking about the _math_ of
the problem[2]. I remember being super-excited (at 14-or-so yrs old) at being
able to have my Turbo Pascal program draw a 640x480 grayscale(!) plane+sphere
image on my monochrome VGA screen... which was the style at the time; the VGA
card having been bought by me via pocket money and the screen having been
bought by my parents. (Which is just another way of saying they bought both.)

Ray Tracing offers a _remarkably_ big payoff for very little code. It _does_
require a little algebra for line+(plane/sphere) intersections and such, but
that's stuff you can easily look up these days.

[1] Yeah, I'm old. We had "codes" (typically heavily compressed/obfuscated) in
these things called computer "magazines" that you would type in and see what
happened.

[2] There's _always_ math. Even if you're doing CRUD, there's probably math
behind it: Form validation is a certain type of math, etc.

------
tsahyt
Writing a toy ray tracer is something that I'd recommend to everyone who's
interesting in becoming a better programmer. Once you get deep enough into it
you'll encounter so many interesting problems (e.g. data structures, software
architecture, some linear algebra, etc.) to hone your skills on. It's almost
up there with "write your own compiler" as a learning experience in my opinion
and you get the added benefit of creating some pretty pictures in the process.

------
theoh
Ray tracing is great, metropolis flavour particularly. But you need an
artistic sense to create complex and rewarding scene geometry, whether it's
static or animated. I spent years obsessing over CS when the experience that
actually drew me into the graphics field in the first place must have been the
result of someone's artistic judgement, passed through a conceptually very
simple bit of software (this is the 90s I'm talking about) which really just
projected geometry into the screen.

(Oliver Deussen's work on rendering plants and other natural phenomena is an
example of the kind of CS technique necessary to create geometry for any
rendering process.)

------
daveidol
I wrote a similar program in plain Java + Swing (and no other libraries) years
ago, which I dumped on GitHub here (there are a few screenshots):
[https://github.com/idolize/ray-tracer](https://github.com/idolize/ray-tracer)

------
blt
I love ray tracing. A small amount of code generates magical looking images.
More advanced methods have a really pleasing mix of geometry, probability,
data structures/algorithms, and low-level optimization.

