Better HN
topnewbestaskshowjobs
Log inSign up

OlaOst

4 karma · joined Dec 29, 2016 (9y ago) · 3 submissions

Submissions

comment 9y ago · link · parent

I got one implemented in D at https://github.com/olaost/snowflake

Should try to put it up on Shadertoy...

comment 9y ago · link · parent

Consider a single free water molecule. As it moves around randomly it will hit the growing snowflake on a random side and get stuck to it, jiggling around a bit until it is in a position that is hard to get unstuck from. This creates the basic hexagonal shape of the snowflake.

Because of the huge number of water molecules floating around, it should be statistically likely that all sides of the snowflake will be hit and grow evenly. But the tips of the hexagon will be slightly more likely to be hit since they are protuding a little bit. Thus the tips will grow outwards and will be even more likely to get water molecules stuck to them. Eventually the tips will get large enough that molecules will stick to their sides, creating new growing branches. And those branches will eventually grow other branches and so on in a fractal manner.

The saturation of water molecules and the temperature are the conditions for how often the snowflake is hitnby water molecules and how much they jiggle around before getting stuck. As the snowflake falls through the air, these conditions change, which creates all the varied forms of snowflakes.

comment 9y ago · link · parent

The D language, while not 100% C++ compatible, takes a pragmatic approach to C++ interop (https://dlang.org/spec/cpp_interface.html)