Skip to content

One of the first graphical projects at 42 school, fract-ol introduces us to 2D programming with fractal generation.

Notifications You must be signed in to change notification settings

mcombeau/fract-ol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fract-ol

Fract'ol fract-ol 42 project badge

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.

Fract-ol mono-colored Mandelbrot by mcombeau

Status

Finished: 22/04/2022.

Grade: 125%.

Usage


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.


Installing and Compiling Fract-ol

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!

Executing Fract-ol

At execution time, you must specify a fractal to display. You may also provide other optional parameters:

./fractol <type> <options>

Types are :

  • M, m, or 1: Mandelbrot fractal
  • J, j, or 2: Julia fractal
  • B, b, or 3: Burning Ship fractal
  • T, t, or 4: Tricorn fractal
  • X, x, or 5: 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

Fract-ol Controls

While Fractol is running, the following set of controls are available:

ControlsAction
 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 windowQuit fract-ol

Screenshots

Mandelbrot set

Fract-ol purple and yellow striped Mandelbrot by mcombeau Fract-ol red bllue and green striped Mandelbrot by mcombeau Fract-ol sun crest purple Mandelbrot by mcombeau

Julia set

Fract-ol purple green and yellow Julia by mcombeau Fract-ol red swirl Julia by mcombeau Fract-ol blue snowflake Julia by mcombeau

Burning ship set

Fract-ol golden burning ship by mcombeau

Mandelbox set

Fract-ol brown tribal Mandelbox by mcombeau


Made by mcombeau: [email protected] | LinkedIn: mcombeau | Website: codequoi.com