A processing method and device of a virtual plant model

CN115888087BActive Publication Date: 2026-10-09NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211595927.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-13
Publication Date
2026-10-09
Estimated Expiration
2042-12-13

AI Technical Summary

Technical Problem

[0002]在游戏场景中,可以通过部署虚拟植物来提升真实感,而在现有的游戏中,虚拟植物通常是静止的,也存在部分游戏中通过利用正弦函数对模型顶点进行简单地扰动、弯曲,以造成植物有风吹动的假象

Benefits of technology

[0033] In this embodiment of the invention, a virtual plant model is obtained, and the top of the virtual plant model is determined.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115888087B_ABST
    Figure CN115888087B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a kind of virtual plant model processing method and device, the method comprises: obtaining virtual plant model, and determining the pivot point information of vertex in virtual plant model;Determine the wind information in the virtual scene where virtual plant model is located;According to pivot point information and wind information, determine the rotation control information for vertex, and based on rotation control information, control vertex to move.By the embodiment of the present application, the wind movement effect of virtual plant model is simulated by combining pivot point and wind information, which can combine the structure of virtual plant model itself, enrich the wind movement effect of different kinds of virtual plant model, can also be linked with the environment in virtual scene, improve the sense of reality of virtual scene, and the required art editing is relatively simple, reduces the consumption of art manpower resources, the performance consumption caused in the process of operation is also smaller, can be run in mobile platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of game technology, and in particular to a method and apparatus for processing virtual plant models. Background Technology

[0002] In game scenarios, virtual plants can be deployed to enhance realism. However, in existing games, virtual plants are usually static. Some games also use sine functions to simply perturb and bend the model vertices to create the illusion that the plants are being blown by the wind.

[0003] However, this method can only simulate the effect of branch and leaf disturbance, which is relatively simple and not realistic enough. In addition, when there are a large number of different types of plants, this method will consume a lot of art resources and cause performance problems during operation, making it difficult to run on mobile platforms. Summary of the Invention

[0004] In view of the above problems, a method and apparatus for processing virtual plant models are proposed to overcome or at least partially solve the above problems, comprising:

[0005] A method for processing virtual plant models, the method comprising:

[0006] Obtain the virtual plant model and determine the pivot point information of the vertices in the virtual plant model;

[0007] Determine the wind information of the virtual scene in which the virtual plant model is located;

[0008] Based on pivot point information and wind information, rotation control information for the vertex is determined, and the vertex is moved based on the rotation control information.

[0009] Optionally, the virtual plant model includes multiple sub-elements split into levels, with pivot points set at the junctions of sub-elements at different levels.

[0010] Optionally, based on pivot point information and wind information, rotation control information for the vertex is determined, including:

[0011] Based on the pivot point information and wind force information, determine the rotation axis and rotation angle information;

[0012] Based on the rotation axis and rotation angle information, the rotation control information for the vertex is determined.

[0013] Optionally, the pivot point information includes the pivot point's location information, and the wind force information includes wind force information. Based on the pivot point information and the wind force information, the rotation axis and rotation angle information are determined, including:

[0014] Based on the position information of the pivot point, determine its distance information from the vertex;

[0015] By combining distance information and wind speed information, the rotation angle information is determined.

[0016] Optionally, the pivot point information includes the axial information of the pivot point, and the wind force information includes the wind direction information. Based on the pivot point information and the wind force information, the rotation axis and rotation angle information are determined, including:

[0017] The rotation axis information is determined based on the axial direction information and the wind direction information.

[0018] Optionally, the axial information of the pivot point is consistent with the orientation information of the child element where the vertex is located.

[0019] Optionally, determine the pivot point information of the vertices in the virtual plant model, including:

[0020] Obtain the connection relationships between multiple sub-elements, and determine the index information between vertices and pivot points in the virtual plant model based on the connection relationships between multiple sub-elements;

[0021] Based on the index information, determine the pivot point corresponding to the vertex in the virtual plant model, and determine the pivot point information corresponding to the pivot point from the pivot point information set.

[0022] Optionally, the pivot point information set is stored in the pivot point texture.

[0023] Optionally, multiple sub-elements split according to hierarchy include:

[0024] Main stem elements, branch elements, leaf elements.

[0025] Optionally, a leaf element is a set consisting of multiple leaf elements.

[0026] A processing device for a virtual plant model, the device comprising:

[0027] The pivot point information determination module is used to acquire the virtual plant model and determine the pivot point information of the vertices in the virtual plant model;

[0028] The wind information determination module is used to determine the wind information in the virtual scene where the virtual plant model is located;

[0029] The vertex movement control module is used to determine the rotation control information for the vertex based on the pivot point information and wind information, and to control the vertex to move based on the rotation control information.

[0030] An electronic device includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the processing method for the virtual plant model as described above.

[0031] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the processing method for the virtual plant model as described above.

[0032] The embodiments of the present invention have the following advantages:

[0033] In this embodiment of the invention, a virtual plant model is obtained, and the top of the virtual plant model is determined.

[0034] The pivot point information of the points is used to determine the wind information in the virtual scene where the virtual plant model is located. Then, based on the pivot point information and wind information, the rotation control information for the vertices is determined, and the rotation control information is used to determine the rotation control information.

[0035] This system controls the movement of vertices, combining pivot points and wind information to simulate the wind effects of virtual plant models. It not only incorporates the structure of the virtual plant models themselves, enriching the wind effects of different types of virtual plants, but also interacts with environmental conditions within the virtual scene, enhancing the overall effect of the virtual environment.

[0036] It offers a high degree of realism and requires relatively simple art editing, reducing the consumption of art human resources. It also consumes less performance during operation and can run on mobile platforms. Attached Figure Description

[0037] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are merely illustrative of the present invention.

[0038] In some embodiments, other drawings can be obtained from these drawings by those skilled in the art without any creative effort.

[0039] Figure 1 This is a flowchart of the steps of a virtual plant model processing method provided in an embodiment of the present invention;

[0040] Figure 2a This is a schematic diagram of a virtual plant model provided in an embodiment of the present invention;

[0041] Figure 2b This is a schematic diagram of another virtual plant model provided in an embodiment of the present invention;

[0042] Figure 3This is a flowchart of the steps of another virtual plant model processing method provided in an embodiment of the present invention;

[0043] Figure 4 This is a flowchart of the steps of another virtual plant model processing method provided in an embodiment of the present invention;

[0044] Figure 5 Figure 5 shows a structural block diagram of a virtual plant model processing device according to an embodiment of the present invention;

[0045] Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of the present invention;

[0046] Figure 7 This is a schematic diagram of a computer-readable storage medium provided in an embodiment of the present invention. Detailed Implementation

[0047] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0048] Reference Figure 1 The diagram illustrates a flowchart of a method for processing a virtual plant model according to an embodiment of the present invention, which can be applied to game applications that can run on mobile platforms.

[0049] Specifically, it may include the following steps:

[0050] Step 101: Obtain the virtual plant model and determine the pivot point information of the vertices in the virtual plant model.

[0051] As an example, a virtual plant model can be a plant model in a virtual scene, such as a tree or grass model in a game scene, and it can be a 3D model.

[0052] When rendering a virtual scene, such as using VS (Vertex Shader), a pre-built virtual plant model can be obtained. The virtual plant model can include multiple sub-elements split into layers, and each sub-element can include one or more vertices.

[0053] Among them, VS is a processing unit that adds various special effects to 3D scenes. The programmable nature of the vertex shader engine allows developers to adjust various special effects by loading new software instructions. Each vertex will be clearly defined by various data variables, including at least the x, y, and z coordinates of each vertex. The data that each vertex may contain includes color, initial path, material, lighting characteristics, etc.

[0054] As an example, multiple child elements split hierarchically can include:

[0055] Main stem elements, branch elements, leaf elements.

[0056] Specifically, the virtual plant model can be divided into multiple sub-elements according to hierarchy, and each sub-element has its own hierarchy, such as... Figure 2a The virtual plant model is divided into layers such as trunk, branches (which can include different levels, such as first-level branches, second-level branches, ... N-level branches), and leaves. According to the plant's own structure, lower-level sub-elements are connected to upper-level sub-elements, such as leaf elements being connected to branch elements or trunk elements, and branch elements being connected to trunk elements.

[0057] In one embodiment of the present invention, a blade element can be a set composed of multiple blade elements. Specifically, given the large number of blade elements, to save resources, multiple blade elements can be grouped according to the parent sub-elements they are connected to (blank elements connected to the same parent sub-element belong to the same group), and the blade elements in the same group are treated as a set, such as... Figure 2a By grouping the blades together and controlling the whole group as a single blade element, the sense of clustering of the blade elements during movement can be enhanced, and resources can be saved by eliminating the need to process each blade element individually.

[0058] To improve the rendering effect of the virtual plant model and ensure that the rendering effect can be combined with the structure of the virtual plant model itself, for each vertex in the virtual plant model, its corresponding pivot point can be determined, and the pivot point information of its corresponding pivot point can be obtained.

[0059] A pivot point is a specific location in 3D space that serves as a reference for object transformation. All objects have a pivot point, through which you can control how an object translates, rotates, and scales. The pivot point also represents the object's precise position in space, and all transformations of an object are relative to the pivot point.

[0060] The pivot point information may include the pivot point's position and axial information.

[0061] In one embodiment of the present invention, the pivot point can be set at the junction of different level sub-elements, that is, the pivot point is set at the junction of the upper level sub-element and the lower level sub-element.

[0062] like Figure 2a A pivot point A1 can be set at the junction of the trunk and the root; a pivot point A2 can be set at the junction of the trunk and branch 1; a pivot point A3 can be set at the junction of branch 1 and branch 2; and a pivot point A4 can be set between branch 2 and the leaf cluster.

[0063] Based on this, for each vertex in the virtual plant model, its sub-element can be determined, and then the pivot point located at the intersection of its sub-element and the upper-level sub-element can be determined.

[0064] In one embodiment of the present invention, the axis of the pivot point can be consistent with the orientation of the sub-element where the vertex is located. Specifically, for each pivot point, a three-dimensional coordinate system can be established with the pivot point as the origin, and the axis of the X-axis in the three-dimensional coordinate system (i.e., the axis of the pivot point) can be bound to the orientation of the sub-element connected to the pivot point. This ensures that the axis of the pivot point is consistent with the orientation of the sub-element connected to the pivot point, which facilitates subsequent adjustment of the wind effect of the sub-element based on the pivot point.

[0065] The orientation of the child element can be a direction that originates from the pivot point and extends along the child element, such as... Figure 2b Establish a three-dimensional coordinate system for pivot point A2, and adjust the orientation of the X-axis in the three-dimensional coordinate system to be consistent with the orientation of branch 1, that is, consistent with the outward extension direction of branch 1.

[0066] For example, a pivot point can be set between the trunk element and the branch element, and the axis of the pivot point can be aligned with the axis of the branch element. Similarly, a pivot point can be set between the branch element and the leaf element, and the axis of the pivot point can be aligned with the axis of the leaf element.

[0067] In one embodiment of the present invention, determining the pivot point information of a vertex in a virtual plant model includes:

[0068] Sub-step 11: Obtain and determine the connection relationship between multiple sub-elements, and determine the index information between vertices and pivot points in the virtual plant model based on the connection relationship between multiple sub-elements.

[0069] For child elements at different levels, lower-level child elements are interconnected with upper-level child elements, such as leaf elements connecting to branch elements or trunk elements, and branch elements connecting to trunk elements. To achieve a better chain reaction of swaying in the wind, connections can be established between child elements at different levels based on the virtual plant model's own structure using 3D modeling, rendering, and production software. These connections can be parent-child relationships, and the connections between child elements can be stored. This ensures that in the virtual plant model, leaf elements sway with branch elements, and branch elements sway with trunk elements.

[0070] Specifically, the connection relationships of the child elements of each vertex can be stored in the vertex information, representing which branches will affect the vertex, so that the corresponding pivot point information can be indexed later.

[0071] Based on this, the connection relationships between multiple stored child elements can be obtained and placed in a common cache during rendering to provide to the VS. For example, the relevant data of the connection relationship can be placed in UniformBuffer. UniformBuffer is a common cache that can store a large amount of matrix, vector data, etc. that need to be passed to multiple shaders, thereby reducing the amount of code and reducing the amount of data transferred from the CPU to the GPU.

[0072] After determining the connection relationships, index information can be established between vertices and pivot points in the virtual plant model based on the connection relationships between multiple sub-elements. All vertices in the same sub-element can be indexed to the same pivot point. Specifically, based on the connection relationships between multiple sub-elements, the structure of the entire virtual plant model can be determined, and the upper and lower sub-elements connected to each pivot point can be identified. For all vertices contained in a lower-level sub-element, an index relationship between it and that pivot point can be established.

[0073] Sub-step 12: Based on the index information, determine the pivot point corresponding to the vertex in the virtual plant model, and determine the pivot point information corresponding to the pivot point from the pivot point information set.

[0074] For each pivot point, pivot point information can be determined based on its location and axis. Pivot point information can include the pivot point's location information and axis information, and the pivot point information of all pivot points can be stored as a pivot point information set.

[0075] In one embodiment of the present invention, the pivot point information set can be stored in the pivot point texture, which can be a UV texture. It can include a position information texture for the position information of the pivot point and an orientation information texture for the orientation information of the pivot point. During rendering, the information is obtained by sampling the texture, so that the wind effect of the virtual plant model can be optimized by adding only one UV texture, thereby improving efficiency.

[0076] Specifically, the position and axial information of the pivot point can be processed to generate color block information. Then, based on the color block information, a corresponding texture can be generated. A material ball can then be created based on the texture and exist in the engine along with the virtual plant model.

[0077] For vertices in a virtual plant model, the corresponding pivot point can be determined based on the index information, and then the pivot point information corresponding to that pivot point can be determined from the pre-stored pivot point information set.

[0078] In one example, since different engines have different coordinate systems, the stored pivot point information can be converted and used according to the engine's coordinate system.

[0079] Step 102: Determine the wind information in the virtual scene where the virtual plant model is located.

[0080] In order to link with the environmental conditions in the virtual scene, the wind information in the virtual scene where the virtual plant model is located can be determined. The wind information can include wind strength and wind direction.

[0081] In one example, by obtaining a wind map, the UV coordinates of the current time point in the wind map can be calculated, and the corresponding wind information can be obtained from the wind map.

[0082] Step 103: Based on the pivot point information and wind information, determine the rotation control information for the vertex, and control the vertex to move based on the rotation control information.

[0083] For a given vertex, the impact of wind on it is related not only to the magnitude and direction of the wind, but also to its specific position and structure in the virtual plant model. The specific position and structure of a vertex in the virtual plant model can be characterized by the pivot point information of its corresponding pivot point.

[0084] Based on this, after obtaining wind information, the pivot point information of the corresponding pivot point of the vertex and the current wind information can be combined to calculate the rotation control information for the vertex. Then, the vertex can be moved to the target position according to the rotation control information.

[0085] In this embodiment of the invention, pivot point information is combined with the structure of the virtual plant model, and wind information is used to link with the environmental conditions in the virtual scene, reflecting wind intensity and direction, thereby creating the effect of branches swaying in the wind.

[0086] In one example, after a vertex is moved, its normal information can be modified accordingly.

[0087] In one embodiment of the present invention, determining rotation control information for the vertex based on pivot point information and wind force information may include:

[0088] Sub-step 21: Determine the rotation axis and rotation angle information based on the pivot point information and wind force information.

[0089] In practice, the rotation axis and rotation angle information used to control the movement of the vertex can be calculated based on the pivot point information and wind force information. The rotation axis has the pivot point as its origin.

[0090] In one embodiment of the present invention, the pivot point information may include the position information of the pivot point, and the wind force information may include wind force magnitude information. Determining the rotation axis and rotation angle information based on the pivot point information and the wind force information may include:

[0091] Sub-step 211: Determine the distance information between the pivot point and the vertex based on the pivot point's position information.

[0092] Each pivot point can be set at the intersection of the upper and lower child elements. Multiple vertices in the lower child element can correspond to the same pivot point. Since the distance between the vertices and the pivot point in the same lower child element is different, the wind force affects each vertex differently.

[0093] For example, for branches connected to the main trunk, the pivot point is set at the junction of the main trunk and the branch. The part of the branch closer to the pivot point is closer to the main trunk, receives greater traction from the main trunk, and is less affected by wind. Conversely, the part of the branch farther from the pivot point is farther from the main trunk, receives less traction from the main trunk, and is more affected by wind.

[0094] Based on this, the distance information between the vertex and the pivot point can be determined.

[0095] Sub-step 212: Combine distance information and wind force information to determine the rotation angle information.

[0096] After obtaining the distance information, the distance information and wind force information can be combined to calculate and determine the rotation angle information relative to the vertex.

[0097] In one embodiment of the present invention, the pivot point information includes the axial information of the pivot point, which is consistent with the orientation information of the sub-element where the vertex is located. The wind information includes wind direction information. Therefore, determining the rotation axis and rotation angle information based on the pivot point information and the wind information may include:

[0098] Sub-step 213: Determine the rotation axis information based on the axial information and wind direction information.

[0099] Since the axial information of the pivot point is consistent with the orientation information of the sub-element where the vertex is located, it can represent the orientation of the sub-element where the vertex is located, such as the orientation of the branch element. For sub-elements affected by wind, the axial information and the wind direction information can be cross-producted to obtain the rotation axis information.

[0100] Sub-step 22: Based on the rotation axis and rotation angle information, determine the rotation control information for the vertex.

[0101] After obtaining the rotation axis and rotation angle information, rotation control information can be generated based on the rotation axis and rotation angle information. For example, the rotation control information can be a quaternion describing the rotation.

[0102] Quaternions are a means of describing rotation, consisting of two elements: the axis of rotation and the angle of rotation. They are used to represent a rotation around the axis of rotation by a specific angle.

[0103] In this embodiment of the invention, by acquiring a virtual plant model and determining the pivot point information of the vertices in the virtual plant model, the wind information in the virtual scene where the virtual plant model is located is determined. Then, based on the pivot point information and the wind information, rotation control information for the vertices is determined, and the vertices are moved based on the rotation control information. This achieves the simulation of the wind effect of the virtual plant model by combining the pivot point and wind information. It can not only combine the structure of the virtual plant model itself to enrich the wind effect of different types of virtual plant models, but also link with the environmental conditions in the virtual scene, thereby improving the realism of the virtual scene. Moreover, the required art editing is relatively simple, reducing the consumption of art human resources. The performance consumption during operation is also small, and it can run on mobile platforms (on mobile platforms, it has almost no impact on the frame rate and the power consumption is less than 40mA).

[0104] Reference Figure 3 The diagram illustrates a flowchart of another method for processing a virtual plant model according to an embodiment of the present invention, which may specifically include the following steps:

[0105] Step 301: Obtain the virtual plant model and determine the pivot point information of the vertices in the virtual plant model; wherein, the pivot point information includes the position information and axial information of the pivot point.

[0106] When rendering a virtual scene, such as using VS (Vertex Shader), a pre-built virtual plant model can be obtained. The virtual plant model can include multiple sub-elements split into layers, and each sub-element can include one or more vertices.

[0107] To improve the rendering effect of the virtual plant model and ensure that the rendering effect can be combined with the structure of the virtual plant model itself, for each vertex in the virtual plant model, its corresponding pivot point can be determined, and the pivot point information of its corresponding pivot point can be obtained.

[0108] In one embodiment of the present invention, the pivot point can be set at the junction of different level sub-elements, that is, the pivot point is set at the junction of the upper level sub-element and the lower level sub-element.

[0109] like Figure 2a A pivot point A1 can be set at the junction of the trunk and the root; a pivot point A2 can be set at the junction of the trunk and branch 1; a pivot point A3 can be set at the junction of branch 1 and branch 2; and a pivot point A4 can be set between branch 2 and the leaf cluster.

[0110] Based on this, for each vertex in the virtual plant model, its sub-element can be determined, and then the pivot point located at the intersection of its sub-element and the upper-level sub-element can be determined.

[0111] In one embodiment of the present invention, the axis of the pivot point can be consistent with the orientation of the sub-element where the vertex is located. Specifically, for each pivot point, a three-dimensional coordinate system can be established with the pivot point as the origin, and the axis of the X-axis in the three-dimensional coordinate system (i.e., the axis of the pivot point) can be bound to the orientation of the sub-element connected to the pivot point. This ensures that the axis of the pivot point is consistent with the orientation of the sub-element connected to the pivot point, which facilitates subsequent adjustment of the wind effect of the sub-element based on the pivot point.

[0112] The orientation of the child element can be a direction that originates from the pivot point and extends along the child element, such as... Figure 2b Establish a three-dimensional coordinate system for pivot point A2, and adjust the orientation of the X-axis in the three-dimensional coordinate system to be consistent with the orientation of branch 1, that is, consistent with the outward extension direction of branch 1.

[0113] For example, a pivot point can be set between the trunk element and the branch element, and the axis of the pivot point can be aligned with the axis of the branch element. Similarly, a pivot point can be set between the branch element and the leaf element, and the axis of the pivot point can be aligned with the axis of the leaf element.

[0114] Step 302: Determine the wind information in the virtual scene where the virtual plant model is located; wherein, the wind information includes wind magnitude information and wind direction information.

[0115] In order to link with the environmental conditions in the virtual scene, the wind information in the virtual scene where the virtual plant model is located can be determined. The wind information can include wind strength and wind direction.

[0116] In one example, by obtaining a wind map, the UV coordinates of the current time point in the wind map can be calculated, and the corresponding wind information can be obtained from the wind map.

[0117] Step 303: Based on the position information of the pivot point, determine the distance information between it and the vertex, and combine the distance information and wind force information to determine the rotation angle information.

[0118] Each pivot point can be set at the intersection of the upper and lower child elements. Multiple vertices in the lower child element can correspond to the same pivot point. Since the distance between the vertices and the pivot point in the same lower child element is different, the wind force affects each vertex differently.

[0119] For example, for branches connected to the main trunk, the pivot point is set at the junction of the main trunk and the branch. The part of the branch closer to the pivot point is closer to the main trunk, receives greater traction from the main trunk, and is less affected by wind. Conversely, the part of the branch farther from the pivot point is farther from the main trunk, receives less traction from the main trunk, and is more affected by wind.

[0120] Based on this, the distance information between the vertex and the pivot point can be determined. Then, by combining the distance information and the wind force information, the rotation angle information relative to the vertex can be calculated.

[0121] Step 304: Determine the rotation axis information based on the axial information and wind direction information.

[0122] Since the axial information of the pivot point is consistent with the orientation information of the sub-element where the vertex is located, it can represent the orientation of the sub-element where the vertex is located, such as the orientation of the branch element. For sub-elements affected by wind, the axial information and the wind direction information can be cross-producted to obtain the rotation axis information.

[0123] Step 305: Based on the rotation axis and rotation angle information, determine the rotation control information for the vertex, and control the vertex to move based on the rotation control information.

[0124] After obtaining the rotation axis and rotation angle information, rotation control information can be generated based on the rotation axis and rotation angle information. For example, the rotation control information can be a quaternion describing the rotation.

[0125] Reference Figure 4The diagram illustrates a flowchart of another method for processing a virtual plant model according to an embodiment of the present invention, which may specifically include the following steps:

[0126] Step 401: Obtain a virtual plant model; wherein the virtual plant model includes multiple sub-elements split into levels, and the pivot point is set at the intersection of different level sub-elements.

[0127] When rendering a virtual scene, such as using VS (Vertex Shader), a pre-built virtual plant model can be obtained. The virtual plant model can include multiple sub-elements split into layers, and each sub-element can include one or more vertices.

[0128] In one embodiment of the present invention, the pivot point can be set at the junction of different level sub-elements, that is, the pivot point is set at the junction of the upper level sub-element and the lower level sub-element.

[0129] like Figure 2a A pivot point A1 can be set at the junction of the trunk and the root; a pivot point A2 can be set at the junction of the trunk and branch 1; a pivot point A3 can be set at the junction of branch 1 and branch 2; and a pivot point A4 can be set between branch 2 and the leaf cluster.

[0130] Based on this, for each vertex in the virtual plant model, its sub-element can be determined, and then the pivot point located at the intersection of its sub-element and the upper-level sub-element can be determined.

[0131] In one embodiment of the present invention, the axis of the pivot point can be consistent with the orientation of the sub-element where the vertex is located. Specifically, for each pivot point, a three-dimensional coordinate system can be established with the pivot point as the origin, and the axis of the X-axis in the three-dimensional coordinate system (i.e., the axis of the pivot point) can be bound to the orientation of the sub-element connected to the pivot point. This ensures that the axis of the pivot point is consistent with the orientation of the sub-element connected to the pivot point, which facilitates subsequent adjustment of the wind effect of the sub-element based on the pivot point.

[0132] The orientation of the child element can be a direction that originates from the pivot point and extends along the child element, such as... Figure 2b Establish a three-dimensional coordinate system for pivot point A2, and adjust the orientation of the X-axis in the three-dimensional coordinate system to be consistent with the orientation of branch 1, that is, consistent with the outward extension direction of branch 1.

[0133] For example, a pivot point can be set between the trunk element and the branch element, and the axis of the pivot point can be aligned with the axis of the branch element. Similarly, a pivot point can be set between the branch element and the leaf element, and the axis of the pivot point can be aligned with the axis of the leaf element.

[0134] Step 402: Obtain and determine the connection relationship between multiple sub-elements, and determine the index information between vertices and pivot points in the virtual plant model based on the connection relationship between multiple sub-elements.

[0135] For child elements at different levels, lower-level child elements are interconnected with upper-level child elements, such as leaf elements connecting to branch elements or trunk elements, and branch elements connecting to trunk elements. To achieve a better chain reaction of swaying in the wind, connections can be established between child elements at different levels based on the virtual plant model's own structure using 3D modeling, rendering, and production software. These connections can be parent-child relationships, and the connections between child elements can be stored. This ensures that in the virtual plant model, leaf elements sway with branch elements, and branch elements sway with trunk elements.

[0136] Specifically, the connection relationships of the child elements of each vertex can be stored in the vertex information, representing which branches will affect the vertex, so that the corresponding pivot point information can be indexed later.

[0137] Based on this, the connection relationships between multiple stored child elements can be obtained and placed in a common cache during rendering to provide to the VS. For example, the relevant data of the connection relationship can be placed in UniformBuffer. UniformBuffer is a common cache that can store a large amount of matrix, vector data, etc. that need to be passed to multiple shaders, thereby reducing the amount of code and reducing the amount of data transferred from the CPU to the GPU.

[0138] After determining the connection relationships, index information can be established between vertices and pivot points in the virtual plant model based on the connection relationships between multiple sub-elements. All vertices in the same sub-element can be indexed to the same pivot point. Specifically, based on the connection relationships between multiple sub-elements, the structure of the entire virtual plant model can be determined, and the upper and lower sub-elements connected to each pivot point can be identified. For all vertices contained in a lower-level sub-element, an index relationship between it and that pivot point can be established.

[0139] Step 403: Based on the index information, determine the pivot point corresponding to the vertex in the virtual plant model, and determine the pivot point information corresponding to the pivot point from the pivot point information set.

[0140] For each pivot point, pivot point information can be determined based on its location and axis. Pivot point information can include the pivot point's location information and axis information, and the pivot point information of all pivot points can be stored as a pivot point information set.

[0141] In one embodiment of the present invention, the pivot point information set can be stored in the pivot point texture, which can be a UV texture. It can include a position information texture for the position information of the pivot point and an orientation information texture for the orientation information of the pivot point. During rendering, the information is obtained by sampling the texture, so that the wind effect of the virtual plant model can be optimized by adding only one UV texture, thereby improving efficiency.

[0142] Specifically, the position and axial information of the pivot point can be processed to generate color block information. Then, based on the color block information, a corresponding texture can be generated. A material ball can then be created based on the texture and exist in the engine along with the virtual plant model.

[0143] For vertices in a virtual plant model, the corresponding pivot point can be determined based on the index information, and then the pivot point information corresponding to that pivot point can be determined from the pre-stored pivot point information set.

[0144] In one example, since different engines have different coordinate systems, the stored pivot point information can be converted and used according to the engine's coordinate system.

[0145] Step 404: Determine the wind information in the virtual scene where the virtual plant model is located.

[0146] In order to link with the environmental conditions in the virtual scene, the wind information in the virtual scene where the virtual plant model is located can be determined. The wind information can include wind strength and wind direction.

[0147] In one example, by obtaining a wind map, the UV coordinates of the current time point in the wind map can be calculated, and the corresponding wind information can be obtained from the wind map.

[0148] Step 405: Based on the pivot point information and wind information, determine the rotation control information for the vertex, and control the vertex to move based on the rotation control information.

[0149] For a given vertex, the impact of wind on it is related not only to the magnitude and direction of the wind, but also to its specific position and structure in the virtual plant model. The specific position and structure of a vertex in the virtual plant model can be characterized by the pivot point information of its corresponding pivot point.

[0150] Based on this, after obtaining wind information, the pivot point information of the corresponding pivot point of the vertex and the current wind information can be combined to calculate the rotation control information for the vertex. Then, the vertex can be moved to the target position according to the rotation control information.

[0151] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0152] Reference Figure 5 The diagram shows a structural schematic of a processing device for a virtual plant model according to an embodiment of the present invention, which may specifically include the following modules:

[0153] The pivot point information determination module 501 is used to acquire the virtual plant model and determine the pivot point information of the vertices in the virtual plant model.

[0154] The wind information determination module 502 is used to determine the wind information in the virtual scene where the virtual plant model is located.

[0155] The vertex movement control module 503 is used to determine the rotation control information for the vertex based on the pivot point information and wind information, and to control the vertex to move based on the rotation control information.

[0156] In one embodiment of the present invention, the virtual plant model includes multiple sub-elements split into levels, with a pivot point set at the junction of different levels of sub-elements.

[0157] In one embodiment of the present invention, the vertex movement control module 503 includes:

[0158] The rotation axis and rotation angle determination submodule is used to determine the rotation axis and rotation angle information based on pivot point information and wind force information.

[0159] The rotation control information determination submodule is used to determine the rotation control information for a vertex based on the rotation axis and rotation angle information.

[0160] In one embodiment of the present invention, the pivot point information includes the position information of the pivot point, the wind force information includes the wind force magnitude information, and the rotation axis and rotation angle determination submodule includes:

[0161] The distance information determination unit is used to determine the distance information between the pivot point and the vertex based on the position information of the pivot point.

[0162] The rotation angle determination unit is used to determine the rotation angle information by combining distance information and wind force information.

[0163] In one embodiment of the present invention, the pivot point information includes the axial information of the pivot point, the wind force information includes the wind direction information, and the rotation axis and rotation angle determination submodule includes:

[0164] The rotation axis information determination unit is used to determine the rotation axis information based on the axial direction information and the wind direction information.

[0165] In one embodiment of the present invention, the axial information of the pivot point is consistent with the orientation information of the sub-element where the vertex is located.

[0166] In one embodiment of the present invention, the pivot point information determination module 501 includes:

[0167] The index information determination submodule is used to obtain and determine the connection relationship between multiple sub-elements, and to determine the index information between vertices and pivot points in the virtual plant model based on the connection relationship between multiple sub-elements.

[0168] The submodule for determining pivot point information based on index is used to determine the pivot point corresponding to the vertex in the virtual plant model based on the index information, and to determine the pivot point information corresponding to the pivot point from the pivot point information set.

[0169] In one embodiment of the present invention, the pivot point information set is stored in the pivot point texture.

[0170] In one embodiment of the present invention, the multiple sub-elements split according to hierarchy include:

[0171] Main stem elements, branch elements, leaf elements.

[0172] In one embodiment of the present invention, the blade element is a set composed of multiple blade elements.

[0173] In this embodiment of the invention, by acquiring a virtual plant model and determining the pivot point information of the vertices in the virtual plant model, the wind information in the virtual scene where the virtual plant model is located is determined. Then, based on the pivot point information and the wind information, rotation control information for the vertices is determined, and the vertices are controlled to move based on the rotation control information. This achieves the simulation of the wind effect of the virtual plant model by combining the pivot point and wind information. It can not only combine the structure of the virtual plant model itself to enrich the wind effect of different types of virtual plant models, but also link with the environmental conditions in the virtual scene, thereby improving the realism of the virtual scene. Moreover, the required art editing is relatively simple, reducing the consumption of art human resources. The performance consumption caused during operation is also small, and it can run on mobile platforms.

[0174] refer to Figure 6An embodiment of the present invention also provides an electronic device, which may include a processor 601, a memory 602, and a computer program stored in the memory 602 and capable of running on the processor. When the computer program is executed by the processor, it implements the above-described processing method for the virtual plant model.

[0175] refer to Figure 7 An embodiment of the present invention also provides a computer-readable storage medium 700, on which a computer program is stored, and when the computer program is executed by a processor, it implements the processing method of the virtual plant model as described above.

[0176] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0177] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0178] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0179] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0180] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0181] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0182] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore,

[0183] The appended claims are intended to be interpreted as including the preferred embodiments as well as all variations and modifications that fall within the scope of the embodiments of the present invention.

[0184] Finally, it should be noted that in this paper, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the term...

[0185] The terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitation, an element defined by the phrase “comprising one…” does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes the aforementioned element.

[0186] The above 5 sections provide a detailed description of the processing method and apparatus for a virtual plant model.

[0187] In this paper, specific examples are used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for processing virtual plant models, characterized in that, The method includes: A virtual plant model is obtained, and the pivot point information of the vertices in the virtual plant model is determined; wherein, the virtual plant model includes multiple sub-elements split into layers, and each sub-element includes one or more vertices; the pivot point is set at the intersection of different layers of sub-elements; the multiple sub-elements split into layers include: trunk elements, branches elements, and leaf elements; Determine the wind information in the virtual scene where the virtual plant model is located; Based on the pivot point information and the wind force information, rotation control information for the vertex is determined, and the vertex is controlled to move based on the rotation control information; Determining the pivot point information of the vertices in the virtual plant model includes: Obtain vertex information for each vertex, determine the connection relationships between the multiple sub-elements, and determine the index information between vertices and pivot points in the virtual plant model based on the connection relationships between the multiple sub-elements; Based on the index information, determine the pivot point corresponding to the vertex in the virtual plant model, and determine the pivot point information corresponding to the pivot point from the pivot point information set; The step of determining the rotation control information for the vertex based on the pivot point information and the wind force information includes: determining the rotation axis and rotation angle information based on the pivot point information and the wind force information; Based on the rotation axis and rotation angle information, rotation control information for the vertex is determined; The pivot point information includes the pivot point's position information, and the wind force information includes wind force magnitude information. Determining the rotation axis and rotation angle information based on the pivot point information and the wind force information includes: Based on the position information of the pivot point, determine the distance information between it and the vertex; By combining the distance information and the wind force information, the rotation angle information is determined; The pivot point information includes the axial information of the pivot point, and the wind force information includes wind direction information. Determining the rotation axis and rotation angle information based on the pivot point information and the wind force information includes: The rotation axis information is determined based on the axial information and the wind direction information; The axial information of the pivot point is consistent with the orientation information of the sub-element where the vertex is located; the pivot point information set is stored in the pivot point texture, and the pivot point texture is used to obtain the pivot point information by sampling the pivot point texture during rendering.

2. The method according to claim 1, characterized in that, The blade element is a set composed of multiple blade elements.

3. A processing device for a virtual plant model, characterized in that, The device includes: A pivot point information determination module is used to acquire a virtual plant model and determine the pivot point information of the vertices in the virtual plant model; wherein, the virtual plant model includes multiple sub-elements split into layers, each sub-element including one or more vertices; the pivot point is set at the intersection of different layers of sub-elements; the multiple sub-elements split into layers include: trunk elements, branch elements, and leaf elements; The wind information determination module is used to determine the wind information in the virtual scene where the virtual plant model is located; A vertex movement control module is used to determine rotation control information for the vertex based on the pivot point information and the wind information, and to control the vertex to move based on the rotation control information; The index information determination submodule is used to obtain the vertex information of each vertex, determine the connection relationship between multiple sub-elements, and determine the index information between vertices and pivot points in the virtual plant model based on the connection relationship between multiple sub-elements. The submodule for determining pivot point information based on index is used to determine the pivot point corresponding to the vertex in the virtual plant model based on the index information, and to determine the pivot point information corresponding to the pivot point from the pivot point information set; The vertex movement control module includes: The rotation axis and rotation angle determination submodule is used to determine the rotation axis and rotation angle information based on the pivot point information and the wind force information; The rotation control information determination submodule is used to determine the rotation control information for the vertex based on the rotation axis and rotation angle information. The pivot point information includes the pivot point's position information; the wind force information includes wind force magnitude information; and the rotation axis and rotation angle determination submodule includes: The distance information determination unit is used to determine the distance information between the pivot point and the vertex based on the position information of the pivot point; A rotation angle determination unit is used to determine rotation angle information by combining the distance information and the wind force information; The pivot point information includes the axial information of the pivot point, the wind force information includes wind direction information, and the rotation axis and rotation angle determination submodule includes: A rotation axis information determination unit is used to determine rotation axis information based on the axial direction information and the wind direction information. The axial information of the pivot point is consistent with the orientation information of the sub-element where the vertex is located; the pivot point information set is stored in the pivot point texture, and the pivot point texture is used to obtain the pivot point information by sampling the pivot point texture during rendering.

4. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the processing method for the virtual plant model as described in any one of claims 1 to 2.

5. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the processing method for the virtual plant model as described in any one of claims 1 to 2.