This is a tool I built with three.js called FloraSynth. It’s capable of generating 3D tree and plant models by simply clicking the space bar. The idea is that each model is a different variation.
By switching the presets you can test out some sample tree types I added in, and the models can be exported as .OBJ files.
Yea adding more exporting options is on my to do list for sure. The reason I haven’t added GLTF is the exporters provided by three.js don’t “merge” likewise vertices. In the sense that if two vertices have identical positions but different UV’s, it stores the same position twice leading to excessively large filesizes.
OBJ was simple enough I could create my own exporter but I just need to look into solutions for other file formats. I’m honestly open to suggestions on that.
Thanks for the feedback! I’m currently working on including the textures in the export so they will look better in the preview, for now it just exports geometry.
The UV’s are all included in the file so throwing on the textures in blender for example would be a breeze.
haha yea I’ve seen those. The problem is that they don’t “merge” likewise vertices. In the sense that if two vertices have identical positions but different UV’s, it stores the same position twice leading to excessively large filesizes.
I bet there is a way to edit them to do what I need though.
my OBJ exporter was only slightly painful to create
This is a very interesting project having quite an elaborate growth model, judging from the complexity of the amount of UI options.
A few things to look after:
even when idle, CPU usage jumps from ≈ 10% in a non-florasynth Firefox tab to ≈70% with the florasynth tab in the foreground. GPU usage likewise jumps to ≈26% from a previous 0%. I notice this because the fans on my AirBook 2017 go off pretty soon.
Maybe you should switch from a (mostly needless) animation loop to on-demand rendering on space-bar press.
Other than that: very well done so far!
Suggestion for further work:
Show tree growth animated …
I would be fine generating a few modles if its closed source, but i want to import htme into threjs in a way that has the branches swaying in the wind, and to do that i may need to somehow calculate the branches without considering it as one mesh? Im not really sure how to do it tho. if u have the open source code to share, or jsut to share it with me personally to work on it with u, that would be cool.
i just want trees blwoing in the wind. one day maybe
As of now the code is unfortunately closed source. I haven’t fully decided on the direction to take this project, so I may very well end up releasing it at some point.
Depending on the quality of the sway animation you need, I would recommend looking into skeletal rigging animations for blender. You could probably create some basic motion for a static mesh that way.
I’ve actually been trying to add exportable skeletal wind sway animations to Florasynth for a while, with some difficulty. I bet I could get it working pretty soon if its something you would be interested in.
B"H
Tried to just use a tree exporte d in threejs but still leaves show up as opaque by default. even after changing material to transarent. tried alpha clip in blender also. only wiht the alpha texture downlaoded separately and lots of tweaking does something maybe work. is there a way to set up the alpha for the leaves automatically such that when i import the threejs glb it automatically has it as transaprent? would be helpful. Also, even if a skeleton is just applied to the branches, can use code later to figure out how to sway it, dont even need to add animation to it
are u also ok if i try to reverse engineer the code based on the minified version? just the part for calcualting the branches etc.