This project's goal is to make a fractal visualizer.
Only works on 42-Paris Dumps at the moment but should be portable on any macOS X. This project countains several submodules you must initialize them beforehand :
⚠️ As of June, 3rd 2022, this program does not work anymore due to a lot of deprecations and won't be updated as it's a simple school project.
$> git clone --recurse-submodules -j3 https://github.com/kibotrel/42-Fractol
$> brew install pidof && cd 42-Fractol && make
Once the program is compiled, run it with the following command line :
$> ./fractol 'Desired Fractal'
To get more informations on how the program works and how you can interact with it type :
$> ./fractol
To set everything up before running the visualizer with a graphic interface do :
$> ./fractol menu
Every fractal bellow are handled by the program.
Name | Type | Multithread |
---|---|---|
Mandelbrot | Complex | ✔️ |
Julia | Complex | ✔️ |
Burning Ship | Complex | ✔️ |
Burning Julia | Complex | ✔️ |
Sierpinski triangle | Space filling curve | ✖️ |
Van Koch's snowfake | Auto-similar | ✖️ |
Barnsley's fern | Random generation | ✖️ |
Flower (Original) | Space filling and auto-similar | ✖️ |
Keyboard :
- W / A / S / D Shift the displayed fractal by a fixed length in the desired direction
- 1 / 2 / 3 / 4 / 5 / 6 / 7 / 8 Change the displayed fractal in the visualizer
- M Update the used coloring process between Gradient mode and Areas mode
- V / B / N Modify the color used in Gradient mode
- Z / X / C Modify the color used in Areas mode
- Page_Up / Page_Down Update the amount of details in the displayed fractal
- P Trigger Psychedelic mode
- J / K / L Modify the audiofile used in Psychedelic mode
- ~ Toggle the variation of Julia and Burning Julia using mouse cursor position
- R Reset everything to the default point of view
- ESC Quit the visualizer
Mouse:
- Mouse Wheel Update the zoom level depending on the scroll direction
- Cursor Update preset complex in both Julia and Burning Julia fractals
Each following error is handled by the program leading to a complete memory free and program exit :
- Invalid fractal name (ERROR-CODE 1)
- Failed memory allocation (ERROR-CODE 2)
- Failed to fork the process (ERROR-CODE 3)
- Failed to create a thread (ERROR-CODE 4)
- Failed to play an audio file (ERROR-CODE 5)
- Audio file unavailable (ERROR-CODE 6)
Whenever one of these error occurs, the correct error message is displayed on the standard output and the whole program return an error code that you can retrieve by running :
$> echo $?