CN117011436A - Animation generation method and device for virtual plants and electronic equipment - Google Patents

Animation generation method and device for virtual plants and electronic equipment Download PDF

Info

Publication number
CN117011436A
CN117011436A CN202311023564.2A CN202311023564A CN117011436A CN 117011436 A CN117011436 A CN 117011436A CN 202311023564 A CN202311023564 A CN 202311023564A CN 117011436 A CN117011436 A CN 117011436A
Authority
CN
China
Prior art keywords
plant
individual model
virtual
plant individual
coordinate information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311023564.2A
Other languages
Chinese (zh)
Inventor
程俊
陈炫烨
张帅波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
GD Midea Heating and Ventilating Equipment Co Ltd
Shanghai Meikong Smartt Building Co Ltd
Original Assignee
GD Midea Heating and Ventilating Equipment Co Ltd
Shanghai Meikong Smartt Building Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by GD Midea Heating and Ventilating Equipment Co Ltd, Shanghai Meikong Smartt Building Co Ltd filed Critical GD Midea Heating and Ventilating Equipment Co Ltd
Priority to CN202311023564.2A priority Critical patent/CN117011436A/en
Publication of CN117011436A publication Critical patent/CN117011436A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • G06T13/603D [Three Dimensional] animation of natural phenomena, e.g. rain, snow, water or plants
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/506Illumination models

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application discloses an animation generation method and device of a virtual plant and electronic equipment, and belongs to the technical field of image processing. The method comprises the following steps: creating at least one plant individual model; creating a virtual plant cluster based on the at least one plant individual model; and controlling the growth state of the plant individual model based on first UV coordinate information of the plant individual model in the virtual plant cluster, and displaying the growth state in an animation form on a display interface, wherein the first UV coordinate information is coordinate information representing the texture distribution of the plant individual model. According to the method, the plant individual model of the single virtual plant is constructed, the virtual plant cluster is created, the control of the plant growth effect is realized in the virtual plant cluster according to the first UV coordinate information of the plant individual model, the simulated virtual plant growth occupies less resources, the calculated amount is small, and the animation state of the single plant in the plant cluster can be accurately controlled.

Description

Animation generation method and device for virtual plants and electronic equipment
Technical Field
The application belongs to the technical field of image processing, and particularly relates to an animation generation method and device of a virtual plant and electronic equipment.
Background
With the development of computer graphics, more and more kinds of virtual objects can be depicted by means of computers and other devices, and the fidelity of the virtual objects is also increasing. The virtual plant simulating the growth and development process of the plant in the three-dimensional space can accurately and realistically reflect the morphological structure of the real plant, and is widely applied to the fields of games, agriculture, smart cities, disaster monitoring and the like.
At present, the modeling of the virtual plants mostly realizes the simulation of the plant growth process through modes such as vertex animation, skin animation, deformation targets and the like, but when large-scale plant clusters are rendered by the animation technology, the constructed model resource file is overlarge, the calculated amount is large, and the animation state of single plants in the plant clusters cannot be accurately controlled.
Disclosure of Invention
The present application aims to solve at least one of the technical problems existing in the prior art. Therefore, the application provides the animation generation method, the device and the electronic equipment for the virtual plants, which have the advantages of less resources occupied by simulating the growth of the virtual plants, small calculated amount and capability of accurately controlling the animation state of the single plant in the plant cluster.
In a first aspect, the present application provides a method for generating an animation of a virtual plant, the method comprising:
creating at least one plant individual model;
creating a virtual plant cluster based on the at least one plant individual model;
and controlling the growth state of the plant individual model based on first UV coordinate information of the plant individual model in the virtual plant cluster, and displaying the growth state in an animation form on a display interface, wherein the first UV coordinate information is coordinate information representing the texture distribution of the plant individual model.
According to the animation generation method of the virtual plants, the plant individual models of the single virtual plants are constructed, the virtual plant clusters are created, in the virtual plant clusters, the control of the plant growth effect is realized according to the first UV coordinate information of the plant individual models, the simulated virtual plant growth occupies less resources and is small in calculation amount, and the animation states of the single plants in the plant clusters can be accurately controlled.
According to one embodiment of the present application, the controlling the growth state of the plant individual model based on the first UV coordinate information of the plant individual model includes:
controlling the growth state of the plant individual model based on the V coordinate value of the first UV coordinate information and the growth state parameter of the plant individual model;
wherein the value range of the growth state parameter is 0 to 1, the growth state parameter is 0, which represents that the plant does not grow, and the growth state parameter is 1, which represents that the plant grows completely.
According to an embodiment of the present application, the controlling of the growth state of the plant individual model based on the V coordinate value of the first UV coordinate information and the growth state parameter of the plant individual model includes:
discarding the first UV coordinate information at the current moment when the V coordinate value at the current moment is larger than the growth state parameter;
and under the condition that the V coordinate value at the current moment is smaller than the growth state parameter, moving the vertex of the plant individual model to a target direction by a target distance so as to enable an opening at the top end of the plant individual model to be closed, wherein the target direction is a vertex normal direction away from the plant individual model.
According to one embodiment of the application, the target distance is determined based on layer thickness parameters of the plant individual model.
According to one embodiment of the application, after the creating of the virtual plant cluster, the method further comprises:
setting a vertex color for each plant individual model in the virtual plant cluster, wherein the vertex color of each plant individual model is different;
determining a direction of swaying of the plant individual model based on the apex color of the plant individual model;
controlling a swaying state of the plant individual model based on the swaying direction and the first UV coordinate information.
According to one embodiment of the present application, the next vertex position at which the plant individual model performs the swaying is a sum of a current vertex position of the plant individual model and a vertex offset, which is a product of the swaying direction and a V coordinate value of the first UV coordinate information.
According to one embodiment of the application, after the creating of the virtual plant cluster, the method further comprises:
and outputting the grid of the virtual plant cluster, wherein the grid is used for displaying at a webpage end.
According to one embodiment of the present application, the plant individual model further includes second UV coordinate information, which is coordinate information characterizing a texture distribution of the plant individual model, and the second UV coordinate information is used for diffuse reflection map sampling of the plant individual model.
In a second aspect, the present application provides an animation generating apparatus of a virtual plant, the apparatus comprising:
a first processing module for creating at least one plant individual model;
a second processing module for creating a virtual plant cluster based on the at least one plant individual model;
and the third processing module is used for controlling the growth state of the plant individual model based on the first UV coordinate information of the plant individual model in the virtual plant cluster and displaying the growth state in an animation mode on a display interface, wherein the first UV coordinate information is coordinate information representing the texture distribution of the plant individual model.
According to the animation generation device of the virtual plant, disclosed by the application, the plant individual model of the single virtual plant is constructed, the virtual plant cluster is created, the control of the plant growth effect is realized in the virtual plant cluster according to the first UV coordinate information of the plant individual model, the simulated virtual plant growth occupies less resources and has small calculation amount, and the animation state of the single plant in the plant cluster can be accurately controlled.
In a third aspect, the present application provides an electronic device, including a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method for generating an animation of a virtual plant according to the first aspect when executing the computer program.
In a fourth aspect, the present application provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the animation generation method of a virtual plant as described in the first aspect above.
In a fifth aspect, the present application provides a computer program product comprising a computer program which when executed by a processor implements the method of animation generation of a virtual plant as described in the first aspect above.
The above technical solutions in the embodiments of the present application have at least one of the following technical effects:
and controlling states such as the growth direction, the growth degree and the like of the plant individual model according to the first UV coordinate information of the plant individual model, and realizing the control of the plant growth effect under the condition of occupying less resources and calculating amount.
Further, different plant individual models in the virtual plant cluster are marked by using the vertex colors, the direction of the plant individual model for swaying is determined by using the vertex colors of the plant individual models, and the vertices of the plant individual models are shifted by combining the first UV coordinate information, so that the animation effect of the plant swaying can be simulated.
Additional aspects and advantages of the application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application.
Drawings
The foregoing and/or additional aspects and advantages of the application will become apparent and may be better understood from the following description of embodiments taken in conjunction with the accompanying drawings in which:
FIG. 1 is a flowchart of a method for generating an animation of a virtual plant according to an embodiment of the present application;
FIG. 2 is a schematic diagram of UV coordinate information of a plant individual model according to an embodiment of the present application;
FIG. 3 is a schematic illustration of the structure of an unsealed tip of a plant individual model provided by an embodiment of the present application;
FIG. 4 is a schematic view of the structure of a closed top end of a plant individual model according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a virtual plant cluster according to an embodiment of the present application;
FIG. 6 is a second schematic diagram of a virtual plant cluster according to an embodiment of the present application;
FIG. 7 is a second flowchart of a method for generating an animation of a virtual plant according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an animation generating device of a virtual plant according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions of the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which are obtained by a person skilled in the art based on the embodiments of the present application, fall within the scope of protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
In the related art, the animation of a virtual plant is performed in the following ways:
firstly, the vertex animation realizes the effect of virtual plant growth by directly modifying the position of each vertex of the object, and the animation data and the calculation amount are large in the mode.
Secondly, the skinned animation generates the animation by changing the orientation and the position of bones, so that the effect of virtual plant growth is realized, each vertex in the mode needs additional bone index and weight information, the model file is increased, the fineness of the animation is proportional to the quantity of bones, and a large amount of calculation amount is needed for calculating the bone animation.
Thirdly, the deformation target directly operates the vertex, normal line and tangent line data on the vertex of the grid to realize the effect of virtual plant growth, and the mode can achieve a finer animation effect, but the animation file is large and the calculation amount is large.
Fourth, the large-scale plant rendering adopts a direct plant cluster mode to realize the effect of virtual plant growth so as to reduce the call of rendering instructions, but plants in the cluster in the mode belong to the same model, and an independent animation state cannot be realized.
The method for generating the animation of the virtual plant, the device for generating the animation of the virtual plant, the electronic device and the readable storage medium provided by the embodiment of the application are described in detail below by means of specific embodiments and application scenes thereof with reference to the accompanying drawings.
The animation generation method of the virtual plant can be applied to the terminal, and can be specifically executed by hardware or software in the terminal.
The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet having a touch sensitive surface (e.g., a touch screen display and/or a touch pad). It should also be appreciated that in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer having a touch-sensitive surface (e.g., a touch screen display and/or a touch pad).
In the following various embodiments, a terminal including a display and a touch sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and joystick.
The execution subject of the animation generation method of the virtual plant provided by the embodiment of the application can be an electronic device or a functional module or a functional entity in the electronic device, wherein the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a camera, a wearable device and the like.
As shown in fig. 1, the animation generation method of the virtual plant includes: step 110, step 120 and step 130.
Step 110, creating at least one plant individual model.
The plant individual model is a three-dimensional model of a single virtual plant, for example, the plant individual model may be a virtual plant model of a single flower.
In actual practice, individual plant models that characterize individual plant characteristics may be constructed by modeling software.
In this embodiment, one or more plant individual models may be created, and the plant types corresponding to the created plant individual models may be the same or different.
For example, by modeling software, multiple plant individual models can be constructed that characterize a single flower; multiple plant individual models can also be constructed that characterize individual flowers and multiple plant individual models that characterize individual grasses.
Step 120, creating a virtual plant cluster based on the at least one plant individual model.
The virtual plant cluster is a population comprising one or more plant individual models, and the plant individual models in the virtual plant cluster can be distributed randomly, uniformly or in a clustered manner.
For example, a plurality of plant individual models may be laid out in a randomly dispersed manner, creating a virtual plant cluster, and the plurality of plant individual models within the virtual plant cluster may be distributed in a random manner.
In this embodiment, individual plant individual models in the virtual plant cluster can be individually controlled by individually constructing plant individual models and integrating a plurality of plant individual models into the virtual plant cluster.
And 130, controlling the growth state of the plant individual model based on the first UV coordinate information of the plant individual model in the virtual plant cluster, and displaying the growth state in an animation mode on a display interface.
The first UV coordinate information is coordinate information representing texture distribution of the plant individual model.
The three-dimensional model is tiled on a two-dimensional plane, the coordinates of each point of the three-dimensional model on the two-dimensional plane are nominally called UV coordinates, the UV coordinates are also called texture information distribution coordinates, the UV coordinates have two coordinate axes of U and V, the U represents the horizontal direction, and the V represents the vertical direction.
For example, as shown in fig. 2, the plant individual model is tiled on a two-dimensional plane, and each point of the plant individual model has corresponding coordinates in the two-dimensional plane.
In this embodiment, for the plant individual model in the virtual plant cluster, the states such as the growth direction and the growth degree of the plant individual model are controlled according to the first UV coordinate information of the plant individual model, and are displayed in an animation form on the display interface, so that the control of the plant growth effect is realized under the conditions of less occupied resources and less calculated amount.
In actual execution, a program algorithm for controlling plant growth can be written, the first UV coordinate information of the plant individual model is taken as an algorithm parameter, the growth direction, the growth degree and other states of the plant individual model are controlled, and animation of plant growth is displayed on a display interface.
And a program algorithm for controlling plant leaf withering can be compiled, the falling direction, the withering degree and other states of the plant individual model leaf are controlled by taking the first UV coordinate information of the plant individual model as algorithm parameters, and the animation of plant leaf withering is displayed on a display interface. According to the animation generation method of the virtual plants, provided by the embodiment of the application, the plant individual model of the single virtual plant is constructed, the virtual plant cluster is created, the control of the plant growth effect is realized in the virtual plant cluster according to the first UV coordinate information of the plant individual model, the simulated virtual plant growth occupies less resources and has small calculation amount, and the animation state of the single plant in the plant cluster can be accurately controlled.
In some embodiments, controlling the growth state of the plant individual model based on the first UV coordinate information of the plant individual model may include:
controlling the growth state of the plant individual model based on the V coordinate value of the first UV coordinate information and the growth state parameter of the plant individual model;
wherein, the value range of the growth state parameter is 0 to 1, the growth state parameter is 0 to represent that the plant does not grow, and the growth state parameter is 1 to represent that the plant grows completely.
In this embodiment, the growth state parameter of the plant individual model may be a parameter inputted by the user to regulate the growth of the plant individual model.
When a plant corresponding to a plant individual model is required to be in a complete growth state, the growth state parameter input by a user can be 1; when a plant corresponding to a plant individual model is required to be in an ungrown state, a growth state parameter input by a user can be 0.
In actual implementation, the V coordinate value of the first UV coordinate information of the plant individual model is compared with the growth state parameter, and the plant individual model is controlled to simulate the plant growth process according to the magnitude relation between the V coordinate value and the growth state parameter.
In some embodiments, controlling the growth state of the plant individual model based on the V coordinate value of the first UV coordinate information and the growth state parameter of the plant individual model may include:
discarding the first UV coordinate information at the current moment under the condition that the V coordinate value at the current moment is larger than the growth state parameter;
and under the condition that the V coordinate value at the current moment is smaller than the growth state parameter, moving the vertex of the plant individual model to a target distance in the target direction so as to close the opening at the top end of the plant individual model, wherein the target direction is the normal direction of the vertex far away from the plant individual model.
In this embodiment, the growth state parameter of the plant individual model input at the current time is smaller than the V coordinate value of the first UV coordinate information of the plant individual model, the first UV coordinate information at the current time is discarded, and drawing is not performed.
At present, the growth state parameter of the plant individual model is input to be larger than the V coordinate value of the first UV coordinate information of the plant individual model, at the moment, the tip of the plant individual model is not closed, namely the vertex of the plant individual model is positioned in the plant individual model, the vertex of the tip of the plant individual model is deviated towards the target direction, after the target distance is moved, the opening at the top end of the plant individual model is closed, and the vertex of the plant individual model is presented.
In some embodiments, the target distance is determined based on layer thickness parameters of the plant individual model.
The layer thickness parameter of the plant individual model can be a parameter which is input by a user and used for regulating the layer thickness of the plant individual model.
For example, the V coordinate value of the first UV coordinate information of the plant individual model is compared with the growth state parameter, and if the V coordinate value is larger than the current growth state parameter, the drawing is discarded.
The V coordinate values are less than the current growth state parameters, as shown in fig. 3, the tips of the plant individual models are unsealed.
In this example, the tip of the plant individual model was deviated in the target direction, that is, in the opposite direction to the normal line of the tip, and the layer thickness parameter of the plant individual model was a value for the deviation, and after the deviation, as shown in fig. 4, the tip of the plant individual model was successfully closed, that is, the opening at the tip of the plant individual model was closed.
In some embodiments, after creating the virtual plant cluster, the animation generation method of the virtual plant may further include:
setting vertex colors for each plant individual model in the virtual plant cluster, wherein the vertex colors of each plant individual model are different;
determining a swaying direction of the plant individual model based on the vertex color of the plant individual model;
and controlling the swaying state of the plant individual model based on the swaying direction and the first UV coordinate information.
As shown in fig. 5, after the virtual plant cluster is created, a random vertex color is set for each plant individual model in the virtual plant cluster, each plant individual model has a corresponding vertex color, and different plant individual models in the virtual plant cluster can be distinguished through the vertex colors.
In this embodiment, different plant individual models in the virtual plant cluster are marked by using the vertex colors, the direction of the plant individual model for swaying is determined by using the vertex colors of the plant individual models, and the vertices of the plant individual models are shifted by combining the first UV coordinate information, so that the animation effect of the plant swaying can be simulated.
In actual execution, a program algorithm for controlling the swaying of plants can be written, different plant individual models in the virtual plant cluster are distinguished through vertex colors, and the swaying animation state of the single plant in the plant cluster is accurately controlled.
In some embodiments, the next vertex position at which the plant individual model is swayed is the sum of the current vertex position of the plant individual model and a vertex offset, the vertex offset being the product of the swaying direction and the V coordinate value of the first UV coordinate information.
The current vertex position is the original vertex position of the plant individual model at the current moment, and the next vertex position is the new vertex position after the plant individual model is swayed.
In this embodiment, the vertex color of the plant individual model is used as a random number seed, the random swaying direction of the plant individual model is calculated, the V coordinate value of the first UV coordinate information is used as an offset scaling factor of the swaying direction, and the swaying direction are multiplied to obtain the vertex offset corresponding to the swaying of the plant individual model control model.
In actual implementation, the calculation formula of the swaying performed by the plant individual model may be: new vertex position = original vertex position + pan direction x offset scaling factor, where the offset scaling factor is the V-coordinate of the first UV coordinate information.
In some embodiments, after creating the virtual plant cluster, the animation generation method of the virtual plant may further include:
and outputting grids of the virtual plant clusters, wherein the grids are used for displaying at the webpage end.
As shown in fig. 6, after the virtual plant cluster is created, the virtual plant cluster is combined into a grid and exported, the grid can be displayed at the web page end, and all plant individual models in the virtual plant cluster belong to a grid body.
In actual implementation, the growth state and the swaying state of the plant individual model can be controlled according to the first UV coordinate information and the vertex color of the plant individual model, so that the main bodies corresponding to different plant individual models in the virtual plant cluster have different states.
In some embodiments, the plant individual model further comprises second UV coordinate information, the second UV coordinate information being coordinate information characterizing a texture distribution of the plant individual model, the second UV coordinate information being used to sample the diffuse reflection map of the plant individual model.
It should be noted that, for a single plant individual model, first UV coordinate information and second UV coordinate information are acquired, the first UV coordinate information and the second UV coordinate information are both UV coordinate information characterizing texture distribution, the first UV coordinate information is used for controlling a growth state of the plant individual model, and the second UV coordinate information is used for diffuse reflection map sampling.
In the embodiment, diffuse reflection sampling is carried out on the mapping according to the second UV coordinate information of the plant individual model, so that texture drawing of the surface of the plant individual model is completed.
A specific embodiment is described below.
As shown in FIG. 7, individual plant models can be created by modeling software to create individual plant models.
For each plant individual model, two sets of UV coordinates are set, a first set of UV coordinates (namely second UV coordinate information) is used for diffuse reflection mapping sampling, and a second set of UV coordinates (namely first UV coordinate information) is used for controlling the growth direction of plants.
By randomly interspersing a plurality of individual plant models, a virtual plant cluster is created, giving the individual plant models within the virtual plant cluster a random vertex color that is used to distinguish different individuals within the algorithm.
And writing a loader algorithm, wherein the loader algorithm is a program algorithm for controlling the growth and the swaying of the plant individual models in the virtual plant clusters.
In this embodiment, random shifting based on time T is performed based on the apex color, and individual models of different plants within the virtual plant cluster are randomly swayed.
The algorithm has two parameters, growth and layerthicess, the growth state parameter, 0 indicates no growth, 1 indicates complete growth, and layerthicess is the layer thickness parameter.
Comparing the V coordinate value of the second set of UV coordinates with the growth, simulating the growth process, and discarding the non-drawing process when the V coordinate value is larger than the current growth value; when the V coordinate value is smaller than the current growth value, the plant individual model tip is not closed, the vertex of the tip is shifted to the negative direction of the normal direction, and the tip is successfully closed to close the port.
In the embodiment of the company, a program algorithm is adopted to realize the effect of simulating plant growth, the UV coordinates are utilized to control the growth direction, the top end opening is closed by shifting the top point to the negative direction, the fragments are discarded if the top end opening exceeds the top end opening, and the plant growth effect with controllable program is realized under the conditions that the mobile end occupies less resources and the calculated amount is small; and marking each complete plant by using the vertex color, shifting the vertex by using a program algorithm, and realizing independent random swaying effect of the single plant by using the program algorithm.
According to the animation generation method of the virtual plant, provided by the embodiment of the application, the execution main body can be an animation generation device of the virtual plant. In the embodiment of the present application, an animation generation method of executing a virtual plant by an animation generation device of a virtual plant is taken as an example, and the animation generation device of a virtual plant provided in the embodiment of the present application is described.
The embodiment of the application also provides an animation generation device of the virtual plant.
As shown in fig. 8, the animation generating device of the virtual plant includes:
a first processing module 810 for creating at least one plant individual model;
a second processing module 820 for creating a virtual plant cluster based on the at least one plant individual model;
the third processing module 830 is configured to control a growth state of the plant individual model based on first UV coordinate information of the plant individual model in the virtual plant cluster, and display the growth state in an animation form on a display interface, where the first UV coordinate information is coordinate information representing texture distribution of the plant individual model.
According to the animation generation device of the virtual plants, provided by the embodiment of the application, the plant individual model of the single virtual plant is constructed, the virtual plant cluster is created, the control of the plant growth effect is realized in the virtual plant cluster according to the first UV coordinate information of the plant individual model, the simulated virtual plant growth occupies less resources and has small calculation amount, and the animation state of the single plant in the plant cluster can be accurately controlled.
In some embodiments, the third processing module 830 is configured to control a growth state of the plant individual model based on the V coordinate value of the first UV coordinate information and the growth state parameter of the plant individual model;
wherein, the value range of the growth state parameter is 0 to 1, the growth state parameter is 0 to represent that the plant does not grow, and the growth state parameter is 1 to represent that the plant grows completely.
In some embodiments, the third processing module 830 is configured to discard the first UV coordinate information at the current time when the V coordinate value at the current time is greater than the growth state parameter;
and under the condition that the V coordinate value at the current moment is smaller than the growth state parameter, moving the vertex of the plant individual model to a target distance in the target direction so as to close the opening at the top end of the plant individual model, wherein the target direction is the normal direction of the vertex far away from the plant individual model.
In some embodiments, the target distance is determined based on layer thickness parameters of the plant individual model.
In some embodiments, the third processing module 830 is further configured to set a vertex color for each individual plant model within the virtual plant cluster, where the vertex color of each individual plant model is different;
determining a swaying direction of the plant individual model based on the vertex color of the plant individual model;
and controlling the swaying state of the plant individual model based on the swaying direction and the first UV coordinate information.
In some embodiments, the next vertex position at which the plant individual model is swayed is the sum of the current vertex position of the plant individual model and a vertex offset, the vertex offset being the product of the swaying direction and the V coordinate value of the first UV coordinate information.
In some embodiments, the third processing module 830 is further configured to output a grid of the virtual plant cluster, where the grid is used for displaying on the web page side.
In some embodiments, the plant individual model further comprises second UV coordinate information, the second UV coordinate information being coordinate information characterizing a texture distribution of the plant individual model, the second UV coordinate information being used to sample the diffuse reflection map of the plant individual model.
The animation generating device of the virtual plant in the embodiment of the application can be electronic equipment or a component in the electronic equipment, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be other devices than a terminal. By way of example, the electronic device may be a mobile phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, mobile internet appliance (Mobile Internet Device, MID), augmented reality (augmented reality, AR)/Virtual Reality (VR) device, robot, wearable device, ultra-mobile personal computer, UMPC, netbook or personal digital assistant (personal digital assistant, PDA), etc., but may also be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The animation generating device of the virtual plant in the embodiment of the application can be a device with an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, and the embodiment of the present application is not limited specifically.
The animation generating device for the virtual plant provided by the embodiment of the application can realize each process realized by the method embodiments of fig. 1 to 7, and in order to avoid repetition, the description is omitted here.
In some embodiments, as shown in fig. 9, an electronic device 900 is further provided in the embodiments of the present application, which includes a processor 901, a memory 902, and a computer program stored in the memory 902 and capable of running on the processor 901, where the program when executed by the processor 901 implements the respective processes of the above-mentioned embodiments of the animation generation method of the virtual plant, and the same technical effects can be achieved, and for avoiding repetition, a detailed description is omitted herein.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device.
The embodiment of the application also provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the processes of the above embodiment of the animation generation method of the virtual plant, and can achieve the same technical effects, so that repetition is avoided and no further description is given here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application also provides a computer program product, which comprises a computer program, wherein the computer program realizes the animation generation method of the virtual plant when being executed by a processor.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application further provides a chip, the chip comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running programs or instructions, the processes of the embodiment of the animation generation method of the virtual plant can be realized, the same technical effect can be achieved, and the repetition is avoided, and the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.
In the description of the present specification, reference to the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present application have been shown and described, it will be understood by those of ordinary skill in the art that: many changes, modifications, substitutions and variations may be made to the embodiments without departing from the spirit and principles of the application, the scope of which is defined by the claims and their equivalents.

Claims (12)

1. A method for generating an animation of a virtual plant, comprising:
creating at least one plant individual model;
creating a virtual plant cluster based on the at least one plant individual model;
and controlling the growth state of the plant individual model based on first UV coordinate information of the plant individual model in the virtual plant cluster, and displaying the growth state in an animation form on a display interface, wherein the first UV coordinate information is coordinate information representing the texture distribution of the plant individual model.
2. The animation generation method of a virtual plant according to claim 1, wherein the controlling the growth state of the plant individual model based on the first UV coordinate information of the plant individual model comprises:
controlling the growth state of the plant individual model based on the V coordinate value of the first UV coordinate information and the growth state parameter of the plant individual model;
wherein the value range of the growth state parameter is 0 to 1, the growth state parameter is 0, which represents that the plant does not grow, and the growth state parameter is 1, which represents that the plant grows completely.
3. The animation generation method of a virtual plant according to claim 2, wherein the controlling the growth state of the plant individual model based on the V coordinate value of the first UV coordinate information and the growth state parameter of the plant individual model comprises:
discarding the first UV coordinate information at the current moment when the V coordinate value at the current moment is larger than the growth state parameter;
and under the condition that the V coordinate value at the current moment is smaller than the growth state parameter, moving the vertex of the plant individual model to a target direction by a target distance so as to enable an opening at the top end of the plant individual model to be closed, wherein the target direction is a vertex normal direction away from the plant individual model.
4. A method of animation production of a virtual plant as claimed in claim 3, wherein the target distance is determined based on layer thickness parameters of the plant individual model.
5. The animation generation method of a virtual plant of claim 1, wherein after the creating a virtual plant cluster, the method further comprises:
setting a vertex color for each plant individual model in the virtual plant cluster, wherein the vertex color of each plant individual model is different;
determining a direction of swaying of the plant individual model based on the apex color of the plant individual model;
controlling a swaying state of the plant individual model based on the swaying direction and the first UV coordinate information.
6. The animation generation method of a virtual plant according to claim 5, wherein a next vertex position at which the plant individual model performs a swaying is a sum of a current vertex position of the plant individual model and a vertex offset, the vertex offset being a product of the swaying direction and a V coordinate value of the first UV coordinate information.
7. The animation generation method of a virtual plant of any of claims 1-6, wherein after the creating of a virtual plant cluster, the method further comprises:
and outputting the grid of the virtual plant cluster, wherein the grid is used for displaying at a webpage end.
8. The animation generation method of a virtual plant according to any one of claims 1 to 6, wherein the plant individual model further comprises second UV coordinate information, the second UV coordinate information being coordinate information characterizing a texture distribution of the plant individual model, the second UV coordinate information being used for diffuse reflection map sampling of the plant individual model.
9. An animation generation device for a virtual plant, comprising:
a first processing module for creating at least one plant individual model;
a second processing module for creating a virtual plant cluster based on the at least one plant individual model;
and the third processing module is used for controlling the growth state of the plant individual model based on the first UV coordinate information of the plant individual model in the virtual plant cluster and displaying the growth state in an animation mode on a display interface, wherein the first UV coordinate information is coordinate information representing the texture distribution of the plant individual model.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the animation generation method of a virtual plant as claimed in any one of claims 1-8 when the program is executed by the processor.
11. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the animation generation method of a virtual plant according to any of claims 1-8.
12. A computer program product comprising a computer program which, when executed by a processor, implements the method of animation generation of a virtual plant as claimed in any one of claims 1 to 8.
CN202311023564.2A 2023-08-14 2023-08-14 Animation generation method and device for virtual plants and electronic equipment Pending CN117011436A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311023564.2A CN117011436A (en) 2023-08-14 2023-08-14 Animation generation method and device for virtual plants and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311023564.2A CN117011436A (en) 2023-08-14 2023-08-14 Animation generation method and device for virtual plants and electronic equipment

Publications (1)

Publication Number Publication Date
CN117011436A true CN117011436A (en) 2023-11-07

Family

ID=88574224

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311023564.2A Pending CN117011436A (en) 2023-08-14 2023-08-14 Animation generation method and device for virtual plants and electronic equipment

Country Status (1)

Country Link
CN (1) CN117011436A (en)

Similar Documents

Publication Publication Date Title
CN111145326B (en) Processing method of three-dimensional virtual cloud model, storage medium, processor and electronic device
US20210183165A1 (en) Image processing method and apparatus, electronic device, and computer-readable storage medium
AU2017213540B2 (en) 3d sculpting
CN111047509A (en) Image special effect processing method and device and terminal
CN106683193B (en) Design method and design device of three-dimensional model
CN106898040A (en) Virtual resource object rendering intent and device
CN105144243A (en) Data visualization
CN112184873A (en) Fractal graph creating method and device, electronic equipment and storage medium
CN111773719A (en) Rendering method and device of virtual object, storage medium and electronic device
CN114693856B (en) Object generation method and device, computer equipment and storage medium
CN113318428A (en) Game display control method, non-volatile storage medium, and electronic device
CN115375822A (en) Cloud model rendering method and device, storage medium and electronic device
CN116012507A (en) Rendering data processing method and device, electronic equipment and storage medium
Leist et al. Interactive visualisation of spins and clusters in regular and small-world Ising models with CUDA on GPUs
CN109145688A (en) The processing method and processing device of video image
US20230326129A1 (en) Method and apparatus for storing visibility data of three-dimensional model, device, and storage medium
CN117011436A (en) Animation generation method and device for virtual plants and electronic equipment
Liu et al. Interactive modeling of trees using VR devices
CN114299203A (en) Processing method and device of virtual model
CN107194980A (en) Faceform's construction method, device and electronic equipment
CN117745892A (en) Particle generation performance control method, device, storage medium, and electronic device
WO2023179091A1 (en) Three-dimensional model rendering method and apparatus, and device, storage medium and program product
CN116630509A (en) Image processing method, image processing apparatus, computer-readable storage medium, and electronic apparatus
CN115035215A (en) Image processing method and device and computer readable storage medium
CN117671062A (en) Image generation method, device, nonvolatile storage medium and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination