Plant rendering object generation method and device, electronic equipment and medium

Through automated plant growth path generation and model construction, the problems of long and low efficiency of plant model production in the existing technology are solved, and efficient and unique automated generation of plant models are achieved.

CN119113520APending Publication Date: 2024-12-13NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411038752.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the prior art, the production time of plant models is long and inefficient, and art production personnel need to manually model, resulting in large workload and low efficiency.

Method used

By determining plant growth parameters, performing multiple rounds of node growth step by step based on these parameters, and generating branch trunk models and leaf models including branches of different thicknesses and thinnesses to form plant rendering objects and realize automated plant model production.

Benefits of technology

It greatly reduces the workload and time of plant model production, improves efficiency, avoids the need for manual modeling, and ensures the uniqueness of the growth styles of different types of plants.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119113520A_ABST
    Figure CN119113520A_ABST
Patent Text Reader

Abstract

The invention provides a plant rendering object generation method and device, electronic equipment and a medium, and relates to the technical field of computers.The method comprises the steps that plant growth parameters are determined, multi-round node step-by-step growth is carried out based on the plant growth parameters to obtain a plant growth path, and the plant growth path comprises a plurality of branch paths; each branch path comprises a plurality of growth nodes; according to the number of the growth nodes on each branch path, a branch model comprising branches with different thicknesses is generated on the plant growth path; and according to a preset leaf generation rule, generating a plurality of leaf models at the tail end of each branch path of the branch model, and forming a plant rendering object based on the branch model and the plurality of leaf models. By adopting the plant rendering object generation method and device, the electronic equipment and the medium, the problems of long manufacturing time and low manufacturing efficiency in the existing tree model manufacturing process are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and medium for generating a plant rendering object. Background Art

[0002] As an important scene element, plants are widely used in various types of game scenes. At the same time, in order to reflect the realism of the game scene, game scenes in different seasons and different geographical locations also need to display different types of plants. This requires art production staff to manually model each plant and then place the prepared plants in the designated game scene.

[0003] However, a wide variety of plants often need to be placed in game scenes. If art production personnel make plant models through manual modeling, there are problems of long production time and low production efficiency. Summary of the invention

[0004] In view of this, the purpose of the present application is to provide a method, device, electronic device and medium for generating a plant rendering object, so as to solve the problems of long production time and low production efficiency in the existing plant model production process.

[0005] In a first aspect, an embodiment of the present application provides a method for generating a plant rendering object, comprising:

[0006] Determine plant growth parameters, and perform multiple rounds of node step-by-step growth based on the plant growth parameters to obtain a plant growth path, the plant growth parameters include a maximum node depth, a maximum number of nodes that can be grown in each round, and a maximum number of child nodes that can be grown for each node, the plant growth path includes multiple branch paths, and each branch path includes multiple growth nodes;

[0007] According to the number of growth nodes on each branch path, a branch model including branches of different thicknesses is generated on the plant growth path;

[0008] According to the preset leaf generation rules, multiple leaf models are generated at the end of each branch path of the branch model, and a plant rendering object is formed based on the branch model and the multiple leaf models.

[0009] In a second aspect, an embodiment of the present application further provides a device for generating a plant rendering object, the device comprising:

[0010] A path generation module is used to determine plant growth parameters and perform multiple rounds of node step-by-step growth based on the plant growth parameters to obtain a plant growth path. The plant growth parameters include a maximum node depth, a maximum number of nodes that can be grown in each round, and a maximum number of child nodes that can be grown from each node. The plant growth path includes multiple branch paths, and each branch path includes multiple growth nodes.

[0011] A branch model generation module is used to generate a branch model including branches of different thicknesses on the plant growth path according to the number of growth nodes on each branch path;

[0012] The leaf model generation module is used to generate multiple leaf models at the end of each branch path of the branch model according to preset leaf generation rules, and to form a plant rendering object based on the branch model and the multiple leaf models.

[0013] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory through the bus, and when the machine-readable instructions are executed by the processor, the steps of the method for generating a plant rendering object as described above are performed.

[0014] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for generating a plant rendering object as described above are executed.

[0015] The embodiments of the present application bring the following beneficial effects:

[0016] The embodiments of the present application provide a method, device, electronic device and medium for generating a plant rendering object, which can automatically complete the modeling of different types of plants in a programmed manner, and the growth patterns of the same plant will not be repeated, and there is no need for art production personnel to produce models through manual modeling. This greatly reduces the workload of plant modeling, shortens the modeling time, and improves the modeling efficiency. Compared with the plant rendering object generation method in the prior art, this solves the problems of long production time and low production efficiency in the existing plant modeling process.

[0017] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A flow chart showing a method for generating a plant rendering object provided in an embodiment of the present application is shown;

[0020] Figure 2 A schematic diagram showing a plant growth path provided in an embodiment of the present application is shown;

[0021] Figure 3 A schematic diagram showing nodes generated during the first round of plant growth process provided by an embodiment of the present application is shown;

[0022] Figure 4 A schematic diagram showing a multi-round generation process of a plant growth path provided in an embodiment of the present application;

[0023] Figure 5 A schematic diagram showing the positions of child node vertices and parent node vertices provided in an embodiment of the present application is shown;

[0024] Figure 6 A schematic diagram showing the structure of a device for generating a plant rendering object provided in an embodiment of the present application is shown;

[0025] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0026] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.

[0027] It is worth noting that before the present application was proposed, plants, as an important scene element, were widely used in various types of game scenes. At the same time, in order to reflect the realism of the game scene, game scenes in different seasons and different geographical locations also need to display different types of plants, which requires art production personnel to manually model each plant and then place the prepared plants in the designated game scene. However, since a wide variety of plants often need to be placed in game scenes, taking trees as an example, without considering the different growth methods of the same tree, it is necessary to establish at least dozens of tree models. If art production personnel use manual modeling to make all plant models, there are problems of long production time and low production efficiency.

[0028] Based on this, an embodiment of the present application provides a method for generating a plant rendering object to shorten the production time of a plant model and improve the production efficiency of a plant model.

[0029] The terms involved in the embodiments of the present application are explained below.

[0030] Graphical User Interface:

[0031] It is an interface display format for communication between people and computers, allowing users to manipulate icons, logos or menu options on the screen using input devices such as a mouse or keyboard, and also allowing users to manipulate icons or menu options on the screen by performing touch operations on the touch screen of a touch terminal to select commands, start programs or perform other tasks.

[0032] Virtual scene:

[0033] It is a virtual scene displayed (or provided) when the application is running on a terminal device or server, that is, the scene used in the normal game process. In other words, the virtual scene refers to the virtual game control that carries the virtual object during the game process. The virtual object can perform actions such as movement and skill release in the virtual scene under the operation instructions issued by the user (i.e., the player) to the terminal device. Optionally, the virtual scene can be a simulation environment of the real world, or a semi-simulation and semi-fictitious virtual environment, or a purely fictitious virtual environment. The virtual scene can be any one of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, and a three-dimensional virtual scene. The virtual environment can be the sky, land, ocean, etc., wherein the land includes environmental elements such as deserts and cities. Among them, the virtual scene is a scene in which the user controls the complete game logic of the virtual object. Optionally, the virtual scene can also be used for a virtual environment battle between at least two virtual objects, and there are virtual resources available for at least two virtual objects in the virtual scene. Exemplarily, the virtual scene can include any one or more of the following elements: game background elements, game virtual character elements, game prop elements, etc.

[0034] In an optional implementation, the method for generating a plant rendering object in one embodiment of the present disclosure may be run on a local terminal device or a server. When the method for generating a plant rendering object is run on a server, the method may be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0035] In an optional implementation, various cloud applications, such as cloud games, can be run under the cloud interaction system. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the running body of the game program and the game screen presentation body are separated. The storage and operation of the game loading method are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the control is performed by the cloud game server in the cloud. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.

[0036] In an optional embodiment, taking a game as an example, a local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.

[0037] In a possible implementation, an embodiment of the present invention provides a method for generating a plant rendering object, wherein the terminal device may be the local terminal device mentioned above, or may be a client device in the cloud interaction system mentioned above.

[0038] See also Figure 1 , Figure 1 This is a flow chart of a method for generating a plant rendering object provided in an embodiment of the present application. Figure 1 As shown, the method for generating a plant rendering object provided in an embodiment of the present application provides a graphical user interface through a terminal device, and the method includes:

[0039] Step S101, determining plant growth parameters, and performing multiple rounds of node step-by-step growth based on the plant growth parameters to obtain a plant growth path.

[0040] In this step, in order to improve the generation efficiency of plant models in virtual scenes and shorten the time of plant model production, the present application uses a method of automatically generating models through a program to produce plant models. This method can be applied to terminal devices used by game users (players) when participating in games, so as to generate plant models in real time during the game user's participation in the game, and can also be applied to terminal devices used by game developers in the process of developing games, so that when game developers create game scenes, they can use this method to quickly generate various plants that need to be placed in the game scene.

[0041] In one example, the plant growth process can be implemented only on the server side, or can be displayed on the client side. When the plant growth process is displayed on the client side, the graphical user interface includes any one of the following items: a first graphical user interface for game users, and a second graphical user interface for game developers.

[0042] When the terminal device is a terminal device used by a player, the graphical user interface may refer to the first graphical user interface. If the graphical user interface is the first graphical user interface, the plant generation instruction includes a plant generation instruction triggered in response to a plant generation event, and / or a plant generation instruction triggered in response to a game user's specified interactive behavior with respect to the first graphical user interface. Among them, the plant generation event may refer to a game event that can trigger a plant generation instruction, for example, the plant generation event may be the completion of a specified game task, and the plant generation instruction is triggered after the specified game task is completed. The specified interactive behavior may refer to an interactive behavior that can trigger a plant generation instruction, for example, the specified interactive behavior may be a triggering operation of a game user with respect to a plant generation control in the first graphical user interface.

[0043] When the terminal device is a terminal device used by a game developer, the graphical user interface may refer to a second graphical user interface. If the graphical user interface is the second graphical user interface, the plant generation instruction includes a plant generation instruction triggered in response to a specified editing behavior of the game developer. The specified editing behavior may refer to an editing behavior that can trigger the plant generation instruction. For example, the specified editing behavior may be an editing behavior of placing plants at a target position in a game scene taken by the game developer. When the game developer performs the specified editing behavior, the plant generation instruction is triggered to generate a plant model in the game scene.

[0044] In order to generate different types of plants, and in order to enable the same type of plants to have different growth patterns, it is necessary to determine the plant growth path according to the plant generation instructions.

[0045] Here, the plant growth path includes multiple branch paths, each branch path includes multiple growth nodes, growth nodes are referred to as nodes, and growth nodes are divided into parent nodes and child nodes, and child nodes are grown on the basis of parent nodes. The plant generation instruction includes plant type and plant generation position. The plant type can refer to the type used to indicate the type of plant to be generated. The type of plant to be generated is a plant type with branches and leaves. For example, the plant type can be a woody plant or a herbaceous plant with branches and leaves.

[0046] Refer to the following Figure 2 Let's introduce the plant growth path in detail.

[0047] Figure 2 A schematic diagram of a plant growth path provided in an embodiment of the present application is shown, such as Figure 2 As shown, the entire plant growth path includes multiple nodes represented by black circles, among which node 210 is a root node, node 220 is a child node of node 210, nodes 230, 231 and 232 are child nodes of node 220, and nodes 240 and 241 are child nodes of node 230. Nodes 210, 220, 230 and 240 form a branch path, and nodes 210, 220, 230 and 241 form another branch path, and nodes between different branch paths may be partially repeated.

[0048] Among them, the plant generation instruction also includes plant growth parameters, and the plant growth parameters include the maximum node depth, the maximum number of nodes that can be grown in each round, and the maximum number of child nodes that can grow from each node. The maximum node depth is used to determine the growth depth of the entire plant. For example, if the maximum node depth is 4, then when the node depth of the child nodes grown in a certain round of plant growth is 4, the plant stops growing. The maximum number of nodes that can be grown in each round is used to characterize the maximum number of child nodes that can be grown in each round of plant growth. The maximum number of child nodes that can grow from each node is used to characterize the maximum number of child nodes that can grow under each parent node in this round of plant growth. Among them, the maximum number of nodes between different rounds can be the same or different; the maximum number of child nodes between different rounds can be the same or different.

[0049] In the embodiment of the present application, the entire plant growth path is obtained after multiple rounds of plant growth processes, and each round of plant growth process will generate multiple child nodes based on the parent node of this round. Among them, the plant growth process actually refers to the growth process of the plant growth path.

[0050] Specifically, when determining the entire plant growth path, first determine the maximum node depth in the plant growth parameters, the maximum number of nodes that need to be generated in each round of plant growth, and the maximum number of child nodes that can grow from each node according to the plant generation instructions. Then, create a new root node corresponding to the plant, add the root node to the node list, set the node depth of the root node to 0, and the default node direction of the root node is vertically upward, that is, vertical to the ground. In addition, the newly generated nodes in each round of plant growth need to add the node identifier of the node to the node list and set the node depth of the node, wherein the node depth of each node is based on the node depth of the parent node of the node plus one, for example: when the parent node of the parent node of a node is a root node, the node depth of the node is 2.

[0051] For each round of plant growth process, the parent node of this round is selected from the currently generated node sequence, and multiple child nodes corresponding to the parent node of this round are generated according to the branch growth information of this round, wherein the node sequence is formed by arranging all nodes according to the node depth after each round of plant growth process ends, and the node sequence can be arranged in the order of node depth from small to small, that is, the root node is the node at the bottom. The node depth of the current node represents the depth distance between the current node and the root node. The branch growth information of this round includes the branch length and branch growth direction corresponding to each child node to be generated in the current round of plant growth process. Then, the node sequence is updated based on all the child nodes generated in this round, so as to use the updated node sequence for the next round of plant growth process. Finally, when it is determined that the plant growth process reaches the growth stop requirement, the path composed of all nodes is used as the plant growth path.

[0052] When selecting the parent node of this round from the currently generated node sequence, each node in the node sequence can be traversed to determine whether the current node already has a child node; if there is no child node, the current node is determined as the parent node of this round; if there is a child node, the current node satisfies the child node generation condition according to the number of child nodes that already exist at the current node, the node depth of the current node, and the growth parameter; if the child node generation condition is met, the current node is determined as the parent node of this round. Among them, when traversing the node sequence, each node in the node sequence needs to be selected as the parent node of this round in turn to generate multiple child nodes on the parent node of this round.

[0053] Among them, when determining whether the current node meets the child node generation condition according to the number of child nodes that already exist in the current node, the node depth of the current node and the growth parameter, it can be determined whether the number of child nodes that already exist under the current node is less than the maximum number of child nodes that can be grown by each node in the growth parameter, and whether the node depth of the current node is greater than the preset depth threshold and less than the maximum node depth; if the number of existing child nodes is less than the maximum number of child nodes that can be grown by each node, and the node depth of the current node is greater than the preset depth threshold and less than the maximum node depth, it is determined that the child node generation condition is met, so that multiple child nodes are generated under the current node when the current node meets the child node generation condition. For example: the preset depth threshold is 1, the number of child nodes that already exist under the current node is 1, the node depth is 2, the maximum number of child nodes is 3, and the maximum node depth is 5. Since the number of existing child nodes 1 is less than 4, and the node depth 2 is greater than 1 and less than 5, it is determined that the child node generation condition is met, and at this time, the current node can be used as the parent node of this round to generate multiple child nodes on the parent node of this round. The child node generation condition may refer to the condition that the number of existing child nodes is less than the maximum number of child nodes, and the node depth of the current node is greater than a preset depth threshold and less than the maximum node depth.

[0054] The preset depth threshold is used to characterize the node depth from which the plant growth path starts to branch, that is, to characterize the node depth from which the plant growth path starts to fork to generate multiple branches. The larger the preset depth threshold, the farther the location from which multiple branches start to form is from the root node, and the smaller the preset depth threshold, the closer the location from which multiple branches start to form is to the root node. The preset depth threshold is an adjustable value, and those skilled in the art can determine the value of the preset depth threshold according to actual conditions.

[0055] After generating multiple child nodes corresponding to the parent node of this round, it is necessary to determine whether the number of child nodes generated in this round reaches the maximum number of nodes that can be grown in each round. If the number of child nodes generated in this round reaches the maximum number of nodes that can be grown in each round, the plant growth process of this round is terminated to update the node sequence based on all child nodes generated in this round. Here, assuming that the maximum number of nodes that can be grown in each round is 4, when 4 child nodes are generated in this round, these newly generated 4 child nodes are added to the node sequence, and the corresponding node depth is set for each child node, so as to use the updated node sequence for the next round of plant growth process.

[0056] In addition, the growth stop requirement is determined based on the maximum node depth. Any of the following three methods can be used to determine whether the growth stop requirement is met. One method is: after each round of plant growth process, determine the maximum value of the node depth of all newly generated child nodes in this round of plant growth process, and compare the maximum value with the maximum node depth. If the maximum value is less than the maximum node depth, it is determined that the growth stop requirement is not met. If the maximum value is equal to the maximum node depth, it is determined that the growth stop requirement is met. At this time, each round of plant growth process can generate child nodes with the maximum number of nodes that can grow in each round.

[0057] Another method is: in each round of plant growth, each time a child node is generated, the node depth of the newly generated child node is determined, and the node depth of the child node is compared with the maximum node depth. If the node depth of the child node is equal to the maximum node depth, the node depth of the newly generated child node in this round is updated to be equal to the number of child nodes with the maximum node depth. When the number of child nodes equal to the maximum node depth is greater than or equal to the set number threshold, it is determined that the growth stop requirement is met, otherwise, it is determined that the growth stop requirement is not met. At this time, the number of child nodes that can be generated in each round of plant growth depends not only on the maximum number of child nodes that can be grown in each round, but also on the number of child nodes equal to the maximum node depth. Among them, the set number threshold is adjustable, and those skilled in the art can determine the value of the number threshold according to actual conditions.

[0058] The third method is: traverse all nodes to determine whether all nodes do not meet the child node generation condition. If all nodes do not meet the child node generation condition, it is determined that the growth stop requirement is met.

[0059] When it is determined that the plant growth process reaches the growth stop requirement, the path formed by all nodes is used as the plant growth path, and the entire plant growth process can be ended at this time.

[0060] The following is an example of the plant growth process.

[0061] Taking the first round of plant growth process as an example, assuming that the maximum number of nodes in this round is 4, and the preset maximum number of child nodes of each child node is 3, each node is traversed, and when the number of nodes generated in this round is less than the maximum number of nodes that can be grown in each round, each traversed node is selected in turn as the parent node of the current round. Since there is only a root node at present, the root node is first used as the parent node of the current round, and then it is determined whether there is a child node on the root node. Since there is no child node on the root node, a new node is allowed to be generated on the root node as the child node of the root node. Here, the root node is recorded as: node 210, and the child node of the newly generated root node is recorded as: node 220, and the growth position of node 220 is determined according to the branch growth information under the first round of plant growth process.

[0062] After each node is generated in each round of plant growth, determine whether the number of nodes generated in this round is less than the maximum number of nodes that can be grown in each round. If it is less than the maximum number of nodes that can be grown in each round, generate a new child node on the current parent node of this round. If it is greater than or equal to the maximum number of nodes, stop the plant growth process in this round.

[0063] Taking the above example as an example, since the maximum number of nodes in the first round is 4, only 1 node has been generated at this time, and 3 nodes need to be grown, the root node is continued to be selected as the parent node of the current round, and it is determined whether the root node has child nodes. Since child nodes already exist at this time, it is determined whether the number of existing child nodes of the root node is less than the maximum number of child nodes that can be grown by each node and whether the node depth of the root node is greater than the preset depth threshold, and the preset depth threshold is set to 0. If the number of existing child nodes of the root node is less than the maximum number of child nodes and the node depth of the root node is greater than 1, a new node is generated, otherwise other nodes are selected as the new parent node of the current round. Since the number of existing child nodes of the root node is 1, it meets the requirement of being less than the maximum number of child nodes, but the node depth of the root node is 0 at this time, which does not meet the requirement of the node depth being greater than 0. Therefore, child nodes cannot continue to be generated on the root node, and a new parent node of the current round needs to be selected.

[0064] Therefore, node 220 is selected as the new parent node of the current round, and then it is determined whether there is a child node on node 220. Since there is no child node on node 220, a new node is allowed to be generated on node 220 as the first child node of node 220, and the first child node of node 220 is recorded as: node 230. At this time, the number of child nodes generated is 2, which has not reached the maximum number of nodes 4. Therefore, node 220 is continuously selected as the parent node of the current round to determine whether there is a child node on node 220. Since node 230 already exists on node 220 at this time, it is determined whether the number of child nodes already existing on node 220 is less than the maximum number of child nodes 4 and whether the node depth of node 220 is greater than 0. Since the number of child nodes of node 220 is 1 and the node depth of node 220 is 1, it meets the requirements for generating nodes, so the second new child node is continuously generated on node 220, and the second new child node is recorded as: node 231. And so on, until the 4 child nodes of this round are generated.

[0065] Refer to the following Figure 3 Let's introduce the child nodes generated at the end of the first round of plant growth.

[0066] Figure 3 A schematic diagram showing nodes generated during the first round of plant growth process provided by an embodiment of the present application is shown, such as Figure 3 As shown, after the first round of plant growth, a node, namely node 220, is generated on node 210, and three nodes, namely node 230, node 231 and node 232, are generated on node 220. After the first round of plant growth, a total of 4 nodes are generated.

[0067] In addition, the next round of plant growth process is based on the results of the previous round of plant growth process, and this cycle is repeated until the growth stop requirement is met, at which time a complete plant growth path can be obtained. When selecting a new parent node of the current round, the method can be from left to right or from right to left, or a random method can be used to select a new parent node of the current round.

[0068] It should be pointed out that the branch growth information of each round of plant growth process is different, and the branch growth information between each node in the same round is also different. After each time it is determined that a node is allowed to be generated, the branch growth information of the generated node needs to be determined. Here, the branch growth information of this round of plant growth process includes the branch growth information corresponding to each child node, and the branch growth information corresponding to each child node includes the branch length and the branch growth direction.

[0069] When determining the branch growth information of the current round of plant growth process, the branch growth information corresponding to each child node to be generated in the current round of plant growth is actually determined. Here, the branch length corresponding to each child node to be generated in the current round of plant growth process can be determined according to the preset basic length parameter, and then the branch growth direction corresponding to each child node to be generated in the current round of plant growth process can be determined according to the node direction of the parent node in the current round.

[0070] When determining the branch length, the value of the power function with the preset length decreasing parameter as the base and the depth of the child node to be generated as the exponent can be used as the length correction value, and the product of the preset basic length parameter and the length correction value can be used as the branch length. The branch length is denoted as: Length, the preset length decreasing parameter is denoted as: BranchLengthFalloff, the preset basic length parameter is denoted as: BranchLength, and the depth of the child node to be generated is denoted as: Depth, then Branch Length = BranchLength×pow(BranchLengthFalloff,Depth). Here, by adjusting the value of BranchLengthFalloff, the effect of the branch length gradually decreasing with the extension of the branch path under different plant growth processes can be achieved, so as to be more in line with the actual growth conditions of the plants.

[0071] In a possible implementation, the subnodes to be generated include trunk subnodes and branch subnodes. The trunk subnodes and branch subnodes can be determined by the maximum trunk node depth. The maximum trunk node depth is determined based on the difference between the maximum node depth and a set value. For example, if the set value is 1 and the maximum node depth is 5, the maximum trunk node depth is 4. Here, nodes with a node depth less than or equal to the maximum trunk node depth can be determined as trunk subnodes, and nodes with a node depth greater than the maximum trunk node depth can be determined as branch subnodes. The set value is adjustable, and those skilled in the art can determine the specific value of the set value according to actual conditions.

[0072] The growth stop requirement includes the trunk growth stop requirement, and the trunk growth stop requirement is used to determine whether the trunk stops growing. When determining whether the trunk growth stop requirement is met, it can be determined whether the node depth of the child node to be generated is greater than the maximum trunk node depth. If it is greater than the maximum trunk node depth, it is determined that the trunk growth stop requirement is met, otherwise it is determined that the trunk growth stop requirement is not met. In addition, the tree branch child node is a node generated after the trunk child node. Depending on the type of child node, the branch growth direction also includes two types. The branch growth direction includes a first branch direction corresponding to the trunk child node and a second branch direction corresponding to the tree branch child node. In addition, the branch growth direction is the node direction of the child node.

[0073] When determining the branch growth direction, the child node to be generated is determined to be a trunk child node or a branch child node based on the node depth of the parent node of this round, that is, whether the node depth corresponding to the child node to be generated meets the trunk growth stop requirement, and the trunk growth stop requirement is determined by the difference between the maximum node depth and the set value; if the trunk growth stop requirement is not met, the child node to be generated is determined as a trunk child node. If the child node to be generated is determined to be a trunk child node, the first branch direction corresponding to the trunk child node is determined to generate the trunk child node according to the first branch direction; if the trunk growth stop requirement is met, it is determined whether the branch stop requirement is met. If the trunk growth stop requirement is met and the branch stop requirement is not met, the child node to be generated is determined to be a branch child node. If the child node to be generated is determined to be a branch child node, the second branch direction corresponding to the branch child node is determined to generate the branch child node according to the second branch direction. If the branch stop requirement is met, the path growth is stopped, the child node is not generated, and there is no need to determine the second branch direction.

[0074] Here, taking the maximum trunk node depth of 4 and the maximum node depth of 6 as an example, assuming that the node depth of the child node to be generated is 3, since the node depth of the child node does not meet the trunk growth stop requirement, that is, the node depth is less than or equal to the maximum trunk node depth of 4, therefore, the first branch direction can be determined to generate the trunk child node using the first branch direction. Conversely, if the node depth of the child node to be generated is 5, since the node depth of the child node to be generated meets the trunk growth stop requirement, that is, the node depth is greater than the maximum trunk node depth of 4, therefore, the second branch direction can be determined to generate the branch child node using the second branch direction.

[0075] In a feasible implementation scheme, when determining the first branch direction, the sum of the preset direction range parameter and the direction random parameter can be used as the branch direction correction value, and the sum of the node direction of the parent node of this round and the branch direction correction value can be used as the first branch direction. Here, the node direction can refer to the node direction of the parent node of the current round, and the node direction is denoted as: Direction. The preset direction range parameter is used to determine the range of the branch growth direction, and the preset direction range parameter is denoted as: Distort. The direction random parameter is used to characterize the direction randomness between different nodes under the same parent node. The direction random parameter is a unit vector, denoted as: Random.onUnitSphere. The first branch direction is denoted as: newDir1, then newDir1 = Direction + Distort + Random.onUnitSphere.

[0076] In a feasible implementation, when determining the second branch direction, the sum of the preset direction range parameter, the direction random parameter and the branch direction rotation parameter can be used as the branch direction correction value, and the sum of the node direction of the parent node of this round and the branch direction correction value can be used as the second branch direction. Here, the branch direction rotation parameter is recorded as: BranchAngle, which is the value of the rotation angle, used to rotate newDir1, and the second branch direction is recorded as: newDir2, then newDir1 can be rotated by the BranchAngle angle to obtain newDir2.

[0077] After determining the branch length and branch growth direction of the child node to be generated, for each child node to be generated, the position after extending the branch length corresponding to the child node from the position of the parent node of this round toward the branch growth direction corresponding to the child node can be selected as the child node growth position, and the child node is generated at the child node growth position. Taking the parent node of the current round as node 220 as an example, assuming that the branch growth direction corresponding to the child node to be generated is the vertical positive direction and the branch length is 0.5m, the child node is generated at a position 0.5m away from node 220 and directly above node 220.

[0078] Refer to the following Figure 4 To introduce the specific process of plant growth path through multiple rounds of growth.

[0079] Figure 4 A schematic diagram showing a multi-round generation process of a plant growth path provided in an embodiment of the present application is shown. Figure 4 As shown, the maximum number of child nodes on each node is 3, and 3 child nodes are generated in each round of plant growth process. The existing nodes in this round are represented by solid black circles, and the newly generated child nodes in this round are represented by hollow white circles. In the first round of plant growth process, node 220 is generated on node 210, and nodes 230, node 231 and node 232 are generated on node 220. In the second round of plant growth process, nodes 240, node 241 and node 242 are generated on node 230, and node 243 is generated on node 231. In the third round of plant growth process, nodes 244 and node 245 are generated on node 231, and nodes 246 and node 247 are generated on node 232. In the fourth round of plant growth process, node 248 is generated on node 232, and nodes 250, node 251 and node 252 are generated on node 240. The subsequent plant growth process will not be repeated.

[0080] Step S102: generating a trunk model including branches of different thicknesses on the plant growth path according to the number of growth nodes on each branch path.

[0081] In this step, after determining the plant growth path, a branch model corresponding to the obtained plant growth path is established. The branch model will display branches of different thicknesses according to the number of growth nodes on each branch path to truly simulate the actual growth of the plant.

[0082] In the embodiment of the present application, the thickness of different branches is determined by the thickness, and the thickness depends on the number of growth nodes on the branch path. Here, for each branch path, the thickness of the branch path can be determined according to the number of growth nodes on the branch path, and the branch model can be generated according to the thickness of the branches of different branch paths.

[0083] In addition, each branch path includes multiple sub-branches, where a sub-branch is a branch between two adjacent nodes on the branch path, and the branch thickness includes the branch thickness of each sub-branch. Figure 4 Middle nodes 210, 220, 230, 240 and 250 constitute a branch, which includes the first sub-branch corresponding to nodes 210 and 220, the second sub-branch corresponding to nodes 220 and 230, the third sub-branch corresponding to nodes 230 and 240, and the fourth sub-branch corresponding to nodes 240 and 250, which is equivalent to dividing the branch into four sections, each section corresponds to a sub-branch, and the thickness of the branches of each sub-branch can be different.

[0084] When determining the thickness of the branches of the branch path, it is necessary to determine the number of branch nodes corresponding to each sub-branch, and determine the thickness of the branches of the sub-branch based on the number of branch nodes and the total number of nodes on the entire plant. The number of branch nodes is the number of all nodes generated based on the sub-branch, for example: all nodes generated by the third sub-branch corresponding to node 230 and node 240 include node 240, node 250, node 251 and node 252, that is, all sub-nodes after the sub-branch are regarded as branch nodes and include the first sub-node in the branch, and the first child node refers to node 240. Similarly, the number of branch nodes of the sub-branch corresponding to node 210 and node 220 is the number of all child nodes except the root node.

[0085] In addition, when determining the branch thickness of the sub-branch according to the number of branch nodes and the total number of nodes on the entire plant, the branch thickness correction value of the sub-branch can be determined according to the ratio of the number of branch nodes to the total number of nodes, and then the branch thickness of the sub-branch can be determined according to the product of the preset branch thickness parameter and the branch thickness correction value. Here, taking the third sub-branch corresponding to nodes 230 and 240 in the above example as an example, the number of branch nodes is 4 and the total number of nodes is 17, then the ratio of 4 / 17 can be determined as the branch thickness correction value, and the branch thickness is recorded as: BranchRadius, and then the product of the branch thickness correction value and the preset branch thickness parameter is determined as the value of the branch thickness BranchRadius. The larger the value of BranchRadius, the thicker the branch, and the smaller the value of BranchRadius, the thinner the branch. The ratio of the number of branch nodes to the total number of nodes may also be corrected first, for example, by adding the ratio to the basic thickness correction value to obtain a corrected ratio, which is corrected using the comparison value, and then the thickness of the branches is determined by multiplying the corrected ratio by the preset branch thickness parameter.

[0086] In one example, after determining the thickness of the branches of the sub-branch, the calculated thickness of the branches can be further corrected according to the distance between the nodes in the sub-branch and the root node. Specifically, determine whether the sub-node under the sub-branch is a root node. If it is a root node, adjust the thickness of the branches to use the adjusted thickness of the branches as the final thickness of the branches of the sub-branch. Among them, according to the distance between each root node and the root node, a distance correction value is set to adjust the thickness of the branches using the distance correction value. The specific adjustment method is shown in the formula of the subsequent sub-node vertex position. In addition, the root node is not the root node, but a node whose node depth difference with the root node is less than or equal to the set difference threshold, that is, a node closer to the root node. For example, the node depth of the root node is 0. If the difference threshold is set to 3, the root node can be a node with a node depth less than 4. In this way, nodes with node depths of 1, 2, and 3 are all root nodes.

[0087] When generating a branch model according to the thickness of the tree trunk of different branch paths, it is necessary to select multiple child node vertices uniformly on the plane where the child node of the child branch is located for each child branch, and generate a branch mesh corresponding to the child branch according to the triangle formed by connecting multiple child node vertices with multiple parent node vertices, so as to generate a branch model according to the branch meshes corresponding to different child branches. Among them, the child node vertex can refer to the vertex of the branch model corresponding to the child node in the child branch, and the parent node vertex can refer to the vertex of the branch model corresponding to the parent node in the child branch.

[0088] Specifically, the grid orientation can be determined first. Here, the node orientation of the child node is used as the grid orientation of the child node. If it is a root node, the grid orientation is the result of the cross product of the node orientation of the child node of the root node and the front direction (1,0,0) of the world coordinate. Among them, the root node has only one child node. Then, select the plane passing through the child node and perpendicular to the node direction of the child node as the target plane, select a circle with the child node as the center and BranchRadius as the radius on the target plane, and divide the circle into equal parts according to the preset number of vertices, and use the multiple equal points on the circle after equal division as the child node vertices corresponding to the child node. For example: Taking the sub-branch formed by nodes 230 and 240 as an example, node 240 is a sub-node, assuming that the preset number of vertices is 12, starting from the grid direction corresponding to node 240, after each rotation of 360÷12=30° around the node direction of node 240, a point is selected at a position far from node 240 by BranchRadius, and the selected point is a sub-node vertex position, so that a total of 12 sub-node vertices can be selected. Among them, the grid direction is a direction selected in the target plane, and the grid direction is perpendicular to the node direction of node 240 in three-dimensional space.

[0089] The calculation formula for the vertex position of the child node is: Vert.position = node.Position + normal × BranchRadius × (1 + offset), where Vert.position represents the vertex position of the child node, node.Position represents the position of the child node, normal represents the angle of each rotation, that is, the 30° calculated above, and offset represents the distance correction value.

[0090] After determining the positions of multiple child node vertices in the child branch, the branch mesh corresponding to the child branch can be obtained according to the multiple child node vertices and the multiple parent node vertices corresponding to the child branch. For example: the child branch corresponding to node 230 and node 240 has a total of 12 child node vertices. Similarly, the child branch corresponding to node 220 and node 230 also has a total of 12 child node vertices, and the 12 child node vertices of the child branch corresponding to node 220 and node 230 are the parent node vertices of the child branch corresponding to node 230 and node 240. Connecting every two adjacent child node vertices with the two parent node vertices at the corresponding positions can form a quadrilateral, from which two triangles can be obtained. Similarly, all child node vertices can be connected to the parent node vertices at the corresponding positions to obtain a branch mesh, which is the Mesh of the child branch.

[0091] Repeat the above process to obtain the branch network of each sub-branch, and the branch meshes on all branch paths constitute the entire trunk mesh. After adding textures, setting materials, and rendering the entire trunk mesh, the trunk model can be obtained.

[0092] Refer to the following Figure 5 Let's introduce how to obtain the branch grid.

[0093] Figure 5 A schematic diagram showing the positions of the child node vertices and the parent node vertices provided in the embodiment of the present application is shown. Figure 5 As shown, on the child branch corresponding to node 230 and node 240, node 230 is a parent node, and the 12 parent node vertices corresponding to the parent node include parent node vertex 2301 and parent node vertex 2302. Node 240 is a child node, and the 12 child node vertices corresponding to the child node include child node vertex 2401 and child node vertex 2402. Child node vertex 2401, child node vertex 2402, parent node vertex 2301 and parent node vertex 2302 are sequentially connected to form a quadrilateral, and the quadrilateral can be divided into two triangles. In this way, every two adjacent child node vertices among the 12 child node vertices are connected to the parent node vertex at the corresponding position, and the branch mesh of the child branch can be obtained.

[0094] Step S103, generating a plurality of leaf models at the end of each branch path of the trunk model according to a preset leaf generation rule, and forming a plant rendering object based on the trunk model and the plurality of leaf models.

[0095] In this step, the end of the branch path may refer to the last node of each branch path.

[0096] In an embodiment of the present application, a cross-insertion method can be used to generate a preset number of leaf models at the end of each branch path. The preset number is pre-set, for example: if the preset number is 4, 4 leaf models are generated at the last node of each branch path. Here, for each leaf under each branch path, the Fibonacci sphere algorithm can be used to determine the insert direction of the leaf, and then multiple leaf vertex positions are determined according to the insert direction, and a leaf mesh is constructed based on the multiple leaf vertex positions, so as to generate a leaf model of the leaf using the leaf mesh.

[0097] When using the Fibonacci sphere algorithm to determine the blade insertion direction, the Fibonacci sphere algorithm can be used to determine multiple leaf surface normal directions of the leaf. The Fibonacci sphere algorithm is to obtain two planes perpendicular to each other in three-dimensional space. Each plane corresponds to two leaf surface normal directions in opposite directions. A total of four leaf surface normal directions can be obtained. These four leaf surface normal directions are recorded as: leafDirections[i].

[0098] Then, the leaf surface vector is determined according to the multiple leaf surface normal directions, and the insert direction is determined according to the leaf surface vector. The leaf surface vector includes a first leaf surface vector and a second leaf surface vector. When determining the leaf surface vector according to the multiple leaf surface normal directions, the multiple leaf surface normal directions can be cross-multiplied in sequence (i.e., vector products are calculated) to obtain multiple first leaf surface vectors. For example, if the four leaf surface normal directions are leafDirections[1], leafDirections[2], leafDirections[3], and leafDirections[4], then the first leaf surface vector obtained by cross-multiplying leafDirections[1] and leafDirections[2] is leafDirections[1][2]. The cross product of ns[2] and leafDirections[3] yields a first leaf vector leafDirections[2][3]. Similarly, we can obtain two more first leaf vectors, leafDirections[3][4] and leafDirections[4][1]. These four first leaf vectors are denoted as Tangents1[i], where Tangents1[1] is leafDirections[1][2], Tangents1[2] is leafDirections[2][3], and each Tangents1[i] represents a leaf node.

[0099] Then, for each first leaf surface vector, the first leaf surface vector is cross-producted with the corresponding leaf surface normal direction to obtain a second leaf surface vector, where the second leaf surface vector may refer to a vector perpendicular to the first leaf surface vector in the plane corresponding to the first leaf surface vector and the leaf surface normal direction. For example, Tangents1[1] is cross-producted with leafDirections[1] to obtain a second leaf surface vector Tangents2[1]. Similarly, Tangents1[2] is cross-producted with leafDirections[2] to obtain a second leaf surface vector Tangents2[2]. By analogy, a total of four second leaf surface vectors may be obtained, which are denoted as Tangents2[i]. Among them, Tangents1[i], Tangents2[i] and leafDirections[i] are three mutually perpendicular vectors, and Tangents1[i] and Tangents2[i] determine the plane where the leaf patch is located.

[0100] When determining the insert direction according to the leaf surface vector, select the blade direction in the plane corresponding to the leaf surface vector, and multiply the blade direction by the leaf surface vector to obtain the insert direction. Here, since the plane where the leaf patch is located has been determined, it is only necessary to determine four vertices in the plane to determine the specific position of the leaf. To this end, a blade direction is randomly selected in the plane where the leaf patch is located. The blade direction is recorded as: orientation. The insert direction includes the first insert direction and the second insert direction. The first insert direction is recorded as: tangent1, and the second insert direction is recorded as: tangent2. Then the first insert direction tangent1 = orientation × Tangents1[i], and the second insert direction tangent2 = orientation × Tangents2[i]. Among them, tangent1 and tangent2 are two direction vectors perpendicular to each other.

[0101] Then, multiple blade vertex positions are determined according to the insert direction. Here, the blade vertex position can be determined according to the end node position of the branch path, the insert direction and the preset blade radius. Here, the blade vertex position includes the first blade vertex position and the second blade vertex position. When determining the blade vertex position, the product of the insert direction and the preset blade radius can be determined, wherein the preset blade radius is denoted as LeafQuadRadius, the product of the first insert direction and the preset blade radius is the first product, and the product of the second insert direction and the preset blade radius is the second product. Then, according to the sum of the end node position and the product, the first blade vertex position is determined. The first blade vertex position includes two, denoted as: v 11 and v 12 , according to the sum of the terminal node position and the first product, v can be determined 11 According to the sum of the terminal node position and the second product, v can be determined 12 . Using node.Position to represent the end node position, the following formula is used:

[0102] v 11 =node.Position+tangent1×LeafQuadRadius;

[0103] V 12 =node.Position+tangent2×LeafQuadRadius;

[0104] Similarly, the second leaf vertex position is determined according to the difference between the terminal node position and the product. The second leaf vertex position includes two positions, which are respectively denoted as: v 21 and v 22 , based on the difference between the terminal node position and the first product, v can be determined21 , based on the difference between the terminal node position and the second product, v can be determined 99 . Using node.Position to represent the end node position, the following formula is used:

[0105] V 21 =node.Position-tangent1×LeafQuadRadius;

[0106] v 22 =node.Position-tangent2×LeafQuadRadius.

[0107] Then, according to leafDirections[i], the normal direction of the leaf mesh is specified, and the corresponding UV values ​​are set for the four vertex positions. At the same time, the quadrilateral formed by the four leaf vertices is split to obtain the triangles required to construct the Mesh. In this way, a leaf mesh in the viewing direction can be obtained.

[0108] Finally, in order to be able to observe the blade from four different directions (the preset number is 4), the above steps need to be repeated three times to generate blade meshes in other directions. In this way, the same processing is performed at the end of each branch path, and multiple blade meshes can be generated at the end of each branch path. After adding textures, setting materials, and rendering on the basis of the blade mesh, a blade model can be obtained.

[0109] In this way, after the branch model and the leaf model are obtained, the complete plant composed of the branch model and the leaf model can be displayed in the graphical user interface to obtain the plant rendering object.

[0110] Compared with the generation method of plant rendering objects in the prior art, the present application can automatically complete the model making for different types of plants in a programmed manner, and the growth patterns of the same plants will not be repeated. There is no need for art production personnel to make models through manual modeling, which greatly reduces the workload of plant model making, shortens the model making time, improves the model making efficiency, and solves the problems of long production time and low production efficiency in the existing plant model making process.

[0111] Based on the same inventive concept, an embodiment of the present application also provides a device for generating a plant rendering object corresponding to the method for generating a plant rendering object. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the method for generating a plant rendering object in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0112] See also Figure 6 , Figure 6This is a schematic diagram of the structure of a device for generating a plant rendering object provided in an embodiment of the present application. Figure 6 As shown in , the device 300 for generating a plant rendering object includes:

[0113] The path generation module 301 is used to determine plant growth parameters, and perform multiple rounds of node step-by-step growth based on the plant growth parameters to obtain a plant growth path. The plant growth parameters include a maximum node depth, a maximum number of nodes that can be grown in each round, and a maximum number of child nodes that can be grown for each node. The plant growth path includes multiple branch paths, and each branch path includes multiple growth nodes.

[0114] A branch model generation module 302, for generating a branch model including branches of different thicknesses on a plant growth path according to the number of growth nodes on each branch path;

[0115] The leaf model generation module 303 is used to generate multiple leaf models at the end of each branch path of the branch model according to a preset leaf generation rule, and to form a plant rendering object based on the branch model and the multiple leaf models.

[0116] In a feasible implementation scheme, the path generation module 301 includes a child node generation module, a loop generation module, and a path generation module: the child node generation module is used to select the parent node of this round from the currently generated node sequence for each round of plant growth process, and generate multiple child nodes corresponding to the parent node of this round according to the branch growth information of this round, wherein the node sequence is formed by arranging all nodes according to the node depth after the end of each round of plant growth process, and the branch growth information of this round includes the branch length and branch growth direction corresponding to each child node to be generated in this round of plant growth process; the loop generation module is used to update the node sequence based on all child nodes generated in this round, so as to use the updated node sequence for the next round of plant growth process; the path generation module is used to determine whether the plant growth process reaches the growth stop requirement, and use the path formed by all nodes as the plant growth path, and the growth stop requirement is determined based on the maximum node depth.

[0117] In a feasible implementation scheme, the branch model generation module 302 includes a thickness determination module and a branch model generation module. The thickness determination module is used to determine the thickness of the branches of each branch path according to the number of growth nodes on the branch path; the branch model generation module is used to generate a branch model according to the thickness of the branches of different branch paths.

[0118] In a feasible implementation scheme, the blade model generation module 303 includes a blade model generation submodule, and the blade model generation submodule is used to generate a preset number of blade models at the end of each branch path using a cross-insertion method.

[0119] In a feasible implementation scheme, the child node generation module includes a node growth position selection module and a growth module. The node growth position selection module is used to: for each child node to be generated, select the position after extending the branch length corresponding to the child node from the position of the parent node of this round toward the branch growth direction corresponding to the child node as the child node growth position, and the growth module is used to: and generate the child node at the child node growth position.

[0120] In a feasible implementation scheme, the child node generation module includes a branch length determination module and a branch growth direction determination module. The branch length determination module is used to: determine the branch length corresponding to each child node to be generated in this round of plant growth according to a preset basic length parameter, and the branch length gradually decreases with the extension of the branch path under different plant growth processes; the branch growth direction determination module is used to: determine the branch growth direction corresponding to each child node to be generated in this round of plant growth according to the node direction of the parent node in this round.

[0121] In a feasible implementation scheme, the child node generation module also includes a child node judgment module, a first parent node determination module, and a second parent node determination module. The child node judgment module is used to: traverse each node in the node sequence and determine whether the current node already has a child node; the first parent node determination module is used to: if there is no child node, then determine the current node as the parent node of this round; the second parent node determination module is used to: if there is a child node, then determine whether the current node meets the child node generation conditions based on the number of child nodes that already exist in the current node, the node depth of the current node, and the growth parameters; if the child node generation conditions are met, then determine the current node as the parent node of this round.

[0122] In a feasible implementation scheme, the branch path includes multiple sub-branches, where a sub-branch is a branch between two adjacent nodes on the branch path, and the branch thickness includes the branch thickness of each sub-branch. The thickness determination module includes a sub-branch node quantity determination module and a sub-branch thickness calculation module. The sub-branch node quantity determination module is used to: for each sub-branch, determine the number of branch nodes corresponding to the sub-branch, and the number of branch nodes is the number of all nodes generated based on the sub-branch; the sub-branch thickness calculation module is used to: determine the branch thickness of the sub-branch based on the number of branch nodes and the total number of nodes on the entire plant.

[0123] In a feasible implementation scheme, the sub-branch thickness calculation module is specifically used to: determine the branch thickness correction value of the sub-branch based on the ratio of the number of branch nodes to the total number of nodes; determine the branch thickness of the sub-branch based on the product of a preset branch thickness parameter and the branch thickness correction value.

[0124] In a feasible implementation scheme, the branch path includes multiple sub-branches, where a sub-branch is a branch between two adjacent nodes on the branch path. The branch model generation module is specifically used to: for each sub-branch, evenly select multiple sub-node vertices on the plane where the sub-node of the sub-branch is located; generate a branch mesh corresponding to the sub-branch based on a triangle formed by connecting multiple sub-node vertices with multiple parent node vertices, so as to generate a branch model based on the branch meshes corresponding to different sub-branches.

[0125] In a feasible implementation scheme, the leaf model generation submodule includes a leaf direction determination module and a leaf mesh construction module. The leaf direction determination module is used to: for each leaf under each branch path, use the Fibonacci spherical algorithm to determine the leaf direction of the leaf; the leaf mesh construction module is used to determine multiple leaf vertex positions according to the leaf direction, and construct a leaf mesh based on the multiple leaf vertex positions, so as to use the leaf mesh to generate a leaf model of the leaf.

[0126] In a feasible implementation scheme, the insert direction determination module includes a normal direction determination submodule and an insert direction determination submodule. The normal direction determination submodule is used to determine multiple blade surface normal directions of the blade using the Fibonacci spherical algorithm; the insert direction determination submodule is used to determine the blade surface vector based on the multiple blade surface normal directions, and determine the insert direction based on the blade surface vector.

[0127] In a feasible implementation scheme, the blade mesh construction module includes a blade vertex position determination module, which is used to determine the blade vertex position according to the end node position of the branch path, the insert direction and the preset blade radius.

[0128] In a feasible implementation scheme, the branch length corresponding to each sub-node to be generated in this round of plant growth is determined according to a preset basic length parameter, including: taking the value of a power function with a preset length decreasing parameter as the base and the sub-node depth as the exponent as the length correction value; and taking the product of the preset basic length parameter and the length correction value as the branch length.

[0129] In a feasible implementation scheme, the child nodes include trunk child nodes and branch child nodes, and the branch growth direction includes a first branch direction corresponding to the trunk child node and a second branch direction corresponding to the branch child node; the branch growth direction determination module is specifically used to: determine whether the child node to be generated is a trunk child node or a branch child node based on the node depth of the parent node in this round; if it is determined to be a trunk child node, determine the first branch direction corresponding to the trunk child node to generate the trunk child node according to the first branch direction; if it is determined to be a branch child node, determine the second branch direction corresponding to the branch child node to generate the branch child node according to the second branch direction.

[0130] In a feasible implementation scheme, the branch growth direction determination module includes a first branch direction determination module and a second branch direction determination module. The first branch direction determination module is used to: use the sum of a preset direction range parameter and a direction random parameter as a branch direction correction value; and use the sum of the node direction of the parent node of this round and the branch direction correction value as the first branch direction; the second branch direction determination module is used to: use the sum of a preset direction range parameter, a direction random parameter and a branch direction rotation parameter as a branch direction correction value; and use the sum of the node direction of the parent node of this round and the branch direction correction value as the second branch direction.

[0131] In a feasible implementation scheme, the thickness determination module also includes a thickness adjustment module, which is used to: determine whether the child node under the sub-branch is a root node; if it is a root node, adjust the branch thickness to use the adjusted branch thickness as the final branch thickness of the sub-branch.

[0132] In a feasible implementation scheme, the blade surface vector includes a first blade surface vector and a second blade surface vector, and the blade direction determination submodule is specifically used to: cross-multiply multiple blade surface normal directions in sequence to obtain multiple first blade surface vectors; for each first blade surface vector, cross-multiply the first blade surface vector with the corresponding blade surface normal direction to obtain the second blade surface vector.

[0133] In a feasible implementation scheme, the blade direction determination submodule is further specifically used to: select a blade direction in a plane corresponding to the blade surface vector, and multiply the blade direction by the blade surface vector to obtain the blade direction.

[0134] In a feasible implementation scheme, the blade vertex position includes a first blade vertex position and a second blade vertex position, and the blade vertex position determination module is specifically used to: determine the product of the insert direction and a preset blade radius; determine the first blade vertex position based on the sum of the end node position and the product; determine the second blade vertex position based on the difference between the end node position and the product.

[0135] In a feasible implementation scheme, the node judgment module is specifically used to: determine whether the number of existing child nodes under the current node is less than the maximum number of child nodes that can grow from each node in the growth parameters, and whether the node depth of the current node is greater than a preset depth threshold and less than the maximum node depth; if the number of existing child nodes is less than the maximum number of child nodes that can grow from each node, and the node depth of the current node is greater than the preset depth threshold and less than the maximum node depth, it is determined that the child node generation conditions are met.

[0136] In a feasible implementation scheme, the device 300 for generating plant rendering objects also includes a single-round growth end judgment module, which is used to determine whether the number of child nodes generated in this round reaches the maximum number of nodes that can be grown in each round; if the number of child nodes generated in this round reaches the maximum number of nodes that can be grown in each round, the plant growth process in this round is terminated to update the node sequence based on all child nodes generated in this round.

[0137] Through the above-mentioned device, the present application can automatically complete the model making for different types of plants in a programmed manner, and the growth patterns of the same plants will not be repeated, and there is no need for art production personnel to make models through manual modeling. This greatly reduces the workload of plant model making, shortens the model making time, improves the model making efficiency, and solves the problems of long production time and low production efficiency in the existing plant model making process.

[0138] See also Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown in , the electronic device 400 includes a processor 410 , a memory 420 and a bus 430 .

[0139] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, the above-mentioned Figure 1 The steps of the method for generating the plant rendering object in the method embodiment are specifically implemented as follows:

[0140] Determine plant growth parameters, and perform multiple rounds of node step-by-step growth based on the plant growth parameters to obtain a plant growth path, the plant growth parameters include a maximum node depth, a maximum number of nodes that can be grown in each round, and a maximum number of child nodes that can be grown for each node, the plant growth path includes multiple branch paths, and each branch path includes multiple growth nodes;

[0141] According to the number of growth nodes on each branch path, a branch model including branches of different thicknesses is generated on the plant growth path;

[0142] According to the preset leaf generation rules, multiple leaf models are generated at the end of each branch path of the branch model, and a plant rendering object is formed based on the branch model and the multiple leaf models.

[0143] In a feasible implementation scheme, when the processor 410 executes multiple rounds of node step-by-step growth based on the plant growth parameters to obtain a plant growth path, it is specifically used to: for each round of plant growth process, select the parent node of this round from the currently generated node sequence, and generate multiple child nodes corresponding to the parent node of this round according to the branch growth information of this round, wherein the node sequence is formed by arranging all nodes according to the node depth after the end of each round of plant growth process, and the branch growth information of this round includes the branch length and branch growth direction corresponding to each child node to be generated in this round of plant growth process; update the node sequence based on all child nodes generated in this round, so as to use the updated node sequence for the next round of plant growth process; determine that the plant growth process reaches the growth stop requirement, and use the path formed by all nodes as the plant growth path, and the growth stop requirement is determined based on the maximum node depth.

[0144] In a feasible implementation scheme, when the processor 410 generates a branch model including branches of different thicknesses on a plant growth path according to the number of growth nodes on each branch path, it is specifically used to: for each branch path, determine the thickness of the branches of the branch path according to the number of growth nodes on the branch path; and generate a branch model according to the thickness of the branches of different branch paths.

[0145] In a feasible implementation scheme, when the processor 410 generates multiple leaf models at the end of each branch path of the trunk model according to the preset leaf generation rules, it is specifically used to: use the cross-insertion method to generate a preset number of leaf models at the end of each branch path.

[0146] In a feasible implementation scheme, when the processor 410 generates multiple child nodes corresponding to the parent node of this round according to the branch growth information of this round, it is specifically used to: for each child node to be generated, select the position after extending the branch length corresponding to the child node from the position of the parent node of this round in the branch growth direction corresponding to the child node as the growth position of the child node, and generate the child node at the child node growth position.

[0147] In a feasible implementation scheme, when the processor 410 determines the branch growth information of this round, it is specifically used to: determine the branch length corresponding to each child node to be generated in this round of plant growth according to a preset basic length parameter, and the branch length gradually decreases with the extension of the branch path under different plant growth processes; determine the branch growth direction corresponding to each child node to be generated in this round of plant growth according to the node direction of the parent node of this round.

[0148] In a feasible implementation scheme, the parent node of this round includes multiple ones. When the processor 410 selects the parent node of this round from the currently generated node sequence, it is specifically used to: traverse each node in the node sequence, and determine whether the current node has a child node; if there is no child node, determine the current node as the parent node of this round; if there is a child node, determine whether the current node meets the child node generation condition based on the number of child nodes that already exist in the current node, the node depth of the current node and the growth parameters; if the child node generation condition is met, determine the current node as the parent node of this round.

[0149] In a feasible implementation scheme, the branch path includes multiple sub-branches, where a sub-branch is a branch between two adjacent nodes on the branch path, and the branch thickness includes the branch thickness of each sub-branch. When the processor 410 determines the branch thickness of the branch path according to the number of growth nodes on the branch path, it is specifically used to: for each sub-branch, determine the number of branch nodes corresponding to the sub-branch, the number of branch nodes is the number of all nodes generated based on the sub-branch; determine the branch thickness of the sub-branch according to the number of branch nodes and the total number of nodes on the entire plant.

[0150] In a feasible implementation scheme, when the processor 410 determines the branch thickness of the sub-branch based on the number of branch nodes and the total number of nodes on the entire plant, it is specifically used to: determine the branch thickness correction value of the sub-branch based on the ratio of the number of branch nodes to the total number of nodes; determine the branch thickness of the sub-branch based on the product of a preset branch thickness parameter and the branch thickness correction value.

[0151] In a feasible implementation scheme, the branch path includes multiple sub-branches, and the sub-branch is a branch between two adjacent nodes on the branch path. When the processor 410 generates a branch model according to the thickness of the trunk of different branch paths, it is specifically used to: for each sub-branch, evenly select multiple sub-node vertices on the plane where the sub-nodes of the sub-branch are located; generate a branch mesh corresponding to the sub-branch according to the triangle formed by connecting multiple child node vertices with multiple parent node vertices, so as to generate a branch model according to the branch meshes corresponding to different sub-branches.

[0152] In a feasible implementation scheme, when the processor 410 executes the cross-insertion method to generate a preset number of leaf models at the end of each branch path, it is specifically used to: for each leaf under each branch path, determine the insertion direction of the leaf using the Fibonacci sphere algorithm; determine multiple leaf vertex positions according to the insertion direction, and construct a leaf mesh based on the multiple leaf vertex positions, so as to generate a leaf model of the leaf using the leaf mesh.

[0153] In a feasible implementation scheme, when the processor 410 executes the Fibonacci sphere algorithm to determine the insertion direction of the blade, it is specifically used to: determine multiple blade surface normal directions of the blade using the Fibonacci sphere algorithm; determine the blade surface vector based on the multiple blade surface normal directions, and determine the insertion direction based on the blade surface vector.

[0154] In a feasible implementation, when the processor 410 determines multiple blade vertex positions according to the insert direction, it is specifically used to: determine the blade vertex position according to the end node position of the branch path, the insert direction and the preset blade radius.

[0155] In a feasible implementation scheme, when the processor 410 determines the branch length corresponding to each child node to be generated in the current round of plant growth according to the preset basic length parameter, it is specifically used to: use the value of a power function with a preset length decreasing parameter as the base and the child node depth as the exponent as the length correction value; and use the product of the preset basic length parameter and the length correction value as the branch length.

[0156] In a feasible implementation scheme, the child nodes include trunk child nodes and branch child nodes, and the branch growth direction includes a first branch direction corresponding to the trunk child node and a second branch direction corresponding to the branch child node; when the processor 410 determines the branch growth direction corresponding to each child node to be generated in this round of plant growth according to the node direction of the parent node in this round, it is specifically used to: determine whether the child node to be generated is a trunk child node or a branch child node based on the node depth of the parent node in this round; if it is determined to be a trunk child node, and determine the first branch direction corresponding to the trunk child node, so as to generate the trunk child node according to the first branch direction; if it is determined to be a branch child node, and determine the second branch direction corresponding to the branch child node, so as to generate the branch child node according to the second branch direction.

[0157] In a feasible implementation scheme, when the processor 410 is executing to determine the first branch direction and the second branch direction, it is specifically used to: use the sum of the preset direction range parameter and the direction random parameter as the branch direction correction value; use the sum of the node direction of the parent node of this round and the branch direction correction value as the first branch direction; use the sum of the preset direction range parameter, the direction random parameter and the branch direction rotation parameter as the branch direction correction value; use the sum of the node direction of the parent node of this round and the branch direction correction value as the second branch direction.

[0158] In a feasible implementation scheme, after determining the branch thickness of the sub-branch based on the product of a preset branch thickness parameter and a branch thickness correction value, the processor 410 is also used to: determine whether the child node under the sub-branch is a root node; if it is a root node, adjust the branch thickness to use the adjusted branch thickness as the final branch thickness of the sub-branch.

[0159] In a feasible implementation scheme, the leaf surface vector includes a first leaf surface vector and a second leaf surface vector. When the processor 410 determines the leaf surface vector based on multiple leaf surface normal directions, it is specifically used to: cross-multiply the multiple leaf surface normal directions in sequence to obtain multiple first leaf surface vectors; for each first leaf surface vector, cross-multiply the first leaf surface vector with the corresponding leaf surface normal direction to obtain the second leaf surface vector.

[0160] In a feasible implementation, when the processor 410 is executed and determines the blade direction according to the blade surface vector, it is specifically used to: select the blade direction in the plane corresponding to the blade surface vector, and multiply the blade direction by the blade surface vector to obtain the blade direction.

[0161] In a feasible implementation scheme, the blade vertex position includes a first blade vertex position and a second blade vertex position. When the processor 410 determines the blade vertex position according to the end node position of the branch path, the insert direction and the preset blade radius, it is specifically used to: determine the product of the insert direction and the preset blade radius; determine the first blade vertex position according to the sum of the end node position and the product; determine the second blade vertex position according to the difference between the end node position and the product.

[0162] In a feasible implementation scheme, when the processor 410 determines whether the current node satisfies the child node generation conditions based on the number of existing child nodes of the current node, the node depth of the current node and the growth parameters, it is specifically used to: determine whether the number of existing child nodes under the current node is less than the maximum number of child nodes that can grow from each node in the growth parameters, and whether the node depth of the current node is greater than a preset depth threshold and less than the maximum node depth; if the number of existing child nodes is less than the maximum number of child nodes that can grow from each node, and the node depth of the current node is greater than the preset depth threshold and less than the maximum node depth, it is determined that the child node generation conditions are met.

[0163] In a feasible implementation scheme, after executing the generation of multiple child nodes corresponding to the parent node of this round according to the branch growth information of this round, the processor 410 is also used to: determine whether the number of child nodes generated in this round reaches the maximum number of nodes that can be grown in each round; if the number of child nodes generated in this round reaches the maximum number of nodes that can be grown in each round, then end the plant growth process of this round to update the node sequence based on all child nodes generated in this round.

[0164] Through the above-mentioned electronic equipment, the present application can automatically complete the model making for different types of plants in a programmed manner, and the growth patterns of the same plants will not be repeated, and there is no need for art production personnel to make models through manual modeling. This greatly reduces the workload of plant model making, shortens the model making time, improves the model making efficiency, and solves the problems of long production time and low production efficiency in the existing plant model making process.

[0165] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of the method for generating the plant rendering object in the method embodiment are specifically implemented as follows:

[0166] Determine plant growth parameters, and perform multiple rounds of node step-by-step growth based on the plant growth parameters to obtain a plant growth path, the plant growth parameters include a maximum node depth, a maximum number of nodes that can be grown in each round, and a maximum number of child nodes that can be grown for each node, the plant growth path includes multiple branch paths, and each branch path includes multiple growth nodes;

[0167] According to the number of growth nodes on each branch path, a branch model including branches of different thicknesses is generated on the plant growth path;

[0168] According to the preset leaf generation rules, multiple leaf models are generated at the end of each branch path of the branch model, and a plant rendering object is formed based on the branch model and the multiple leaf models.

[0169] In a feasible implementation scheme, when the processor executes multiple rounds of node step-by-step growth based on plant growth parameters to obtain a plant growth path, it is specifically used to: for each round of plant growth process, select the parent node of this round from the currently generated node sequence, and generate multiple child nodes corresponding to the parent node of this round according to the branch growth information of this round, wherein the node sequence is formed by arranging all nodes according to the node depth after the end of each round of plant growth process, and the branch growth information of this round includes the branch length and branch growth direction corresponding to each child node to be generated in this round of plant growth process; update the node sequence based on all child nodes generated in this round, so as to use the updated node sequence for the next round of plant growth process; determine that the plant growth process reaches the growth stop requirement, and use the path formed by all nodes as the plant growth path, and the growth stop requirement is determined based on the maximum node depth.

[0170] In a feasible implementation scheme, when the processor generates a branch model including branches of different thicknesses on a plant growth path according to the number of growth nodes on each branch path, it is specifically used to: for each branch path, determine the thickness of the branches of the branch path according to the number of growth nodes on the branch path; and generate a branch model according to the thickness of the branches of different branch paths.

[0171] In a feasible implementation scheme, when the processor generates multiple leaf models at the end of each branch path of the trunk model according to the preset leaf generation rules, it is specifically used to: use the cross-insertion method to generate a preset number of leaf models at the end of each branch path.

[0172] In a feasible implementation scheme, when the processor generates multiple child nodes corresponding to the parent node of this round according to the branch growth information of this round, it is specifically used to: for each child node to be generated, select the position after extending the branch length corresponding to the child node from the position of the parent node of this round in the branch growth direction corresponding to the child node as the growth position of the child node, and generate the child node at the child node growth position.

[0173] In a feasible implementation scheme, when the processor is executing to determine the branch growth information of this round, it is specifically used to: determine the branch length corresponding to each child node to be generated in this round of plant growth according to a preset basic length parameter, and the branch length gradually decreases with the extension of the branch path under different plant growth processes; determine the branch growth direction corresponding to each child node to be generated in this round of plant growth according to the node direction of the parent node of this round.

[0174] In a feasible implementation scheme, when the processor selects the parent node of this round from the currently generated node sequence, it is specifically used to: traverse each node in the node sequence and determine whether the current node already has a child node; if there is no child node, determine the current node as the parent node of this round; if there is a child node, determine whether the current node meets the child node generation condition based on the number of child nodes that already exist in the current node, the node depth of the current node and the growth parameters; if the child node generation condition is met, determine the current node as the parent node of this round.

[0175] In a feasible implementation scheme, the branch path includes multiple sub-branches, where a sub-branch is a branch between two adjacent nodes on the branch path, and the branch thickness includes the branch thickness of each sub-branch. When the processor determines the branch thickness of the branch path according to the number of growth nodes on the branch path, it is specifically used to: for each sub-branch, determine the number of branch nodes corresponding to the sub-branch, the number of branch nodes is the number of all nodes generated based on the sub-branch; determine the branch thickness of the sub-branch according to the number of branch nodes and the total number of nodes on the entire plant.

[0176] In a feasible implementation scheme, when the processor is executing to determine the branch thickness of the sub-branch based on the number of branch nodes and the total number of nodes on the entire plant, it is specifically used to: determine the branch thickness correction value of the sub-branch based on the ratio of the number of branch nodes to the total number of nodes; determine the branch thickness of the sub-branch based on the product of a preset branch thickness parameter and the branch thickness correction value.

[0177] In a feasible implementation scheme, the branch path includes multiple sub-branches, and the sub-branch is a branch between two adjacent nodes on the branch path. When the processor generates a branch model according to the thickness of the trunk of different branch paths, it is specifically used to: for each sub-branch, evenly select multiple sub-node vertices on the plane where the sub-nodes of the sub-branch are located; generate a branch mesh corresponding to the sub-branch based on the triangle formed by connecting the multiple sub-node vertices with the multiple parent node vertices, so as to generate a branch model according to the branch meshes corresponding to different sub-branches.

[0178] In a feasible implementation scheme, when the processor executes the cross-insertion method to generate a preset number of leaf models at the end of each branch path, it is specifically used to: for each tree leaf under each branch path, determine the insertion direction of the leaf using the Fibonacci sphere algorithm; determine multiple leaf vertex positions according to the insertion direction, and construct a leaf mesh based on the multiple leaf vertex positions, so as to generate a leaf model of the leaf using the leaf mesh.

[0179] In a feasible implementation scheme, when the processor executes the Fibonacci sphere algorithm to determine the insertion direction of the blade, it is specifically used to: determine multiple blade surface normal directions of the blade using the Fibonacci sphere algorithm; determine the blade surface vector based on the multiple blade surface normal directions, and determine the insertion direction based on the blade surface vector.

[0180] In a feasible implementation scheme, when the processor determines multiple blade vertex positions according to the insertion direction, it is specifically used to: determine the blade vertex position according to the end node position of the branch path, the insertion direction and the preset blade radius.

[0181] In a feasible implementation scheme, when the processor determines the branch length corresponding to each child node to be generated in the current round of plant growth according to the preset basic length parameter, it is specifically used to: use the value of a power function with a preset length decreasing parameter as the base and the child node depth as the exponent as the length correction value; and use the product of the preset basic length parameter and the length correction value as the branch length.

[0182] In a feasible implementation scheme, the child nodes include trunk child nodes and branch child nodes, and the branch growth direction includes a first branch direction corresponding to the trunk child node and a second branch direction corresponding to the branch child node; when the processor determines the branch growth direction corresponding to each child node to be generated in this round of plant growth according to the node direction of the parent node in this round, it is specifically used to: determine whether the child node to be generated is a trunk child node or a branch child node based on the node depth of the parent node in this round; if it is determined to be a trunk child node, determine the first branch direction corresponding to the trunk child node to generate the trunk child node according to the first branch direction; if it is determined to be a branch child node, determine the second branch direction corresponding to the branch child node to generate the branch child node according to the second branch direction.

[0183] In a feasible implementation scheme, when the processor is executing to determine the first branch direction and the second branch direction, it is specifically used to: use the sum of the preset direction range parameter and the direction random parameter as the branch direction correction value; use the sum of the node direction of the parent node of this round and the branch direction correction value as the first branch direction; use the sum of the preset direction range parameter, the direction random parameter and the branch direction rotation parameter as the branch direction correction value; use the sum of the node direction of the parent node of this round and the branch direction correction value as the second branch direction.

[0184] In a feasible implementation scheme, after determining the branch thickness of the sub-branch based on the product of a preset branch thickness parameter and a branch thickness correction value, the processor is also used to: determine whether the child node under the sub-branch is a root node; if it is a root node, adjust the branch thickness to use the adjusted branch thickness as the final branch thickness of the sub-branch.

[0185] In a feasible implementation scheme, the leaf surface vector includes a first leaf surface vector and a second leaf surface vector. When the processor determines the leaf surface vector based on multiple leaf surface normal directions, it is specifically used to: cross-multiply the multiple leaf surface normal directions in sequence to obtain multiple first leaf surface vectors; for each first leaf surface vector, cross-multiply the first leaf surface vector with the corresponding leaf surface normal direction to obtain the second leaf surface vector.

[0186] In a feasible implementation scheme, when the processor is executed and determines the blade direction according to the blade surface vector, it is specifically used to: select the blade direction in the plane corresponding to the blade surface vector, and multiply the blade direction by the blade surface vector to obtain the blade direction.

[0187] In a feasible implementation scheme, the blade vertex position includes a first blade vertex position and a second blade vertex position. When the processor determines the blade vertex position according to the end node position of the branch path, the insert direction and the preset blade radius, it is specifically used to: determine the product of the insert direction and the preset blade radius; determine the first blade vertex position according to the sum of the end node position and the product; determine the second blade vertex position according to the difference between the end node position and the product.

[0188] In a feasible implementation scheme, when the processor determines whether the current node satisfies the child node generation conditions based on the number of existing child nodes of the current node, the node depth of the current node and the growth parameters, it is specifically used to: determine whether the number of existing child nodes under the current node is less than the maximum number of child nodes that can grow from each node in the growth parameters, and whether the node depth of the current node is greater than a preset depth threshold and less than the maximum node depth; if the number of existing child nodes is less than the maximum number of child nodes that can grow from each node, and the node depth of the current node is greater than the preset depth threshold and less than the maximum node depth, it is determined that the child node generation conditions are met.

[0189] In a feasible implementation scheme, after executing the generation of multiple child nodes corresponding to the parent node of this round according to the branch growth information of this round, the processor is also used to: determine whether the number of child nodes generated in this round reaches the maximum number of nodes that can be grown in each round; if the number of child nodes generated in this round reaches the maximum number of nodes that can be grown in each round, then end the plant growth process of this round to update the node sequence based on all child nodes generated in this round.

[0190] Through the above-mentioned storage medium, the present application can automatically complete the model making for different types of plants in a programmed manner, and the growth patterns of the same plants will not be repeated, and there is no need for art production personnel to make models through manual modeling. This greatly reduces the workload of plant model making, shortens the model making time, improves the model making efficiency, and solves the problems of long production time and low production efficiency in the existing plant model making process.

[0191] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0192] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0193] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0194] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0195] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0196] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for generating a plant rendering object, characterized in that: include: Determine plant growth parameters, and perform multiple rounds of node step-by-step growth based on the plant growth parameters to obtain a plant growth path, wherein the growth parameters include a maximum node depth, a maximum number of nodes that can be grown in each round, and a maximum number of child nodes that can be grown from each node, and the plant growth path includes multiple branch paths, and each branch path includes multiple growth nodes; According to the number of growth nodes on each branch path, a branch model including branches of different thicknesses is generated on the plant growth path; According to preset leaf generation rules, a plurality of leaf models are generated at the end of each branch path of the trunk model, and the plant rendering object is constructed based on the trunk model and the plurality of leaf models.

2. The method according to claim 1, characterized in that The step of performing multiple rounds of node step-by-step growth based on the plant growth parameters to obtain a plant growth path includes: For each round of plant growth, a parent node of this round is selected from the currently generated node sequence, and multiple child nodes corresponding to the parent node of this round are generated according to the branch growth information of this round, wherein the node sequence is formed by arranging all nodes according to the node depth after each round of plant growth, and the branch growth information of this round includes the branch length and branch growth direction corresponding to each child node to be generated in the process of this round of plant growth; updating the node sequence based on all child nodes generated in this round, so as to use the updated node sequence to perform the next round of plant growth process; It is determined that the plant growth process reaches a growth stop requirement, and a path formed by all nodes is used as a plant growth path, wherein the growth stop requirement is determined based on the maximum node depth.

3. The method according to claim 1, characterized in that: The step of generating a branch model including branches of different thicknesses on the plant growth path according to the number of growth nodes on each branch path includes: For each branch path, the thickness of the branches of the branch path is determined according to the number of growth nodes on the branch path; Generate a branch model based on the thickness of branches in different branch paths.

4. The method according to claim 1, characterized in that The method of generating a plurality of leaf models at the end of each branch path of the trunk model according to a preset leaf generation rule includes: A cross-insert method is used to generate a preset number of blade models at the end of each branch path.

5. The method according to claim 2, characterized in that: The generating of multiple child nodes corresponding to the parent node of this round according to the branch growth information of this round includes: For each child node to be generated, the position after extending the branch length corresponding to the child node from the position of the parent node of this round toward the branch growth direction corresponding to the child node is selected as the growth position of the child node, and the child node is generated at the growth position of the child node.

6. The method according to claim 2, characterized in that The branch growth information of this round is determined by the following methods, including: According to the preset basic length parameter, the branch length corresponding to each sub-node to be generated in the current round of plant growth is determined. The branch length gradually decreases with the extension of the branch path in different plant growth processes. According to the node direction of the parent node in this round, the branch growth direction corresponding to each child node to be generated in the process of plant growth in this round is determined.

7. The method according to claim 2, characterized in that The step of selecting the parent node of this round from the currently generated node sequence includes: Traversing each node in the node sequence and determining whether the current node already has a child node; If there is no child node, the current node is determined as the parent node of this round; If a child node already exists, determine whether the current node meets the child node generation condition according to the number of child nodes that already exist at the current node, the node depth of the current node and the growth parameter; If the child node generation conditions are met, the current node is determined as the parent node of this round.

8. The method according to claim 3, characterized in that The branch path includes a plurality of sub-branches, each sub-branch being a branch between two adjacent nodes on the branch path, and the branch thickness includes the branch thickness of each sub-branch. The step of determining the thickness of the branches of the branch path according to the number of growth nodes on the branch path includes: For each sub-branch, determine the number of branch nodes corresponding to the sub-branch, where the number of branch nodes is the number of all nodes generated based on the sub-branch; The thickness of the trunk of the sub-branch is determined according to the number of branch nodes and the total number of nodes on the entire plant.

9. The method according to claim 8, characterized in that Determining the thickness of the trunk of the sub-branch according to the number of branch nodes and the total number of nodes on the entire plant includes: Determine the branch thickness correction value of the sub-branch according to the ratio of the number of branch nodes to the total number of nodes; The thickness of the branch of the sub-branch is determined according to the product of the preset branch thickness parameter and the branch thickness correction value.

10. The method according to claim 3, characterized in that The branch path includes a plurality of sub-branches, each of which is a branch between two adjacent nodes on the branch path. The generating of the branch model according to the thickness of the trunk of different branch paths includes: For each sub-branch, multiple sub-node vertices are uniformly selected on the plane where the sub-nodes of the sub-branch are located; A branch mesh corresponding to the child branch is generated according to a triangle formed by connecting the multiple child node vertices with the multiple parent node vertices, so as to generate a trunk model according to the branch meshes corresponding to different child branches.

11. The method according to claim 4, characterized in that The cross-insertion method is used to generate a preset number of blade models at the end of each branch path, including: For each leaf under each branch path, the Fibonacci spherical algorithm is used to determine the insertion direction of the leaf; A plurality of blade vertex positions are determined according to the insert direction, and a blade mesh is constructed based on the plurality of blade vertex positions, so as to generate a blade model of the blade using the blade mesh.

12. The method according to claim 11, characterized in that The method of using the Fibonacci spherical algorithm to determine the blade insertion direction includes: Using the Fibonacci sphere algorithm, multiple leaf surface normal directions of the leaf are determined; A blade surface vector is determined according to the multiple blade surface normal directions, and a blade direction is determined according to the blade surface vector.

13. The method according to claim 11, characterized in that The step of determining a plurality of blade vertex positions according to the blade insert direction comprises: The blade vertex position is determined according to the end node position of the branch path, the insert direction and the preset blade radius.

14. The method according to claim 6, characterized in that The step of determining the branch length corresponding to each child node to be generated in the current round of plant growth according to the preset basic length parameter includes: The value of the power function with the preset length decreasing parameter as the base and the child node depth as the exponent is used as the length correction value; The product of the preset basic length parameter and the length correction value is used as the branch length.

15. The method according to claim 6, characterized in that The subnodes include a trunk subnode and a branch subnode, and the branch growth direction includes a first branch direction corresponding to the trunk subnode and a second branch direction corresponding to the branch subnode; The step of determining the branch growth direction corresponding to each child node to be generated during the current round of plant growth according to the node direction of the current round of parent node includes: Determine whether the child node to be generated is a trunk child node or a branch child node based on the node depth of the parent node of this round; If it is determined to be a trunk subnode, determining a first branch direction corresponding to the trunk subnode to generate a trunk subnode according to the first branch direction; If it is determined to be a tree branch subnode, a second branch direction corresponding to the tree branch subnode is determined to generate a tree branch subnode according to the second branch direction.

16. The method according to claim 15, characterized in that The first branch direction and the second branch direction are determined by: The sum of the preset direction range parameter and the direction random parameter is used as the branch direction correction value; The sum of the node direction of the parent node of the current round and the branch direction correction value is used as the first branch direction; The sum of the preset direction range parameter, the direction random parameter and the branch direction rotation parameter is used as the branch direction correction value; The sum of the node direction of the parent node of this round and the branch direction correction value is used as the second branch direction.

17. The method according to claim 9, characterized in that After determining the branch thickness of the sub-branch according to the product of the preset branch thickness parameter and the branch thickness correction value, the method further includes: Determine whether the child node under the child branch is a root node; If it is a root node, the branch thickness is adjusted to use the adjusted branch thickness as the final branch thickness of the sub-branch.

18. The method according to claim 12, characterized in that The leaf surface vector includes a first leaf surface vector and a second leaf surface vector, and determining the leaf surface vector according to the plurality of leaf surface normal directions includes: Cross-product the multiple leaf surface normal directions in sequence to obtain multiple first leaf surface vectors; For each first blade surface vector, the first blade surface vector is cross-multiplied with the corresponding blade surface normal direction to obtain a second blade surface vector.

19. The method according to claim 12, characterized in that The step of determining the blade direction according to the blade surface vector comprises: A blade direction is selected in a plane corresponding to the blade surface vector, and the blade direction is multiplied by the blade surface vector to obtain a blade direction.

20. The method according to claim 13, characterized in that The blade vertex position includes a first blade vertex position and a second blade vertex position, and the determining of the blade vertex position according to the end node position of the branch path, the insert direction and the preset blade radius includes: Determining the product of the insert direction and the preset blade radius; Determining a first blade vertex position according to a sum of the terminal node position and the product; The second blade vertex position is determined according to the difference between the terminal node position and the product.

21. The method according to claim 7, characterized in that The determining whether the node satisfies the child node generation condition according to the number of child nodes existing in the current node, the node depth of the current node and the growth parameter includes: Determine whether the number of child nodes existing under the current node is less than the maximum number of child nodes that can grow from each node in the growth parameter, and whether the node depth of the current node is greater than a preset depth threshold and less than a maximum node depth; If the number of existing child nodes is less than the maximum number of child nodes that each node can grow, and the node depth of the current node is greater than a preset depth threshold and less than the maximum node depth, it is determined that the child node generation condition is met.

22. The method according to claim 7, characterized in that After generating multiple child nodes corresponding to the parent node of this round according to the branch growth information of this round, it also includes: Determine whether the number of child nodes generated in this round reaches the maximum number of nodes that can be grown in each round; If the number of child nodes generated in this round reaches the maximum number of nodes that can be grown in each round, the plant growth process in this round is terminated to update the node sequence based on all child nodes generated in this round.

23. A device for generating a plant rendering object, characterized in that: include: A path generation module, used to determine plant growth parameters, and perform multiple rounds of node step-by-step growth based on the plant growth parameters to obtain a plant growth path, wherein the plant growth parameters include a maximum node depth, a maximum number of nodes that can be grown in each round, and a maximum number of child nodes that can be grown from each node, and the plant growth path includes multiple branch paths, each of which includes multiple growth nodes; A branch model generation module, used to generate a branch model including branches of different thicknesses on the plant growth path according to the number of growth nodes on each branch path; The leaf model generation module is used to generate multiple leaf models at the end of each branch path of the branch model according to preset leaf generation rules, and to form a plant rendering object based on the branch model and the multiple leaf models.

24. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for generating a plant rendering object as described in any one of claims 1 to 22.

25. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for generating a plant rendering object according to any one of claims 1 to 22 are executed.