Fractal explorer is a
Processing sketch created for touch interaction on
Cyber-Commons, a large format display device.
Although the sketch is intended to be run on Cyber-Commons, where users interact either by touch or with a mouse, it can also be run on a common computer for mouse only interaction.
The
Mandelbrot Set is explored in the sketch through categorized parameters of a touch menu.
Touch menu interaction is assisted by a state textbox, positioned horizontally where the user last touched, that displays messages informing available actions based on the previous action.
The goal of the sketch is to allow users unfamiliar with fractal properties to gain an intuitive understanding through interaction.
The sketch’s menu is a recursive class that maintains a list of children of type itself and appears where the user touches.
What differentiates one menu from another is its title, list of children, and associated action.
It was designed to be able to add or remove sections based on the current fractal being displayed in addition to updating the state textbox.
An example is
Julia / Mandelbrot Mode, an option that can be selected to bring up new relevant actions.
-
Fractal Color
This menu opens WidgetColor, a class designed to manage color selection between Processing and the shaders.
Color is managed in each shader by determining the two closest neighboring color nodes from a sorted list to a particular pixel and interpolating their colors.
WidgetColor displays the color bar as well as 4 options that take control away from the menu when selected:
-
Color: This mode causes touched color nodes to toggle selection bars for updating their color (Figure 3).
This feature is multi-user friendly as multiple color nodes can be updated at the same time.
While a color node is being updated by an “on drag” event the color bar updates in real time but the fractal does not due to the limitations described in Shaders.
Newly opened selection bars that overlap the menu or other selection bars hide the previously interacted elements (Figure 4).
|
|
Figure 3 shows 2 selection bars opened. |
Figure 4 does not show a menu because a selection bar is hiding it. |
-
Move: This mode causes a touched node to be selected and then moved by an “on drag” event.
As the node moves the color bar updates in real time but the fractal does not due to the limitations described in Shaders.
-
Add: While this mode is active touching will place a new color node at the same x position as the touch but vertically on the color bar.
As this is a single event per touch, the fractal can be updated immediately after a color node is added.
The number of color nodes that can be placed in total is 32 due to nodes being sent to the shader, but fractals tend to look quite ugly with this many colors and so the limitation is (hopefully) not reached in practice.
-
Remove: While this mode is active touching a node will remove it from the color bar.
A limitation is placed to prevent removing color nodes if only 2 remain.
-
Fractal Options
This menu’s children may be added or removed if Julia / Mandelbrot Mode is active.
The purpose of its children are to demonstrate concepts that are more mathematical than intuitive:
-
Display Complex Grid: This state can be toggled while performing other actions to overlay the complex grid for reference (Figure 1).
-
Display Orbit Traps: This mode causes a touched pixel to be mapped to the complex plane as c in the Mandelbrot / Julia Set algorithms.
As the algorithm iterates, all of the values z takes are shown with connected lines.
If z belongs to the Mandelbrot / Julia Set, then it will form either a closed or spiraling shape (Figure 5).
If z does not belong to the Mandelbrot / Julia Set it will leave the screen and tend towards infinity (Figure 6).
|
|
Figure 5 shows the orbit trap of a point inside the Mandelbrot Set and near its boundary. |
Figure 6 shows a point outside the Mandelbrot Set and near its boundary tending to infinity. |
-
Julia / Mandelbrot Mode: This state can be toggled to interpret c as a constant user specified value instead of a pixel mapping.
When entering Julia Mode for the first time a suggested value for the constant from a list the viewer can see is displayed (Figure 7).
|
|
Figure 7 shows the list of suggested Julia constant values. |
Figure 8 shows the result of having assigned c as (-0.88, 0.0i). |
-
Set Constant: This mode causes a touch to be mapped to the complex plane as c modifying the current Julia Set.
The complex grid overlay is show while this mode is active for reference (Figure 8).
-
Suggested Constants: This list exists for users to quickly cycle though interesting Julia Sets (Figure 7).
Selecting a Julia Set without any knowledge of good values generally produces uninteresting Julia Sets.
-
Navigation
This menu’s children all map touches to the complex plane to manipulate the complex plane window.
Because the complex plane window is a square and Cyber-Commons’s display is a long rectangle cropping and centering are required.
The expected behavior is to move the user to the center of the display when being used on Cyber-Commons:
-
Pan: This mode maintains the length of the complex plane window but repositions its top-left corner so that the location the user touched becomes the new center.
-
Reset: Touching this resets the complex plane window without modifying the current navigation mode.
If the Mandelbrot Set is being displayed then the center of the complex plane window is (-0.5, 0.0i) to center the fractal.
-
Zoom In: This mode halves the length of the complex plane window and repositions its top-left corner so that the location the user touched becomes the new center.
-
Zoom Out: This mode doubles the length of the complex plane window and repositions its top-left corner so that the location the user touched becomes the new center.