All Projects → edap → ofxLSystem

edap / ofxLSystem

Licence: MIT license
3D turtle graphics interpretation of L-Systems

Programming Languages

C++
36643 projects - #6 most used programming language
Makefile
30231 projects
GLSL
2045 projects
QML
638 projects

Projects that are alternatives of or similar to ofxLSystem

ofxSpaceColonization
Space Colonization algorithm implementation in openFrameworks
Stars: ✭ 62 (+58.97%)
Mutual labels:  tree, addon, algorithmic-botany
Polygon Wind
Wind shader for low poly assets in Unity.
Stars: ✭ 119 (+205.13%)
Mutual labels:  tree, shaders
unity-surfaceshader-flipbook
Surface shaders with flipbook / spritesheet animation functionality
Stars: ✭ 43 (+10.26%)
Mutual labels:  shaders
SoftLight
A shader-based Software Renderer Using The LightSky Framework.
Stars: ✭ 2 (-94.87%)
Mutual labels:  shaders
MoPlugs
MotionBuilder Extensions Pack
Stars: ✭ 27 (-30.77%)
Mutual labels:  shaders
webgl-raub
WebGL bindings to desktop OpenGL
Stars: ✭ 66 (+69.23%)
Mutual labels:  addon
raiderio-addon
RaiderIO AddOn
Stars: ✭ 35 (-10.26%)
Mutual labels:  addon
Half-Life-Resurgence
Recreation & expansion of NPCs, entities, and weapons from the Half-Life series into Garry's Mod!
Stars: ✭ 52 (+33.33%)
Mutual labels:  addon
generic-addons
Set of generic addons for Odoo
Stars: ✭ 26 (-33.33%)
Mutual labels:  addon
regexp-graph
No description or website provided.
Stars: ✭ 22 (-43.59%)
Mutual labels:  tree
meShaderEd
The RenderMan Shader Editor
Stars: ✭ 21 (-46.15%)
Mutual labels:  shaders
cc3 blender tools
Add-on for importing and auto-setup of character creator 3 & 4 and iClone 7 & 8 character exports.
Stars: ✭ 191 (+389.74%)
Mutual labels:  addon
addon-home-panel
Home Panel - Home Assistant Community Add-ons
Stars: ✭ 164 (+320.51%)
Mutual labels:  addon
kodi
KODI Addons Project
Stars: ✭ 48 (+23.08%)
Mutual labels:  addon
ESOLinuxAddonManager
[MIRROR] Elder Scrolls Online addon downloader, for Linux! Check the link below for the development repo which has the releases and issuetracker.
Stars: ✭ 25 (-35.9%)
Mutual labels:  addon
tbcnn
Efficient tree-based convolutional neural networks in TensorFlow
Stars: ✭ 121 (+210.26%)
Mutual labels:  tree
DLAA
(DLAA) Directionally Localized antiAliasing
Stars: ✭ 18 (-53.85%)
Mutual labels:  shaders
extraction
Tree Extraction for JavaScript Object Graphs
Stars: ✭ 70 (+79.49%)
Mutual labels:  tree
Graph-Theory
The Repository is All about the Graph Algorithms. I am Still Working On it. I am trying to Note down all the variations of Popular graph Algorithms. I am also keeping the solution to the problems of Different Online Judges according to the topic. I hope you can find it useful.
Stars: ✭ 16 (-58.97%)
Mutual labels:  tree
Shader-Playgrounds
A WebGL shaders editor for beginners and otherwise.
Stars: ✭ 28 (-28.21%)
Mutual labels:  shaders

ofxLSystem

Build status Build status

This addon has a dependency on ofxLSystemGrammar. Download it and add it to your addon folder

ofxLSystem is a 3D graphic turtle graphic interpretation of L-Syestems. In the readme of ofxLSystemGrammar you can find some information about L-System. This addon can be used to generate meshes as the following ones:

example example example example example

Supported platforms

It is currently tested on mac, linux and windows and the current version of openFrameworks in master

On linux, you need g++ > 4.9 and the -std=gnu++14 flag. Otherwise you will have an error about std::regex_iterator. This flag is the default since OF 0.9.3, just in case you set it to std=c++11 as described in this post.

Usage

In your header file include ofxLSystem and declare an instance of it. Declare also a material, it will be applied to the tree's mesh.

#include "ofxLSystem.h"
// ...
ofxLSystem tree
ofMaterial treeMaterial

In your ofApp.cpp

void ofApp::setup(){
  treeMaterial.setDiffuseColor(ofFloatColor::blueSteel)
  tree.setStep(4);
  tree.build();
}


void ofApp::draw(){
  treeMaterial.begin();
  tree.draw();
  treeMaterial.end();
}

tree.setAxiom("F") tells to ofxLSystem to use F as axiom, tree.setRules({"F -> FF[+F][-F]"}) to use F -> FF[+F][-F] as reproduction rule and tree.setStep(4) to iterate 4 times. Have a look into ofxLSystemGrammar or in the 2 examples in this project for more L-System examples.

By default, each L-System is initialized with this parameters:

typedef map<string,float> Constants;

vector<string>    rulesContainer = {"F -> F[+F][-F]"};
string            axiom = "F";
bool              randomYRotation = false;
int               depth = 1;
float             theta = 25.00;
float             stepWidth = 10.00;
bool              scaleWidth = false;
float             stepLength = 100.00;
map<string,float> constants = Constants();

you can overwrite the default parameters using these methods:

void setAxiom(string _axiom);
void setRules(vector<string> _rulesContainer);
void setTheta(float _theta);
void setRandomZRotation(bool _randomYRotation);
void setStep(int _depth);
void setScaleWidth(bool _scaleWidht);
void setStepWidth(float _stepWidth);
void setStepLength(float _stepLength);
void setConstants(map<string,float> _Constants);

For example, the following snippet:

ofxLSystem tree;
map<string, float> constants;
constants.insert(make_pair("R", 1.456));

tree.setAxiom("A(100)");
tree.setRules({"A(s) -> F(s)[+A(s/R)][-A(s/R)]"});
tree.setRandomYRotation(true);
tree.setConstants(constants);
tree.setStep(4);
tree.setScaleWidth(true);
tree.setStepLength(90);

Generates a tree like this:

example

Examples

  • example-gui contains ~10 differents L-Systems, with a GUI to change colors, rotation angle, n steps ecc. It saves the settings for each tree on a separate xml file
  • example-forest An example on how you can build a forest merging the meshes of 60 trees in one
  • example-shader I've added some simple shaders following "the book of shader" of Patricio Gonzalo Vivo.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].