Welcome to Fractal Forums

Fractal Software => 3D Fractal Generation => Topic started by: Buddhi on November 22, 2009, 09:28:43 PM




Title: Sierpinski triangle
Post by: Buddhi on November 22, 2009, 09:28:43 PM
Few days ago I found on Internet some pictures of Sierpinski Triangle and Sierpinski Temple (David Makin's pictures). It is very beautiful mathematical form. Unfortunately I didn't find any detailed algorithm. I decided to found proper algorithm by myself. I made lots of trials and before I understood how this kind of iterative algorithms works I get some interesting pictures. One of these is below.   

(http://www.fractalforums.com/gallery/1/thumb_640_22_11_09_9_00_02.jpg)
http://www.fractalforums.com/gallery/?sa=view;id=1088

Finally I found proper algorithm and rendered this "Sierpinski's Planet"

(http://www.fractalforums.com/gallery/1/640_22_11_09_9_01_17.jpg)
http://www.fractalforums.com/gallery/1/640_22_11_09_9_01_17.jpg

Bellow is my iteration algorithm in C
Code:
double k=2.0;
double a_off = 0;
double b_off = 0;
for (L = 0; L < N; L++)
{
  xx = fmod(a * k+a_off, 2.0);
  yy = fmod(b * k+b_off, 2.0);
  zz = fmod(c * k, 2.0);

  if ((zz>1.0)&&(xx<0.5 || xx>1.5 || yy<0.5 || yy>1.5))
  {
result = 0;
break;
  }
  k *= 2.0;
  result = 1;
  if(zz>1.0)
  {
     a_off = 1.0;
     b_off = 1.0;
  }
  else
  {
     a_off = 0;
     b_off = 0;
  }
}


Title: Re: Sierpinski triangle
Post by: Dinkydau on November 25, 2009, 02:57:05 PM
The second one is really cool!


Title: Re: Sierpinski triangle
Post by: Timeroot on February 04, 2010, 07:11:37 AM
It took me a while to realize these were square pyramids, not the regular sierpinksi pyramids. This means that, although there does seem to be a "floor" in this picture, the "floor" is dense, and it could extend onwards who-knows-how-far... a very simple, yet awe-inspiring image. Reminds me of the ancient Aztecs.  ;D


Title: Re: Sierpinski triangle
Post by: kram1032 on February 04, 2010, 11:44:44 AM
due to them being cubes, you could actually build them... I wonder how stable they would be :)
(Not using any glue between the cubes)


Title: Re: Sierpinski triangle
Post by: Timeroot on February 04, 2010, 05:30:23 PM
Yes, but you would have to build it upside down - note that many of the edges of the "floors" aren't supported by anything. By inverting it, we could get a buildable structure.... but it would tip over pretty easily. Would make an interesting problem for civil engineers, that's for sure!!!!