B"H
In blender there is some addon that makes trees automatically base on parameters, and includes a trunk with several branches and sub branches etc. and leaves whose textures can be specified.
I want to do this in threejs, just generate tree geometries AND have them “blow in the wind:” etc. I cant find any examples to go on
Here is an example for constructing a tree, but most likely you should make your own code for a tree and add motion, by varying the angles of the branches:
For that you would probably want to use a custom vertex shader and deform the vertices after they have been transformed to worldspace.
The amount of deformation would be controlled by the vertical position of the vertex in localspace, since there is 0 deformation at the stump, and maximum deformation at the top.
You could use onBeforeCompile to patch the tree shader to make this happen… by editing the vertex shader, and adding uniforms that describe the wind forces… (or possibly a noise texture that would be sampled by the world space position, and the animated wind direction)
Lol nice B"H reference. are u jewish if i may ask?
and where can i find any kind of trees blowign in the wind, like fortnite, but infinitely better? theres got to be some code somewhere for it. are armatures necessary?