All Projects → edap → ofxSpaceColonization

edap / ofxSpaceColonization

Licence: other
Space Colonization algorithm implementation in openFrameworks

Programming Languages

C++
36643 projects - #6 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to ofxSpaceColonization

ofxLSystem
3D turtle graphics interpretation of L-Systems
Stars: ✭ 39 (-37.1%)
Mutual labels:  tree, addon, algorithmic-botany
ofxCameraAnaglyph
Anaglyph Camera for Stereo 3D Rendering for OpenFrameworks
Stars: ✭ 25 (-59.68%)
Mutual labels:  openframeworks, addon
ofxAubio
openFrameworks addon for aubio, estimates beat, onset, pitch, and a few other things
Stars: ✭ 56 (-9.68%)
Mutual labels:  openframeworks, addon
Ofxtweenzor
Tweening Engine for OpenFrameworks
Stars: ✭ 52 (-16.13%)
Mutual labels:  openframeworks, addon
Ofxio
A collection of I/O core utils including a directory watcher, file filters and ordering, compression and more.
Stars: ✭ 78 (+25.81%)
Mutual labels:  openframeworks, addon
ofxRaycaster
Plane, 2D and 3D Ray objects for openFrameworks.It checks for the intersection of a ray with a segment, a sphere, a triangle, a plane, an ofPrimitive, an ofPolyline an with an ofMesh.
Stars: ✭ 54 (-12.9%)
Mutual labels:  openframeworks, addon
Ofxcv
Alternative approach to interfacing with OpenCv from openFrameworks.
Stars: ✭ 614 (+890.32%)
Mutual labels:  openframeworks, addon
Ofxbullet
Bullet Physics Wrapper for Openframeworks
Stars: ✭ 138 (+122.58%)
Mutual labels:  openframeworks, addon
ofxLSystemGrammar
openFrameworks addon that implements most of the string rewriting grammars described in the book "The Algorithimic Beauty of Plants"
Stars: ✭ 36 (-41.94%)
Mutual labels:  openframeworks, algorithmic-botany
ofxOpenCvDnnObjectDetection
OpenCV based DNN Object Detection Library for Openframeworks
Stars: ✭ 34 (-45.16%)
Mutual labels:  openframeworks, addon
ofxPS3EyeGrabber
A Sony PS3 Eye Camera grabber for openFrameworks.
Stars: ✭ 83 (+33.87%)
Mutual labels:  openframeworks, addon
cc3 blender tools
Add-on for importing and auto-setup of character creator 3 & 4 and iClone 7 & 8 character exports.
Stars: ✭ 191 (+208.06%)
Mutual labels:  addon
packager
Generate an addon zip file from a Git, SVN, or Mercurial checkout.
Stars: ✭ 94 (+51.61%)
Mutual labels:  addon
scrolltotop
Scroll To Top extension for Chrome, Firefox, Safari, Opera.
Stars: ✭ 60 (-3.23%)
Mutual labels:  addon
addon-tailscale
Tailscale - Home Assistant Community Add-ons
Stars: ✭ 47 (-24.19%)
Mutual labels:  addon
raiderio-addon
RaiderIO AddOn
Stars: ✭ 35 (-43.55%)
Mutual labels:  addon
webgl-raub
WebGL bindings to desktop OpenGL
Stars: ✭ 66 (+6.45%)
Mutual labels:  addon
gradle-dependencies-viewer
A simple web UI to analyze dependencies for your project based on the text data generated from "gradle dependencies" command.
Stars: ✭ 70 (+12.9%)
Mutual labels:  tree
ConsolePort
ConsolePort - Game Controller Addon for World of Warcraft
Stars: ✭ 108 (+74.19%)
Mutual labels:  addon
leaflet-layer-tree-plugin
No description or website provided.
Stars: ✭ 31 (-50%)
Mutual labels:  tree

ofxSpaceColonization

Build status Build status

cover

This addon is an openFrameworks implementation of the paper Modeling Trees with a Space Colonization Algorithm by Adam Runions, Brendan Lane, and Przemyslaw Prusinkiewicz.

Dependecies

It requires ofxBranchesPrimitive. The example example-ofxenvelope requires the addon ofxEnvelope

Usage

//in your header file
ofxSpaceColonization tree;

// in your App.cpp file
void ofApp::setup(){
    tree.build();
}

void ofApp::update(){
    tree.grow();
}

void ofApp::draw(){
    tree.draw();
}

This will generate a tree using this standard options:

static const ofxSpaceColonizationOptions defaultSpaceColOptions = {
    150,                             // maxDist, leaves are attractive if closer than this distance
    10,                              // minDist, leaves are attractive if farther than this distance
    150,                             // trunkLength, the length of the trunk
    glm::vec4(0.0f,0.0f,0.0f, 1.0f), // rootPosition, the position of the root
    glm::vec3(0.0f, 1.0f, 0.0f),     // rootDirection, the direction on which the tree will starts to grow
    7,                               // branchLength, the length of each branch
    false,                           // doneDrawing, a value that indicates when the grow process is done
    false,                           // cap, if the cylinders that compose the branches have caps or not
    2.0,                             // radius, the radius of the branch
    16,                              // resolution, the resolution of the cylinders that compose the geometry
    1,                               // textureRepeat, how many times a texture has to be repeated on a branch
    0.9997                           // radiusScale, how much the radius will increase or decrease at each interaction
};

You can specify yours options using the setup method:

void ofApp::setup(){
    auto myOpt = ofxSpaceColonizationOptions({
       // ...
    });
    tree.setup(myOpt);
    tree.build();
}

The form of the tree changes depending on these options and on the position of the leaves. By default, some default leaves are provided but you can provide your leaves by using the setLeavesPositions() method. It takes a vector<glm::vec3> as argument.

void ofApp::setup(){
    vector<glm::vec3> points;
    // ... fullfill the vector
    tree.setLeavesPositions(points);
    tree.build();
}

I've created an addon that can be used to generate the points, it is called ofxEnvelope and you can see in the example example-ofxenvelope how to use it.

Wind

The grow method takes a glm::vec3 as optional parameter. This vector can be used to move the leaves, like this Example:

void ofApp::update(){
  float t = ofGetElapsedTimef();
  float n = ofSignedNoise(t * windFreq) * windAmpl;
  auto wind = glm::vec3(n,0.0,0.0); // a weird wind that only breezes on the x axis
  tree.grow(wind);
}

Examples

example-3d example-3d

example-ofxenvelope example-ofxenvelope

License

MIT

References

Procedurally Generated Trees with Space Colonization Algorithm in XNA C#

Daniel Shiffman Video

space-colonization

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].