Code Monkey home page Code Monkey logo

d0l-fractal-trees's Introduction

What is this about?

As part of a 1.5-year long Computer Graphics course that I took here, I had to create a solo demo in C using OpenGL 1.0 (Yes! Immediate Mode OpenGL!) and a data structure of my choice before moving ahead with the more advanced Core Profile OpenGL.

In the sketches I created, I needed to render a tree which could grow and interact with the wind. I found from Wikipedia that the scientific way to generate trees in CG is through the use of Lindenmayer Systems, or L-Systems for short.

After reading first few chapters of Lindenmayer's own book, "The Algorithmic Beauty of Plants", I decided to implement a simple L-System API for use in my project.

Although I later decided not to use the grow/shrink feature in my project, these short programs demonstrate that the API is indeed capable of allowing this to happen.

This repository contains the source code for a 'cool' experiment I wrote while working on the API and my project.

What is this NOT about?

This may quite possibly be the "wrong way" of writing C APIs!

Heck! Instead, I am learning what is right and what is not! What you see here is purely experimental code, and I have taken no efforts to optimize anything. My only motive at the time was to write something that runs and is logical enough for me to use.

Also, at least for now, the API supports only Deterministic Context-Free (D0L) L-Systems.

Building with the supplied .bat files

Pre-requisites:

a. Any Windows NT (3.1 and above) Operating System.
b. You must have Visual Studio Command Line Utilities installed.

Steps:

  1. Open an instance of the x64 Native Tools Command Prompt.

  2. Navigate to the d0l-fractal-trees folder using cd.

  3. Run the .bat file corresponding to the app you want to build, for example, run Build2DTree.bat to build 2DTree.exe.

  4. You will find the generated executable file at d0l-fractal-trees/bin.

Controls

Key Description
L increase iterations
Shift + L decrease iterations
D increase delta
Shift + D decrease delta
R toggle rotation (Only for 3DTree)

Previews

2D Tree

Running 2DTree.exe


3D Tree

Running 3DTree.exe


d0l-fractal-trees's People

Contributors

kaivalyad avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.