Skip to content

Commit

Permalink
iteration loop and navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
mclarekin committed Oct 30, 2020
1 parent e7318ae commit dcaa75c
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 41 deletions.
62 changes: 32 additions & 30 deletions mandelbulber2/manual/chapters/iteration_loop.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,46 @@ \section{Iteration loop}\label{iteration-loop}
by repeating a formula (\emph{iterating}) in an iteration loop.
The integer \emph{i} is used to represent the \emph{iteration count} number.

The iteration count starts with \emph{i} = 0, then at the end of each iteration the
The iteration count starts with \emph{i} = 0, then at the end of each iteration, the
count number is increased by 1, and the next iteration of the formula commences
(e.g. iteration count 0, 1, 2, 3, ...). The iterating continues until \emph{termination conditions} are met,
(e.g., iteration count 0, 1, 2, 3, ...). The iterating continues until \emph{termination conditions} are met,
which is either when the iteration count \emph{i} = \emph{maxiter} or when the \emph{bailout} condition is achieved.

This section explains the calculations within the iteration loop.

A fractal formula is built from mathematical equations.
These equations can be modifications of the Mandelbrot Set equation (e.g Mandelbulb) and also other mathematical equations.
These equations can be modifications of the Mandelbrot Set equation (e.g., Mandelbulb) and also other mathematical equations.

The equations are made from mathematical operators ($+, -, *, /$)
and can include mathematical functions (e.g. sin, cos, tan, exp, log, sqrt, pow, abs)
and also mathematical conditions (e.g. if x > y then ``compute following equation(s)'', if i > 4 then ``compute following equation(s)'').
and can include mathematical functions (e.g., sin, cos, tan, exp, log, sqrt, pow, abs)
and also mathematical conditions (e.g., if x > y then ``compute following equation(s),'' if i > 4 then ``compute following equation(s)'').

The equations are applied to vector z or any parts of z (i.e the z.x, z.y and z.z components)
The equations are applied to vector z or any parts of z (i.e., the z.x, z.y and z.z components)

Examples:

{\tt\emph{z.x} = fabs(\emph{z.x});} is using the function fabs() (which is floating-point version of abs()), where \emph{z.x} is assigned the absolute value of \emph{z.x}.

{\tt if (\emph{z.x} - \emph{z.y} < 0.0) swap(\emph{z.x}, \emph{z.y});} is using the conditional function if() to determine if the values of z.x and z.y should be swapped.

{\tt \emph{z} *= 3.0} is using the operator * to multiply the all components of vector z by 3.0.
{\tt \emph{z} *= 3.0} is using the operator * to multiply all components of vector z by 3.0.

A set of equations that have a specific function within the formula are called \emph{transforms}, e.g rotation, scale.
A set of equations that have a specific function within the formula are called \emph{transforms}, e.g., rotation, scale.

The generally a formula is constructed from one or more transforms, which are constructed from equations.
Generally a formula is constructed from one or more transforms, which are constructed from equations.

With each iteration of the formula, the point being iterated is \emph{mapped} (moved) to new coordinates as a result of the mathematical equations.

\subsection{Single formula fractals}\label{single-formula-fractals}

The simplest 3D fractals are calculated by iterating a single fractal formula. More complex fractals are made by iterating a mix of formulas, adding extra transforms, and/or including additional conditions.

Below there are 3 examples of fractals formulas written in C language code
Below there are 3 examples of fractals formulas written in C language code.

\subsubsection{Mandelbulb Power 2}\index{Mandelbulb} \nopagebreak

This formula is a modified Mandelbrot Set equation, expanded to \nth{3} dimension.
A cross section at $ z_z = 0 $ looks exactly the same as Mandelbrot Set.
This formula is a modified Mandelbrot Set equation, expanded to 3D.
A cross section at $ z_z = 0 $ looks exactly the same as the Mandelbrot Set.
\nopagebreak

\begin{tabular}{l l}
Expand Down Expand Up @@ -73,7 +73,7 @@ \subsubsection{Box Fold Bulb Pow 2}
how a fractal formula can be more complicated than the
\emph{Mandelbrot Set} formula.

First part is a ``box fold''\index{transform!box fold} transform which conditionally maps the point in x,y,z directions. Second part is a ``spherical fold''\index{transform!spherical fold} which does conditional scaling in a radial direction.
First part is a ``box fold''\index{transform!box fold} transform which conditionally maps the point in x, y and z directions. Second part is a ``spherical fold''\index{transform!spherical fold} which does conditional scaling in a radial direction.
The end of formula is the same as \emph{Mandelbulb Power 2}.

\begin{tabular}{l l}
Expand All @@ -92,7 +92,7 @@ \subsubsection{Processing of single formula fractals}
{Examples of simple Iteration loops with one formula}
{iteration_loops}{h}

When the calculation of the iteration loop finishes the resulting final value of \emph{z} is
When the calculation of the iteration loop finishes, the resulting final value of \emph{z} is
used to estimate the distance to the fractal body and to calculate the color of the surface.

\subsection{Hybrid fractals}\index{fractal!hybrid}
Expand All @@ -106,7 +106,7 @@ \subsubsection{Iteration loop of hybrid fractals}
The calculation consists of the iteration loop, \emph{maxiter} and \emph{bailout} condition. The
difference is that when \emph{hybrid mode} is enabled, a user can create a \emph{sequence} of up to nine different fractal formulas (or transforms) inside the iteration loop.

By default the program works in single fractal formula mode, where you can only configure the parameters of the formula tab in the first slot (label \#1) (figure \ref{fractal_tabs})
By default the program works in single fractal formula mode, where you can only configure the parameters of the formula tab in the first slot (label \#1) (figure \ref{fractal_tabs}).

\simpleImageWithCaption75Width{img/manual/media/fractal_tabs.png}
{Fractal Tab - Formula only in first slot}
Expand All @@ -115,7 +115,7 @@ \subsubsection{Iteration loop of hybrid fractals}
There are two ways to enable Hybrid Fractals Mode:
\begin{itemize}
\item Click in any slot with a number higher than one. The program will ask if you want to
enable hybrid fractals or boolean mode. Select \emph{Enable hybrid fractals}
enable hybrid fractals or boolean mode. Select \emph{Enable hybrid fractals}.
\item Go to \emph{Objects} / \emph{Hybrid} tab. Tick \emph{Enable hybrid fractals} checkbox.
\end{itemize}

Expand All @@ -125,9 +125,11 @@ \subsubsection{Iteration loop of hybrid fractals}

Once hybrid fractals mode has been enabled, a user can select additional formulas from the dropdown menus in any of the nine formula slots,
as shown in figure \ref{fractal_tabs_with_defined_fractals_tabs_highlighted}.
In this figure \emph{Mandelbulb~-~Power~2} is selected in slot \#1, \emph{Menger Sponge}
in slot \#2 and \emph{Box Fold Bulb Pow 2} in slot \#3. These formulas will be
used in the next examples. They will be processed in the loop as it is showed on figure \ref{iteration_loop_hybrid}
In this figure, \emph{Mandelbulb~-~Power~2} is selected in slot \#1, \emph{Menger Sponge}
in slot \#2 and \emph{Box Fold Bulb Pow 2} in slot \#3.

These formulas will be
used in the next examples. They will be processed in the loop as it is showed on figure \ref{iteration_loop_hybrid}.

\simpleImageWithCaption75Width{img/manual/media/iteration_loop_hybrid.png}
{Complex Iteration loop with hybrid fractal}
Expand All @@ -137,8 +139,8 @@ \subsubsection{Iteration loop of hybrid fractals}

The iteration count numbers determine when in the sequence each formula is calculated.

The sequence is in the order of the enabled formula slots from \#1 to slot \#9, (e.g. If the sequence is calculating formulas in slots
\#1 and \#5, then the iteration loop repeats the sequence of slot \#1 calculation followed by slot
The sequence is in the order of the enabled formula slots from \#1 to slot \#9, (e.g., If the sequence is calculating formulas in slots
\#1 and \#5, then the iteration loop repeats the sequence of slot \#1 calculation, followed by slot
\#5 calculation.)

How the sequence will work depends on the following selections:
Expand All @@ -154,7 +156,7 @@ \subsubsection{One iteration for each slot}
The simplest way to create a hybrid fractal is a sequence where formulas are calculated one after another, then the sequence is repeated until termination conditions are met.

In figure \ref{iteration_loop_hybrid_sequence_1}, the sequence consists of one \emph{Mandelbulb - Power 2}, one \emph{Menger Sponge} and
one \emph{Box Fold Bulb Pow 2}. The length of the sequence is three iterations, so after every third iteration the sequence repeats from the first slot. The numbers shown are the Iteration Count, starting at i = 0. The count increases by 1 after \underline{every} iteration performed in the iteration loop.
one \emph{Box Fold Bulb Pow 2}. The length of the sequence is three iterations; so after every third iteration, the sequence repeats from the first slot. The numbers shown are the Iteration Count, starting at i = 0. The count increases by 1 after \underline{every} iteration performed in the iteration loop.

\simpleImageWithCaptionFullWidth{img/manual/media/iteration_loop_hybrid_sequence_1.png}
{Hybrid sequence - Simple sequence using three different formulas}
Expand All @@ -168,11 +170,11 @@ \subsubsection{One iteration for each slot}
{hybrid_sequence_example_1}{H}

Because the first iteration is (slot \#1) \emph{Mandelbulb - Power 2}, the general shape
of the fractal will be simlar in shape to the \emph{Mandelbulb - Power 2}.
of the fractal will be similar in shape to the \emph{Mandelbulb - Power 2}.

Note: Generally, the first few iterations of a fractal strongly influence the final hybrid fractal shape.

In the next iteration \emph{Menger Sponge} formula is used. A single iteration
In the next iteration, the \emph{Menger Sponge} formula is used. A single iteration
of this formula produces the shape of figure \ref{single_iteration_of_menger_sponge}.

\simpleImageWithCaptionSmallWidth{img/manual/media/single_iteration_of_menger_sponge.png}
Expand Down Expand Up @@ -223,7 +225,7 @@ \subsubsection{More iterations for each slot}
{iteration_loop_hybrid_sequence_3}{H}

As above, the initial shape is mainly defined by the first two iterations of \emph{Mandelbulb - Power 2},
but the high number of \emph{Menger Sponge} iterations makes the \emph{Menger Sponge} features become more apparent (figure \ref{hybrid_sequence_example_3})
but the high number of \emph{Menger Sponge} iterations makes the \emph{Menger Sponge} features become more apparent (figure \ref{hybrid_sequence_example_3}).

\simpleImageWithCaptionHalfWidth{img/manual/media/hybrid_sequence_example_3.png}
{Hybrid sequence result - The second slot set to 10 repeat iterations}
Expand All @@ -235,7 +237,7 @@ \subsubsection{Range of iterations for slot}

On each formula tab the parameters \emph{Start at iteration} and \emph{Stop at iteration} are used to define this range.

When computing the iteration loop, the program is moving through the enabled formula slots, checking formula iteration range conditions. If the current Iteration Count number is within the range then a calculation of that formula is performed, and the Iteration Count is increased by 1. If the Iteration Count number is outside the iteration range condition, then the formula is skipped (i.e. no calculation and therefore the iteration count remains unchanged). The program then moves to the next enabled slot in the sequence.
When computing the iteration loop, the program is moving through the enabled formula slots, checking formula iteration range conditions. If the current Iteration Count number is within the range, then a calculation of that formula is performed, and the Iteration Count is increased by 1. If the Iteration Count number is outside the iteration range condition, then the formula is skipped (i.e., no calculation, and therefore, the iteration count remains unchanged). The program then moves to the next enabled slot in the sequence.

The second formula slot (\emph{Menger Sponge}) in the sequence shown in figure \ref{iteration_loop_hybrid_sequence_4}, has the iteration range set to \emph{from 4 to 250}.

Expand All @@ -244,12 +246,12 @@ \subsubsection{Range of iterations for slot}
{Hybrid sequence - Range of iteration set to 4-250 on second slot}
{iteration_loop_hybrid_sequence_4}{H}

During the first pass of the sequence \emph{Menger Sponge} formula could not be used at iterations 2 and 3,
During the first pass of the sequence, the \emph{Menger Sponge} formula could not be used at iterations 2 and 3,
because \emph{Start at iteration} was when i = 4 for this formula, and therefore the slot was skipped.
During the second pass of the sequence \emph{Menger Sponge} formula was used at iterations 5 and 6,
During the second pass of the sequence, the \emph{Menger Sponge} formula was used at iterations 5 and 6,
because those iterations were inside the defined range of iterations.

The shape of the resulting fractal is shown in figure \ref{hybrid_sequence_example_4}
The shape of the resulting fractal is shown in figure \ref{hybrid_sequence_example_4}.

\simpleImageWithCaptionHalfWidth{img/manual/media/hybrid_sequence_example_4.png}
{Hybrid sequence result - Range of iteration set to 4-250 on second formula slot}
Expand All @@ -259,7 +261,7 @@ \subsubsection{Range of iterations for slot}

\subsubsection{Changed order in sequence}

The order of fractal formulas can be easily changed between slots with the use of the arrow buttons (figure \ref{fractal_tabs_with_defined_fractals_arrows})
The order of fractal formulas can be easily changed between slots with the use of the arrow buttons (figure \ref{fractal_tabs_with_defined_fractals_arrows}).

\simpleImageWithCaption75Width{img/manual/media/fractal_tabs_with_defined_fractals_arrows.png}
{Fractal tabs with highlighted tab-arrows}
Expand Down
16 changes: 9 additions & 7 deletions mandelbulber2/manual/chapters/navigation.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ \section{Navigation}\label{navigation}
To set the current view there are two elements:

\begin{description}
\item[Camera]\index{navigation!camera} represents a point where the camera is located
\item[Camera]\index{navigation!camera} represents a point where the camera is located.
\item[Target]\index{navigation!target} represents the point onto which the camera will focus (the
camera is \emph{always} looking at the target.)
\end{description}
Expand All @@ -16,7 +16,7 @@ \subsection{Navigation by mouse pointer dragging}\label{navigation-by-mouse-poin
\item[Holding left mouse button] - rotates camera by moving target
\item[Holding right mouse button] - rotates camera around indicated point by moving camera and target
\item[Holding middle button] - rotates camera by changing only the roll angle
\item[Holding left and right buttons] - moves camera and target relatively to indicated point
\item[Holding left and right buttons] - moves camera and target relative to the indicated point
\item[Holding control key and rotating mouse wheel] - moving camera forward/backward towards indicated point
\end{description}

Expand Down Expand Up @@ -98,7 +98,9 @@ \subsubsection{Move target mode}\label{move-target-mode}\index{navigation!target
{Movement mode - target}
{move_target}{H}

Moves only the target while maintaining a fixed camera position (figure \ref{move_target}). The camera rotates following the target. \textbf{Note:} In Relative Step Mode, the target is moved by distance related to distance of target to fractal surface. If target is inside the fractal (distance = 0), then this option will not work with Relative Step Mode.
Moves only the target while maintaining a fixed camera position (figure \ref{move_target}). The camera rotates following the target.

\textbf{Note:} In Relative Step Mode, the target is moved by a distance related to the distance of target to fractal surface. If the target is inside the fractal (distance = 0), then this option will not work with Relative Step Mode.

\subsection{Linear camera and target movement modes using clicks on image}\label{linear-camera-and-target-movement-modes-using-the-mouse-pointer}

Expand Down Expand Up @@ -151,13 +153,13 @@ \subsubsection{Rotate around target}\label{rotate-around-target}
\subsection{Reset View}\label{reset-view}\index{navigation!reset view}

Camera Position is reset, by being zoomed out from the fractal but still
maintaing the camera angles.
maintaining the camera angles.

If the rotations are changed to zero before using Reset View, the camera will
then be zoomed out from the target, and rotated to look down the y axis.

\subsection{Calculation of rotation angles
modes}\label{calculation-of-rotation-angles-modes}
\subsection{Calculation of rotation angle
modes}\label{calculation-of-rotation-angle-modes}

\subsubsection{Fixed-roll angle}\label{fixed-roll-angle}

Expand Down Expand Up @@ -209,7 +211,7 @@ \subsection{Camera rotation in animations}\label{camera-rotation-in-animations}\
rotations between keyframes.

To compensate for this, on the Keyframe navigation tab use the button \emph{Set the
same distance from the camera for all the frames} This adjusts all keyframes by
same distance from the camera for all the frames}. This adjusts all keyframes by
setting a constant distance between camera and target. It is important to note
that the use of this function does not change the visual effect for the
keyframes, and will help correct interpolation. See figure \ref{camera_target_tracking_2}.
Expand Down
2 changes: 1 addition & 1 deletion mandelbulber2/manual/chapters/opencl.tex
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ \subsection{Configuring OpenCL}\label{configure-opencl}
\end{itemize}


\subsection{Trouble shooting OpenCL}\label{opencl-troubleshooting}
\subsection{Troubleshooting OpenCL}\label{opencl-troubleshooting}

\subsubsection{Driver crash under Windows}

Expand Down
3 changes: 0 additions & 3 deletions mandelbulber2/sound/sound.tex
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@ \subsection{Rendering the animation.}\label{rendering-the-animation.}

\includegraphics[width=4.14000in,height=2.65000in]{img/sound/media/image10.png}

\subsection{Now render the trial
animation.}\label{now-render-the-trial-animation.}

When rendering is finished (note the time it took), press ``Show
animation'' button for a preview (you can also use ``Show animation''
while rendering is in progress.)
Expand Down

0 comments on commit dcaa75c

Please sign in to comment.