Inlägg

Final Simulation Demo

  To achieve the final simulation for this project, we made some additional changes such as we: 1. Added multiple trees to the simulation. 2. Implemented falling snow by using Unity's particle systems. 3. Implemented fog for added visual impact. 4. Implemented a wind zone, which is a built in system in Unity which works on for example particle systems to simulate wind forces. The wind zone game object does not work on imported trees from Blender, which means that we still use our own code for applying wind force to our trees. Although we take the inputs from the wind zones (main, pulse magnitude and pulse frequency) and use them in our code to make the wind affecting the snow and the trees look the same.

Step 3: Adding Branches

After implementing a simulation of movement in a tree trunk, we began adding branches to the tree. The branches were also made in Blender and works similarly to the tree trunk since it also consists of a number of nodes. The nodes are rotated to simulate movement, meaning each branch works as a mass spring system like the tree trunk. Although the rotation of the nodes on the branches are different than the rotation of the parent tree trunk because of a difference in mass and size.

Step 2.1: Improving Mass Spring System

Bild
The next step was to make additonal improvements to the mass spring tree simulation version.  The following equations was used to calculate the stiffness of the mass spring system: The wind force which is applied to the tree is calculated by: In addition, a boundary for the maximum rotation angle is applied to prevent illogical bending of the tree for high values of the wind speed. More information regarding equation (3) can be found here: https://link.springer.com/article/10.1007%2Fs00468-003-0295-6 More information regarding equation (5), (6) and (7) can be found here: https://www.engineeringtoolbox.com/wind-load-d_1775.html https://www.wikihow.com/Calculate-Wind-Load

Step 2: Implementing a Mass Spring System

  In step two we implemented a different way of simulating movement of the 3D tree model. Instead of calculating the rotation of each joint based on the moment on the joint, we applied a wind-force and dampening on each node in a spring mass system. We did this by implementing the spring mass system code from LAB 2, but with some changes to fit this specific simulation setup: - Instead of working with changes in position of the nodes like in LAB 2, we change the rotation of the nodes.  - This mass spring system is anchored in the bottom of the tree, instead of it being anchored in the top of the system.  - Hooke's Law is used to calculate the force to be applied to the nodes in each node , instead of using it for several points like in the rope example from LAB 2. - The Euler integration method is used in the code of the simulation. More information regarding LAB 2 and its code can be found here:  https://canvas.kth.se/courses/21338/pages/lab-assignment-2-spring-mass...

Step 1: Implementing Rotation of Joints

  We first created a 3D model of a tree in Blender. The 3D model has 20 joints which can be bent to simulate movement of the tree.  In Unity, we then applied a rotation to each joint depending on the acceleration of the wind according to these equations: N = L x (MA) Rotation Angle = N/R N: Moment of a joint L: Length of the tree M: Mass of the part of a joint to the top of the tree A: Acceleration of the wind R: Elastic coefficient of a joint (joints closer to the top of the tree, will have a greater rotation angle) More information about these equations can be found at:   https://www.sciencedirect.com/science/article/pii/S0097849306000835#bib22

PROJECT SPECIFICATION

Bild
Simulating dynamic tree movement in a wind field Simon Ekman simonevh@kth.se   Anders Blomqvist andblomq@kth.se Sandra Tor santor@kth.se   Background Dynamic foliage which can be affected by various forces such as wind, moving objects, rain etc can create a more immersive world. Interactive foliage makes the world feel more alive and not as stiff as predefined animations. Together with a mass-spring system and a skeletal mesh this dynamic foliage behaviour can be implemented.  We got inspiration from this video by Patrick Murphy which simulates plants affected by wind. However we want to make a tree instead but the concept is the same. A more detailed implementation has been made by Y.Akagi and K.Kitajima [3] where they implemented a wind system and a tree which moves accordingly, shown in figure 1. Figure 1. A tree which moves in the wind.   Problem The problem is to simulate in real time a realistic animation showing how trees are affected by wind at different spe...