Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDL2-Mandelbrot-Plotter

Download SDL Latest License

My version of a Mandelbrot set plotter using SDL2 Library

Table Of Content
  1. Overview
  2. Getting Started
  3. Usage
  4. License



Overview

The Mandelbrot set is a set of complex number on the complex plane that will not deviate when it is iterated multiple time with the formula Zn+1 = Zn2 + C

This program plot the mandelbrot set by mapping out each pixel according to the coordinate of the complex plane and then iterate it multiple time with the formula mentioned above until it exceed a certain value. Each pixel is then colored according to the number of iteration it reaches, unless it reaches the maximum iteration allowed in this case the pixel is then colored black.

Increasing the maximum iteration count will reveal more detail of the mandelbrot set, and although this program use long double data type for the highest floating point precision, it was build using MSVC compiler therefore it only use 8 byte of memory (as supposed to C++ standard 10 byte or even 16 byte long double).

Back to Top




Getting Started

Download the latest version from release. Extract the binaries and dll to a single directory.


UI element

When you open the program you will see the mandelbrot set being rendered in the viewport as well as other UI element/info showing in the top left corner. Those UI/info will help you to navigate when exploring the mandelbrot set.

1. Center Coordinate

This coordinate is where the center of the screen is currently located. This will help you to navigate around when exploring the mandelbrot set.


2. Frame Time

Total time needed to render the current frame.


3. Zoom value

It's the zoom!.


4. Zooming multiplier

When zooming in/out this value will multiply the current zoom value.


5. Iteration step

When increasing/decreasing the maximum iteration value, this value will add or subtract the current max iteration value.


6. Maximum Iteration

This value limit the maximum iteration count of a value in the set before it hit it's potential iteration count. Thus increasing this value may reveal more detail at a cost of more calculation cycle needed.



Extra

  • Locked zoom coordinate

This is the coordinate where the camera will zoom in/out when using the manual/keyboard zoom or the AutoZoom feature. This variable will change whenever you zoom in/out with you mouse/cursor. You can set the initial coordinate when starting the program to zoom to a certain coordinate you targeted accurately using the Terminal Command.


  • AutoZoom

This feature when enabled will automatically zoom in every frame to the Locked Coordinate using the current Zooming multiplier value until it reaches 1.5 x 1014 times magnification. There's currently a frame capture feature being develop so you can automatically capture each frame and then stitch them together to make something like this.

Back to Top




Usage

This section will show you how to use the program and multiple way of using it to explore the mandelbrot set.

Control

Key Function
Left click Zoom in to the cursor location
Right click Zoom out from the cursor location
E Zoom in to the locked coordinate
Q Zoom out from the locked coordinate
U Toggle info UI
Z Toggle AutoZoom
Mousewheel Up Increase Max iteration
Mousewheel Down Reduce Max iteration
LCtrl + Mousewheel Up Increase iteration stepping value
LCtrl + Mousewheel Down Reduce iteration stepping value
LShift + Mousewheel Up Increase Zooming multiplier value
LShift + Mousewheel Down Reduce Zooming multiplier value



Terminal

Openning the program directly by clicking it will run the program with the default configuration, while running the program from the terminal will provide more option and configuration.

mandelbrot.exe [argument]

*All argument can be passes together in any order.



Some of the available arguments are :


  • Resolution

This argument will set the window resolution. Setting this to a high value will slows down the rendering time. The default value is 800 x 800.

mandelbrot.exe -r [width] [height]

example of setting the resolution to 1920 x 1080 :

mandelbrot.exe -r 1920 1080

  • Zoom Coordinate

This argument will set the starting zoom coordinate. Example of the zooming coordinate can be found in here. The default starting coordinate is X = 0.281717921930775 & Y = 0.5771052841488505.

mandelbrot.exe -c [X Coordinate] [Y Coordinate]

example of setting the starting zoom coordinate to X = 0.840719 & Y = 0.22442 :

mandelbrot.exe -c 0.840719 0.22442

  • Colortheme

This Argument change the colortheme to any of the currently 4 different colortheme. The default color is palette 0 commonly found in the Wikipedia.

mandelbrot.exe -p [palette index]

example of setting the colortheme to palette 2 :

mandelbrot.exe -p 1

Example of the colortheme and it's palette index can be found in the gallery

Back to Top




Gallery

  • Colortheme/palette 1 -p 0


  • Colortheme/palette 2 -p 1


  • Colortheme/palette 3 -p 2


  • Colortheme/palette 4 -p 3

Back to Top




License

Distributed under the GNU General Public V3.0 License. See License for more information.

Back to Top

About

Mandelbrot set plotter/explorer using SDL2 Library

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages