Unity-based plant growth demonstration method

By collecting and processing pictures of plants from each growth period, combining the functions of Unity3D, we create land models with ups and downs and achieve dynamic growth effects, solving the problem that traditional methods cannot meet the large-scale planting and display plant growth changes, and improving the visual effect and learning experience.

CN119295685APending Publication Date: 2025-01-10WUHAN YOUJIAO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411168783.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The traditional Unity terrain brush method cannot meet the needs of large-area planting under the WebGL platform, and cannot effectively display the changes in the growth period of plants, and the visual presentation effect is poor.

Method used

By collecting pictures of each growth period of the plant, performing snippet processing, creating models of different growth periods, and creating land models with ups and downs and changes in Unity3D, adding plant models according to the timeline to achieve the visual effect of dynamic growth of plants .

Benefits of technology

A large-area plant growth demonstration has been achieved, and users can intuitively feel the changes in the growth cycle of the plant, improving visual effects and learning experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295685A_ABST
    Figure CN119295685A_ABST
Patent Text Reader

Abstract

The invention relates to a Unity-based plant growth demonstration method, which comprises the following steps of: S1, obtaining pictures of a plant in each growth period, and screening a proper sample from the pictures; s2, deducting the sample to obtain an appearance picture of the plant; s3, importing the shape picture of the plant into Unity 3D to obtain a material for making the plant, and making a land with a required size in the Unity 3D; s4, respectively making models of each growth period of the single plant by utilizing the materials; s5, determining the row spacing, the column spacing and the rotation angle of the plants according to the size of the land and the planting density, and further determining the coordinate position and the orientation of each plant on the land; s6, adding the plant models in each growth period to corresponding coordinate positions on the land according to a time axis; and S7, when plant growth is demonstrated, obtaining a visual effect of dynamic growth of the plant by dragging the time axis. The method is suitable for manufacturing large-area plants, and a user can visually feel the change trend of the plants in different growth periods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of simulation modeling, and in particular to a plant growth demonstration method based on Unity. Background Art

[0002] With the rapid development of digital education, the education industry has an increasingly high demand for virtual simulation project resources. Traditional Flash can no longer meet the growing needs of the education industry. Unity has become the mainstream tool for producing virtual simulation projects.

[0003] As a powerful cross-platform engine, Unity provides developers with a wealth of tools and resources, making it possible to achieve an immersive experience of plant planting and growth.

[0004] Plant planting and growth simulation can not only provide a more realistic environment and interactivity for games, but also contribute to applications in education, scientific research and other fields. By simulating the growth process of plants in a virtual environment, users can understand the plant ecosystem more intuitively and cultivate an interest in nature.

[0005] In this context, with the help of the powerful features of Unity, developers can create realistic plant models, realize dynamic growth processes, and provide users with an interactive experience with plants.

[0006] The traditional Unity terrain brush method of planting plants cannot meet the needs of planting large areas of plants on the WebGL platform, and cannot allow users to feel the changes in the growth period of plants. The visual presentation effect is poor and needs to be improved. Summary of the invention

[0007] Based on the above description, the present invention provides a plant growth demonstration method based on Unity, which can meet the needs of large-scale plant planting and demonstration, and allow users to feel the changes in the growth cycle of plants with better visual effects.

[0008] The technical solution of the present invention to solve the above technical problems is as follows:

[0009] The plant growth demonstration method based on Unity is characterized by comprising the following steps:

[0010] S1. Obtain pictures of plants at different growth stages and select suitable samples from them;

[0011] S2, performing image clipping processing on the sample to obtain an image of the plant's appearance;

[0012] S3. Import the plant's appearance picture into Unity3D, obtain the material for making the plant, and make the land of the required size in Unity3D;

[0013] S4. Use the materials to make models of individual plants at different growth stages;

[0014] S5. Determine the row spacing, column spacing and rotation angle of the plants according to the size of the land and the planting density, and then determine the coordinate position and orientation of each plant on the land;

[0015] S6. Add plant models of each growth period to corresponding coordinate positions on the land according to the time axis;

[0016] S7. When demonstrating plant growth, you can obtain the visual effect of dynamic plant growth by dragging the timeline.

[0017] As a preferred solution: In step S4, open the production panel through Paint Details in Terrain, drag the image to the Detail Texture position, set the length, width, height and image noise data of the plant, and click OK to produce a plant model for a period of time.

[0018] As a preferred solution: take the lower left corner of the land area as the starting point to obtain the starting point coordinates; determine the row spacing and column spacing of the plants to obtain the coordinate position of each plant, and randomly generate the rotation angle α of each plant; add each plant to the land based on the row spacing, column spacing and rotation angle.

[0019] As a preferred solution: when determining the row spacing and column spacing of plants, input the default row spacing and column spacing according to the type of plant, use a for loop to iterate the number of rows through the SetDetailLayer method, and design a random offset between rows; obtain the position of each row by superimposing the default row spacing and the random offset between rows; add a nested for loop to iterate the number of columns, design a random offset between columns, and obtain the position of each column by superimposing the default column spacing and the random offset between columns.

[0020] As a preferred solution: Use Python's built-in random function to generate a random floating point number between 0 and 1, and then multiply it by 360 to get a random angle between 0 and 360.

[0021] As a preferred solution: when making the land, first make a base of the required size, indent the edge of the base by a certain distance to obtain an embedded rectangle, define the annular area between the embedded rectangle and the edge of the base as a transition zone, make an arc-shaped transition surface from the edge of the base to the embedded rectangle in the transition zone, randomly select several rectangular areas inside the embedded rectangle as change areas, and make the terrain of the base into wavy ridges in the change area; after the base is made, add the plant model to the base, and then make a shielding layer above the base to allow the plants to pass through the shielding layer; finally, cover the shielding layer and the edge of the base with a wrapping layer.

[0022] Compared with the prior art, the technical solution of the present application has the following beneficial technical effects: the present application collects pictures of plants at various growth stages to produce models of plants at different growth stages, and produces a land model with ups and downs and changes, and adds plant models at various growth stages to the land according to the timeline. This method is suitable for producing large-scale plants; during the demonstration of this method, the timeline is dragged to give the plants a visual effect of growth and change, allowing users to intuitively feel the changing trends of plants at different growth stages, thereby deepening their understanding and knowledge of the plant growth process. This interactive learning method is expected to bring new possibilities to the fields of education and entertainment. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a top view of the substrate in this embodiment;

[0024] Figure 2 Schematic diagram of the structure of the land model in this embodiment. DETAILED DESCRIPTION

[0025] The plant growth demonstration method based on Unity includes the following steps:

[0026] S1. Obtain pictures of plants at different growth stages and select suitable samples from them.

[0027] Specific: Determine the plants that need to be collected and the important periods of the plant's growth. Record the pathological shapes that appear in each period in a form and arrange a shooting plan. According to the plan, go to the site to take photos of the plants from various angles. The resolution of the photos should not be less than 1920*1080. The shooting angle must be horizontal or vertical, not other angles. There should be no less than three pictures of each state. There should be no interference in the image. If necessary, the shooting should be combined with a curtain. Select suitable samples from the pictures taken.

[0028] S2. Cut out the sample to obtain a plant appearance picture.

[0029] Specifically: after obtaining the sample, the sample is cut out, only the plant is retained in the picture, and the rest is filled with transparency, so as to obtain the appearance picture of the plant.

[0030] S3. Import the plant's appearance picture into Unity3D, obtain the material for making the plant, and make the land of the required size in Unity3D.

[0031] Reference Figure 1 and Figure 2 , Figure 1Each cross represents a plant. When making land, the default shape of the land is a square. First, make a base T1 of the required size, and indent the edge of the base T1 by a certain distance to get an embedded rectangle. For example Figure 1 In the figure, the side length of the base is W, and the indentation distance is L. In this embodiment, L and W need to satisfy a certain proportional relationship, specifically: L=W×k, where k is the proportional coefficient. It is necessary to calibrate the value of the proportional coefficient k in advance according to the side length of the base, that is, set the side length value range of the base T1, and set the k value for each value range. When making the base, the corresponding k value is called according to the value range of the side length of the base, and then the indentation distance L is calculated according to the side length of the base. In this way, the indentation distance can be adaptively changed with the side length of the base, making the transition of the terrain edge of the base more natural.

[0032] The annular area between the embedded rectangle and the edge of the substrate T1 is defined as the transition zone (e.g. Figure 1 In the transition zone, a curved transition surface is made from the edge of the base T1 to the embedded rectangle, and several rectangular areas are randomly selected inside the embedded rectangle (such as Figure 1 The topography of the base T1 is made into a wave-shaped bulge in the change zone. The edge of the base terrain made by the above means has a transition effect, and there will be a random wave-shaped bulge area in the center of the base terrain. In this way, after adding plants to the base, the whole plant will present a changing, undulating visual effect, which looks more natural.

[0033] After the base T1 is made, the plant model is added to the base, and then a shielding layer T1 is made above the base, so that the plant passes through the shielding layer T2; finally, a wrapping layer T3 is wrapped around the edge of the shielding layer and the base.

[0034] S4. Use the materials to make models of individual plants at different growth stages.

[0035] Specifically: Open the production panel through Paint Details in Terrain, drag the image into the DetailTexture position, set the length, width, height and image noise data of the plant, and click OK to create a plant model for a period of time.

[0036] S5. Determine the row spacing, column spacing and rotation angle of the plants according to the size of the land and the planting density, and then determine the coordinate position and orientation of each plant on the land.

[0037] Specific: Take the lower left corner of the land area ( Figure 1 The midpoint (2) is taken as the starting point to obtain the starting point coordinates; the row spacing and column spacing of the plants are determined to obtain the coordinate position of each plant, and the rotation angle α of each plant is randomly generated; each plant is added to the land according to the row spacing, column spacing and rotation angle.

[0038] When determining the row and column spacing of plants, input the default row and column spacing according to the type of plant, use a for loop to iterate the number of rows through the SetDetailLayer method, and design random offsets between rows; obtain the position of each row by superimposing the default row spacing and the random offset between rows; add a nested for loop to iterate the number of columns, design random offsets between columns, and obtain the position of each column by superimposing the default column spacing and the random offset between columns.

[0039] Use Python's built-in random function to generate a random floating point number between 0 and 1, and then multiply it by 360 to get a random angle between 0 and 360, that is, a random rotation angle.

[0040] S6. Add plant models of each growth period to corresponding coordinate positions on the land according to the time axis.

[0041] S7. When demonstrating plant growth, you can obtain the visual effect of dynamic plant growth by dragging the timeline.

[0042] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. The plant growth demonstration method based on Unity is characterized by: The following steps are involved: S1. Obtain pictures of plants at different growth stages and select suitable samples from them; S2, performing image clipping processing on the sample to obtain an image of the plant's appearance; S3. Import the plant's appearance picture into Unity3D, obtain the material for making the plant, and make the land of the required size in Unity3D; S4. Use the materials to make models of individual plants at different growth stages; S5. Determine the row spacing, column spacing and rotation angle of the plants according to the size of the land and the planting density, and then determine the coordinate position and orientation of each plant on the land; S6. Add plant models of each growth period to corresponding coordinate positions on the land according to the time axis; S7. When demonstrating plant growth, you can obtain the visual effect of dynamic plant growth by dragging the timeline.

2. The Unity-based plant growth demonstration method according to claim 1, characterized in that: In step S4, open the production panel through Paint Details in Terrain, drag the image to the Detail Texture position, set the length, width, height and image noise data of the plant, and click OK to create a plant model for a period of time.

3. The Unity-based plant growth demonstration method according to claim 1, characterized in that: Take the lower left corner of the land area as the starting point to obtain the starting point coordinates; determine the row spacing and column spacing of the plants to obtain the coordinate position of each plant, and randomly generate the rotation angle α of each plant; add each plant to the land based on the row spacing, column spacing and rotation angle.

4. The Unity-based plant growth demonstration method according to claim 3, characterized in that: When determining the row and column spacing of plants, input the default row and column spacing according to the type of plant, use a for loop to iterate the number of rows through the SetDetailLayer method, and design random offsets between rows; obtain the position of each row by superimposing the default row spacing and the random offset between rows; add a nested for loop to iterate the number of columns, design random offsets between columns, and obtain the position of each column by superimposing the default column spacing and the random offset between columns.

5. The Unity-based plant growth demonstration method according to claim 3, characterized in that: Use Python's built-in random function to generate a random floating point number between 0 and 1, and then multiply it by 360 to get a random angle between 0 and 360.

6. The Unity-based plant growth demonstration method according to claim 1, characterized in that: When making the land, first make a base of the required size, indent the edge of the base by a certain distance to obtain an embedded rectangle, define the annular area between the embedded rectangle and the edge of the base as a transition zone, make an arc-shaped transition surface from the edge of the base to the embedded rectangle in the transition zone, randomly select several rectangular areas inside the embedded rectangle as change areas, and make the terrain of the base into a wavy ridge in the change area; after the base is made, add the plant model to the base, and then make a shielding layer above the base to allow the plants to pass through the shielding layer; finally, cover the shielding layer and the edge of the base with a wrapping layer.