Giter Club home page Giter Club logo

3d-lsystem's Introduction

3D-Lsystem

A tool that can be used for Lindenmayer Systems fractals. The tool is made of two parts, as shown below. To launch the program, the following programs and libraries are required:

  • python v2.7.6,
  • OpenGL and the pyOpenGL binding for the visualization
  • pygame for the context window.

You can see an overview of what the program can display in the results folder.

The file "Génération de nature fractale.pdf" is the report of the project but I'm sorry, for my exam it had to be written in french. I did not have the time to translate it.

Simple fractal generator

Usage: ./3dlsystem [fractal_name] [fractal_step:int] ['debug'] where fractal_step is the precision of the fractal and fractal_name can be:

  • 'tree1': A first try for drawing a 3D tree
  • 'tree2': A second 3D tree, much betted, with nice colors
  • 'tree2D': A tree, 2D version
  • 'tree3': A third 3D tree
  • 'tree3psy': The same tree as the previous one, buffed with LSD
  • 'tree4': Another 2D tree
  • 'tree5': A very fractalic-looking 3D tree
  • 'tree6': Another type of 3D tree with random factor
  • 'hilbert': The std hilbert curve
  • 'koch': The std koch curve
  • 'koch3D': a koch curve in 3D, like a diamond
  • 'dragon': the well known dragon curve (2D)
  • 'tedragon' the tedragon curve (2D)
  • 'levyc': The Levy Curve
  • 'sierpinsky': the sierpinsky carpet (some LSD added)
  • 'sierpinsky2': another version of the sierpinksy carpet (zoom to see the difference)

For all the fractals, a default precision has been set so that it is interesting but not too hard to draw for your computer. You can increase this value but it's not advised to give much more for the safety of your computer...

You can add the mention 'debug' to enable a step by step generation.

Here are the available controls in the display window:

  • Left key, Right key: control camera rotation speed
  • Up key, Down key or *mouse wheel: zoom in/out
  • Z, Q, S, D, A, E: control scene rotation on x, y and z axis
  • Space: look at the last drawed point of the fractal
  • Enter: reinitialize the view

In debug mode :

  • N: Go to next step
  • R: Enable autorun. This will automatically run 5 steps by frame
  • +, -: Control autorun speed

Forest generator

The purpose of this script is to generate a fractal forest using many different fractal trees.

Usage: ./forest.py [size=S] [fractal=F] [random=R] [debug[=True|False]] where the parameters can be precised in any order, and means:

  • S: int >= 1 is the size of the forest. The fractal number will be set to S squared. Default value is 10
  • F: int is a modificator of the precision of the fractals that will be generated. Any positive or negative number can be specified, but values higher than 2 or 3 are not advised. Default value is -2.
  • R: float > 0 is the random factor for the placement of the fractal trees. By default, it is computed according to the size of the grid
  • debug allow to enter debug mode

Here are the available controls in the display window:

  • Left key, Right key: control camera rotation speed
  • Up key, Down key or *mouse wheel: zoom in/out
  • Z, Q, S, D, A, E: control scene rotation on x, y and z axis
  • Space: look at the last drawed point of the fractal
  • Enter: reinitialize the view

In debug mode:

  • N: Go to next step
  • R: Enable autorun. This will automatically run 5 steps by frame
  • +, -: Control autorun speed Do not increase autorun speed to much to keep an acceptable framerate.

3d-lsystem's People

Contributors

hiestaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.