The Basics of UltraFractal 5 and its Use of Classes

 

UltraFractal 5 represents a major upgrade of UltraFractal, especially with respect to the creation of formulas. The old programming language for UltraFractal did not allow for the definitions of user-defined functions or for the native import of images. The new programming language uses classes, meaning that it is object oriented. These new terms, and what they mean, will be defined as we work through the tutorial. The change to object oriented programming has also changed the user interface, and this will be the main emphasis in the first part of the tutorial. Of course, all of the old programs still work, and the user interface for the old programs is still the same.

A class is a mini-program that is structured in a way that it can be used with many different types of formulas. When it is used with a formula, it is called an object. In order to use it with a formula, the formula must be written in a way so that the object can be plugged in. For the purpose of understanding the new structures we will call the object a plug-in and the place where it goes a slot. These are not official programming terms, but they will be useful in helping the user understand how classes and objects are used. The big advantage to classes is that a given functionality, as defined by the class, can be used with many different formulas without having to write new code. It also means that the options for a given formula are dramatically expanded with the formula writer needing to write a line of code. As a result the user should be able to create more varied and interesting art without having to try many different formulas.

The class paradigm applies to ufm's (fractal formulas like Mandelbrot), ucl's (coloring algorithms like Orbit Traps) and uxf's (transformations like Kaleidoscope). The classes are stored in a new type of file format called a ulb (class library file). Common.ulb is the foundation class for UltraFractal 5 and contains an extensive collection base classes and utility classes. Users who are familiar with older versions of UltraFractal know that you can click on a ufm, ucl or uxf using the  UltraFractal browser and see a list of the formulas available. In UltraFractal 5, if the user has selected a formula that uses classes, the default class will appear in the parameter list with a browser button icon to it right. Clicking the browser button will give a list of all the ulb's available, and clicking a ulb will show the classes that can go into the slot.

There are some differences in how the parameter list appears and how it is used in formulas that use classes. Orbit Traps was the prototype coloring algorithm around which much of the class information was structured during the development of UltraFractal 5, so we will use The class version of Orbit Traps for most of the tutorial.

If you open UltraFractal 5 and have not changed the default settings the location tab should have the following appearance:

If you click the browse button you will see the other coloring algorithms in standard.ucl. Open the one titled Generic Coloring (Gradient). The location tab will now have the following appearance. The fractal in the view window should not have changed:

Notice that the title of the coloring algorithm is now Generic Coloring (Gradient) and Smooth (Mandelbrot) is down in the parameters region. There are actually two versions of Smooth (Mandelbrot), the original which gives the view in the first image, and a class version, which is the default coloring algorithm for Generic Coloring (Gradient), shown in the second image. If you have selected Generic Coloring (Gradient) for coloring, try clicking on the browse button next to Smooth (Mandelbrot). You should see a list of all the coloring classes in standard.ulb. It should look like this:

On the left hand side of the browser window you should see a list of folders, one of which should be named "Public". Double click on the Public folder and select dmj.ulb. You should see the following:

Select Orbit Traps Gradient (UF5). The is the coloring class we will be using for most of this tutorial. The outside tab should look like the following:

We need to further examine how the various plug-ins can be accessed by the user. In the image above the Trap Position plug-in has its arrow in the position to display its parameters. If you set up the coloring formula as described above you should see the Mandelbrot set with a pattern around it. In case you don't have it set this way, here is a upr that will do it for you. Just copy and paste into UltraFractal.

Fractal1 {
::rpiSiin2de1SvJOMQ47Ix/hIffh8gA0W5Dbb3WpVqal227ITiD4ijdktTp8vfHnECQ3A40cz
e++mX2zMxZKSihwvd4APPDzwpY0T1bFg82ySNrxTn47tmyWt2gnM33jT2RVacglRiimyMaM6
vSh39ElgaM3dz45jD99nf3TgUqitx7VO79NUVORc3sxhRWphohDq0UllTIFGmUgR3TS2sSJL
FpIPZBJhZ2hD89HOInUUwErqRTFGqC/D/Rxj99yJrEWvJTqyL5kKE5kPZWIhx+eZMOVQyhA7
VDRkSUpjKzyRegSU7woXg9o8lKpB5VsQbIKD2fsvVLFLKkbtaBsSxilEGXWawBhzHOgJ0sUa
dWTRE6MAmQKoDHAQ+fRcmgSUd6KJckFaj38MVAZsknVkUGs1DSuUBhNq2dSaW+Anohkea+7x
jK5Lv9xX+9i/oWyMvpIF6LRa0HLWVbCbatDp7XXn17kfjvddkg/tQadLj1tuG+sFVwocai5L
xmNsetSA6aMPNAdFNxIVOi3GUH5ouQqoaBhzt3JJ2L6whHs07wakjKp5+pjorqBCcFteDrwd
0cpEQ/rwOxXcEezaFVvWyTxQ965VedtCUDjRJy8cpo603ey/2eJIHY765/xEOYanpUqpqvBt
TDUHpVnMba612aydO5yPoao7k78SVsMT/MlOhAzOCcnA0wt6qP2v/c0GaRf4p3Q32X891GEd
RV/gLU+smUQ7qzmd/fqNKJLFdF6O3erB8B7G4Hcd4tN3srJ1ukLGa/kyRT747a5QgX3l8UF6
6c7XBfF+Wz2DCF9kEkRUUSaaA2Z0OWCdkyDdU5Zlikqat6/DxNLIhZN9w/B49KAqVvrRAZ5l
7glLT7q06FY7H4SNVfp/cwS21rRNYbtZfAvlZWfYaoLM3XPaXmUHHnjH0F6oBthxdAAGaplc
oi+izCofaKVntP1TcylSlNsduosFujNqOQ4kWVZgXdhETNJ7VuDDf7OH0CG69RFrgX/Yzln3
fa/p2v2Bb/Ph/IDunLSoorrDXTaHh/EX47QKtx9ckMUIWak1157o6hD2/Ygqn7ozlSIjBC8a
nuH4xg3X9J23rSJ4pxxxR3E2s70JNbHEFFFEGFaVTtogpz3Lb6sZzCuZWjgw4ZNCmENbWczu
RTia2NOA0SzbHP2tEyWXZ/LLDjhj2/xJEnVV
}

Now try exploring the parameters in Trap Position and Astroid to see what they do to the image. The behavior should be very much like you are used to in earlier versions of Ultrafractal.