One of this year’s most jaw-dropping efforts to date is developer Román Cortés 3D rendering of a rose. Relying on Monte Carlo methods to keep the code size down, Cortés’ code draws a very nicely shaded 3D rose for the love-themed 2012 edition of JS1K. You can check out the live demo on the JS1K website.
One word of warning, part of what makes Cortés’ rose so small is that much of the heavy lifting is handed off to the processor. The demo code brought my CPU use over 100 percent and kept it pegged there the entire time it was open in Safari. Firefox and Chrome both managed to keep the number down to roughly 93 percent, but suffice to say that a procedurally generated 3D rose will tax your CPU.
To see how Cortés created the code behind the rose, be sure to visit his blog which offers a very thorough tutorial explaining how and why the code works. There’s also a great write up on Cortés’ previous JS1K effort, a 3D Christmas tree. Also be sure to check out the other submissions to this year’s JS1K contest on the JS1K website.