Fractal type Attractor - a Tutorial
The fractal type "Attractor" - new in ChaosPro 4.0 - is based on formulas which generate one 3D point per iteration. This point will then be drawn - more or less!
In the first instance this does not sound too exciting, but if you let ChaosPro generate many points, these points will form arbitrary complex objects.
Basically you can - at least theoretically - create any three dimensional object with that: You only need to write a formula, which generates a more or less random point of the desired object.
And after millions of points have been generated, you will see the object itself.
Let's start with a very simple example: A sphere!
What do we need in order to generate a sphere? A formula! More precisely a formula which generates a random point on a sphere per iteration. This is quite easy.
Of course we do not need to write such a formula, as it belongs to the standard distribution of ChaosPro.
So let's start: At first we create a new fractal of type Attractor:
- Choose menu item Fractal/New Defaulttype/Attractor: A new fractal gets generated, using default values.
- Press the green traffic light to start generating the fractal object
- Make sure the parameter window is open: Menu item Fractalwindows/Parameters must be checked.
And now we change the formula:
In the parameter window we select the Formula tab (there are five tabs: Parameter, View, Light, Formula, Coloring - see image at the right side).
We then change the iteration formula currently used by clicking with the left mouse button onto the icon beneath the formula name - see image, labelled with number (2)
ChaosPro will then open a window in which all formulas currently available are presented in a tree view.
The fractal now uses that formula.
There is an item called AttractorConstructor.cfm, if collapsed, expand it to see the contents.
There is a formula named "Sphere". That's the one we are looking for! We use it! Simply double click onto that formula.
ChaosPro has a preview mode in which the first few thousand pixels are drawn quickly in order to show you the basic shape of the object.
Whenever ChaosPro needs to redraw the fractal it first draws the preview.
We now can rotate the object: We click into the fractal window with the left mouse button and move the mouse around. This will rotate us around the object.
Although it looks like the object itself rotates, mathematically "we" are rotating around the object. But in principe this does not make any difference for us as long!
To be even more exact we do not rotate around the object, but around the view point: Let's switch to the View tab, there we can see the view point which is (0/0/0).
And the object, i.e. our sphere, is centered around (0/0/0). And due to that it seems as if we are rotating exactly around the object.
If the object by chance would not be a sphere, but rather some other complex sophisticated object, which lies around anywhere in the space, then it would run out of round, if we rotate...
Let's practice this and change the view point: Either complicated, by entering some values, or easily and more intuitively:
Hold down the Shift key and "grab" the fractal with the left mouse button (i.e. press left mouse button inside the window and move the mouse):
By doing that we do not rotate around the sphere, but move around the view point.
Well, and now stop holding down the Shift key, grab the fractal again, move the mouse. Oh! It runs out of round!
If you have a mouse wheel on your mouse, then make use of it: Using the mouse wheel you can zoom in/zoom out.
Fig. View Tab
All these actions can also be done in the corresponding tab, i.e. in the View tab: The sliders and entry fields found there in principle do exactly the same: Rotate, zoom and such stuff.
Whether you prefer to use them instead of directly grabbing the fractal is up to you.
There is a feature which needs to be mentioned: The checkbox "Follow Object" in the View tab (see image): The feature might be very useful sometimes - and nasty and irritating at some other time:
If activated, ChaosPro will determine the middle of the object while doing the preview render and set the view point to that point every time the fractal changes.
It thus "follows" the object and makes sure the object is halfway "centered" in the window.
This might be very reasonable if you are wildly searching for interesting fractals and you must constantly "find" the fractal as it may be outside the current window.
As such you then the must constantly readjust the view point so the visual focus is at the center of the object.
On the other hand it can be very bothersome if by accident the checkbox is activated!
So do not forget to uncheck this check box! If your fractal seems to constantly change the position in the window, then perhaps this checkbox is activated!
Suppose you've just repositioned the fractal so it is perfectly centered in the window, then you shortly adjust the light settings
and some other parameter and suddenly ChaosPro discards your view point and sets it to what it thinks is the center of the object.
Let's go back to the main topic- our sphere. Basically very boring! What can we do with it to make it more interesting?
Well, ChaosPro constantly generates points which then are drawn. The lighting algorithm then detects points, tries to find a surface using neighboring points and "throws" a light ray on it to determine the light intensity.
And the resulting object, the sphere, then is drawn.
Now what would be if we "displace" the points "by random" immediately before they are drawn?
Let's do that - let's add another formula after the sphere formula: See the image at the left side:
You need to click the right button: The button immediately above the "desired" button lets you change the current formula (that's not what we want), and our button lets one add another formula.
Click onto the button.
The new formula which performs a random based displacement of a point in 3D space, is in the folder AttractorTrafo.cfm and is labelled "Perlin based FBM".
After the formula has been added we can see the effect almost immediately: Oops! Our sphere is distorted!
As a side note: We should make sure the checkbox "Final" is checked with our new formula "Perlin based FBM" so that the formula is applied after the
input for the next iteration has been determined, immediately before the point is drawn.
Otherwise the input for the next iteration is the result from the random displacement which could be nice but if not desired...
But because the base formula here (sphere formula) is a formula which does not care about any starting point and just generates the next point on the sphere by random (the formula is a so-called "constructor" formula...) the checkbox has no effect in this special case.
But please activate the checkbox now as it is important for later steps in this tutorial...
Now it's upto you: Experiment with the parameters of the formula "Perlin based FBM": Try out Octaves=1,2,3,... and watch the effects, set Scale Factor to 2,3,4,5, try out different values for Scale.
The image aside for example has the following settings:
- Scale Factor=1.5
- Scale Step=0.5
- In Coloring Tab Speed set to 0.1 (so that the colors do not change so much...)
- Zoom out a little bit, rotate
Finally it should not be too difficult to obtain an object which looks like a stone or a comet or a crinkled piece of paper (assumed you chose a proper color...)
To sum up: Originally there was a sphere. By the subsequent formula (Perlin based FBM) the sphere was distorted.
And now imagine what happens if you apply the Perlin displacement formula to a more complex base shape...
I think it would be best to try it out: Let's adjust the parameters of the Perlin formula to some smaller values,
otherwise the formula is so dominant that it will make crinkled paper from any object:
- Scale Factor=0.5
- Scale Step=0.5
- Now lets check the checkbox "Hide" for the formula "Perlin based FBM", so we can see the base shape, our sphere.
- Now we change the sphere formula: Press the button as shown in the image aside. In the formula window expand the folder "Attractors.cfm" and choose the formula labeled "Polynomial A/B".
- Enter the following parameters manually:
- Move/rotate the object so it fits into the window.
Ok, looks nice, not so boring like a sphere...and now we uncheck the "Hide" checkbox of the "Perlin based FBM" formula, in order to apply the distortion.
If you like you can change the colors, the resulting object might then look as follows:
Sometimes it lasts some time until the fractal appears to be "solid": ChasoPro already uses all of the CPU power of your system for fractal type "Attractor", i.e. if you have a multi core CPU you can see that all your CPU cores are busy.
But nethertheless, it needs time and millions of points until you can see whether the object is nice and worth some fine tuning or not.
Lets stick to this formula, I would like to explain the search functionality and experimenting with parameters:
First of all, we deselect "Perlin based FBM" by checking the "Hide" checkbox. This makes the rendering faster, that is never amiss.
The current fractal looks nice, but isn't there a more beautiful thing? We could change the parameters of the formula. Cumbersome!
And it's often leading nowhere.
Fig. Search Button
Great many combinations of parameters lead to just an endless cloud of points which cannot be drawn correctly.
Due to that ChaosPro (as well as Chaoscope, another very nice program! You should definitely try it out!) an automatic search function:
This search function picks parameter values randomly, checks whether the resulting fractal can be drawn. If yes, it stops, if no, it continues.
This task lasts until ChaosPro has found parameters, which seem to form something reasonable. Whether the resulting fractal then is nice or rather boring...well - ChaosPro cannot know that.
Ok, let's click onto the button which shows a magnifying glass. Does a new fractal appear?
In any case a counter will appear in the window where the fractal is drawn: It shows you how many parameters ChaosPro has already tested while searching for new reasonable parameters.
If the counter disappears, then ChaosPro thinks, the current parameters lead to something useful. If the counter does not stop increasing,
then you can press onto the search button again: ChaosPro will stop the current search and restarts from scratch. Sometimes this helps, sometimes not.
If the counter disappears and the window is black, there are two reasons:
- The fractal is outside the current view area (perhaps it is behind us, or too wide left/right/up/down). So we zoom out (mouse wheel is the most easiest thing) in order to check whether there is a fractal anywhere.
- If all stays black, then bad luck, the search yielded no valid result. We then continue with the search and keep on clicking onto the search button.
And at any time ChaosPro will find something. Keep on searching, you won't break anything! Some people spend hours clicking onto the search button and watching the results.
Not later than now you will become quite fast in mouse handling and using the mouse wheel: When using the search function you need to constantly
adjust the position of the object: Sometimes it is far away then you need to zoom in, the next object is too near and you need to zoom out in order to see it completely.
Sometimes the object is not centered and is somewhere near the edge of the window and you need to center it (you remember...holding down Shift key will let us "move" the object instead of rotate it).
And not later than now - if you use the search function - you will recognize the benefit of the checkbox "Follow Object" in the view tab
which automatically adjusts the viewpoint so that the object is halfway centered: It spares yourself some work with the mouse.
Fig. Search Settings
If you have found an interesting object then pause for a moment: The object looks nice, but how would slight variations of it look like?
What if ChaosPro would change the parameters by random only slightly? ChaosPro can do that: The slider at the left side of the magnifying glass
specifies how strong the parameters should be changed. Normally the slider stays at 100 (unit: percent), that means, the parameters will
be chosen completely at random from the defined range of values.
Set the slider to 0.5%. That will instruct ChaosPro to change the parameters only by 0.5% of their defined range of values based on the current value.
This is ideal in order to get only slight variations or mutations. If you want stronger variations, choose a higher value.
Now click again onto the magnifying glass. You will see: The fractal looks quite similar to before, but it has changed somewhat.
Sometimes it has changed to be more interesting, sometimes it will be more boring. If you don't like the way the parameters are taking, then press Ctrl-Z or choose the menu item "Fractal/Undo", in order to go back to the previous settings.
Fig. Parameter Change
Using the search function in ChaosPro is one way of finding interesting objects. But of course you can change the parameters yourself by directly entering numbers.
And regarding that I now want to describe another small new feature which ChaosPro offers:
ChaosPro allows you to change a number in an entry field not only by typing in a new number, but also using the mouse. This feature is "general" and not limited to the new fractal type "Attractor": Whenever you see an entry field with a number inside, you can change it with the mouse.
Now how does it work:
The digit which you selected will be increased or decreased while you move the mouse up and down. See image at the right side, perhaps it helps a bit to understand what I mean.
- Choose a digit from the number using the mouse (by selecting a digit with the left mouse button).
- Keep the left mouse button pressed, do not release it.
- The digit which you've just selected defines how strong the number will change.
- After that move the mouse up/down while holding down the left mouse button.
If there is the number 0.77903204 and for example you choose the 0.77903204, then you can easily explore how the fractal looks like,
if the parameter is 0.78903204, 0.79903204, 0.80903204. This is easy going with the mouse.
Round about 20 pixels on the screen correspond to a change of the selected digit. By selecting the proper digit you can determine how much the number actually changes.
As ChaosPro restarts the rendering each time a parameter changes you can see quite fast, how the fractal responds to changes of its parameters.
Enjoy yourself exploring fractals!
Let's sum up what we have done so far: ChaosPro can use an arbitrary formula (Sphere, Polynomial A/B, or whatever formula) f1(z). You can add another formula f2(z) after that formula (for example a random displacement formula), thus the resulting formula will be f2(f1(z)).
You can proceed doing so and add as many formulas as you like (or as it makes sense), in order to get interesting effects.
Now to something new: It is not only possible to add a formula after another formula, but also to create a new formula sequence in addition to the existing one(s). Until now we worked with a single formula sequence: We had a sphere formula, added a random displacement formula. That's it!
But internally ChaosPro chooses a random formula sequence in each iteration. As we had only a single formula sequence, the same sequence has been chosen.
It's possible to create a "new" formula sequence: This is basically done for IFS fractals: They contain several formula sequences, each sequence
consists of a simple matrix multiplication and a vector addition. A single formula sequence there would yield either a single point or a sequence of points which go to inifinity - not too exiting!
But if you choose several sequences of formulas and thus allow ChaosPro to randomly choose one of the formulas for each iteration, apply it, choose another formula randomly, apply it, etc., then very interesting new objects will appear.
Let's try this out in order to show something of the flexibility of this fractal type: Let's choose three formula sequences, each sequence consisting of a single formula - a linear transformation formula (which effectvely does a matrix multiplication plus a vector addition).
ChaosPro has a little-known feature, the so called "Presets": These are different default settings for fractals, ment to be starting points for exploring.
If you like you can create your own additional presets, starting points for fractal exploration. You obtain a list of presets by clicking with the left mouse button
onto the small arrow within the formula button (at the right side of the formula button) - or by clicking with the right mouse button onto the formula button.
A popup menu will appear which lists the currently defined presets.
The list might look different than shown in the image, that's because I am writing this tutorial before the final release of ChaosPro - but the idea behind that stays the same.
We now select the menu item "Select IFS": Now our fractal will be changed, the parameters and formulas assigned to this preset will
be assigned to our fractal.
A quite interesting fractal. As you can see, the formula with the name "Scale, Shear, Rotate, Displace" has been assigned three times to it.
Of course the three formulas have different parameters. This is what makes it interesting.
You can also see that "weight" and "color" is different for each formula:
The "weight" defines how often ChaosPro will choose this formula compared to the other one. If formula #1 has weight=1 and formula #2 has weight=8, then formula #2 will be chosen 8 times as often as formula #1.
And "color" assigns a unique color to the formula which allows a coloring formula to reference that parameter and create interesting coloring effects.
But I want to show what's else possible: At first we choose another color palette, I like "Volcano". The toolbar contains the palette icon.
Rotate, zoom in/out to get a feeling of what this actuall is.
And now I want to distort this fractal using the beforehand used formula "Perlin based FBM". One difficulty now is that we have three formulas and thus
we now must add the new formula to each of the three formulas if we want to displace the points.
So we select the first formula and add the formula "Perlin based FBM" from AttractorTrafo.cfm. And in order to displace the final point and not to modify the input for the next iteration (and thus the overall shape of the whole IFS fractal) we
mark the checkbox "Final" and thus tell ChaosPro, that this formula should be applied immediately before the pixel will be drawn.
Then we select formula 2, add "Perlin based FBM", make sure that "Final" is checked. The same procedure for formula 3.
You can see, the fractal looks a little bit distorted! In order to distort it further, choose Scale=0.4 for formula "Perlin Based FBM" for each of the three formulas.
It's a little bit cumbersome to constantly switch between three formulas if you want to change some parameter in all of them. But that's life!
Looks promising? Yes, could be more beautiful, but it's up to you to explore!
Now if you have some spare hours left (well, in fact: not you, but your computer), then you could render an animation, a very simple one, just to show you that this *is* possible:
- Please open the animation window and add the current fractal: Simply click onto the button "Add". A copy of the current fractal will be added to the animation.
- Then set Scale=0 on all three formulas in order to remove the random displacement.
- Add the fractal with the new settings to the animation by clicking the button "Add" again. A copy of the current fractal will be added.
- How much time do you have? How much time did it need to render the fractal? My computer needed 1 minute for the fractal, I have 2 hours spare time, thus I can now render 120 frames. This will give a smooth animation I think...ok, why not?
I drag the second key frame in the animation window and pull it down until there are 120 frames between the first one and the second one.
- Ok, finished, rendering the animation can start, please click onto the button "Start" in the animation window.
- After choosing a file name ChaosPro will ask for the compression to use. I always use "no compression", as I always will use another animation editing tool which allows me to experiment with different compression/quality ratios, depending on my needs: If I want to upload an animation to my homepage, then the size should not be too big. If I want to show a friend such an animation, then the size does not matter, quality is what matters!
This is of course best done with a perfect animation which then can be downsized to your needs.
It's very easy to create an animation. And by viewing the animation you can see the effect of the "Scale" parameter. It seems to be only a multiplicator for the displacement: From 0.4 (displacement) slowly moving to 0 (no displacement).
If you like you can rotate the fractal during, zoom in/out, you can add dozends or hundreds of keyframes, just as you like. I only show you a few basic possibilities, just let your imagination run wild.
ChaosPro also has further render modes: A render mode determines "how" ChaosPro renders the object from all the millions of points. Until now we used the render mode "Solid":
In this render mode ChaosPro tries to form an object and lets shine light onto it in order to make the object solid.
The different points are used as samples for the whole object. This works quite well for solid objects (like a sphere), but sometimes areas of the object are hit too rarely, thus too few points are calculated for that area thus the object looks somehow perforated.
But there are also other render modes: My favorit is the "Flame" mode, well-known due to flame fracals (you might google for that).
The main trick done by this algorithm is that it counts how often a pixel on the screen gets hit and then the logarithm for that will be calculated - just to get to the point.
As it operates on screen pixels the 3D effect basically is thrown away - it's not possible to render a light and light is very important for the perception of 3D.
but on the other hand the object looks transparent and unveils its inner structure. Due to the logarithm applied to pixels the object still looks like 3D (dense areas seem to be in front, sparse areas seem to be far away), but it does not look realistic, it looks unnaturally beautiful.
Interestingly the flame coloring algorithm not only works for flame fractals, but quite well also for many other 3D fractals (although not ment for them!).
Just choose the flame mode for our current fractal: Choose the "Parameter" tab, choose the "Flame" render mode.
And suddenly our fractal is rendered - well - transparently?
One thing to mention: The flame coloring algorithm needs a proper coloring formula which makes use of the additional information and creates correct colors from the density.
Thus you need the coloring formula "Weighted Sequence" or "FlameSequence". The IFS by default has "Weighted Sequence", and due to that we do not need to change something here.
But if you explore your own objects and the object looks boring it might be due to the wrong coloring formula.
Using a suitable coloring formula creates astonishing effects.
If there exists a flame render mode, then it's for sure not a big step towards flame fractals: Right!
As a waste product ChaosPro then can render flames as well.
But the "normal" flame fractals are 2D fractals and ChaosPro renders in 3D. Well, ChaosPro does not care, it works! Flame fractals can be rendered without problems,
but as they are only 2D objects, only a colorful plane will appear. You won't notice that though - only if you rotate the flame object: It's razor-thin!
But exactly this adds zest to it! With ChaosPro it is possible to extend the flame formula into the third dimension (i.e. adjust the single components of the formula itself to produce a new 3D point instead of a new 2D point) and then to render
true 3D flames!
If you know flames and then imagine that these objects are 2D pixels renders with a special algorithm, then you might get excited how the result would look like if done in true 3D.
So it sounds incredibly interesting: There exists a special formula "3D Superfunction" in "AttractorFlame" which does exactly that: The resulting flame fractals then are true 3D fractals. They look quite similar to standard 2D flames, but
it's possible to rotate them.
Ok, enough talk: How do we get a Flame? Using Presets! Simply click onto the formula selecton button using the right mouse button. And from the list of presets choose "Select Flame 2D".
The next step is the same as in Apophysis or UltraFractal: You start a random search for new useful parameters.
So you do in ChaosPro - the magnifying glass instructs ChaosPro to perform a new search.
But beware, a short note: Flames are somewhat special: If you look at the formula of the flame, then the overall structure is that the
flame master formula contains round about 50 completelty independent small formulas.
You can see that in the parameters listed: There are many of them! And normally a flame fractal only uses only a few of those 50 formulas,
the others not. Otherwise the flame fractal would be too mixed up - and in order to be "nice" for a human being, there must be some kind of
order in the chaos. Additionally too many active sub formulas just let rendering time increase.
Fig. Flame Search
So we need to tell ChaosPro to search, but choose only some of the 50 sub formulas. How do we do that?
Well, the formula for the flame fractal uses a special feature of ChaosPro made for such issues: It tells ChaosPro that there are many
sub formulas inside the main formula. And ChaosPro then offers the possibility to choose some of them at random and then randomly
chooses parameters for these formulas.
This is all done if you right click with the mouse onto the search button. See image at the left side: A small popup menu will appear
which offers us the possibility to choose 5, 10, all or just keep the current ones and then to choose the values of the remaining
parameters at random.
So choose "5 Vars" from the section "All Formulas": This will activate exactly 5 sub formulas from the first flame formula, then choose values for the remaining parameters at random, then choose another 5 sub formulas from the second flame formula, for the third, fourth, etc., until all formulas have been randomized.
Ok, now search can start: If you've chosen the menu item, ChaosPro starts the search. By the way, ChaosPro keeps in mind what you have chosen.
So the next time you want to search you only need to click onto the search button with the left mouse button and do not have to right click, choose item from popup menu.
After some time you for sure have found an interesting flame fractal. Then you would like to render a few mutations, perhaps it gets more
interesting: As before we just set the slider aside to 5%. And then we right click (!!) onto the search button and choose the item "Keep"
in the section "All Formulas".
This instructs ChaosPro to keep the current sub formulas and only slightly changes the parameters.
The sub formulas itself define the overall structure of the flame, if another sub formula would be chosen, then the flame would
change completely. Using "Keep" prevents that.
The result then are mutations.
So much for flame fracals. The 3D-Flame function is labelled "3D Superfunction". If you like you can replace the "normal" flame functions with that one and
then continue your search. Have fun!
Now the tutorial is at its end. There is still much to explore for you, for example the light. But these settings are more intuitive because
they have a reference to the real world. But formulas and render modes and all that stuff is really confusing!
Perhaps a few ideas for you:
- Experiment with colors and coloring formulas! Colors are one of the most important things! A completely chaotic fractal may unveil a beautiful structure if proper coloring is used!
- Try to attach different formulas, for example Polynomial A/B and then Pickover, or any other formula! Why not? Essentially the resulting objects then are more complex than just a single formula.
- Search for IFS fractals on the Internet - the class of IFS fractals is huge! For example there is a program called Xenodream,
which only renders IFS fractals - and for these of course offers much much more than ChaosPro! It's a very exiting program, unfortunately not freeware,
but Garth Thornton and Virginia Sterling deserve my deepest respect for such a great program!
And you can see how complex IFS fractals can become, although the base formula is very simple!