Giter Club home page Giter Club logo

42-fractol's Introduction

julia_0

42-Fractol

This project's goal is to make a fractal visualizer.

Install

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

Usage

Run the program

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

Fractal list

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 ✖️

Controls

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

Error management

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 $?

Screenshots

mandelbrot_0 julia_1 julia_3 burning_ship burning_julia_0 burning_julia_1 sierpinski koch barnsley flower menu_0 menu_11 menu_2

42-fractol's People

Contributors

kibotrel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

42-fractol's Issues

Linux port using SDL2

To-do:

  • Removed MLX which is now deprecated on macOS X
  • Refactor the code using SDL2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.