<figure><img src="image_1.png" /></figure>

HAL
open science

Study of Plant Animation Synthesis by Unity3D

Yanna Jiang, Boxiang Xiao, Baozhu Yang, Xinyu Guo

► To cite this version:

Yanna Jiang, Boxiang Xiao, Baozhu Yang, Xinyu Guo. Study of Plant Animation Synthesis by Unity3D. 8th International Conference on Computer and Computing Technologies in Agriculture (CCTA), Sep 2014, Beijing, China. pp.344-350, 10.1007/978-3-319-19620-6_39. hal-01420249

HAL Id: hal-01420249

https://inria.hal.science/hal-01420249

Submitted on 20 Dec 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Study of Plant Animation Synthesis by Unity3D

Yanna Jiang²,ª, Boxiang Xiao¹,ᵇ,*, Baozhu Yang¹,ᶜ, Xinyu Guo¹,ᵈ

¹ Animation Department, Beijing Research Center for Information Technology in Agriculture, Beijing
100097,China; ² College of Information Engineering, Capital Normal University, Beijing 100048,China
ªjiangyannacs@126.com, ᵇxiaobx@nercita.org.cn, ᶜyangbz@nercita.org.cn, ᵈguoxy@nercita.org.cn

**Abstract.** Virtual plant is a novel research issue in computer applications, and realistic plant animation is widely used in many fields. The research of precise, efficient and photorealistic plant animation synthesis is one of the important issues that the current virtual plant facing with. This paper using maize achieves real time and realistic plant animation, based on the platform of Unity3D. The virtual maize model is generated by use of interactive parameterized modeling method. By setting a good interactive interface, users can dynamically adjust the parameters to realize different animation effects. Finally, concluding and analyzing this method. In addition future research and application direction is discussed in order to achieve better plant animation.

**Keywords:** Unity3D, Plant animation, Animation synthesis

# 1 Introduction

## 1.1 Plant Modeling and Animation

In recent years, plant modeling and animation synthesis become a novel research, achieving wide attention of domestic and foreign researchers, generating a number of representative studies [1-6]. As for the issue of plant platform simulation,Zhao Xing et al.[1] from the aspect of botany,established a two-scaled automaton model of virtual plant growth based on the growth mechanism of plants. By restoring camera movement and tree's three-dimensional point clouds, Tan et al.[2] constructed realistic 3D models of natural trees based on real plant image. On this basis, for plant dynamic virtual simulation and animation synthesis problem,Feng Jinhui et al.[3] using nonlinear mechanics and wave theory to solve the motion of different branches,simulating tree swaying in the wind.Habel et al.[4] using geometry and dynamic model which is physically based, through a two-step nonlinear deformation method to simulate the interaction of branches and the external force acting on them,realizing the simulation of branches bending and swaying in the wind with a high sense of reality.Diener[5] using the coupling of video analysis and hierarchical clustering offers as an alternative to physical simulation FEATURE TRACKING IS APPLIED TO THE VIDEO FOOTAGE, ALLOWING THE 2D POSITION AND VELOCITY OF AUTOMATICALLY IDENTIFIED FEATURES TO BE CLUSTERED. EXTRACTING THE MOTION OF REAL PLANT IN THE WIND FROM VIDEO, MAPPING IT TO 3D PLANT MODELS, FORMING THE PLANT ANIMATION.XIAO BOXIANG et al.[6] PRESENTED A MOTION CAPTURE DATA-DRIVEN ANIMATION APPROACH, RECONSTRUCTED PLANT MOTION BY REAL PLANT SCANNED DATA AND MOTION CAPTURE DATA. BASED ON THE VIRTUAL MAIZE MODEL, IMPLEMENTED DATA-DRIVEN PLANT ANIMATION. EXISTING RESEARCH METHODS PROVIDE A TECHNIQUE REFERENCE TO ACHIEVE HIGH PRECISE AND HIGH REALISTIC ANIMATION SYNTHESIS. AT THE SAME TIME, THE DEVELOPMENT TOOL ORIENTED GAME PRODUCTION ALSO PROVIDE A GOOD PLATFORM FOR REALISTIC SIMULATION OF THE PLANT.
## 1.2 Unity3D Simulation Platform

As a fully integrated, cross-platform professional game engine, Unity3D[7] is a hierarchical comprehensive development tool, can be used for interactive contents, such as real-time three-dimensional animation, 3D video games, architectural visualization and so on. It provides a visual authoring environment, uses C# and JavaScript as the scripting language, has a detailed property editor and a dynamic game preview. Unity3D[8] has a highly optimized graphics rendering pipeline for DirectX and OpenGL. With excellent advanced rendering effects and user customization support, Unity3D can sufficiently handle large volumes of three-dimensional model in real time. It has a very powerful physics engine, can realize realistic interactive feel, create high-quality 3D simulation system[9] and real visual effects to simulate physical phenomena of the real world. Unity3D provides a highly perfect light and shadow rendering system with the function of soft shadows and baking, can release the game to Windows, Mac, Android or iPhone platform. Using the Unity web player plugin, which is only 500K in size, can release web games, supporting Mac and Windows' web browser. A complete Unity3D program is a combination of several scenes. Each scene including many models, through the script can dynamically control their behavior. With the Unity as virtual reality development platform, the efficiency of development is high, the effect is realistic, the interactive capabilities is powerful, the amount of data is small.

## 2 Key Technique Research and System Development

This paper uses Unity3D as development platform. First, three-dimensional model of typical plant is generated by use of interactive parameterized modeling method. Then, getting and setting the attribute value of WindZone using C# scripting language. Interactive interface is made by use of NGUI, users can adjust the parameters to dynamically modify the value of wind main, wind turbulence, wind pulse magnitude, and wind pulse frequency. The overall architecture of the system is shown in Figure 1:

<figure><img src="image_3.png" /><figcaption>Fig.1. The framework of plant animation system</figcaption></figure>

### 2.1 Interactive Plant Parameterized Three-dimensional Modeling Method

Plant three-dimensional modeling method is varied. For different modeling purposes and application requirements, different modeling methods can obtain different modeling results. Parameterized modeling method is the method which starts earlier, is more influential and widely used. This kind of method uses a set of parameters to represent the main organs and three-dimensional morphological structure of the plant. Usually in an interactive way to realize parameters' dynamic adjustment and
editing,in order to achieve the purpose of modifying the three-dimensional shape of models[10].This
paper adopts an interactive parametrized modeling approach.First collecting three-dimensional
morphology structure data of maize in field with the three-dimensional instrument Immersion
G2LX.Then constructing the three-dimensional model of maize,by defining the veins curve and leaf
blade margin curve to achieve the virtual modeling of leaf characteristics.Finally generating maize
plant and population model in accordance with the plant type structure of typical maize.

<figure><img src="image_4.png" /><figcaption>Fig.2. Immersion G2LX Digitizer, Leaf Template and Modeling Parameters</figcaption></figure>

## 2.2 Key Technique Research

### 2.2.1 Model Import

There are two methods for constructing three-dimensional model in the scene.One is the use of built-in
functions of Unity3D.Another way is to import the 3D model as the same way of importing
resources,where the models are constructed in the modeling software.This paper uses 3DMax as the
modeling software to construct the three-dimensional plant model.Converting the format of
three-dimensional plant to .fbx,which is the compatible format in Unity3D.The imported model
information in Unity3D including spatial location, الشهير name, etc. Then, in the inspector panel of
Unity3D to set the textures.Though directional light is added in the scene,there still exists the
phenomenon that the imported model appears partial dark.This problem is solved by setting and
adjusting point light.

### 2.2.2 Interactive Technique

A good user interface is produced by use of NGUI plugin.Through clicking the button,users can switch
the browse modes.By dynamically input parameters to achieve different levels of animation
effects.There are three cameras in the scene.The NGUI camera is to display the constructed
two-dimensional user interactive interface.By defining two camera objects in the scene,dynamically
controlling the state of the scene camera and first-person camera, browse mode is switched.By
importing the first-person controller in the scene and setting its position and viewing angle,users
through mouse,keyboard roaming in the scene,and then from different aspects to observe animation
effects.
### 2.2.3 Plant Animation

This paper realizing the plant animation by adding the component of `WindZone`, as shown in figure 3. And then getting and setting the component's each property value in scripts, to achieve the plant's swaying effects under different wind conditions. `Unity3D` comes with the tree component is `SpeedTree`, thus the tree supporting swing, `WindZone` just provides wind condition data to swing. For external imported plant model, there is still no wind effect although the `WindZone` component is added. Initially using brush to draw the plant model onto the terrain, when choosing the model needs to set the value of `Bend Factor` greater than 0, as shown in Figure 4. `Bend Factor` is used for setting the camber of plant, thus plant model can have oscillating effects in the scene. As plant model is drawn directly onto the terrain, the attribute value of `WindZone` can not be dynamically obtained and modified by scripts. Thus importing `Unity tree package` and creating tree model. Then in the inspector panel uses the imported model and texture to replace that tree's mesh and texture. Adding `WindZone` for plant model in the way of adding component, binding the written C# script on to the plant model. Finally solving the problem of external plant model swaying and wind conditions' dynamic change.

<figure><img src="image_5.png" /><figcaption>Fig.3. Properties of `WindZone`</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Fig.4. Selected plant model and camber setting</figcaption></figure>

## 2.3 System Development

Based on `Unity4.2` using `maize` as the study object implemented plant population animation. This paper is mainly divided into the following sections. First is the scene integration [11], including creating terrain, setting textures and adding light and sky boxes in the scene. Second, importing the plant model and trees package. Creating a tree model and setting the model's specific location through translation, rotation and scaling. Letting the imported external model and textures to replace tree's mesh and textures. Adding `WindZone` component for the plant model, binding a C# script which can access and change the wind conditions. Interactive interface using `NGUI` plugin to implement, by use of input box through event-trigger to get the parameters dynamically setted by users. Changing the property values of `WindZone` to achieve the plant animation under different wind conditions. The implemented animation effects is shown in Figure 5.
<figure><img src="image_7.png" /><figcaption>Fig. 5. (a) Maize canopy at static status; (b) Motion of canopy by influence of wind</figcaption></figure>

3 Conclusions

By study of the above key techniques, a simple and low-cost plant animation system is built. This system achieves a certain degree of realism and interactivity. Through the interactive interface, users can switch browse mode and dynamically change the wind conditions. In the mode of first-person, users can roam in the scene by use of mouse and keyboard, and can from different angles to observe the plant's motion effects caused by different wind conditions. In the follow-up work, we intended to implement a plant animation system with a more perfect function, more friendly man-machine interactive interface. To further enhance the realism and interactivity of user experience, data glove can be also used, thus allowing users to interact with the scene more efficiently.

Acknowledgement

This work is supported by National Natural Science Foundation of China (Grant No.61300079);by
Beijing Municipal Natural Science Foundation Project “Study of plant dynamic modeling and
simulation based on kinematic analysis”(Grant No. 4132028); by Special Fund for S&T
Innovation of Beijing Academy of Agriculture and Forestry Sciences (Grant No.
KJCX201204007).The authors thank the reviewers for their valuable comments and suggestions.

References

1. Zhao Xing, de REFFYE P, Xiong Fanlun et al. Dual-scale automaton model for virtual plant development [J]. Chinese Journal of Computers, 2001,24(6):608-615.

2. Tan P, Zeng G, Wang J, et al. Image-based tree modeling[J]. ACM Transactions on Graphics (TOG), 2007, 26(3): 87.

3. Feng Jinhui, Chen yanyun, Yan Tao, Wu Enhua. Going with wind-physically based animation of trees[J]. Chinese Journal of Computers, 1998.21(9):769-773

4. Habel R, Kusternig A, Wimmer M. Physically guided animation of trees[C]//Computer Graphics Forum. Blackwell Publishing Ltd, 2009, 28(2): 523-532.

5. Diener J, Reveret L, Fiume E. Hierarchical retargetting of 2D motion fields to the animation of 3D plant models[C]//Proceedings of the 2006 ACM SIGGRAPH/Eurographics symposium on Computer animation. Eurographics Association, 2006: 187-195.
6. Xiao Boxiang, Guo Xinyu, Zhao Chunjiang. An Approach of Mocap Data-driven Animation for Virtual Plant. IETE Journal of Research, 2013,59(3):258-263.

7. Zhu Zhu.Design and application research of virtual experimental system based on Unity3D[D].master's thesis,2012.5.

8. Chen Hong, Ma Qin, Zhu Dehai.Research of interactive virtual agriculture simulation platform based on Unity3D[J].2012.3(3):184-186.

9. Xuan Yusong.Unity3D game development [M],The People's Posts and Telecommunications Press,2012.

10. Xiao Boxiang, Guo Xinyu, et al. An interactive digital design system for corn modeling. Mathematical and Computer Modelling, 2010,51(11-12):1383-1389.

11. Kenneth C. Finney .3D Game Programming All in One[M].Qi Bolan,Xiao Yi translated.Beijing:Tsinghua University Press,2005.