All Projects → edap → Palmgenerator

edap / Palmgenerator

Licence: agpl-3.0
Three.js module to generate palms procedurally.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Palmgenerator

Dialogfliptest
Android实现dialog的3D翻转效果
Stars: ✭ 30 (-48.28%)
Mutual labels:  3d
Clash Royale Clone
A Unity clone of Supercell's Clash of Clans spin-off mobile game Clash Royale with possibly some twists.
Stars: ✭ 43 (-25.86%)
Mutual labels:  3d
Helix Toolkit
Helix Toolkit is a collection of 3D components for .NET.
Stars: ✭ 1,050 (+1710.34%)
Mutual labels:  3d
Egjs View3d
Fast & customizable 3D model viewer for everyone
Stars: ✭ 34 (-41.38%)
Mutual labels:  3d
Pixel2mesh
Pixel2Mesh: Generating 3D Mesh Models from Single RGB Images. In ECCV2018.
Stars: ✭ 997 (+1618.97%)
Mutual labels:  3d
Meshcnn
Convolutional Neural Network for 3D meshes in PyTorch
Stars: ✭ 1,032 (+1679.31%)
Mutual labels:  3d
G3d
A pure 3D render engine compatible with webgl, running both in browser and gcanvas.
Stars: ✭ 948 (+1534.48%)
Mutual labels:  3d
Spherelayout
a layout which supports 3d rotate and enable its childview has z-depth for android
Stars: ✭ 55 (-5.17%)
Mutual labels:  3d
Monodepth360
Master's project implementing depth estimation for spherical images using unsupervised learning with CNNs.
Stars: ✭ 41 (-29.31%)
Mutual labels:  3d
Sophus
C++ implementation of Lie Groups using Eigen.
Stars: ✭ 1,048 (+1706.9%)
Mutual labels:  3d
Nintimdo Rp 3d models
Autodesk Fussion and stl files
Stars: ✭ 35 (-39.66%)
Mutual labels:  3d
Vitruvio
Vitruvio brings the powerful ArcGIS CityEngine procedural modeling capabilities to Unreal Engine.
Stars: ✭ 37 (-36.21%)
Mutual labels:  3d
Blender autotracker
Blender autotracker addon
Stars: ✭ 47 (-18.97%)
Mutual labels:  3d
Tk Substancepainter
🗿 Shotgun Toolkit Engine for Allegorithmic Substance Painter https://www.allegorithmic.com/products/substance-painter
Stars: ✭ 33 (-43.1%)
Mutual labels:  3d
Navmeshscene
based on recastnavigation, a 3d scene
Stars: ✭ 53 (-8.62%)
Mutual labels:  3d
Flux Studio
Web-based 2d/3d editing application for FLUX desktop manufacturing products
Stars: ✭ 29 (-50%)
Mutual labels:  3d
Fdf
School 42 project // 3D Wireframe Viewer
Stars: ✭ 46 (-20.69%)
Mutual labels:  3d
Ueviewer
Viewer and exporter for Unreal Engine 1-4 assets (UE Viewer).
Stars: ✭ 1,083 (+1767.24%)
Mutual labels:  3d
Psychosynth
GNU Psychosynth is a a synthesizer and modular audio framework inspired by the ideas of the Reactable.
Stars: ✭ 53 (-8.62%)
Mutual labels:  3d
Curtainsjs
curtains.js is a lightweight vanilla WebGL javascript library that turns HTML DOM elements into interactive textured planes.
Stars: ✭ 1,039 (+1691.38%)
Mutual labels:  3d

Palm Generator

Video

The Palm Generator is a Three.js module to create palms. For the moment it is in beta version, and it is available just as es6 class, but an npm package will arrive soon. Here you can see what kind of palms it is able to create.

Usage

This repository contains a usage example, run npm start. To use the PalmGenerator in your THREEjs application, copy the classes PalmGenerator.js and phyllotaxis.js in your source folder and follow this instructions.

First, you need to create a palm. The palm generator constructor has the following signature:

let palm = new PalmGenerator(leafGeometry, trunkGeometry, options, curve=false);

leafGeometry. Required. Has to be an instance of THREE.Geometry, and it is the geometry used for the leaves of the palm.

trunkGeometry. Required. Has to be an instance of THREE.Geometry, and it is the geometry used for the trunk of the palm.

options. Optional. Is an object containing the options. The available options are:

  • spread. Float. It is the value that defines how much the objects that compose the palm should distantiate from each other. Keep it between 0 and 2.

  • angle Float, degrees. It is the rotation angle that affects the phyllotaxis pattern. The default is the golden angle, 137.5,

  • num Integer. It defines how many objects compose the palm. Keep it between 200 and 1000. The smaller, the faster.

  • growth.Float. This value define how much the palm should grow along the y axis.

  • foliage_start_at. Integer.It defines how many object will be leafs. It has to be a value smaller than num.

  • trunk_regular. Boolean. It defines if the phyllotaxis will deform the trunk or not.

  • buffers: Boolean. Highly experimental, default is false, updates will follow.

  • angle_open: Float, degree. It defines the disclose angle of the leaves.

  • starting_angle_open Float, degree. It defines from which angle the leaves will start to disclose.

curve. Optional. A CatmullRomCurve3 can be passed as last argument. The first vertex in the curve will define the position of the treetop, the last one will define the position of the part of the trunk that is attached to the ground. Look at the curve in src/application.js to have an idea about how to make palms alongside curves.

The PalmGenerator returns an object containing an instance of THREE.Geometry.

Example:

let leafGeometry = new THREE.SphereGeometry(5, 20, 20);
let trunkGeometry = new THREE.BoxGeometry(5,5,5);
let palm = new PalmGenerator(leafGeometry,
                            trunkGeometry,
                            curve);
let geometry = palm.geometry;
let bufGeometry = new THREE.BufferGeometry().fromGeometry(geometry);
let mesh = new THREE.Mesh(bufGeometry, material);
scene.add( mesh );

Enter LeafGeometry

The previous snippet generates a tree that looks weird. The trunk is fine but the foliage is really abstract. This is because the PalmGenerator accepts any kind of geometry, but probably a sphere isn't the best geometry to draw a leaf. In order to have leaves the looks like palm leaves but do not require too much polygons, I've created a custom geometry, called LeafGeometry. You can dowload the class LeafGeometry.js from the repository and put it into your source folder. We change the previous snippet as follows:

let leaf_opt = {
    length: 60,
    length_stem: 20,
    width_stem: 0.2,
    leaf_width: 0.8,
    leaf_up: 1.5,
    density: 11,
    curvature: 0.04,
    curvature_border: 0.005,
    leaf_inclination: 0.9
};

let trunkGeometry = new THREE.BoxGeometry(5,5,5);
let leafGeometry = new LeafGeometry(leaf_opt);

let palm_opt = {
    spread: 0.1,
    angle: 137.5,
    num: 406,
    growth: 0.12,
    foliage_start_at: 56,
    trunk_regular: false,
    buffers: false,
    angle_open: 36.17,
    starting_angle_open: 50
};

let palm = new PalmGenerator(leafGeometry,
                            trunkGeometry,
                            palm_opt);
let geometry = palm.geometry;
let bufGeometry = new THREE.BufferGeometry().fromGeometry(geometry);
let mesh = new THREE.Mesh(bufGeometry, material);
scene.add( mesh );

The leaf_opt hash contains a bunch of options, you can have an idea about what each option is doing playing around with this demo. The previous snippet should generate a palm like this one:

example

Curves

If we add a curve to the previous palm, passing an instance of a CatmullRomCurve3 as fourth argument to the constructor, for example:

var curve = new THREE.CatmullRomCurve3( [
      new THREE.Vector3( -40, 150, 0 ),
      new THREE.Vector3( -40, 100, 0 ),
      new THREE.Vector3( 0, 60, 0 ),
      new THREE.Vector3( 0, 0, 0 ),
] );

let palm = new PalmGenerator(leafGeometry,
                            trunkGeometry,
                            palm_opt,
                            curve);

A palm like the following one is created:

example

Online Editor

If you want to generate your palm playing around with the parameters, try the Palm Generator Online Editor

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