| Fractalicious |
[Jun. 16th, 2008|03:38 pm] |
I dunno how many fractal or graphics geeks read my journal, but I'm looking for some specific ideas that maybe someone could help me out with (or be fascinated by the very concept of).
Fractals. The Mandelbrot set is 2-dimensional. (Wikipedia will tell you about Hausdorff–Besicovitch dimensions and I don't care about them. When you look at it, it has an X and a Y axis but no Z axis, and that's what I'm referring to here.) I want to find a 3-dimensional one. I could rotate Mandelbrot around its X-axis and get something pretty, but I was hoping for something with tubes that snake around--not vast arcing swaths cut out of space. And I can't just easily port Mandelbrot to three dimensions unless someone makes some really fascinating changes to math sometime very soon, because it's an iterative algorithm that puts the X and Y coordinates in the real and complex part of a number. There's nowhere for Z to go, and it would REALLY not look good if Z replaced the power of 2 in that equation. I think.
So, I need a nice 3-dimensional, or at least natively 3-variable fractal.
Even more demanding: It'd be nice to have an escape-time fractal instead of an iterating fractal. Yes, yes, Sierpinski is very nice, but iterating fractals really don't work for the specific application I have in mind. Specifically I want an escape-time fractal because you can calculate the value of any point to arbitrary depth in a vacuum. You don't need to calculate the rest of the fractal to do it, like you do for Sierpinski. Mandelbrot is an escape-time one, and it's pretty nice.
I'm -considering- doing this with Julia sets... except that Julia is FOUR-dimensional. Each Julia set is a 2D picture, and you define a Julia set out of two more variables. I could always set one dimension constant, or I could try doing something really bizarre with time travel, I guess. Holding one variable constant is an effective, if unbeautiful, solution. At least it allows for multiple maps to explore.
... Voxels. A voxel is a volume-pixel, for the uninitiated. An MRI is a collection of many slices of pictures of your brain, so each picture has X and Y, and the location of that picture in the stack of pictures is Z. Voxels are a different way to do 3d rendering...you just divide space into a bunch of cubes, instead of using polygons. You shoot a ray of light into the scene, and look at which cube(s) it hits, in order to determine the color of the pixel to draw on the screen. Very very good for simplistic, non-reflective raytracing.
Are these two things coming together yet? I want to render a fractal in voxels. I want to render it in variable depth, so when you get close to a wall, it scrapes more detail out of it--but far away, it doesn't bother to calculate things yet. I know this part is very do-able. Maybe even 'easy'.
The hard part is making it interesting to LOOK at! See, the problem with escape-time fractals is that they define a monochrome set--either a pixel/voxel 'escapes' after a bunch of iterations, or it doesn't. That means all the walls are just one color. In order to make it interesting, I want to do something with the SLOPE of the volume, and have reflections. I might be able to puzzle out my own way to calculate the slope of a surface at a given voxel, but I'd really like it if anyone reading this has any experience with that (or knows someone who does / can point me at a paper on the subject).
Besides that, pixels are colored based on how far away from the camera they are, like it was in a foggy place. It'll take work to make this good.
Yeah this is a pet project I thought a lot about over the weekend. My last 3d fractal renderer (it's OLD) just made a height-map out of Mandelbrot with some interpolation, and rendered it with polygons...that was a disaster for a LOT of reasons. Time for a different approach. And for those of you who are boggling at all this, um...sorry? |
|
|
| Comments: |
*boggle*
Kitt's Brain Translation: blah blah blah fractal blah blah blah math blah blah blah pixel blah blah blah disaster. Disaster. That's something I understand!
One note I might make, there exist "skip to end" algorithms for iterative fractals-- you can do iterative calculations to plot random points on them. I realize that this doesn't satisfy the Arbitrary At A Point criterion, but it could be worth noting.
As to the unpretty Julia Set option, I actually like this one a lot because it gives you some hope of plucking out an interesting fractal by design. And holding one variable constant isn't the only option: consider using a parametric equation to trace curves or lines through the space of C(real) + C(imag). This idea could let you "sculpt" the landscape a bit, because of the eerie matchup one always sees between a Julia Set and its corresponding point on the Mandelbrot Set.
Example: you want your set to have edges at the top and bottom which fractally trail off rather than abruptly ending in sliced-off ends, so have your parametric track through the Mandelbrot Set end and begin outside it: you're mathematically guaranteed to have empty Julia sets at either endcap!
(Z = Z^2 + C starts out as escaping in those cases.)
Also note that in a Julia set you're ALREADY holding TWO variables constant for the 2D version.
The Mandelbrot set itself simply holds the other two variables constant. That's about it.
Of course, it's been far too long since I worked with fractals, so I'm not sure what all this implies, but it's already gotten me to open up several Wikipedia articles on the topic (their mathematics section is, unsurprisingly, vast.
Actually they're not held constant in the Mandelbrot Set so much as they change for EVERY POINT. The center of each Julia set will have the same escape time as the corresponding POINT on the Mandelbrot Set plane.
Right, meaning that each point on the Mandelbrot Set corresponds to the point (0,0) on an associated Julia Set. Meaning those variables are held at zero.
Or am I muddled?
From: (Anonymous) 2008-06-18 01:02 am (UTC)
Fractalicious | (Link)
|
Depending how much 3d you want, you could generate pseudo normals like a bump map and give it some depth and use a low (to the horizon) light source to emphasize it.
Jon peddie
From: (Anonymous) 2008-06-18 11:47 pm (UTC)
Quaternion Julia Sets | (Link)
|
If you want 3D for Mandelbrot or Julia sets, you can use quaternions instead of complex numbers. This gives you a 4D image, but you can take a 3D cross-section of it (equivalent to setting one parameter to a constant).
Check out a page about quaternion Julia sets here: http://www.egregium.us/quaternion-julia-set-fractals/
I'm going to post an explanation of how I rendered those images (sort of like the pseudo-raytracing voxel thing you're describing), but in the meantime you might be interested in this article: http://www.math.spbu.ru/diffjournal/j/pdf/rosa2.pdf
The slope of a voxel isn't hard (it's really the normal vector you're interested in). The article above shows a little about how to do it. I assume it's derived from a vector cross-product. | |