Skip to content

mattatz/THREE.Tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

THREE.Tree

A Tree geometry generator for three.js.

sample

Usage

var tree = new THREE.Tree({
    generations : 4,        // # for branch' hierarchy
    length      : 4.0,      // length of root branch
    uvLength    : 16.0,     // uv.v ratio against geometry length (recommended is generations * length)
    radius      : 0.2,      // radius of root branch
    radiusSegments : 8,     // # of radius segments for each branch geometry
    heightSegments : 8      // # of height segments for each branch geometry
});

var geometry = THREE.TreeGeometry.build(tree);

var mesh = new THREE.Mesh(
    geometry, 
    new THREE.MeshPhongMaterial({}) // set any material
);

var scene = new THREE.Scene();
scene.add(mesh);

Example

A builded Tree can be growing. animation

Demo

Demo

About

a Tree geometry generator for three.js.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published