[net.graphics] 3d fractal generator & shader posted to net.sources

chavez@harvard.ARPA (R. Martin Chavez) (07/02/85)

	I've received a fair number of inquiries regarding
my fractal generator.  I should emphasize that 
	(a) the code requires oodles of CPU cycles if 
you want to compute at high resolution; 
	(b) your frame buffer should have at least
six bits of color; 
	(c) I don't have time to maintain and debug
the code, but I will be happy to answer questions; and
	(d) you should probably get a copy of Mandelbrot's
"The Fractal Geometry of Nature" if you want to generate
some serious fractals (though I have shell scripts to get
you started.)  The choice of polynomial iterates is critical;
Mandelbrot describes the theory in some detail.  There
was also in article in an ACM SIGGRAPH (two [three?] years
ago) that outlines the theory of 3D fractals.  (One
of the authors was Mandelbrot's co-worker at IBM; to
him is due the inspiration for this code, even though I 
can't remember his name at the moment.)

	I do not take responsibility for any bugs you
may find, nor will I sympathize with you when your
system manager asks you why you created a 50Mb file.

	The code is here presented exactly as it was
one year ago.  The file fractal.ms contains some
sketchy documentation; you'll have to compile the files
yourself, as I haven't included a makefile.  The
shell script in 'quaternion.sh' once produced a
memorable picture that I immediately christened 'alien';
I will gladly send the pixel map to any disbelievers
out there.

	The program 'display.c' produces two files,
picture.{col,img}.  The .col file is a color table, 
and the .img file is a pixel map (one byte per pixel)
scanning from left to right and from bottom to top.
The constants in graphics.h (e.g., SCANLINES and
SCANWIDTH) will need to be changed.  You may also
want to experiment with colors other than blue.

	I attach only two stipulations to the distribution
of this code: (1) keep my name associated with it, and
(2) send me any interesting modifications that you devise.
I will be happy to post a revised (and cleaned up) shar
file once people have hacked away a bit.  This code is
a real MESS, but it wasn't too bad for a two-week academic
term project.  (After 150+ hours of hacking last spring,
I haven't been able to bear the sight of this code until
now.)

	Again, my apologies for the crufty code, but
it *did* work in the not-too-distant past.  Enjoy!

		[cf. net.sources]

R. Martin Chavez
Q-4 Nuclear Safeguards
Los Alamos National Laboratory (rmc@lanl.ARPA)

srneely@watcgl.UUCP (Shawn Neely) (07/05/85)

Is it standard terminology to label the dimensionality of a fractal
by the next higher integer? I guess "Here is a 3-D fractal" is sometimes
more appropriate than "Here is a 2.9375-D fractal".