3 ms·
It's really not that hard, once you have some idea of the kind of program you're writing. Write it out normally, and start eliminating everything that can be e
by a1k0n 15y ago
It's really not that hard, once you have some idea of the kind of program you're writing. Write it out normally, and start eliminating everything that can be eliminated (in particular, whitespace, braces, if statements that can be conditionals, subroutines, variables, etc). Takes some ingenuity with loops but it's mostly straightforward.
In this particular example the only really odd thing about it is the lighting calculation, which is an algebraically simplified dot product of the light direction (0, 1, -1) IIRC with the surface normal of a torus (gradient of the equation defining the shape). The derivation of that is long gone but it wasn't hard math.