Tuesday, October 25, 2011

Koch Snowflake - Reloaded

As stated in my last post I played around a bit with Koch Snowflakes and a variation of it.

After figuring out a way to calculate the triangle-count of the next iteration based on the current count it was possible to prevent program crashes due to vertex-/index-buffer overflows.

Another thing made possible is to "merge" the two generation algorithms, i.e. use one method for iteration x and the other for iteration x+1.

The "classic" Koch snowflake algorithm should look something like this:

  1. Start with a triangle (or a tetrahedron made of 4 triangles) and divide every edge in half.
  2. The 3 new points form 4 smaller triangles with half the size.
  3. The triangle in the middle is the base of a new tetrahedron.
  4. Do steps 1 and 3 for every triangle until desired complexity is reached (which is pretty fast).

"Classic" Koch Snowflake subdivision

The variation I (and some others on the web) used nearly does the same, except the smaller tetrahedron is turned that the edges of the smaller base triangle are parallel with the bigger one:


Now I can combine the two different methods to create interesting new patterns. For example:

  1. Start with the initial tetrahedron, then use classic algorithm (C)
  2. Then use variation (V)
  3. Repeat alternations to create the pattern CVCVC
The pattern CVCVC
And some more...
The pattern VCVCV
The pattern CCVVC
The pattern VVCCV
Many more patterns are possible, I was too lazy generating them all. Maybe on personal request...?

1 comment:

Anonymous said...

I Njoy