Title: Base-Motif fractal generator! Post by: Zojirushi on January 15, 2011, 05:53:38 AM I'm reading through "The Fractal Geometry of Nature". Slowly, of course, because it's hard to make sense of his writing if you're not already familiar with the subject xD Oh well, along with calculating dimension and stuff, as I follow along in the book, I'm creating the fractals he describes. So far, I have base-motif fractals coming along very nicely. Basically, you start out with a couple line segments (the base), and you replace each line segment with a series of line segments (the motif) ad infinitum. One limitation of my implementation is that the curve has to be connected - no islands, no jumps. This means you can't render those infinite island fractals, or fractals like the cantor set. Anyways, you can download a demo at the following link, but you'll need DirectX9.0c (that exact version, but you can have multiple versions installed without a problem, so you don't have to uninstall anything). if you get "missing dll dxd9c", thats the problem. http://www.neurofuzzydev.com/downloads/DBPro/BaseMotifFractal.exe (http://www.neurofuzzydev.com/downloads/DBPro/BaseMotifFractal.exe) instructions are as follows: Code: `Q/A changes totalIterations` aaand of course I wouldn't post this in the images showcase if I didn't have pictures! first, failed attempt: (http://www.neurofuzzydev.com/img/fract/fractalAttempt1.png) compilation: (http://www.neurofuzzydev.com/img/fract/fractalAttempt2.png) koch curve to levy curve: (http://www.neurofuzzydev.com/img/fract/kochToRight.gif) koch island and koch island filled curves: (http://www.neurofuzzydev.com/img/fract/kochTriFill.gif) levy curve evolution: (http://www.neurofuzzydev.com/img/fract/levy.png) so, the levy curve has a right angle bracket to start out. If you flip the bracket up and down, this comes up with a crapton of other, completely different shapes! These are called sweeps. dragon sweep: (http://www.neurofuzzydev.com/img/fract/dragon.png) polya's sweep: (http://www.neurofuzzydev.com/img/fract/polyasweep.png) cesaro's sweep: (http://www.neurofuzzydev.com/img/fract/cesarosweep.png) two other right angle sweeps: (http://www.neurofuzzydev.com/img/fract/othersweep1.png) (http://www.neurofuzzydev.com/img/fract/othersweep2.png) one of my favorite one's here. the coloring has nothing to do with the fractal. the motif for this is symmetrical about its center. It's actually a pretty regular shape, but it's also a sweep, so because it's flipped so much, the whole thing looks irregular. (http://www.neurofuzzydev.com/img/fract/fractal.png) these aren't exactly mona lisas, but I'd say they're eye candy for the technically inclined! also, source code is available here:http://forum.thegamecreators.com/?m=forum_view&t=180312&b=6 (http://forum.thegamecreators.com/?m=forum_view&t=180312&b=6) also, this is to be noted: on some of the "evolution" pictures, not all the information needed to generate the fractal is given in the first three images (not necessarily at least). Each line has a property of whether it will copy the motif upright or upside down, but also whether it will copy the motif backwards or forwards (flipped horizontally). So... keep that in mind! this isn't the completely classical thing where the first two pictures describe everything. |