Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] - Base-Motif fractal (buggy)

Author
Message
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 14th Jan 2011 08:47 Edited at: 18th Jan 2011 17:26
Wait! Nevermind about the bugs! I updated everything with an actual user interface! It's not a nice user interface, mind you. Compile it, and run it *windowed*, so that you can refer to the commented out command list in the code.

Uhh, google base motif fractal if you don't know what this is.

Basically, it generates images like this:




the fractal is considered to be the limit of the approximation. This program approximates a fractal. Generally, every single point where two lines meet, is a part of the fractal. almost all the lines are not part of the fractal, they're just there so you can see the in between part.

What's really interesting is that some of these curves have *no* area. They are infinitely long, continuous, non-differentiable, curves. Some of these curves, however, *do* fill a 2d volume. Basically, these curves have weird properties.
Command list:
`Q/A changes totalIterations`
`W/S changes variable4 - determines switching by each bit`
`spacebar renders up to depth totalIterations
`E/D changes variable1 - determines height`
`R/F changes variable2 - determines offset`
`T/G changes variable3 - determines width`
`not all of these values are used all of the time.
`z changes the base to a line`
`x changes the base to a triangle``
`c changes the base to a square`
`d changes the base to a regular hexagon`
`up arrow/down arrow switches between fractals`
`p randomizes all variables1-4`
`o zeros all variables 1-4`
`i exits the loop, in case you try to render too much!`
`y/h increases preview render depth.`
`preview render depth is so that you can see how the fractal will look while you're messing with
`the other variables. Normally this should be 2 or 3.

note - press and hold I if you're stuck! press I, hold I, and then change preview render depth and/or total iterations.

version using cloggy's DLL:


Version without:



[edit2]

If you want to customize more, mess with the array "Motif". This array handles the generating rules. The basic idea is that you replace every line segment with the set of line segments that is motif, every iteration. So, just by adding values and changing the X and Y coordinate of each array index of "motif", you can get any 2d base/motif array.

Then there are sweeps.

What if you flip each line segment horizontally or vertically? the set of line segments in "motif" would be put in, but backwards or upside down! as it turns out that lets us define a whoole 'nother set of fractals! So, if you change the invx and invy parameters of a motif, you get different sweeps.

*always* set invx and invy! to -1 or 1 only plz!

Also, parts of the program rely upon the fact that the first x,y, value of motif should be 0,0, and the last should be 1,0. Make sure this is the case!

anyways, there are some awesome fractals in here, and i hope to make some .gif animations soon!

Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 18th Jan 2011 17:26
[added some new images]

SH4773R
14
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 24th Jan 2011 06:20
Nice!

Login to post a reply

Server time is: 2024-11-21 15:56:14
Your offset time is: 2024-11-21 15:56:14