Our first meeting, we started a Unity project and discussing the scope of the project. Here is a sketch we found that describes how the Monstera Deliciosa grows.
The user can change the age and light power. Age range 1-5 roughly years. Height range 20cm-2m, not manually changeable.
Light position is constant from above. The segment length is same for every segment. Angle for each leaf is constant. The angles for each segment is random.
Sofia spent some time 3D modelling 3 different pots for the plants. The texture for the middle one is final, but the small and large ones are yet to be textured.
We had a meeting and divided up the roles. Filip is responsible for the meshes for the leaf, internode, and petiole. Sofia and Jennifer will collaborate on creating a grammatical structure for the plant, writing it in code, and generating parameters for the meshes from the input data. Sofia and Jennifer started writing code.
public class Leaf
{
public (int, int) Holes;
public (int, int) Size; //width, height
public Color MainColor;
public Color VeinColor;
public int ID;
public int Depth;
public Leaf(int age, int lightPower, int id, int depth)
{
ID = id;
Depth = depth;
if (depth == 0)
{
//lighter color
}
}
}
public class Internode
{
public (int, int) Size; //thickness, length
public Color MainColor;
public int ID;
public int Depth;
public Petiole petiole;
public Internode internode;
public Internode(int age, int lightPower, int id, int depth)
{
ID = id;
Depth = depth;
petiole = new Petiole(age, lightPower, id + 1, depth - 1);
if (depth != 0)
{
internode = new Internode(age, lightPower, id + 1, depth - 1);
}
}
}
public class Petiole
{
public int Length;
public (int, int) Thickness; //start and end thickness
public int Angle; //-45 to 45
public int Rotation; //-180 to 180
public Color MainColor;
public int ID;
public int Depth;
public Leaf Leaf;
public Petiole(int age, int lightPower, int id, int depth)
{
ID = id;
Depth = depth;
if (depth == 0)
{
Angle = 0;
}
else
{
//randomize angle
}
Leaf = new Leaf(age, lightPower, id + 1, depth - 1);
}
}
We now have an integrated program from our two separate pieces of code! The result can now run in Unity, where clicking the button on screen generates a random Monstera Deliciosa based on predetermined values for age and light exposure. The next step is to create sliders for these values in the UI, tweak the parameters for the Monstera generation (to improve the visual look and realism of the generated plants) and work on the Monstera leaf meshes. We also need to start commenting our code (uh oh, yikes) and start working on our project report! We also need to add the pot models to the generation, as currently the Monstera just springs out of Unity's ground which is totally unrealistic tihi.
Here are some of Filip's sketches for the Monstera plant mesh generation.
The textures for the pots were finished and imported into Unity.
Our program may be integrated but we are still not done! We are therefore working on Integration 2.0, which really is just us continuing to piece our two programs together until everything is done and perfect. So far, we've been working on tweaking some parameters in order to make the generated plants mimic our muse, Big Boy, as closely as possibly. Some of the values and calculations needing tweaking have been the angles for the petiole and leaf rotations, as the resulting plant has at times been sticking its body parts all over the place, which isn't very realistic.
Filip has also been working on his leaf meshes, so Sofia and I have now added support for that in our code by making sure that we are calculating all the values that Filip's part of the code will be needing in order to generate the leaves. Sofia also added the pots so they correctly appear under the plant, although we don't know where they've disappeared to now in bug testing, but hopefully we'll find them soon and be able to generate plants in pots again! Jennifer also added two sliders to the UI for plant age and light exposure, these range from 1 to 5 and are hooked up to the code so that using the slider will correctly control the parameters of the next plant.
Editor's note: These images came out very pixelated, which is not how they are in the program. Please use your imagination to make them much smoother!
We have now finalised our project, mainly by writing our report for our course, and are done with our work! The final version can be found online here! We hope you enjoy it.
We decided to name our project Monstera Deliciosa: L-System Aroid Vegetation Approximation, which shortens to MD:LAVA, where Lava is Sofia's beautiful cat.
Here are four images of Monstera Deliciosa generated in our program!