One of the first graphical projects at 42 school, fract-ol generates beautiful fractals from the complex numbers of an iterative mathematical construct. A fractal is a fragmented geometrical figure that infinitely repeats itself at smaller scales. This project uses the school's graphical library, MiniLibX.
Finished: 22/04/2022.
Grade: 125%.
Note that this project was tested on Linux only. It may run on MacOS with small adjustments to the Makefile, as described in hsmits and jvan-sni's 42 Docs.
Clone the repository, including the embedded MiniLibX repository:
git clone https://github.com/mcombeau/fract-ol.git && cd fract-ol && git submodule init && git submodule update
You will now be in the correct directory for compilation. Compile with make
. Fract-ol should now be ready!
At execution time, you must specify a fractal to display. You may also provide other optional parameters:
./fractol <type> <options>
Types are :
M
,m
, or1
: Mandelbrot fractalJ
,j
, or2
: Julia fractalB
,b
, or3
: Burning Ship fractalT
,t
, or4
: Tricorn fractalX
,x
, or5
: Mandelbox fractal
For the Julia fractal set (and only this set), two additional parameters can be specified as calculation values. These represent a complex number that will change the shape of the Julia fractal. They must be fractional numbers between 2.0 and -2.0. For example:
./fractol J 0.285 -0.01
Additionally, you may specify a hexadecimal color for the fractal display:
./fractol M 00CCFF
Please note that for the Julia set, the color option will only be available after specifying calculation values:
./fractol J -0.4 0.6 65CD87
While Fractol is running, the following set of controls are available:
Controls | Action |
W A S D or ▲ ◄ ▼ ► | Move |
- , + or scroll wheel | Zoom in and out |
space | Change color scheme |
left click | Shift Julia set [Julia only] |
1 , 2 , 3 , 4 , or 5 | Switch fractals |
esc or close window | Quit fract-ol |
Made by mcombeau: [email protected] | LinkedIn: mcombeau | Website: codequoi.com