Project and Goal
This is the ImGui interface in all its glory. To the left we have the settings for generation, to the right a brief explanation of symbols and controls, and below that we have the save window.
The Rotations tab defines min and max points for the random offset of angles. Set them to the same value, and the tree will look the same each time it is generated.
The save window will not only save the generated tree as an fbx, but also the settings used to get that result.
The third value of the Rotations tab makes the tree a little bit more interesting. If this value is set to zero, the tree will grow straight up, with straight branches. This "Trunk angle offset" brings the result to life. If the interval is weighted more against either side the tree will naturally lean in that direction.
The CreateCapsule takes in two points and uses a simple rotation algorithm to map the vertex positions of the sphere halves on each end of the shape. I decided to use ten points around the circumference, which makes for a total of 42 vertices.
The algorithm takes an orientation between the two points, rotates it a set amount, and then translates a new point along the x(GetRight) axis of the transform, with the scale set by the Run function of the TurtleGraphics class. On each iteration the transform also tips along the local Y-axis to make for the ring towards the endpoints.
I set out to make a more advanced tool than I actually managed to make. I wanted to be able to specify presets for generating realistic trees such as pines or fir, and have them use custom shaders for foliage. The reality is that the exporting using Assimp took a whole lot longer to get up and running than expected. As a result I had to cut that extra bit of functionality from my project.
I am however very pleased with the work I made. It is so awesome to see these shapes and to think that only code made this happen, and in such a short time too!
I am excited to keep developing methods to generate content both as environment, landscapes, and individual things like plants and rocks.
A small timeline of the progress I made through these five weeks of development.