[net.graphics] fractal mountains

iles@hplabs.UUCP (06/10/85)

Also check out (in the how to create pretty pictures catagory)
the work coming out of Stony Brook in "experimental mathematics."

It requires a moderate amount of understanding of the functions
of a complex variable, but not too much, and you do get some very
pretty pictures for minimal coding effort...

Dan Lieman
hplabs!iles

rich@sdcc13.UUCP (rich) (06/15/85)

Note:
     I am posting this in response to  all  the  people  out
there  who  wrote me and said " please tell me what you find
out" when I originally asked for info on fractals.   I  hope
this  is the proper place for it. Send flames to yourselves.
This is an small portion of one of the papers I have written
since  starting  to play with fractals in March,1985. I have
actually done a lot more work with two dimensional  fractals
(reproduced  most  of  Mandelbrot's book plus more). Any way
the net seemed more interested in  mountains  so  here  they
are. They are still a bit crude, but the idea is there and I
have drawn a few this way. (They look a bit more like  rocks
than mountains right now)

     A fractal may be described as  a  self  similar  recur-
sively  defined geometric object. A fractal mountain, simply
enough, is a fractal object that  happens  to  look  like  a
mountain. The following , short, paper describes the methods
which I have used to generate such  objects.  The  paper  is
short  in  the hope of giving a general understanding of the
method. Following this will be the code,  with  all  of  the
ugly details.* The simplest way to describe a  mountain,  or
at least something that sort of looks like one is by drawing
it in a two dimensional coordinate system. This  is  simpler
to  start  with  since  it  is easier to visualize, and thus
easier to debug. So to begin with we will think of a  simple
,  recursive , subdivision of a triangle. The algorithm goes
as follows:



     1) Choose a triangle

     2) Choose a point, with a high probability of being
        inside the current triangle.

     3)  Create a new triangle by connecting the  new  point
     to the vertices of side A.

     4) Recurse on this new triangle to make new smaller
        triangles on it.

     5) Choose a point, with a high probability of being
        inside the current triangle.

     6)  Create a new triangle by connecting the new point
        to the vertices of side B.

_________________________
* For the most part things that I have done here,  have
been  done  simply  because  they have seemed like they
would work. And so it goes.










                           - 2 -


     7) Recurse on this new triangle to make new smaller
        triangles on it.

     8) Choose a point, with a high probability of being
        inside the current triangle.

     9)  Create a new triangle by connecting the  new  point
     to the vertices of side C.

     10) Recurse on this new triangle to make new smaller
         triangles on it.





     This simple algorithm actually  works.  It  is  just  a
shame  that it is not a "fractal" algorithm. A fractal form,
though seemingly random, contains no random points. This  is
easily  over  come though.  Simply define the new point as a
function of the old points  and  you  have  two  dimensional
fractal mountains.

     Now the problem of  creating  a  more  realistic  three
dimensional  image.  The  first consideration went using the
above algorithm to create a series of slices  with  a  given
thickness  in  three  dimensions.  I would then "glue" these
slices together in three space. The triangles that were ori-
ginally  used to define each slice get progressively smaller
as you approach the viewpoint. This method did not work  out
too well.

     The next seems to be the best method that I have  stum-
bled across, in three space:



     1) Choose a four faced pyramid. { A 90x does just fine }

     2) Subdivide face A a into three new faces by choosing a
        new point by means of some function.

     3) Recurse on the algorithm.

     4) Subdivide face B a into three new faces by choosing a
        new point by means of some function.

     5) Recurse on the algorithm.

     6) Subdivide face C a into three new faces by choosing a
        new point by means of some function.

     7) Recurse on the algorithm.









                           - 3 -


     8) Subdivide face D a into three new faces by choosing a
        new point by means of some function.

     9) Recurse on the algorithm.




     In all of these methods almost any parameterizing func-
tion  will  do  in choosing the new points. Though different
functions leave you with very differing functions.
   I hope that you have enjoyed this.

   -rich stewart

     On a note of  personal  interested.  I  graduate  March
1986.  I  am interested in living off of drawing pretty pic-
tures on computers.  Does anyone out there do this  or  know
of what type of places pay people for this.

{ Lucas films I am out here!!!  , hint hint}



ihnp4--        decvax--       akgua----dcdwest---somewhere--
ucbvax-------- sdcsvax -- sdcc3 --rich

rivero@kovacs.UUCP (Michael Foster Rivero) (06/19/85)

---------------------------------------


	In regards  to  Rich  Stewart's  excerpted  paper  on  fractal
	subdivision.


>       1) Choose a triangle
>
>       2) Choose a point, with a high probability of being
>          inside the current triangle.
>
>       3)  Create a new triangle by connecting the  new  point
>       to the vertices of side A.
>
>       4) Recurse on this new triangle to make new smaller
>          triangles on it.
>
>       5) Choose a point, with a high probability of being
>          inside the current triangle.
>
>       6)  Create a new triangle by connecting the new point
>          to the vertices of side B.
>
>       7) Recurse on this new triangle to make new smaller
>          triangles on it.
>
>       8) Choose a point, with a high probability of being
>          inside the current triangle.
>
>       9)  Create a new triangle by connecting the  new  point
>       to the vertices of side C.
>
>       10) Recurse on this new triangle to make new smaller
>           triangles on it.
>
>


	  Close examination of the above will reveal that all three of
	the  smaller  triangles  share  a  common side with the larger
	triangles. A simple diagram would be....


			       /|\
			      / | \
			     /  |  \
			    /   |   \
			   /    |    \
			  /     |     \
			 /    ,' ',    \
			/   ,'     ',   \
		       /  ,'         ',  \
		      / ,'             ' ,\
		     /,'__________________'\



	  Its main drawback is that even at the limits  of  recursion,
	there  will  always  be triangles with one of the vertecies of
	the starting figure, albeit very long and very thin. This will
	produce images with long thin triangular artifacts.





	  A better approach, (and the one I use) displaces the center of
	each vertex by a random amount. The new triangles are built from
	one existing vertex, and two displaced centerpoints, thus....

			       /\
			      /  \
			     /    \
			    /      \
			   /________\
			  /\        /\
			 /  \      /  \
			/    \    /    \
		       /      \  /      \
		      /________\/________\

	  As you can see, each triangle retains a  fairly  equalateral
	shape, and decreases in size in direct proportion to the level
	of recursion.  By seeding the  random  displacement  generator
	with  a combination of all 6 end verticies, sides of adjoining
	triangles  will  produce  identical  midpoint   displacements,
	eliminating  "holes"  in  the final fractal form.  This allows
	one to apply a psuedo-fractal surface to a predefined form.

	  Sorry Rich! You're busted!


					Michael Rivero






     On a note of  personal  interest.  I cut my graphics teeth
with NASA. I already make a living off of drawing pretty pic-
tures on computers.

( Lucas films, I will see you at SIGGRAPH!!!)

rich@sdcc12.UUCP (rich) (06/25/85)

In article <241@kovacs.UUCP> rivero@kovacs.UUCP (Michael Foster Rivero) writes:
>
>	  Sorry Rich! You're busted!
>
>
>					Michael Rivero
>
              naw,
			   I appreciate the help.
			   thanks, rich
			   
			   ps. i am trying to get to the
			   letters, I havent had the time yet.
			   >

fournier@Navajo.ARPA (06/27/85)

*** REPLACE THIS LINE WITH YOUR FRACTAL ***
Indeed the triangular subdivision you mention is better than the
earlier one. It still has a big drawback though, in that the subtriangles
created will be recursively subdivided without any correlation with the
adjoining subtriangles. If you want to approximate fractional Brownian
motion (one of the random fractal processes), this is incorrect since
the 2-D version is non-Markovian, meaning that one side of the surface
cannot be computed knowing only the boundary. A better subdivision scheme
can be found in the Fournier/Fussell/Carpenter paper in CACM, June 1982,
or the Piper/Fournier Siggraph paper of 1984. Of course a rejoinder by
B. Mandelbrot and a reply can be found in the following CACM issue of
August (or July).
Several people are currently working on new schemes to generate 2-D 
approximations of fBm.
There will be a tutorial at Siggraph on fractals, with Loren Carpenter
and Benoit Mandelbrot together again for the first time.
This should be fun!
If anybody is interested in 3-D fractal (or approximations thereof), I can

If anybody is interested  in C code to generate 3-D fractal (and
the code is short indeed, but no display is included), mail to me.
It will take a few days, since I just got here and I have to bring
most everything up anew. Remember that 3-D here means the process
generate a volume, not a 2-D surface to be inbedded in a 3-D space.