About The Project
Project based on library MiniLibX, to discover or use the mathematical notion of complex numbers, to take a peek at the concept of optimization out computer graphics and practice event handling.
For reasons of simplification, bonus part was merged with mandatory.
Getting Started
to compile the program on Mac:
make all
to compile the program on Linux:
- download and install minilibx for Linux
- extract the minilibx folder from /lib and delete all references to it in Makefile and headers
Prerequisites
- Installed C compiler like gcc, cc or clang.
- installed or compiled minilibx
Usage
start ./fractol and combine with input of your choice (everything should be written in uppercase!).
MANDELBROT: MANDELBROT INSIDE_COLOR OUTSIDE_COLOR OUTLINE_COLOR
JULIA: JULIA INSIDE_COLOR OUTSIDE_COLOR OUTLINE_COLOR REAL_CONSTANT IMAGINARY_CONSTANT
BURNING_SHIP: BURNING_SHIP INSIDE_COLOR OUTSIDE_COLOR OUTLINE_COLOR
PRESETS: MANDELBROT PRESET PRESET_NAME"
░▒▓▆▅▃▂▁COLORS AND PRESETS▁▂▃▅▆▓▒░ ░▒▓▆▅▃▂▁JULIA CONSTANTS▁▂▃▅▆▓▒░
COLORS: PRESETS REAL: | IMAGINARY:
WHITE MATRIX |
BLACK STD_BLUE −0.4 | 0.6
RED STD_RED 0.285 | 0
LIME STD_TEAL 0.285 | 0.01
BLUE STD_GREEN 0.285 | 0.01
YELLOW ACID 0.285 | 0.45
CYAN CMYK -0.70176 | -0.3842
MAGENTA DEPRESSIVE -0.835 | -0.2321
SILVER BLOODY -0.8 | 0.156
GRAY UGLY −0.7269 | 0.1889
MAROON −0.7269 | 0.1889
OLIVE -0.8 | 0
GREEN
PURPLE
TEAL
NAVY
░▒▓▆▅▃▂▁HOTKEYS▁▂▃▅▆▓▒░
MENU KEYS: MANDELBROT PRESETS:
I SHOW VERBOSE USAGE INFORMATION 1 MATRIX
C SHOW VALID COLORS AND PRESETS 2 STD_BLUE
K SHOW VALID JULIA CONSTANTS 3 STD_RED
H SHOW HOTKEYS 4 STD_TEAL
ESC EXIT THE PROGRAM 5 STD_GREEN
6 ACID
OTHER FRACTALS: 7 CMYK
J SWITCH TO JULIA 8 DEPRESSIVE
B SWITCH TO BURNING SHIP 9 BLOODY
0 UGLY
MOUSEWHEEL SCROLLING: PLAY WITH BACKGROUND COLOR:
UP ZOOM IN Q INCREASE RED VALUE
DOWN ZOOM OUT A DECREASE RED VALUE
W INCREASE GREEN VALUE
ARROW KEYS: S DECREASE GREEN VALUE
UP MOVE PICTURE UP E INCREASE BLUE VALUE
DOWN MOVE PICTURE DOWN D DECREASE BLUE VALUE
LEFT MOVE PICTURE LEFT
RIGHT MOVE PICTURE RIGHT
Roadmap
- Resolve slow 🐢 zooming (in and out) and moving of the fractal:
- pre-calculate the rendering before initial rendering
- define sufficient but not too high number of iterations for each fractal separately
- Add more features:
- change Julia shape depending on the mouse coordinate by clicking and moving the mouse pointer around the window
- support changing fractal sharpness with hotkeys
- support more (maybe all?) colors from the library https://htmlcolorcodes.com/colors/
- add persistent fluent fractal animation
- process the input case-insensitive
Contributing
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
Acknowledgments
Many thanks for support and patience to:
💟 Heleen [https://github.com/heleenoomen]
Good color library:
https://htmlcolorcodes.com/colors/
Useful resources to start with minilibx:
https://aurelienbrabant.fr/blog/getting-started-with-the-minilibx
https://harm-smits.github.io/42docs/libs/minilibx
Understanding of fractals and imaginary numbers: