Coder Social home page Coder Social logo

plant-drawing's Introduction

Plant Drawing Using L-Systems

The complete documentation can be found here

This project was made as a part of the Computer Graphics course (IS F311) offered at BITS Pilani, Hyderabad Campus. It features graphical rendering of trees using Lindenmayer Systems. The trees are composed entirely of straight lines and circles, which are themselves drawn using Bresenham's Midpoint Algorithm.

The project is written entirely in C++, using the Open Graphics Library (OpenGL) for all graphical rendering needs. Certain third party libraries which complement OpenGL are also used, consisting of but not limited to GLFW and GLAD.

We faced many design and implementation challenges while working on this project, the major roadblocks being:

  • Rendering using OpenGL: The mere setup of something as new as a graphics library took us a while. The concepts of fragment shaders, vertex shaders, and the limited -1 to 1 coordinate system of OpenGL took some time to understand.
  • Working with headers and classes in C++: Having used C-style languages only for single file algorithmic problems before, it was a major challenge writing an entire project in C++, where OOP paradigms are a little harder to implement than say, in Java or Python.
  • Optimizations to prevent long processing times

The overall time complexity of the preprocessing phase is mostly due to the string expansion algorithm, and is approximately O(k ^ n), where k is the number of rewritable letters ('T' in our strings) in the rewritten string, and n is the number of iterations to be processed (4 in our case).

The time complexity during the program runtime (while changing the iteration to display) is linear in the number of coordinates to render, i.e., O(v), where v is the number of vertices to be rendered.

The program can be evaluated by running the .exe file in the root folder of the project (Visual Studio and a graphics card supporting OpenGL 4.0 or higher are required).

Project Authors: Asutosh Sistla, Kushal Agrawal, and Suchit Kar

plant-drawing's People

Watchers

James Cloos avatar Shujaat Ali Khan 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.