Vegetation information processing method and device, computer storage medium and electronic device

By identifying and classifying branches and leaves in vegetation models, the problem of existing technologies being unable to record multi-level and axial relationships has been solved, achieving efficient vegetation information processing.

CN116271816BActive Publication Date: 2026-04-28NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2023-03-13
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing technologies cannot effectively record multi-level and axial relationships when processing game vegetation information, and the processing methods are complex and have poor performance.

Method used

By acquiring the target vegetation model, identifying branches and leaves, performing intersection detection of branch primitives to determine hierarchical and axis information, and clustering the leaves according to the hierarchical information, the information of the target vegetation model is generated.

Benefits of technology

It improves the applicability and efficiency of vegetation information processing, reduces preprocessing steps and grid type modifications, and improves the data generation efficiency of the target vegetation model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116271816B_ABST
    Figure CN116271816B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a vegetation information processing method and device, computer storage medium and electronic equipment, and relates to the technical field of computers. The method comprises: obtaining a target vegetation model, identifying the target vegetation model to obtain branches and leaves included in the target vegetation model; obtaining branch primitives in the branches, performing intersection detection on the branch primitives, determining hierarchical information of the branch primitives according to the detection result, and obtaining axis information of the branch primitives according to the hierarchical information of the branch primitives; determining branch primitives associated with leaf primitives in the leaves, clustering the leaves according to the hierarchical information of the branch primitives associated with the leaf primitives to obtain clustering information of the leaf primitives; and generating target information of the target vegetation model according to the hierarchical information of the branch primitives, the axis information of the branch primitives and the clustering information of the leaf primitives. The present disclosure improves the efficiency of vegetation information processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to a vegetation information processing method and apparatus, a computer-readable storage medium, and an electronic device. Background Technology

[0002] Wind is one of the most common elements in games. In open-world games, there are many outdoor exploration scenarios, and the vegetation in the game scene is most obviously affected by wind in these scenarios.

[0003] In real-time rendering of games, vegetation information processing can be divided into three types based on common vegetation animation simulation methods: the first is based on the position or color of vertices on the UV; the second is to record the pivot point information of vegetation using the PivotPainter tool; and the third is skeletal skinning.

[0004] However, the first method cannot record the multi-level and axial relationships of vegetation, and its applicability is limited; in the second method, the model preprocessing steps are complicated, requiring two additional highly dynamic textures to record pivot information, and the implementation is complicated; the third method requires changing the type of the static mesh of the model to a skeletal skin model, which cannot be used for vegetation instantiation processing.

[0005] Therefore, a new method for vegetation information processing is needed.

[0006] It should be noted that the information in the background section above is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0007] The purpose of this disclosure is to provide a vegetation information processing method, a vegetation information processing device, a computer-readable storage medium, and an electronic device, thereby overcoming, to at least a certain extent, the problems of limited applicability, complex implementation, and poor performance of vegetation information processing methods in related technologies due to limitations and defects in related technologies.

[0008] According to one aspect of this disclosure, a vegetation information processing method is provided, comprising:

[0009] Obtain a target vegetation model, identify the target vegetation model, and obtain the branches and leaves included in the target vegetation model;

[0010] Obtain branch primitives from the branches, perform intersection detection on the branch primitives, determine the hierarchical information of the branch primitives based on the detection results, and obtain the axis information of the branch primitives based on the hierarchical information of the branch primitives.

[0011] Determine the branch primitives associated with the leaf primitives in the leaves, and cluster the leaves according to the hierarchical information of the branch primitives associated with the leaf primitives to obtain the clustering information of the leaf primitives;

[0012] Based on the hierarchical information and axis information of the branch primitives and the clustering information of the leaf primitives, the target information of the target vegetation model is generated.

[0013] According to one aspect of this disclosure, a vegetation information processing apparatus is provided, comprising:

[0014] The branch recognition module is used to acquire a target vegetation model, identify the target vegetation model, and obtain the branches and leaves included in the target vegetation model.

[0015] The branch grading module is used to acquire branch primitives in the branches, perform intersection detection on the branch primitives, determine the hierarchical information of the branch primitives based on the detection results, and obtain the axis information of the branch primitives based on the hierarchical information of the branch primitives.

[0016] The leaf clustering module is used to determine the branch primitives associated with the leaf primitives in the leaf, and to cluster the leaf according to the hierarchical information of the branch primitives associated with the leaf primitives to obtain the clustering information of the leaf primitives.

[0017] The target information generation module is used to generate target information of the target vegetation model based on the hierarchical information and axis information of the branch primitives and the clustering information of the leaf primitives.

[0018] According to one aspect of this disclosure, a computer storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the vegetation information processing method described in any of the exemplary embodiments above.

[0019] According to one aspect of this disclosure, an electronic device is provided, comprising:

[0020] Processor; and

[0021] Memory for storing the executable instructions of the processor;

[0022] The processor is configured to execute the vegetation information processing method described in any of the above exemplary embodiments by executing the executable instructions.

[0023] This disclosure provides a vegetation information processing method that includes: acquiring a target vegetation model; identifying the target vegetation model to obtain branches and leaves included in the target vegetation model; acquiring branch primitives from the branches; performing intersection detection on the branch primitives; determining the hierarchical information of the branch primitives based on the detection results; obtaining the axis information of the branch primitives based on the hierarchical information of the branch primitives; determining branch primitives associated with leaf primitives from the leaves; clustering the leaves based on the hierarchical information of the branch primitives associated with the leaf primitives to obtain the clustering information of the leaf primitives; and generating target information of the target vegetation model based on the hierarchical information, axis information, and clustering information of the leaf primitives. On the one hand, after obtaining the branches and leaves of the target vegetation model, intersection detection is performed on the branch primitives to obtain the hierarchical information of the branch primitives. Based on the hierarchical information of the branch primitives, the axial information of the branch primitives is obtained, which solves the problem in related technologies that cannot record the multi-level and axial relationships of vegetation, and improves the applicability of vegetation information processing. On the other hand, after obtaining the target vegetation model, the target vegetation model is first identified to identify the branches and leaves in the target vegetation model. Preprocessing of the vegetation model is not required. In addition, based on the branches... After obtaining the axis information of branch primitives from the hierarchical information of the trunk primitives, it is not necessary to record the axis information of branch primitives through high-dynamic mapping, thus improving the efficiency of vegetation information processing. On the other hand, after obtaining the hierarchical information of the target vegetation model, the leaves are clustered according to the hierarchical information of the branch primitives to obtain the clustering information of the leaf primitives. Finally, the target data of the target vegetation model is generated based on the clustering information of the leaf primitives and the axis information of the branch primitives, without the need to modify the mesh type of the target vegetation model, thus improving the efficiency of target data generation for the target vegetation model.

[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description

[0025] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention. It is obvious that the drawings described below are merely some embodiments of the invention, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0026] Figure 1 This illustration schematically depicts a vertex-based approach to processing a vegetation model according to an exemplary embodiment of the present disclosure.

[0027] Figure 2The flowchart illustrates a vegetation information processing method according to an example embodiment of the present disclosure.

[0028] Figure 3 The illustration shows a scenario diagram of a vegetation information processing method according to an example embodiment of the present disclosure.

[0029] Figure 4 The flowchart illustrates a method for obtaining a target vegetation model, identifying the target vegetation model, and obtaining the branches and leaves included in the target vegetation model, according to an example embodiment of the present disclosure.

[0030] Figure 5 The flowchart illustrates a method for performing intersection detection on branch primitives and determining the hierarchical information of branch primitives based on the detection results, according to an example embodiment of the present disclosure.

[0031] Figure 6 The flowchart illustrates a method for determining the hierarchical information of branch elements based on detection results after determining a first branch element as a first-level branch, according to an example embodiment of the present disclosure.

[0032] Figure 7 The flowchart illustrates a method for determining the hierarchical information of a branch element based on a detection result after identifying a second branch element as a secondary branch, according to an example embodiment of the present disclosure.

[0033] Figure 8 The flowchart illustrates a method for obtaining axis information of branch primitives based on hierarchical information of branch primitives according to an exemplary embodiment of the present disclosure.

[0034] Figure 9 The flowchart illustrates a method for obtaining the axis point of a branch element based on the intersection point of the branch element and the parent branch according to an exemplary embodiment of the present disclosure.

[0035] Figure 10 The flowchart illustrates a method for clustering leaves according to hierarchical information of branch primitives associated with leaf primitives, based on an exemplary embodiment of the present disclosure, to obtain clustering information of leaf primitives.

[0036] Figure 11 The flowchart illustrates a method for obtaining clustering information of leaf primitives after identifying leaf primitives as first-level leaves, according to an exemplary embodiment of the present disclosure.

[0037] Figure 12 The illustration schematically shows a flowchart of a method for obtaining clustering information of leaf primitives after determining the level of a second leaf primitive as a second-level leaf, according to an example embodiment of the present disclosure.

[0038] Figure 13The flowchart illustrates a method for generating target information of a target vegetation model based on the hierarchical information of branch primitives, axis information, and clustering information of leaf primitives, according to an example embodiment of the present disclosure.

[0039] Figure 14 A block diagram of a vegetation information processing device according to an exemplary embodiment of the present invention is shown schematically.

[0040] Figure 15 An electronic device for implementing the above-described vegetation information processing method is illustrated according to an example embodiment of the present invention. Detailed Implementation

[0041] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make the invention more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of the invention. However, those skilled in the art will recognize that the technical solutions of the invention may be practiced with one or more of these specific details omitted, or other methods, components, apparatus, steps, etc., may be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of the invention.

[0042] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0043] Wind is a ubiquitous element in games, and it's an indispensable part of games with an ancient Chinese style. In open-world games, there are often many outdoor exploration scenes. In these scenes, the vegetation is most significantly affected by the wind, and the interactive animations between the wind and the vegetation can greatly enhance the vividness and interactivity of the scene.

[0044] Based on the pivot structure of vegetation, vegetation models can be divided into multi-pivot vegetation, single-pivot vegetation, and non-pivot vegetation. Due to limitations in real-time rendering and various hardware, direct dynamic simulation of vegetation models is difficult to meet real-time requirements. Therefore, it is usually necessary to pre-calculate and store the model information offline. Manually calibrating and calculating the hierarchy and axis information for multi-pivot vegetation is tedious and complex. Therefore, an automated method for processing multi-level vegetation information is needed.

[0045] In related technologies, there are three methods for automating the processing of multi-level vegetation information. One method is based on the vertex position or vertex color on the UV axis. Specifically, it describes the relative height relationship of vegetation based on the vertex position or vertex color on the UV axis. The vertex-based method can be found in [reference needed]. Figure 1 As shown, this method is simple to implement but lacks effectiveness. It cannot record the multi-level and axial relationships of the vegetation model, limiting its applicability. Furthermore, because it uses vertex colors, it does not support optimization using dynamic batching. Another approach is to use the PivotPainter tool to record the pivot point information of the vegetation, including the following steps: importing the vegetation model, splitting LOD, resetting root node coordinates, automatically splitting the model, creating new groups, selecting / creating root nodes, manually associating parent-child links, generating a hierarchical structure, and outputting the model. This preprocessing step is complex. When the vegetation model includes many sub-models, it needs to be split into multiple parts to generate pivot points; otherwise, the vegetation model will freeze. Additionally, the branches and leaves of the vegetation model must be assigned different materials; otherwise, problems will occur during animation. Furthermore, associating parent-child links becomes difficult when the grouping is poor. Another approach is skeletal skinning, which has poor support for solving complex-shaped vegetation models. It requires changing the type of the static mesh of the vegetation model to a skeletal skinning model, making it unsuitable for instantiating vegetation models and resulting in poor performance.

[0046] Based on one or more of the above-mentioned problems, this example embodiment first provides a vegetation information processing method, referring to... Figure 2 As shown, the following steps may be included:

[0047] Step S210. Obtain the target vegetation model, identify the target vegetation model, and obtain the branches and leaves included in the target vegetation model;

[0048] Step S220. Obtain the branch primitives in the branch, perform intersection detection on the branch primitives, determine the hierarchical information of the branch primitives based on the detection results, and obtain the axis information of the branch primitives based on the hierarchical information of the branch primitives;

[0049] Step S230. Determine the branch primitives associated with the leaf primitives in the leaves, and cluster the leaves according to the hierarchical information of the branch primitives associated with the leaf primitives to obtain the clustering information of the leaf primitives;

[0050] Step S240. Generate target information for the target vegetation model based on the hierarchical information and axis information of the branch primitives and the clustering information of the leaf primitives.

[0051] The above-described vegetation information processing method involves: acquiring a target vegetation model; identifying the target vegetation model to obtain the branches and leaves included in the target vegetation model; acquiring branch primitives from the branches; performing intersection detection on the branch primitives; determining the hierarchical information of the branch primitives based on the detection results; obtaining the axis information of the branch primitives based on the hierarchical information of the branch primitives; determining branch primitives associated with leaf primitives from the leaves; clustering the leaves based on the hierarchical information of the branch primitives associated with the leaf primitives to obtain the clustering information of the leaf primitives; and generating target information of the target vegetation model based on the hierarchical information, axis information, and clustering information of the leaf primitives. On the one hand, after obtaining the branches and leaves of the target vegetation model, intersection detection is performed on the branch primitives to obtain the hierarchical information of the branch primitives. Based on the hierarchical information of the branch primitives, the axial information of the branch primitives is obtained, which solves the problem in related technologies that cannot record the multi-level and axial relationships of vegetation, and improves the applicability of vegetation information processing. On the other hand, after obtaining the target vegetation model, the target vegetation model is first identified to identify the branches and leaves in the target vegetation model. Preprocessing of the vegetation model is not required. In addition, based on the branches... After obtaining the axis information of branch primitives from the hierarchical information of the trunk primitives, it is not necessary to record the axis information of branch primitives through high-dynamic mapping, thus improving the efficiency of vegetation information processing. On the other hand, after obtaining the hierarchical information of the target vegetation model, the leaves are clustered according to the hierarchical information of the branch primitives to obtain the clustering information of the leaf primitives. Finally, the target data of the target vegetation model is generated based on the clustering information of the leaf primitives and the axis information of the branch primitives, without the need to modify the mesh type of the target vegetation model, thus improving the efficiency of target data generation for the target vegetation model.

[0052] The following provides a detailed explanation and description of each step involved in the vegetation information processing method of the exemplary embodiments of this disclosure.

[0053] First, the application scenarios and purposes of the exemplary embodiments of this disclosure will be explained and described. Specifically, the exemplary embodiments of this disclosure can be used to obtain multi-level information of a multi-pivot vegetation model. The main research focuses on how to reduce the amount of computation and improve the efficiency of obtaining multi-level information during the process of obtaining the target vegetation model.

[0054] In this disclosure, the target vegetation model is used as a basis. After obtaining the target vegetation model, reference is made to... Figure 3 As shown, the vegetation information processing method may include: identifying the target vegetation model to obtain the trunk and leaves of the target vegetation model; then classifying the branches to obtain hierarchical information, clustering the leaves to obtain clustering information, and obtaining the axis information of the branches based on the hierarchical information of the branches; finally, obtaining the target information of the target vegetation model through the hierarchical information, axis information, and clustering information.

[0055] In step S210, a target vegetation model is obtained, and the target vegetation model is identified to obtain the branches and leaves included in the target vegetation model.

[0056] In this example embodiment, the target vegetation model can be a multi-pivot vegetation model, wherein, reference Figure 4 As shown, a target vegetation model is obtained, and the target vegetation model is identified to obtain the branches and leaves included in the target vegetation model, which may include:

[0057] Step S410. Obtain the material slots included in the target vegetation model, and distinguish the branches and leaves in the target vegetation model according to the material slots to obtain the branches and leaves; and / or,

[0058] Step S420. Obtain the maximum number of vertices of connected primitives in the target vegetation model, identify the vegetation model based on the maximum number of vertices of connected primitives, and obtain the branches and leaves.

[0059] The following will further explain and illustrate steps S410 and S420. Specifically, in the target vegetation model, since the trunks and leaves use different rendering methods, they are usually separated into two material slots. Therefore, when identifying the target vegetation model, the material slots included in the target vegetation can be obtained. Based on the material slots, the branches and leaves in the target vegetation model can be distinguished to obtain the branches and leaves included in the target vegetation model. In addition, in the target vegetation model, since leaves are usually made in the form of inlays, the number of vertices of the inlays will be much smaller than the number of vertices of the branches. Therefore, the maximum number of vertices of connected primitives in the target vegetation model can be obtained. Connected primitives can be either connected branch primitives or connected leaf primitives. Therefore, after obtaining the maximum number of vertices of connected branch primitives, the primitive with the larger maximum number of vertices can be identified as the leaf in the target vegetation model.

[0060] In step S220, branch primitives in the branch are obtained, intersection detection is performed on the branch primitives, the hierarchical information of the branch primitives is determined according to the detection results, and the axis information of the branch primitives is obtained according to the hierarchical information of the branch primitives.

[0061] In this example embodiment, after distinguishing the target vegetation model and obtaining the tree trunks and leaves included in the target vegetation model, since there are multiple tree trunks, each branch in the target vegetation model can be represented by a branch primitive; and since there are multiple leaves, each leaf can be represented by a leaf primitive.

[0062] refer to Figure 5 As shown, performing intersection detection on the branch primitives and determining the hierarchical information of the branch primitives based on the detection results may include:

[0063] Step S510. Obtain the bounding box of the target vegetation model, determine the trunk of the target vegetation model based on the height of the bounding box, and determine the trunk of the target vegetation model as the main branch;

[0064] Step S520. Obtain the first branch element excluding the main branch from the branch element, and perform intersection detection on the first branch element and the main branch to obtain the first detection result;

[0065] Step S530. When the first detection result indicates that there is an intersection, the level of the first branch element is determined as a first-level branch, and the main branch is determined as the parent branch of the first branch element. The unique identifier of the parent branch of the first-level branch is stored.

[0066] The hierarchical information of the first-level branch includes the hierarchy of the first branch element and the unique identifier of the parent branch of the first branch element.

[0067] The following will further explain and illustrate steps S510-S530. Specifically, when classifying the branches of the target vegetation model, that is, determining the hierarchical information of the target vegetation model, firstly, the bounding box and the height of the bounding box of the target vegetation model are obtained. The branches within a preset range of the height of the bounding box are determined as the main branches of the target model. The preset range of the height of the bounding box can be 75% or 80% of the height of the bounding box. In this example embodiment, the preset range is not specifically limited. After determining the main branches of the target vegetation model, the first branch primitives (excluding the main branches) can be obtained from the branch primitives. Intersection detection is then performed between the first branch primitives and the main branches; that is, it is determined whether there is an intersection point between the first branch primitives and the main branches. If an intersection point exists, the first branch primitive with the intersection point is designated as a first-level branch. Simultaneously, the main branch is designated as the parent branch of the first branch primitive, and its unique identifier is stored. The hierarchy information of the first branch primitive includes its own hierarchy and the unique identifier of its parent branch.

[0068] In this example embodiment, reference Figure 6 As shown, after determining the first branch primitive as a first-level branch, the step of determining the hierarchical information of the branch primitive based on the detection results further includes:

[0069] Step S610. Obtain the second branch element from the branch element excluding the main branch and the first-level branch, and perform intersection detection on the second branch element and the first-level branch to obtain the second detection result;

[0070] Step S620. When the second detection result indicates that there is an intersection, the level of the second branch element is determined as a second-level branch, and the first branch element that intersects with the second branch element is determined as the parent branch. The unique identifier of the parent branch of the second branch element is stored.

[0071] The hierarchical information of the secondary branches includes the hierarchy of the second branch element and the unique identifier of the parent branch of the second branch element.

[0072] The following will further explain and illustrate steps S610 and S620. Specifically, after obtaining the main branches and primary branches of the target vegetation model, second branch primitives other than the main branches and primary branches can be obtained. Intersection detection is performed on the second branch primitives and the branch primitives of the primary branches. When there is an intersection point between the second branch primitive and the first branch primitive of the primary branch, the level of the second branch primitive is determined as a secondary branch, and the first branch primitive of the primary branch intersecting with the second branch primitive is determined as the parent branch, and the unique identifier of the parent branch is stored. The level information of the second branch primitive includes the level of the second branch primitive and the unique identifier of the parent branch of the second branch primitive.

[0073] In this example embodiment, after determining the main branch, primary branches, and secondary branches, there may still be a third branch element in the branch element that does not intersect with the primary branches. Therefore, referring to... Figure 7 As shown, after determining the second branch element as a secondary branch, the step of determining the hierarchical information of the branch element based on the detection results may further include:

[0074] Step S710. Obtain the third branch element from the branch elements, excluding the main branch, the first-level branch, and the second-level branch;

[0075] Step S720. When it is determined that the third branch element intersects with the secondary branch, the level of the third branch element is determined as the secondary branch, the parent branch of the second branch element that intersects with the third branch element is determined as the parent branch of the third branch element, and the unique identifier of the parent branch of the third branch element is stored.

[0076] The hierarchical information of the secondary branches includes the hierarchy of the third branch element and the unique identifier of the parent branch of the third branch element.

[0077] The following will further explain and illustrate steps S710 and S720. Specifically, firstly, the third branch element, excluding the main branch, first-level branch, and second-level branch elements, is obtained from the branch element set. Intersection detection is then performed between the third branch element and the second branch element of the second-level branch. When an intersection point exists between the third branch element and the second branch element of the second-level branch, the level of the third branch element is determined to be a second-level branch. Furthermore, the parent branch of the second branch element of the second-level branch that intersects with the third branch element is determined as the parent branch of the third branch element, and the unique identifier of the parent branch of the third branch element is stored.

[0078] Furthermore, after obtaining the hierarchical information of the branch elements, the axis information of the branch elements can be obtained based on the hierarchical information, with reference to... Figure 8As shown, the axis information includes axis points and axis directions. Based on the hierarchical information of the branch elements, the axis information of the branch elements can be obtained, and may include:

[0079] Step S810. Based on the hierarchical information of the branch element, obtain the parent branch of the branch element, and based on the intersection point of the branch element and the parent branch, obtain the axis point of the branch element.

[0080] Step S820. Obtain the starting point and ending point of the branch element, and obtain the axial direction of the branch element based on the starting point and ending point of the branch element.

[0081] The following will further explain and illustrate steps S810 and S820. Specifically, the axis information of each branch element includes: axis point and axis direction. When obtaining the axis point, the parent branch of each branch element is obtained according to the hierarchical information of the branch element, and the axis point of each branch element is determined according to the intersection point of each branch element and the parent branch. When obtaining the axis direction, the start point and end point of the branch element are obtained, and the direction from the start point to the end point of each branch element is determined as the axis direction of each branch element.

[0082] Further reference Figure 9 As shown, obtaining the axis point of the branch element based on the intersection point of the branch element and the parent branch can include:

[0083] Step S910. Obtain the coordinates of multiple first intersection points between the branch element of the primary branch and the main branch, obtain the coordinates of the first midpoint based on the coordinates of the multiple first intersection points, and determine the coordinates of the first midpoint as the axis point of the branch element of the primary branch.

[0084] Step S920. Obtain the coordinates of multiple second intersection points between the branch element of the secondary branch and the first branch element of the parent branch. Based on the coordinates of the multiple second intersection points, obtain the coordinates of the second midpoint and determine the coordinates of the second midpoint as the axis point of the branch element of the secondary branch.

[0085] The following will further explain and illustrate steps S910 and S920. Specifically, when determining the axis point of a branch element based on its parent branch, if the branch element is a first-level branch, multiple first intersection points between the branch element and the main branch, along with the coordinates of these first intersection points, are obtained. Based on these first intersection point coordinates, the coordinates of the first midpoint of each first intersection point are obtained, and these first midpoint coordinates are determined as the axis point of the branch element of each first-level branch. If the branch element is a second-level branch, multiple second intersection points between the branch element and the first branch element of its parent branch, along with the coordinates of these second intersection points, are obtained. Based on these second intersection point coordinates, the coordinates of the second midpoint are obtained, and these second midpoint coordinates are determined as the axis point of the branch element of the second-level branch.

[0086] After obtaining the axis point and axis of the branch primitive, the distance from each point in the branch primitive to the axis point can be calculated, and the obtained distance can be normalized to obtain the weight value, which is used to determine the swing amplitude of the branch primitive.

[0087] In step S230, the branch primitives associated with the leaf primitives in the leaves are determined, and the leaves are clustered according to the hierarchical information of the branch primitives associated with the leaf primitives to obtain the clustering information of the leaf primitives.

[0088] In this example embodiment, after classifying the branches, it is also necessary to cluster the leaves. In the target vegetation model, the leaves are connected to the branch primitives. Therefore, the leaf primitives can be clustered according to the hierarchical information of the branch primitives connected to the leaf primitives in the leaves, so as to obtain the clustering information of the leaf primitives.

[0089] refer to Figure 10 As shown, determining the branch primitives associated with the leaf primitives in the leaves, and clustering the leaves according to the hierarchical information of the branch primitives associated with the leaf primitives to obtain the clustering information of the leaf primitives, may include:

[0090] Step S1010. Perform intersection detection on the leaf primitive and the branch primitive of the secondary branch;

[0091] Step S1020. When the leaf element intersects with the branch element of the secondary branch, the level of the leaf element is determined to be a primary leaf;

[0092] The clustering information of the first-level leaves includes the hierarchy of the leaf primitives and the hierarchy information of the branch primitives of the second-level branches that intersect with the leaf primitives.

[0093] The following will further explain and illustrate steps S1010 and S1020. Specifically, firstly, leaf primitives in the leaves are obtained, and intersection detection is performed on the leaf primitives and branch primitives of the secondary branches. When there is an intersection between the leaf primitive and the branch primitive of the secondary branch, the level of the leaf primitive is determined to be a first-level leaf. The branch primitive of the secondary branch can be a second branch primitive or a third branch primitive, which is not specifically limited in this example embodiment. The level information of the secondary branches that intersect with the leaf primitives is stored. The clustering information of the leaf primitives of the first-level leaves includes: the level of the leaf primitives and the level information of the secondary branches that intersect with the leaf primitives.

[0094] Further reference Figure 11 As shown, after identifying the leaf primitives as first-level leaves, obtaining the clustering information of the leaf primitives further includes:

[0095] Step S1110. Obtain the second leaf primitive excluding the first-level leaves in the leaves, and perform intersection detection between the second leaf primitive and the first-level leaves according to the preset search depth;

[0096] Step S1120. When the second leaf element intersects with the first-level leaf, the level of the second leaf element is determined to be a second-level leaf;

[0097] The clustering information of the secondary leaves includes the hierarchy of the second leaf primitive and the hierarchy information of the branch primitives in the clustering information of the primary leaves that intersect with the second leaf primitive.

[0098] The following will further explain and illustrate steps S1110 and S1120. Specifically, after obtaining the first-level leaves, the second-level leaves (excluding the first-level leaves) can be obtained from the leaf primitives. According to the preset search depth, the intersection detection between the second-level leaves and the first-level leaves is performed. When there is an intersection between the second-level leaves and the first-level leaves, the level of the second-level leaves is determined as the second-level leaves, and the level information of the branch primitives in the clustering information of the first-level leaves that intersect with the second-level leaves is stored. The preset search depth can be 2 or 3, and is not specifically limited in this example embodiment. The clustering information of the second-level leaves can include the level of the second-level leaves and the level information of the branch primitives in the clustering information of the first-level leaves that intersect with the second-level leaves.

[0099] Further, refer to Figure 12 As shown, after determining the level of the second leaf primitive as a second-level leaf, obtaining the clustering information of the leaf primitive may further include:

[0100] Step S1210. Obtain the third leaf primitive that does not intersect with the first-level leaf primitive, and perform intersection detection on the third leaf primitive and the branch primitive of the first-level branch;

[0101] Step S1220. When the third leaf element intersects with the branch element of the first-level branch, the third leaf element is determined as a third-level leaf.

[0102] The clustering information of the third-level leaves includes the hierarchy of the third leaf primitive and the hierarchy information of the branch primitives of the first-level branches that intersect with the third-level leaves.

[0103] The following will further explain and illustrate steps S1210 and S1220. Specifically, after determining the first leaf and the second leaf, there may be a third leaf element in the leaf primitive that does not intersect with the first leaf. For the third leaf element, an intersection detection can be performed with the branch primitive of the first-level branch. When there is an intersection between the third leaf element and the branch primitive of the first-level branch, the level of the third leaf element is determined as a third-level leaf, and the level information of the first branch intersecting the third-level leaf is stored. The clustering information of the third-level leaf includes the level of the third leaf element and the level information of the branch primitive of the first-level branch intersecting the third-level leaf.

[0104] In step S240, target information of the target vegetation model is generated based on the hierarchical information and axis information of the branch primitives and the clustering information of the leaf primitives.

[0105] In this example embodiment, reference Figure 13 As shown, the target information of the target vegetation model is generated based on the hierarchical information and axis information of the branch primitives and the clustering information of the leaf primitives, which may include:

[0106] Step S1310. Obtain the clustering information of the leaf primitive and the axis information of the branch primitive associated with the leaf primitive, and encode the clustering information and the axis information to obtain encoded data;

[0107] Step S1320. Obtain the vertex UV information of the target vegetation model, and package the encoded data in the vertex UV information to obtain the target information of the target vegetation model.

[0108] The following will further explain and illustrate steps S1310 and S1320. Specifically, after obtaining the hierarchical information, axis information, and leaf clustering information of the branch primitives included in the target vegetation model, the hierarchical information, axis information, and clustering information can be encoded to obtain encoded data; then, the vertex UV information of the target vegetation model is obtained, and the encoded data is packaged in the vertex UV information to obtain the target information of the target vegetation model.

[0109] The vegetation information processing method provided in this exemplary embodiment has at least the following advantages: Firstly, it eliminates the need for manually splitting and setting the hierarchical information of the target vegetation model, supports multi-level structures (main branches, primary branches, secondary branches, and leaves), and can automatically calculate the axis points and axes of the target vegetation model. Furthermore, it can reduce the computational load by selecting the number of levels based on available resources. Secondly, by encoding the axis information, it converts float3 data into float data, solving the problem in related technologies where PivotPainter needs to record the axis information of the vegetation model through high dynamic range mapping. Thirdly, it shortens the resource preprocessing process, and through automated processing, quickly converts imported model resources into target information that matches the animation, improving the efficiency of vegetation information processing.

[0110] This disclosure also provides a vegetation information processing device, as illustrated in the example embodiments. Figure 14 As shown, it may include: a branch identification module 1410, a branch classification module 1420, a leaf clustering module 1430, and a target information generation module 1440. Wherein:

[0111] Branch recognition module 1410 is used to acquire a target vegetation model, recognize the target vegetation model, and obtain the branches and leaves included in the target vegetation model.

[0112] The branch classification module 1420 is used to acquire branch primitives in the branches, perform intersection detection on the branch primitives, determine the hierarchical information of the branch primitives based on the detection results, and obtain the axis information of the branch primitives based on the hierarchical information of the branch primitives.

[0113] The leaf clustering module 1430 is used to determine the branch elements associated with the leaf elements in the leaf, and to cluster the leaf according to the hierarchical information of the branch elements associated with the leaf elements to obtain the clustering information of the leaf elements.

[0114] The target information generation module 1440 is used to generate target information of the target vegetation model based on the hierarchical information and axis information of the branch primitives and the clustering information of the leaf primitives.

[0115] The specific details of each module in the above-mentioned vegetation information processing device have been described in detail in the corresponding vegetation information processing methods, so they will not be repeated here.

[0116] In one exemplary embodiment of this disclosure, a target vegetation model is obtained, and the target vegetation model is identified to obtain the branches and leaves included in the target vegetation model, including:

[0117] Obtain the material slots included in the target vegetation model, and distinguish the branches and leaves in the target vegetation model according to the material slots to obtain the branches and leaves; and / or,

[0118] The maximum number of vertices of connected primitives in the target vegetation model is obtained, and the vegetation model is identified based on the maximum number of vertices of connected primitives to obtain the branches and leaves.

[0119] In one exemplary embodiment of this disclosure, intersection detection is performed on the branch primitives, and the hierarchical information of the branch primitives is determined based on the detection results, including:

[0120] Obtain the bounding box of the target vegetation model, determine the trunk of the target vegetation model based on the height of the bounding box, and determine the trunk of the target vegetation model as the main branch.

[0121] Obtain the first branch element excluding the main branch from the branch element graph, and perform intersection detection on the first branch element and the main branch to obtain the first detection result;

[0122] When the first detection result indicates that there is an intersection, the level of the first branch element is determined as a first-level branch, and the main branch is determined as the parent branch of the first branch element. The unique identifier of the parent branch of the first-level branch is stored.

[0123] The hierarchical information of the first-level branch includes the hierarchy of the first branch element and the unique identifier of the parent branch of the first branch element.

[0124] In an exemplary embodiment of this disclosure, after determining the first branch primitive as a first-level branch, the step of determining the hierarchical information of the branch primitive based on the detection result further includes:

[0125] Obtain the second branch primitive excluding the main branch and the first-level branch from the branch primitive, and perform intersection detection on the second branch primitive and the first-level branch to obtain the second detection result;

[0126] When the second detection result indicates that there is an intersection, the level of the second branch element is determined as a second-level branch, and the first branch element that intersects with the second branch element is determined as the parent branch. The unique identifier of the parent branch of the second branch element is stored.

[0127] The hierarchical information of the secondary branches includes the hierarchy of the second branch element and the unique identifier of the parent branch of the second branch element.

[0128] In an exemplary embodiment of this disclosure, after determining the second branch primitive as a secondary branch, the step of determining the hierarchical information of the branch primitive based on the detection result further includes:

[0129] Obtain the third branch element from the branch element, excluding the main branch, the first-level branch, and the second-level branch;

[0130] When it is determined that the third branch element intersects with the second-level branch, the level of the third branch element is determined as the second-level branch, the parent branch of the second branch element that intersects with the third branch element is determined as the parent branch of the third branch element, and the unique identifier of the parent branch of the third branch element is stored.

[0131] The hierarchical information of the secondary branches includes the hierarchy of the third branch element and the unique identifier of the parent branch of the third branch element.

[0132] In one exemplary embodiment of this disclosure, the axis information includes axis points and axis directions. The axis information of the branch element is obtained based on the hierarchical information of the branch element, including:

[0133] Based on the hierarchical information of the branch element, the parent branch of the branch element is obtained, and based on the intersection point of the branch element and the parent branch, the axis point of the branch element is obtained.

[0134] Obtain the starting point and ending point of the branch element, and obtain the axial direction of the branch element based on the starting point and ending point of the branch element.

[0135] In one exemplary embodiment of this disclosure, obtaining the axis point of the branch element based on the intersection point of the branch element and the parent branch includes:

[0136] Obtain the coordinates of multiple first intersection points between the branch element of the primary branch and the main branch. Based on the coordinates of the multiple first intersection points, obtain the coordinates of the first midpoint and determine the coordinates of the first midpoint as the axis point of the branch element of the primary branch.

[0137] Obtain the coordinates of multiple second intersection points between the branch element of the secondary branch and the first branch element of the parent branch. Based on the coordinates of the multiple second intersection points, obtain the coordinates of the second midpoint and determine the coordinates of the second midpoint as the axis point of the branch element of the secondary branch.

[0138] In one exemplary embodiment of this disclosure, determining the branch primitives associated with the leaf primitives in the leaves, and clustering the leaves according to the hierarchical information of the branch primitives associated with the leaf primitives to obtain the clustering information of the leaf primitives, includes:

[0139] Intersection detection is performed between the leaf primitives and the branch primitives of the secondary branches;

[0140] When the leaf element intersects with the branch element of the secondary branch, the level of the leaf element is determined to be a first-level leaf.

[0141] The clustering information of the first-level leaves includes the hierarchy of the leaf primitives and the hierarchy information of the branch primitives of the second-level branches that intersect with the leaf primitives.

[0142] In one exemplary embodiment of this disclosure, after determining the leaf primitive as a first-level leaf, obtaining the clustering information of the leaf primitive further includes:

[0143] Obtain the second leaf primitive excluding the first-level leaves from the leaves, and perform intersection detection between the second leaf primitive and the first-level leaves according to a preset search depth;

[0144] When the second leaf element intersects with the first-level leaf, the level of the second leaf element is determined to be a second-level leaf;

[0145] The clustering information of the secondary leaves includes the hierarchy of the second leaf primitive and the hierarchy information of the branch primitives in the clustering information of the primary leaves intersecting with the second leaf primitive. In an exemplary embodiment of this disclosure, after determining the hierarchy of the second leaf primitive as a secondary leaf, obtaining the clustering information of the leaf primitive further includes:

[0146] Obtain the third leaf primitive that does not intersect with the first-level leaf primitive, and perform intersection detection on the third leaf primitive and the branch primitive of the first-level branch;

[0147] When the third leaf element intersects with the branch element of the first-level branch, the third leaf element is identified as a third-level leaf.

[0148] The clustering information of the third-level leaves includes the hierarchy of the third leaf primitive and the hierarchy information of the branch primitives of the first-level branches that intersect with the third-level leaves.

[0149] In an exemplary embodiment of this disclosure, generating target information of the target vegetation model based on the hierarchical information and axis information of the branch primitives and the clustering information of the leaf primitives includes: encoding the hierarchical information and axis information of the branch primitives and the clustering information of the leaf primitives to obtain encoded data; obtaining the vertex UV information of the target vegetation model; and packaging the encoded data in the vertex UV information to obtain the target information of the target vegetation model.

[0150] It should be noted that although several modules or units of the device for performing actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0151] Furthermore, although the steps of the method in this invention are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0152] In an exemplary embodiment of the present invention, an electronic device capable of implementing the above-described method is also provided.

[0153] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely in hardware, entirely in software (including firmware, microcode, etc.), or in a combination of hardware and software, collectively referred to herein as “circuit,” “module,” or “system.”

[0154] The following reference Figure 15 To describe an electronic device 1500 according to this embodiment of the present invention. Figure 15 The electronic device 1500 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0155] like Figure 15As shown, the electronic device 1500 is manifested in the form of a general-purpose computing device. The components of the electronic device 1500 may include, but are not limited to: at least one processing unit 1510, at least one storage unit 1520, a bus 1530 connecting different system components (including storage unit 1520 and processing unit 1510), and a display unit 1540.

[0156] The storage unit stores program code that can be executed by the processing unit 1510, causing the processing unit 1510 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 1510 can perform, as follows: Figure 2 The steps shown are as follows: S210: Obtain the target vegetation model, identify the target vegetation model, and obtain the branches and leaves included in the target vegetation model; S220: Obtain branch primitives in the branches, perform intersection detection on the branch primitives, determine the hierarchical information of the branch primitives according to the detection results, and obtain the axis information of the branch primitives according to the hierarchical information of the branch primitives; S230: Determine the branch primitives associated with the leaf primitives in the leaves, and cluster the leaves according to the hierarchical information of the branch primitives associated with the leaf primitives to obtain the clustering information of the leaf primitives; S240: Generate the target information of the target vegetation model according to the hierarchical information, axis information and clustering information of the branch primitives and leaf primitives.

[0157] Storage unit 1520 may include readable media in the form of volatile storage units, such as random access memory (RAM) 15201 and / or cache memory 15202, and may further include read-only memory (ROM) 15203.

[0158] Storage unit 1520 may also include a program / utility 15204 having a set (at least one) of program modules 15205, such program modules 15205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0159] Bus 1530 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0160] Electronic device 1500 can also communicate with one or more external devices 1600 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 1500, and / or any device that enables electronic device 1500 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1550. Furthermore, electronic device 1500 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1560. As shown, network adapter 1560 communicates with other modules of electronic device 1500 via bus 1530. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0161] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, portable hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the method according to the embodiments of the present invention.

[0162] In exemplary embodiments of the present invention, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the present invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the present invention described in the "Exemplary Methods" section above.

[0163] According to embodiments of the present invention, a program product for implementing the above-described method may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0164] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0165] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0166] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0167] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0168] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0169] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention described herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not invented herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the claims.

Claims

1. A vegetation information processing method, characterized in that, include: Obtain a target vegetation model, identify the target vegetation model, and obtain the branches and leaves included in the target vegetation model; The process involves: acquiring branch primitives from the branches; performing intersection detection on the branch primitives; determining the hierarchical information of the branch primitives based on the detection results; and obtaining the axis information of the branch primitives based on the hierarchical information. The hierarchical information of the branch primitives is determined as follows: acquiring the bounding box of the target vegetation model; determining the main trunk of the target vegetation model based on the height of the bounding box; identifying the main trunk of the target vegetation model as the main branch; acquiring the first branch primitive excluding the main branch; performing intersection detection on the first branch primitive and the main branch to obtain a first detection result; when the first detection result indicates an intersection, determining the first branch primitive as a first-level branch, and identifying the main branch as the parent branch of the first branch primitive, storing the unique identifier of the parent branch of the first-level branch. The branch primitives associated with the leaf primitives in the leaves are identified. The leaves are then clustered according to the hierarchical information of the branch primitives associated with the leaf primitives to obtain the clustering information of the leaf primitives. The clustering information of the leaf primitives is determined as follows: intersection detection is performed on the leaf primitives and the branch primitives of the secondary branches. When the leaf primitives intersect with the branch primitives of the secondary branches, the hierarchy of the leaf primitives is determined to be a primary leaf. Based on the hierarchical information and axis information of the branch primitives and the clustering information of the leaf primitives, the target information of the target vegetation model is generated.

2. The vegetation information processing method according to claim 1, characterized in that, Obtain a target vegetation model, identify the target vegetation model, and obtain the branches and leaves included in the target vegetation model, including: Obtain the material slots included in the target vegetation model, and distinguish the branches and leaves in the target vegetation model according to the material slots to obtain the branches and leaves; and / or The maximum number of vertices of connected primitives in the target vegetation model is obtained, and the vegetation model is identified based on the maximum number of vertices of connected primitives to obtain the branches and leaves.

3. The vegetation information processing method according to claim 1, characterized in that, The hierarchical information of the first-level branch includes the hierarchy of the first branch element and the unique identifier of the parent branch of the first branch element.

4. The vegetation information processing method according to claim 3, characterized in that, After identifying the first branch element as a first-level branch, the step of determining the hierarchical information of the branch element based on the detection results further includes: Obtain the second branch primitive excluding the main branch and the first-level branch from the branch primitive, and perform intersection detection on the second branch primitive and the first-level branch to obtain the second detection result; When the second detection result indicates that there is an intersection, the level of the second branch element is determined as a second-level branch, and the first branch element that intersects with the second branch element is determined as the parent branch. The unique identifier of the parent branch of the second branch element is stored. The hierarchical information of the secondary branches includes the hierarchy of the second branch element and the unique identifier of the parent branch of the second branch element.

5. The vegetation information processing method according to claim 4, after determining the second branch primitive as a secondary branch, the step of determining the hierarchical information of the branch primitive based on the detection result further includes: Obtain the third branch element from the branch element, excluding the main branch, the first-level branch, and the second-level branch; When it is determined that the third branch element intersects with the second-level branch, the level of the third branch element is determined as the second-level branch, the parent branch of the second branch element that intersects with the third branch element is determined as the parent branch of the third branch element, and the unique identifier of the parent branch of the third branch element is stored. The hierarchical information of the secondary branches includes the hierarchy of the third branch element and the unique identifier of the parent branch of the third branch element.

6. The vegetation information processing method according to claim 5, characterized in that, The axis information includes axis points and axis directions. Based on the hierarchical information of the branch elements, the axis information of the branch elements is obtained, including: Based on the hierarchical information of the branch element, the parent branch of the branch element is obtained, and based on the intersection point of the branch element and the parent branch, the axis point of the branch element is obtained. Obtain the starting point and ending point of the branch element, and obtain the axial direction of the branch element based on the starting point and ending point of the branch element.

7. The vegetation information processing method according to claim 6, characterized in that, The axis points of the branch element are obtained based on the intersection points of the branch element and the parent branch, including: Obtain the coordinates of multiple first intersection points between the branch element of the primary branch and the main branch. Based on the coordinates of the multiple first intersection points, obtain the coordinates of the first midpoint and determine the coordinates of the first midpoint as the axis point of the branch element of the primary branch. Obtain the coordinates of multiple second intersection points between the branch element of the secondary branch and the first branch element of the parent branch. Based on the coordinates of the multiple second intersection points, obtain the coordinates of the second midpoint and determine the coordinates of the second midpoint as the axis point of the branch element of the secondary branch.

8. The vegetation information processing method according to claim 5, characterized in that, The clustering information of the first-level leaves includes the hierarchy of the leaf primitives and the hierarchy information of the branch primitives of the second-level branches that intersect with the leaf primitives.

9. The vegetation information processing method according to claim 8, characterized in that, After identifying the leaf primitives as first-level leaves, the clustering information of the leaf primitives is obtained, which also includes: Obtain the second leaf primitive excluding the first-level leaves from the leaves, and perform intersection detection between the second leaf primitive and the first-level leaves according to a preset search depth; When the second leaf element intersects with the first-level leaf, the level of the second leaf element is determined to be a second-level leaf; The clustering information of the secondary leaves includes the hierarchy of the second leaf primitive and the hierarchy information of the branch primitives in the clustering information of the primary leaves that intersect with the second leaf primitive.

10. The vegetation information processing method according to claim 9, characterized in that, After determining the level of the second leaf primitive as a second-level leaf, the process of obtaining the clustering information of the leaf primitive further includes: Obtain the third leaf primitive that does not intersect with the first-level leaf primitive, and perform intersection detection on the third leaf primitive and the branch primitive of the first-level branch; When the third leaf element intersects with the branch element of the first-level branch, the third leaf element is identified as a third-level leaf. The clustering information of the third-level leaves includes the hierarchy of the third leaf primitive and the hierarchy information of the branch primitives of the first-level branches that intersect with the third-level leaves.

11. The vegetation information processing method according to claim 1, characterized in that, Based on the hierarchical information and axis information of the branch primitives and the clustering information of the leaf primitives, target information of the target vegetation model is generated, including: The hierarchical information and axis information of the branch primitives and the clustering information of the leaf primitives are encoded to obtain encoded data; Obtain the vertex UV information of the target vegetation model, and package the encoded data into the vertex UV information to obtain the target information of the target vegetation model.

12. A vegetation information processing device, characterized in that, include: The branch recognition module is used to acquire a target vegetation model, identify the target vegetation model, and obtain the branches and leaves included in the target vegetation model. The branch hierarchy module is used to acquire branch primitives in the branches, perform intersection detection on the branch primitives, determine the hierarchy information of the branch primitives based on the detection results, and obtain the axis information of the branch primitives based on the hierarchy information of the branch primitives. The hierarchy information of the branch primitives is determined as follows: acquiring the bounding box of the target vegetation model, determining the main trunk of the target vegetation model based on the height of the bounding box, and identifying the main trunk of the target vegetation model as the main branch; acquiring the first branch primitive excluding the main branch, performing intersection detection on the first branch primitive and the main branch to obtain a first detection result; when the first detection result indicates an intersection, determining the first branch primitive as a first-level branch, identifying the main branch as the parent branch of the first branch primitive, and storing the unique identifier of the parent branch of the first-level branch. The leaf clustering module is used to determine the branch primitives associated with the leaf primitives in the leaves, and to cluster the leaves according to the hierarchical information of the branch primitives associated with the leaf primitives to obtain the clustering information of the leaf primitives. The clustering information of the leaf primitives is determined by the following method: performing intersection detection on the leaf primitives and the branch primitives of the secondary branches; when the leaf primitives intersect with the branch primitives of the secondary branches, the hierarchy of the leaf primitives is determined to be a primary leaf. The target information generation module is used to generate target information of the target vegetation model based on the hierarchical information and axis information of the branch primitives and the clustering information of the leaf primitives.

13. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processing unit, it implements the vegetation information processing method according to any one of claims 1-11.

14. An electronic device, characterized in that, include: Processing unit; as well as A storage unit for storing the executable instructions of the processing unit; The processing unit is configured to execute the vegetation information processing method according to any one of claims 1-11 by executing the executable instructions.

Citation Information

Patent Citations

  • Virtual object wind animation rendering method and device, storage medium and electronic device

    CN112767522A

  • Graph rendering method and device, storage medium and electronic equipment

    CN112927339A

  • Plant modeling method, electronic equipment and computer storage medium

    CN114049426A