Hacker News new | ask | show | jobs
by Sharlin 1642 days ago
You can exploit this nifty fact: in a pixel grid if you color a pixel at (x, y) based on whether (x & y) == y, you get a discrete, right-angled approximation of the Sierpinski triangle! Transform x and y appropriately to get the equilateral version.

https://play.rust-lang.org/?version=stable&mode=debug&editio...

Edit: quick Shadertoy version: https://www.shadertoy.com/view/flVXDh

1 comments

OMG you've actually done it! That's outrageous!