CN115880402A - Flow animation generation method and device, electronic equipment and readable storage medium - Google Patents

Flow animation generation method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN115880402A
CN115880402A CN202211578874.6A CN202211578874A CN115880402A CN 115880402 A CN115880402 A CN 115880402A CN 202211578874 A CN202211578874 A CN 202211578874A CN 115880402 A CN115880402 A CN 115880402A
Authority
CN
China
Prior art keywords
mucus
curve
model
vertex
grid line
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
CN202211578874.6A
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202211578874.6A priority Critical patent/CN115880402A/en
Publication of CN115880402A publication Critical patent/CN115880402A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T90/00Enabling technologies or technologies with a potential or indirect contribution to GHG emissions mitigation

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the application discloses a method and a device for generating a flow animation, electronic equipment and a computer readable storage medium, wherein a grid-shaped plane model of a mucus model to be generated is obtained, a grid on the grid-shaped plane model is divided by at least two annular grid lines and at least two segmentation grid lines intersected with the annular grid lines, and the intersection points of the annular grid lines and the segmentation grid lines are the vertexes of the mucus model; obtaining a mucus flowing direction curve; acquiring a target height value and a target offset value corresponding to the vertex; and controlling the vertex to shift along the mucus flowing direction curve according to the target height value and the target offset value so as to generate a flowing animation of the mucus model. The embodiment of the application can improve the generation efficiency of the flow animation.

Description

Flow animation generation method and device, electronic equipment and readable storage medium
Technical Field
The application relates to the technical field of games, in particular to a method and a device for generating a flow animation, electronic equipment and a computer-readable storage medium.
Background
Under the internet wave, entertainment items are increasingly important in people's life, and in order to meet the requirements of a special sticky effect in some entertainment items (such as animation films and games), the special sticky effect needs to be presented by a flowing animation composed of a three-dimensional sticky model in at least one image frame.
The existing three-dimensional mucus model generation needs manual fluid calculation simulation to simulate a mucus model meeting the requirements of related personnel, but because the shape, the flow direction and the like of the mucus model corresponding to different requirements are different, if the simulation is carried out only in a manual mode, a large amount of time is undoubtedly spent, and the efficiency of generating the flow animation is low.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating a flow animation, electronic equipment and a computer-readable storage medium, which can improve the generation efficiency of the flow animation.
In a first aspect, an embodiment of the present application provides a method for generating a flow animation, where the method includes:
acquiring a latticed plane model of a mucus model to be generated, wherein a grid on the latticed plane model is divided by at least two annular grid lines and at least two segmentation grid lines intersected with the annular grid lines, and the intersection points of the annular grid lines and the segmentation grid lines are vertexes of the mucus model;
obtaining a mucus flowing direction curve;
obtaining a target height value and a target deviation value corresponding to the vertex;
and controlling the vertex to shift along the mucus flowing direction curve according to the target height value and the target deviation value so as to generate the flowing animation of the mucus model.
In a second aspect, an embodiment of the present application further provides a flow animation generation apparatus, where the apparatus includes:
the model obtaining module is used for obtaining a grid-shaped plane model of the mucus model to be generated, wherein a grid on the grid-shaped plane model is divided by at least two annular grid lines and at least two segmentation grid lines intersected with the annular grid lines, and the intersection points of the annular grid lines and the segmentation grid lines are the vertexes of the mucus model;
the curve acquisition module is used for acquiring a mucus flowing direction curve;
the information acquisition module is used for acquiring a target height value vertex and a target deviation value corresponding to the vertex;
and the model generation module is used for controlling the vertex to shift along the mucus flowing direction curve according to the target height value and the target offset value so as to generate the flowing animation of the mucus model.
In a third aspect, an embodiment of the present application further provides an electronic device, including a memory storing a plurality of instructions; the processor loads instructions from the memory to execute the steps in any of the methods for generating a flow animation provided by the embodiments of the present application.
In a fourth aspect, embodiments of the present application further provide a computer-readable storage medium, where a plurality of instructions are stored, and the instructions are adapted to be loaded by a processor to perform steps in any one of the methods for generating a flow animation provided by embodiments of the present application.
In the embodiment of the application, a latticed plane model of a mucus model to be generated is obtained, where a grid on the latticed plane model is divided by at least two annular grid lines and at least two segmentation grid lines intersecting with the annular grid lines, and an intersection point of the annular grid lines and the segmentation grid lines is a vertex of the mucus model, so as to determine a structure of the mucus model on a plane based on the latticed plane model. Then, a mucus flow direction curve is obtained again to determine the flow direction of the mucus model based on the curve. And then obtaining a target height value and a target offset value corresponding to the vertex, so as to determine the position of the vertex on the annular grid line in the mucus model based on the target height value and the target offset value, and controlling the vertex to offset along the mucus flowing direction curve according to the target height value and the target offset value so as to generate the flowing animation of the mucus model, thereby improving the generation efficiency of the flowing animation.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a flow animation generation system provided by an embodiment of the present application;
FIG. 2 is a flowchart illustrating an embodiment of a method for generating a flow animation according to an embodiment of the present application;
FIG. 3a is a schematic diagram of a grid-like planar model provided in an embodiment of the present application;
FIG. 3b is a schematic diagram of an assigned latticed planar model provided in an embodiment of the present application;
FIG. 4 is a schematic illustration of a mucus flow direction curve provided in an embodiment of the present application;
FIG. 5a is a schematic illustration of a mapped mucus flow direction curve provided in an embodiment of the present application;
FIG. 5b is a schematic diagram of a mapped grid-like planar model provided in an embodiment of the present application;
FIG. 6a is a schematic illustration of a mucus height curve provided in an embodiment of the present application;
FIG. 6b is a schematic illustration of a mucus deflection curve provided in an embodiment of the present application;
FIG. 7 is a schematic view of a mucus model provided by embodiments of the present application;
FIG. 8a is a schematic drawing of a tangent to each point on the mucus flow direction curve provided by an embodiment of the present application;
FIG. 8b is a diagram illustrating a normal of a vertex after a rotation transformation according to an embodiment of the present application;
FIG. 9 is a schematic diagram of a map storing streaming animation information provided in an embodiment of the present application;
FIG. 10 is another schematic view of a mucus model provided by an embodiment of the present application;
FIG. 11 is a schematic structural diagram of a flow animation generation apparatus according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Before explaining the embodiments of the present application in detail, some terms related to the embodiments of the present application will be explained.
In the description of the embodiments of the present application, the terms "first", "second", and the like may be used herein to describe various concepts, but these concepts are not limited by these terms unless otherwise specified. These terms are only used to distinguish one concept from another. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The embodiment of the application provides a method and a device for generating a flow animation, electronic equipment and a computer-readable storage medium. Specifically, the streaming animation generation method according to the embodiment of the present application may be executed by a game engine installed in an electronic device, where the electronic device may be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet Computer, a notebook Computer, a touch screen, a game machine, a Personal Computer (PC), a Personal Digital Assistant (PDA), and the like, and the terminal can also include a client, which can be a game application client, a browser client carrying a game program, or an instant messaging client, and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and a big data and artificial intelligence platform.
For example, as shown in fig. 1, taking an example of a game engine applied to an electronic device as an example, the game engine may obtain a grid-like planar model of a mucus model to be generated, where a grid on the grid-like planar model is divided by at least two annular grid lines and at least two segmentation grid lines intersecting the annular grid lines, and an intersection point of the annular grid lines and the segmentation grid lines is a vertex of the mucus model; obtaining a mucus flowing direction curve; acquiring a target height value and a target offset value corresponding to the vertex; and controlling the vertex to shift along the mucus flowing direction curve according to the target height value and the target offset value so as to generate a flowing animation of the mucus model.
Based on the above problems, embodiments of the present application provide a method and an apparatus for generating a flow animation, an electronic device, and a computer-readable storage medium, which can improve the generation efficiency of the flow animation.
The following detailed description is made with reference to the accompanying drawings, respectively. It should be noted that the following description of the embodiments is not intended to limit the preferred order of the embodiments. Although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be performed in an order different than that shown in the figures.
In this embodiment, a game engine is taken as an example for explanation, and this embodiment provides a method for generating a floating animation, as shown in fig. 2, a specific flow of the method for generating a floating animation may be as follows:
201. and acquiring a latticed plane model of the mucus model to be generated, wherein a grid on the latticed plane model is divided by at least two annular grid lines and at least two segmentation grid lines intersected with the annular grid lines, and the intersection points of the annular grid lines and the segmentation grid lines are the vertexes of the mucus model.
The mucus model to be generated can be applied to a virtual game scene, for example, the mucus model is designed and generated for a mucus special effect in the virtual game scene, because the mucus special effect in the virtual game scene includes a static special effect and a dynamic special effect, and the number of frames of image frames of a flow animation required by different mucus special effects is different, each image frame corresponds to a mucus model with a specific shape, so that the flow animation with the mucus special effect can be presented by generating the mucus model in at least one image frame.
For example, it is set that a dynamic special mucus effect needs to be presented in the current virtual game scene, and the dynamic special mucus effect needs to be presented by a flow animation composed of 10 frames of image frames, then corresponding mucus models need to be designed in each of the 10 frames of image frames, so as to generate the flow animation corresponding to the dynamic special mucus effect through the mucus models of the 10 frames of image frames.
The latticed plane model may be used as a structural basis for generating the mucus model to be generated, so as to generate the mucus model by processing the model, and the latticed plane model includes, but is not limited to, a circle, a rectangle, a triangle, and the like, and is specifically set according to requirements. There are multiple meshes on the latticed planar model, and the multiple meshes on the latticed planar model are used for indicating a specific topological structure when the mucus model is displayed on a plane.
It can be understood that the different shapes of the latticed plane models correspond to different shapes of mucus models, for example, if the latticed plane model is circular, the display effect of the generated mucus model is a mellow effect; if the grid-like planar model is rectangular, the display effect of the generated mucus model is a sharp corner.
The annular grid lines and the segmentation grid lines on the grid-shaped plane model are intersected, and the intersection points are points forming a grid. The above-mentioned annular grid lines are used to divide a planar model into mutually nested annular structures, for example, if the planar model is circular, the annular structures are circular rings; the grid lines are used for further segmenting the annular structure, so that a plurality of grids exist on the plane model, and the grid-shaped plane model is obtained.
For example, if the plane model is set to be a circle, a plurality of meshes may be divided on the plane model by the annular mesh lines and the segmentation mesh lines, as shown in fig. 3a, it may be understood that, in this example, the game engine performs edge processing on the circular plane model through an optimization strategy, and only the mesh indicating the structure of the mucus model is reserved, that is, only the mesh shown in fig. 3a is reserved, and the mesh including the edge smooth part in the divided plane model is not reserved, so as to ensure the display effect of the generated mucus model.
It can be understood that, because the mesh on the latticed plane model is used for indicating the structure of the mucus model when the mucus model is displayed on the plane, and the mesh on the latticed plane model is obtained by dividing the annular mesh line and the segmentation mesh line, that is, the points forming the mesh on the latticed plane model are the intersection points of the annular mesh line and the segmentation mesh line, that is, the vertices of the mucus model, in this embodiment, the game engine can determine the vertices on the latticed plane model by obtaining the latticed plane model, so as to adjust the attribute parameters of the structure of the mucus model, for example, the height value of a certain point of the mucus model, by controlling the vertices, thereby generating the mucus model of the corresponding image frame meeting the requirements of the relevant staff, and finally generating the flow animation meeting the requirements of the relevant staff.
In some embodiments, the latticed plane model may be designed in advance, when the game engine receives a mucus model design instruction, the mucus model design instruction includes model requirement information of a relevant worker on the latticed plane model, and the game engine may obtain, from a preset model set including at least one type of latticed plane model, such as a latticed plane model in a circular shape and a latticed plane model in a rectangular shape, based directly on the model requirement information of the relevant worker carried in the mucus model design instruction, the latticed plane model meeting the requirement of the relevant worker.
In some embodiments, the latticed plane model may also be generated in real time, that is, when the game engine receives a mucus model design instruction, the game engine may directly divide a mesh on a plane model in real time by using a ring-shaped mesh line and a split mesh line based on model requirement information of a relevant worker carried in the mucus model design instruction, so as to obtain a latticed plane model meeting requirements of the relevant worker. The model requirement information includes, but is not limited to, a mesh size, a mesh pattern, or a mesh relative relationship, and the like, where the mesh relative relationship is used to indicate whether the mesh is divided equally.
In some embodiments, the game engine may set a number of division turns and a number of segments to divide a mesh on a planar model by the number of division turns and the number of segments to obtain a mesh-like planar model. The number of the division turns is used for indicating the number of the annular grid lines, namely, determining the number of the annular structures to be divided on the plane model; the number of segments is used to indicate the number of the mesh lines to be sliced. It can be understood that the number of the annular grid lines and the number of the segmentation grid lines can be set according to requirements, and the more the number of the annular grid lines and the number of the segmentation grid lines are, the finer the divided grid is, so that the display effect of the generated mucus model is better.
Wherein the game engine may determine the division distances corresponding to the number of division turns and the number of segments, respectively, based on the size of the plane model, for example, if the plane model is a circle, a distance between each of the ring-shaped grid lines may be determined according to the radius of the circle and the number of division turns, and further, a distance between one segment of the divided grid line and an adjacent segment of the adjacent divided grid line may be determined according to the circumference of the circle and the number of segments.
Specifically, the game engine may mesh the planar model by a circular polygon extrusion method (denoted as polyaxtrude) to obtain a mesh-like planar model, and may record the number of layers of the annular mesh number where the vertex is located into the attribute hierarchy of the vertex during the circulation.
In some embodiments, to facilitate control of vertices on the mesh-like planar model, the vertices on the mesh-like planar model may be assigned values. Specifically, a value is assigned to the vertex on each annular grid line based on the number of layers of each annular grid line in the grid-shaped plane model, wherein the point values of all the vertices on each annular grid line are consistent, and the number of layers of the annular grid line and the point values of the vertices on the annular grid line are in a one-to-one correspondence relationship.
It can be understood that, based on the characteristics of the mucus model, in this embodiment, the game engine generates the corresponding mucus model by performing the same control on all the vertices on each circular grid line, so as to accelerate the generation speed of the mucus model, and finally improve the generation efficiency of the flow animation. In addition, in order to generate the same flow animation in another game engine, the mucus attribute information of each vertex required for generating the mucus model of at least one frame of image frame needs to be stored, and if the same control is performed on all the vertices on each annular grid line, each annular grid line only needs to correspond to one piece of mucus attribute information, that is, all the vertices on the annular grid line can realize the generation of the mucus model according to the mucus attribute information. Therefore, in this embodiment, the vertex on the annular grid line is assigned based on the number of layers of the annular grid line in the grid-shaped plane model, so that the association between the vertex and the number of layers of the annular grid line where the vertex is located is realized, and therefore, corresponding data is searched for based on the number of layers of the annular grid line in the later period, and the vertex on the annular grid line is correspondingly processed.
Illustratively, as shown in fig. 3b, there are 9 circular grid lines in fig. 3b, and the vertex on the circular grid line of the first layer is assigned with 0, that is, the point value of the vertex on the circular grid line of the first layer is 0; assigning a value of 1 to a vertex on the circular grid line of the second layer, that is, a point value of a vertex on the circular grid line of the second layer is 1; assigning 2 to the vertex on the annular grid line of the third layer, namely assigning 2 to the point value of the vertex on the annular grid line of the third layer; assigning a vertex on the circular grid line of the fourth layer to be 3, namely, assigning a point value of the vertex on the circular grid line of the fourth layer to be 3; assigning a vertex on the circular grid line of the fifth layer to be 4, namely assigning a point value of the vertex on the circular grid line of the fifth layer to be 4; assigning a vertex on the circular grid line of the sixth layer to be 5, that is, a point value of the vertex on the circular grid line of the sixth layer is 5; assigning a vertex on the circular grid line at the seventh layer to be 6, i.e. the point value of the vertex on the circular grid line at the seventh layer is 6; assigning 7 to the vertices on the circular grid lines of the eighth layer, i.e. the vertex values on the circular grid lines of the eighth layer are 7; the vertex on the circular grid line at the ninth layer is assigned a value of 8, i.e., the point value of the vertex on the circular grid line at the ninth layer is 8.
202. Obtaining a mucus flowing direction curve.
The mucus flowing direction curve is used for indicating the direction path of the flowing mucus model of each image frame in the flowing animation, for example, if the flowing animation presents a mucus rising special effect, the mucus flowing direction curve is used for indicating the rising path of the mucus model; if the flow animation presents a special effect of horizontal mucus flow, the mucus flow direction curve is used for indicating the path of horizontal mucus flow of the mucus model. In this embodiment, the game engine may stretch the latticed plane model based on the mucus flowing direction curve, so as to obtain the mucus model according to the requirement of the staff, as shown in fig. 4, where fig. 4 is a schematic diagram of the mucus flowing direction curve, and (0, 0) in fig. 4 is the starting point of the mucus flowing direction curve, that is, the position where the latticed plane model is located.
In some embodiments, the mucus flowing direction curve may be designed in advance, when the game engine receives a mucus model design instruction, the mucus model design instruction further includes information of mucus flowing requirements of relevant staff for a mucus model, and the game engine may obtain a mucus flowing direction curve meeting requirements of the relevant staff from a preset flowing direction curve set directly based on the information of mucus flowing requirements of the relevant staff carried in the mucus model design instruction, where the model set includes at least one type of mucus flowing direction curve, for example, a mucus flowing direction curve with a rising direction and a mucus flowing direction curve with a falling direction.
In some embodiments, the mucus flowing direction curve may also be generated in real time, and the generation manner of the mucus flowing direction curve may be that the game engine may automatically generate the mucus flowing direction curve, or the mucus flowing direction curve may be drawn by the relevant staff, so as to generate the mucus flowing direction curve required by the relevant staff, which is not limited herein.
Specifically, if the game engine automatically generates the mucus flowing direction curve, when the game engine receives a mucus model design instruction, the game engine may directly generate the mucus flowing direction curve meeting the requirements of the relevant staff in real time based on the mucus flowing requirement information of the relevant staff carried in the mucus model design instruction. The above information on the demand for mucus flow includes, but is not limited to, a mucus flow direction, a slope of a mucus flow direction curve, and a height in the mucus flow direction curve.
Specifically, if the related staff draws the mucus flowing direction curve by themselves, the game engine may provide a direction curve drawing page and display the direction curve drawing page, so that the related staff draws the mucus flowing direction curve based on the direction curve drawing page. For example, a direction curve drawing control corresponding to a node may be set on the direction curve drawing interface, and the relevant staff drags the direction curve drawing control on the direction curve drawing page to generate a corresponding mucus flowing direction curve.
In some embodiments, since the latticed plane model is processed into the three-dimensional mucus model based on the mucus flowing direction curve, the game engine may set a preset number of curve points in the mucus flowing direction curve, that is, the preset number of curve points constitute the mucus flowing direction curve, and the preset number of curve points represent the mucus flowing direction curve, so that the game engine implements processing on the latticed plane model by performing corresponding control on the preset number of curve points, thereby generating the mucus model required by the relevant worker.
It can be understood that, in this embodiment, a preset number of curve points need to be recorded, so as to perform corresponding processing on the latticed plane model through the preset number of curve points at a later stage. Thus, the game engine may sequentially assign a predetermined number of curve points to their arrangement positions based on the start point of the mucus flow direction curve, i.e., (0, 0) in fig. 4, that is, the point value of the first curve point is 0, the coordinate in the three-dimensional space is (0, 0), the point value of the second curve point is 1, the point value of the third curve point is 2, until the point value of the last curve point is the predetermined number minus 1.
Furthermore, because the corresponding mucus model is generated based on the mucus flowing direction curve and the grid-shaped plane model, and the game engine can perform corresponding processing on the vertexes of each annular grid line based on the number of layers of the annular grid line. Therefore, in order to facilitate processing of the number of layers of each annular grid line and the point values of the curve points of the mucus flow direction curve in the process of generating the mucus model, the number of layers of each annular grid line and the point values of the curve points of the mucus flow direction curve may be mapped to values in the same space.
Specifically, the game engine may map the number of layers of each circular grid line and the point value of the curve point of the mucus flow direction curve to a numerical value in a two-dimensional space.
Wherein the game engine may map the mucus flow direction curve in two-dimensional space by the exhibition UV method and map point values of curve points of the mucus flow direction curve to a preset numerical range, for example, the preset numerical range may be 0 to 1, based on the point values of the curve points. Wherein, the game engine can record the value after the point value mapping of the curve point through a UV file.
Illustratively, as shown in fig. 5a, if there are 11 curve points in the current mucus flow direction curve, the point values of the curve points are sequentially 0 to 10, the preset value range is set to be 0 to 1, the vertical axis of the mucus flow direction curve in fig. 5a is 0, and the coordinates of each curve point on the horizontal axis are determined based on the point values of the curve points, namely 0, 0.1, 0.2 · · 1.
The game engine may perform two-dimensional spatial mapping on the number of layers of each circular grid line by using the UV unfolding method, and map the number of layers of each circular grid line to a preset value range based on the number of layers of each circular grid line, for example, the preset value range may be 0 to 1. Wherein, the game engine can record the mapped numerical value of the layer number of each annular grid line through another UV file. This recording may be done in a coordinate axis similar to that shown in fig. 5a, or the number of layers of different annular grid lines may be represented by color.
Exemplarily, as shown in fig. 5b, the colors of the different layers of the annular grid lines or the grid divided by the annular grid lines in the latticed planar model in fig. 5b represent the mapped values of the different layers of the annular grid lines.
203. And acquiring a target height value and a target offset value corresponding to the vertex.
Aiming at the obtained target height, because the vertexes on each annular grid line need to be stretched to generate the corresponding mucus model, the target height value corresponding to each vertex needs to be determined, and the vertexes on each annular grid line need to be stretched in height based on the target height value to obtain the three-dimensional structure of the mucus model.
Specifically, the target height value may be a distance between a center point of the circular grid line where the vertex is located on the mucus flow direction curve and a starting point of the mucus flow direction curve; the target height value may also be a height of the vertex relative to the bottom of the mucus model, that is, a height between the vertex and a position where the latticed plane model is located, which is not limited herein, and is specifically set according to actual requirements of relevant staff on the mucus model. It is understood that the reference objects corresponding to the target height values are different, and the manner of controlling the vertex movement according to the target height values is different.
In some embodiments, the game engine may obtain a mucus height curve having two coordinate axes, one coordinate axis indicating the number of layers in which the circular grid lines are located in the grid-like planar model, and the other coordinate axis indicating the height corresponding to the vertices on the circular grid lines, so that the game engine may obtain the target height value corresponding to the vertices on each circular grid line from the mucus height curve based on the number of layers in which each circular grid line is located in the grid-like planar model. Therefore, the heights of different vertexes in the mucus model can be conveniently adjusted through the mucus height curve so as to change the shape of the mucus model. Wherein, two coordinate axes of the mucus height curve are horizontal and vertical coordinate axes.
In some embodiments, the mucus height curve including the correspondence between the number of layers of the annular grid lines and the height corresponding to the vertex on the annular grid lines may be pre-designed, that is, when the game engine receives a mucus model design instruction, the mucus model setting instruction includes height requirement information of a relevant worker for the mucus model, and the game engine may directly obtain the mucus height curve meeting the requirement of the relevant worker from a preset height mapping set based on the height requirement information of the relevant worker carried in the mucus model setting instruction.
In some embodiments, the mucus height curve including the correspondence between the number of layers of the annular grid lines and the height corresponding to the vertex on the annular grid lines may be generated in real time, and the generation manner of the mucus height curve may be that the game engine may automatically generate the mucus height curve, or the mucus height curve may be drawn by the relevant staff, so as to generate the mucus height curve required by the relevant staff, which is not limited herein.
Specifically, if the game engine automatically generates the mucus height curve, when the game engine receives a mucus model design instruction, the game engine may directly generate the mucus height curve meeting the requirements of the relevant staff in real time based on the height requirement information of the relevant staff carried in the mucus model design instruction. The height requirement information includes, but is not limited to, a slope of a mucus height curve, a speed of mucus flow, a style requirement of a mucus model, and the like.
Specifically, if the height curve of the mucus is drawn by the relevant staff, a mucus adjusting panel can be provided in the game engine, wherein the mucus adjusting panel comprises an adjustable height curve of the mucus, and the game engine enables the relevant staff to draw or adjust the height curve of the mucus in the mucus adjusting panel by displaying the mucus adjusting panel, so that the convenience of the relevant staff in controlling the mucus model is improved. As shown in fig. 6a, the relevant staff member performs a corresponding adjustment operation on the mucus height curve, for example, drags a certain position of the mucus height curve upwards or downwards, so as to prompt the game engine to acquire operation information on the mucus height curve, and thus, the change of the mucus height curve is controlled according to the operation information, so as to obtain a changed mucus height curve.
It is understood that the numerical values shown on the horizontal axis in fig. 6a are mapped numerical values corresponding to the case where the number of layers per annular grid line is mapped in the range of 0 to 1. Also, the game engine may set the height of the vertical axis in fig. 6a to be also in the range of 0 to 1, thereby determining the position of the height corresponding to the vertex of a certain number of layers in fig. 6a on the mucus flow direction curve based on the mapped point value of the mucus curve point on the mucus flow direction curve mapped in the range of 0 to 1.
In some embodiments, the mucus adjusting panel further includes a height curve template control corresponding to the mucus height curve, as shown in fig. 6a, so as to obtain a mucus height curve through a triggering operation on the height curve template control, display the mucus height curve corresponding to the triggered height curve template in a curve display area in the mucus adjusting panel, and adjust a curve corresponding to the mucus height curve template to obtain a changed mucus height curve.
In some embodiments, the mucus adjusting template further includes a height setting control corresponding to the mucus height curve, where the height setting control includes, but is not limited to, a position input control and a height adjusting control, as shown in fig. 6a, that is, the game engine may determine a position of a curve to be adjusted on the mucus height curve through the position input control, and then drag the position of the curve upward or downward, or control the height adjusting control based on the position, so as to adjust the height of the position, thereby changing the mucus height curve and obtaining a changed mucus height curve.
For the obtained target offset value, because the mucus model has a wire drawing effect, the diameters of the cut surfaces corresponding to different positions of the mucus model are different, and the target offset value is introduced in the embodiment to realize that the diameters of the cut surfaces corresponding to different positions of the mucus model are different, wherein the target offset value is used for indicating the relative distance between the top point on each annular grid line and the center point of the annular grid line on the mucus flowing direction curve.
Specifically, the target offset value may be an offset value in which a vertex on each of the circular grid lines moves toward a center point of the mucus flow direction curve, or may be an offset value in which a center point of the mucus flow direction curve moves toward a vertex on each of the circular grid lines, which is not limited herein. It is understood that, the directions in which the target offset values are offset are different, and the manner of controlling the vertex to move according to the target offset values subsequently also differs, for example, the vertex may be controlled to move from the edge position of the circular grid line to the center point, or the vertex may be controlled to move from the center point to the edge position of the circular grid line.
In some embodiments, the game engine may obtain a mucus offset curve having two coordinate axes, one coordinate axis being used to indicate the number of layers of the circular grid lines in the grid-like planar model, and the other coordinate axis being used to indicate offset values corresponding to vertices on the circular grid lines, so that the game engine may obtain a target offset value corresponding to a vertex on each circular grid line from the mucus offset curve based on the number of layers of the circular grid lines in the grid-like planar model. Therefore, the offset values of different vertexes in the mucus model can be conveniently adjusted through the mucus offset curve so as to change the shape of the mucus model. Wherein, the two coordinate axes of the mucus deviation curve are horizontal and vertical coordinate axes.
In some embodiments, the mucus offset curve including the correspondence between the number of layers of the annular grid lines and the offset value corresponding to the vertex on the annular grid line may be pre-designed, that is, when the game engine receives a mucus model design instruction, the mucus model setting instruction includes offset value requirement information of a relevant worker for the mucus model, and the game engine may directly obtain the mucus offset curve meeting the requirement of the relevant worker from a preset offset value mapping set based on the offset value requirement information of the relevant worker carried in the mucus model setting instruction.
In some embodiments, the mucus deviation curve including the correspondence between the number of layers of the circular grid line and the deviation value corresponding to the vertex on the circular grid line may be generated in real time
The lines may be generated automatically by the game engine or drawn by the relevant staff, and 5 is not limited herein, so as to generate the mucus offset curve required by the relevant staff.
Specifically, if the game engine automatically generates the mucus offset curve, when the game engine receives a mucus model design instruction, the game engine may directly generate the mucus offset curve meeting the requirements of the relevant staff in real time based on the offset value requirement information of the relevant staff, which is carried in the mucus model design instruction.
The offset value requirement information includes, but is not limited to, a slope of a mucus offset curve, a 0-speed of mucus flow, a style requirement of a mucus model, and the like.
Specifically, if the mucus deviation curve is drawn by the relevant staff member, a mucus regulating panel can be provided in the game engine, wherein the mucus regulating panel further comprises an adjustable mucus deviation curve, and the game engine displays the mucus regulating panel to enable the relevant staff member to draw the mucus regulating panel
And the mucus deviation curve is drawn or adjusted, so that the convenience of controlling the mucus model by related workers is improved. As shown in FIG. 5 and FIG. 6b, the staff concerned performs the corresponding adjustment operation on the mucus deviation curve, such as the adjustment of the mucus deviation curve
And dragging a certain position of the mucus offset curve upwards or downwards to prompt the game engine to acquire operation information of the mucus offset curve, so that the mucus offset curve is controlled to change according to the operation information to obtain a changed mucus offset curve.
It is understood that the horizontal axis in fig. 6b shows the mapped values when the number of layers 0 of each annular grid line is mapped to the range of 0 to 1, which is not illustrated in fig. 6b for easy viewing, and can be specifically referred to fig. 6 a. Also, the game engine may set the offset value of the vertical axis in fig. 6b to also range from 0 to 1, thereby determining the position of the offset value on the mucus flow direction curve corresponding to the vertex of a certain number of layers in fig. 6b based on the mapped point value of the mucus curve point on the mucus flow direction curve mapped to range from 0 to 1. Wherein positive and negative values of the vertical axis in fig. 6b are used to indicate direction.
5 in some embodiments, the mucus regulation panel further includes an offset value corresponding to a mucus offset curve
As shown in fig. 6b, the curve template control acquires a mucus offset curve through a triggering operation on the offset value curve template control, so as to display the mucus offset curve corresponding to the triggered offset value curve template in a curve display area in the mucus adjusting panel, so as to adjust the curve corresponding to the mucus offset curve template, and obtain a changed mucus offset curve.
In some embodiments, the mucus adjusting template further includes an offset value setting control corresponding to the mucus offset curve, where the offset value setting control includes, but is not limited to, a position input control and an offset value adjusting control, as shown in fig. 6b, that is, the game engine may determine a position of a curve to be adjusted on the mucus offset curve through the position input control, and then drag the curve position upward or downward, or control the offset value adjusting control based on the position, so as to adjust the offset value of the position, thereby changing the mucus offset curve, and obtaining a changed mucus offset curve.
In some embodiments, the mucus regulating panel may include a mucus height profile and a mucus deflection profile simultaneously, to enable simultaneous operation of the mucus height profile and the mucus deflection profile; the mucus regulation panel may also not comprise both a mucus height profile and a mucus offset profile, i.e. the mucus regulation panel comprises either the mucus height profile or the mucus offset profile, e.g. displaying the mucus height profile first and then the mucus offset profile; or the mucus deviation curve is displayed firstly, and then the mucus height curve is displayed.
Further, the game engine can display the display effect of the corresponding mucus model for each change of the mucus height curve and/or the mucus offset curve in real time in the process of controlling the change of the mucus height curve and/or the mucus offset curve, so that the relevant staff can further adjust the display effect based on the mucus model.
204. And controlling the vertex to shift along the mucus flowing direction curve according to the target height value and the target deviation value so as to generate the flowing animation of the mucus model.
In this embodiment, the game engine controls the vertices on the circular grid line to shift along the mucus flowing direction curve based on the determined target height values and target offset values as the limiting conditions, and stops shifting until the target height values and the target offset values corresponding to the vertices are met, so as to generate a three-dimensional mucus model required by the relevant staff, as shown in fig. 7, thereby improving the generation efficiency of the flowing animation.
In some embodiments, since the mucus flow curves have different directions at different positions, when vertices on the grid-shaped planar model shift along the mucus flow direction curve, coordinates of the vertices need to be rotationally transformed based on a tangential direction of a central point of the annular grid line where the vertices are located on the mucus flow direction curve, so as to promote a normal line of the vertices to fit the tangential direction of the central point, and then the rotated vertices are shifted, so as to shift the vertices on the planar model along the mucus flow direction curve, thereby generating the mucus model required by a relevant worker.
Specifically, the controlling the vertex to shift along the mucus flowing direction curve according to the target height value and the target shift value to generate the flowing animation of the mucus model may include: 5 determining the height of each ring grid line based on the target height value corresponding to the top point of each ring grid line
A central point on the mucus flowing direction curve, and determining a tangent direction of the curve of the central point, as shown in fig. 8a, fig. 8a is a tangent direction of each point on the mucus flowing direction curve, so that a vertex on each annular grid line is subjected to rotation transformation based on the tangent direction of the curve of the central point corresponding to each annular grid line,
and obtaining the vertex after the rotation transformation. Determining the offset direction of the top point on each annular grid line based on the central point corresponding to each annular grid line and the top 0 point after the rotation transformation; controlling rotation on the annular grid lines
And moving the transformed vertex to the central point along the mucus flowing direction curve, and controlling the rotationally transformed vertex to shift along the shift direction according to the target shift value to generate a flowing animation of the mucus model, as shown in fig. 8b, wherein a normal line schematic diagram of each rotationally transformed vertex is shown in fig. 8 b.
5 it will be appreciated that, after the mucus model is generated, the normals to the vertices on the mucus model are adjusted,
the normals of the vertices on the model are adjusted, for example, by the adjacent surfaces of the vertices, so that the normal-adjusted mucus model is applied to the actual scene.
If the direction of the shift of the vertex is such that the vertex moves from the edge position to the center point of the circular mesh line, the target shift value is equal to or smaller than the distance of 0 between the edge position and the center point of the circular mesh line and, for example, if the circular mesh line is circular, the target shift value is equal to or smaller than the radius of the circle formed by the circular mesh line.
In particular, since the number of layers per annular gridline and the point values of the curve points of the mucus flow direction curve are mapped to the same spatial numerical value when determining the target height value and the target offset value, as in the above example
Is a numerical value in the range of 0 to 1. Therefore, the game engine may obtain coordinates of a center point corresponding to the curve of the mucus flowing direction and a curve tangential direction of the center point by the uvsample method based on the target height value corresponding to the 5 vertexes on each of the circular grid lines.
In some embodiments, the rotationally transforming the vertex on each annular grid line based on the curve tangential direction of the central point corresponding to each annular grid line to obtain the vertex after the rotational transformation specifically may include: acquiring the normal direction of the vertex on each annular grid line, wherein the normal direction is the plane normal direction of the vertex on the grid-shaped plane model; based on the correspondence of vertices on each of the circular grid lines
Determining quaternion corresponding to the vertex on each annular grid line in the normal direction and the tangent direction of the curve; and 5, carrying out rotation transformation on the vertex on each annular grid line based on the quaternion corresponding to the vertex on each annular grid line to obtain the vertex after the rotation transformation.
It is understood that since the rotation of the vertex is for urging the normal line of the vertex to fit the tangential direction of the center point on the mucus flow direction curve corresponding to the vertex, the vertex-based rotation may be based on the latticed plane model
The vertex rotation vector is determined, that is, the quaternion is determined, so as to perform rotation transformation on the vertex based on the quaternion, wherein the rotation transformation is performed by the quaternion, so that vertex rotation data is stored, that is, the quaternion is stored, so that another game engine can perform rotation transformation on the vertex directly based on the quaternion, for example, in a Shader (denoted as Shader) of the game engine, the corresponding vertex is subjected to rotation transformation by the quaternion.
5 in some embodiments, the game engine may also perform a rotation transformation on the vertices directly by the qrotate method.
In some embodiments, since the generated mucus model is used for displaying the mucus special effect, a mucus special effect corresponds to the flow animation including at least one frame of image, and each frame of image corresponds to a mucus model,
therefore, in order to form a mucus effect, at least one mucus model is generated. Moreover, in order to implement the display of the mucus special effect 0 on different game engines, in this embodiment, the flow animation information for generating a flow animation may be stored, and the flow animation information includes the mucus attribute information on each circular grid line for generating the mucus model corresponding to at least one image frame, so that other game engines may obtain the flow animation information for displaying the flow animation, for example, in shaders of another game engine, the flow animation may be restored based on the flow animation information.
In this embodiment, to reduce the resources required to save data, the terminal may introduce a map to the terminal
The flow animation information is saved in the map, so that the recording of the flow animation information of the flow animation can be realized through the limited map. It can be understood that, since the mucus attribute information of each vertex on each annular grid line is the same, only one piece of mucus attribute information needs to be correspondingly stored for each annular grid line, that is, in two coordinate axes in the map, one coordinate axis indicates the number of frames of the flow animation, and the other coordinate axis indicates the number of layers of the annular grid lines in the latticed planar model, wherein the two coordinate axes in the map are horizontal and vertical coordinate axes, and the pixel value of the pixel corresponding to the horizontal and vertical coordinates in the map is the stored mucus attribute information, thereby realizing compression of the flow animation information of the flow animation, improving the performance, reducing the bandwidth pressure, saving the cost of the bandwidth, and improving the display effect of the mucus special effect corresponding to the flow animation as a whole.
When a mucus model corresponding to each image frame is generated, the mucus attribute information on each annular grid line in each mucus model can be recorded in advance on the vertex attribute corresponding to the vertex, and after all the mucus models required by the flow animation are obtained, the mucus attribute information on each annular grid line in all the mucus models is stored in a map; or, when a mucus model corresponding to an image frame is generated, the mucus attribute information on each annular grid line in the mucus model is stored in the map.
In some embodiments, since the vertex on each annular grid line needs to be rotated when the mucus model is generated, the mucus attribute information on each annular grid line includes a quaternion, so that the vertex on each annular grid line is rotated by reading the quaternion in the map by another terminal.
Specifically, after determining the quaternion corresponding to the vertex on each annular grid line, the method may further include: acquiring a first map for storing flowing animation information, wherein in two coordinate axes of the first map, one coordinate axis indicates the frame number of flowing animation, and the other coordinate axis indicates the layer number of annular grid lines in the grid-shaped plane model; determining a first pixel position of the mucus attribute information of each annular grid line of the current image frame stored in the first map based on the number of layers of each annular grid line in the latticed planar model and the number of frames of the image frame currently processed by the flow animation; and baking the quaternion corresponding to each annular grid line to a first pixel position in the first map, wherein the baked first map is used for providing the quaternion for a mucus model of the current image frame in the flowing animation.
It can be understood that, since the pixel value of the pixel is rgba, the quaternion corresponding to a certain annular grid line when the mucus model is generated under a certain frame of image frame can be determined by reading the rgba of a pixel in the baked first map.
In some embodiments, since the vertex on each circular grid line needs to be shifted when the mucus model is generated, the mucus attribute information on each circular grid line further includes a position of a central point of each circular grid line on the mucus flowing direction curve and a target offset value of the vertex, so that the other terminal realizes shifting the vertex on each circular grid line by reading the position of the central point and the target offset value of the vertex in the map.
Specifically, after obtaining the target height value corresponding to the vertex on each annular grid line on the grid-shaped plane model, the method may further include: determining the position of the central point of each annular grid line on the mucus flowing direction curve based on the target height value corresponding to the vertex on each annular grid line; acquiring a second map for storing flowing animation information, wherein in two coordinate axes of the second map, one coordinate axis indicates the frame number of the flowing animation, and the other coordinate axis indicates the layer number of annular grid lines in the latticed plane model; determining a second pixel position of mucus attribute information of each annular grid line of the current image frame stored in the second map based on the number of layers of each annular grid line in the latticed plane model and the number of frames of the image frame currently processed by the flow animation; and baking the position of the central point and the target offset value corresponding to each annular grid line to a second pixel position in the second map, wherein the baked second map is used for providing the position of the central point and the target offset value for the mucus model of the current image frame in the flowing animation.
It can be understood that, since the pixel value of the pixel is rgba, the position of the center point corresponding to a certain annular grid line when the mucus model is generated under a certain frame of image frame can be determined by reading the rgb of a pixel in the baked second map; and determining a target offset value corresponding to a certain annular grid line when the mucus model is generated under a certain frame of image frame by reading a of a pixel in the baked second map.
In some embodiments, since the normal of the vertex of each circular grid line on the mucus model needs to be adjusted when the mucus model is generated, the mucus attribute information on each circular grid line further includes the projection lengths of the normal of the vertex on each circular grid line on two base vectors, where the two base vectors are respectively the curve tangential direction and the direction from the central point of each circular grid line on the mucus flowing direction curve to the rotated vertex, so as to implement the normal adjustment of the vertex on each circular grid line on the mucus model by reading the projection lengths on the two base vectors in the map at the other terminal.
The directions of the two basis vectors may be calculated in another terminal, for example, in a Shader of a game engine, and then cross product processing is performed to obtain a direction of a third basis vector, that is, an adjusted normal direction. It can be understood that when a mucus model is generated in an actual scene of another terminal, the actual normal direction of the mucus model is affected by the model structure, so a coordinate system needs to be determined, that is, the coordinate system is composed based on the directions corresponding to which parameters, so that the normal is restored under the definite coordinate system.
Specifically, the projection lengths of the normal lines of the vertexes on each annular grid line on the mucus model on two base vectors are obtained; acquiring a third map for storing flowing animation information, wherein in two coordinate axes of the third map, one coordinate axis indicates the frame number of the flowing animation, and the other coordinate axis indicates the layer number of annular grid lines in the latticed plane model; determining a third pixel position of the third map, which stores mucus attribute information of each annular grid line of the current image frame, based on the number of layers of each annular grid line in the latticed planar model and the number of frames of the image frame currently processed by the flow animation; and baking the projection lengths of the normals of the vertexes on each annular grid line on the mucus model on the two base vectors to a third pixel position in the second map, wherein the baked third map is used for providing the projection lengths of the normals of the vertexes on the two base vectors for the mucus model of the current image frame in the flow animation.
It can be understood that, since the pixel value of the pixel is rgba, the projection length of the normal of the vertex on a certain annular grid line when the mucus model is generated under a certain frame of image frame on two basis vectors can be determined by reading the rg of a pixel in the baked third map.
It is to be understood that the first map, the second map, and the third map may be the same map or different maps, and may be set according to requirements, and if the first map, the second map, and the third map are the same destination map, the destination map may be divided into regions to divide different regions, so as to represent different parameters in the mucus attribute information on each circular grid line by the different regions.
Illustratively, the set flow animation includes 128 image frames, and it is set that 32 circular grid lines exist in each latticed planar model, and it is also set that the mucus attribute information on each circular grid line includes a quaternion, a position of a central point, a target offset value, and a projection length of a normal line of a vertex on two basis vectors, and the mucus attribute information on each circular grid line is stored into one map, as shown in fig. 9, fig. 9 is a map of 128 × 96, and it can be seen from fig. 9 that the map is divided into three regions, namely, three dashed regions in fig. 9, a region a, a region B, and a region C, each region being 128 × 32, wherein the region a is used for storing the projection length of the normal line of the vertex on two basis vectors, the region B is used for including the position of the central point and the target offset value, and the region C is used for storing the quaternion.
It can be understood that, when the other terminal generates the mucus model based on the map, it needs to obtain a latticed plane model, wherein the latticed plane model can be recorded by means of unfolding UV, for example, by using two UV files, one UV file is used for recording the shape of the latticed plane model in the two-dimensional space, and since the latticed plane model is generally a two-dimensional model, the shape of the latticed plane model in the two-dimensional space is consistent with the shape of the latticed plane model in the three-dimensional space, as shown in fig. 3 a; in addition, the number of layers mapped to each annular grid line of the latticed plane model may also be recorded by the second UV file, and the specific recording manner may be as shown in fig. 5a, or as shown in fig. 5b, so that the mapped number is used as an index of a coordinate in the map when another terminal samples from the map.
And after the sampling of the other terminal in the map is finished, generating a corresponding mucus model under the local coordinate of the other terminal based on the sampled mucus attribute information, and restoring the normal of the vertex of each annular grid line on the mucus model, thereby realizing the generation of the mucus model in the other terminal.
In some embodiments, after obtaining the mucus model, the terminal may further randomly or specifically obtain an image, and assign a corresponding color to the mucus model based on the color on the image, so as to obtain a color-assigned mucus model, as shown in fig. 10.
As can be seen from the above, by obtaining a grid-shaped planar model of a mucus model to be generated, where a grid on the grid-shaped planar model is divided by at least two annular grid lines and at least two segmentation grid lines intersecting the annular grid lines, an intersection point of the annular grid lines and the segmentation grid lines is a vertex of the mucus model, so as to determine a structure of the mucus model on a plane based on the grid-shaped planar model. Then, a mucus flow direction curve is obtained again to determine the flow direction of the mucus model based on the curve. And then obtaining a target height value and a target offset value corresponding to the vertex, so as to determine the position of the vertex on the annular grid line in the mucus model based on the target height value and the target offset value, and controlling the vertex to offset along the mucus flowing direction curve according to the target height value and the target offset value so as to generate the flowing animation of the mucus model, thereby improving the generation efficiency of the flowing animation.
In order to better implement the method, embodiments of the present application further provide a flow animation generation apparatus, which may be specifically integrated in an electronic device, for example, a computer device, where the computer device may be a terminal, a server, or the like.
The terminal can be a mobile phone, a tablet computer, an intelligent Bluetooth device, a notebook computer, a personal computer and other devices; the server may be a single server or a server cluster composed of a plurality of servers.
For example, in this embodiment, a method in an embodiment of the present application is described in detail by taking an example that a flow animation generating device is specifically integrated in a terminal, and this embodiment provides a flow animation generating device, as shown in fig. 11, the flow animation generating device may include:
a model obtaining module 111, configured to obtain a grid-shaped plane model of a mucus model to be generated, where a grid on the grid-shaped plane model is divided by at least two annular grid lines and at least two segmentation grid lines intersecting the annular grid lines, and an intersection point of the annular grid lines and the segmentation grid lines is a vertex of the mucus model;
a curve obtaining module 112, configured to obtain a mucus flow direction curve;
an information obtaining module 113, configured to obtain a target height value and a target offset value corresponding to the vertex;
and a model generating module 114, configured to control the vertex to shift along the mucus flowing direction curve according to the target height value and the target shift value, so as to generate a flowing animation of the mucus model.
In some embodiments, the information obtaining module 113 is specifically configured to:
acquiring a mucus height curve, wherein in two coordinate axes of the mucus height curve, one coordinate axis is used for indicating the number of layers of the annular grid lines in the grid-shaped plane model, and the other coordinate axis is used for indicating the height corresponding to the top points on the annular grid lines;
acquiring a target height value corresponding to a vertex on each annular grid line from the mucus height curve based on the number of layers of each annular grid line in the latticed plane model;
acquiring a mucus offset curve, wherein in two coordinate axes of the mucus offset curve, one coordinate axis is used for indicating the number of layers of the annular grid lines in the grid-shaped plane model, and the other coordinate axis is used for indicating the offset value corresponding to the vertex on the annular grid lines;
and acquiring a target offset value corresponding to the vertex of each annular grid line from the mucus offset curve based on the number of layers of each annular grid line in the latticed plane model.
In some embodiments, the apparatus for generating a flow animation further includes an operation module, where the operation module is specifically configured to:
displaying a mucus regulation panel, wherein the mucus regulation panel comprises the mucus height curve and/or the mucus offset curve;
acquiring operation information of the mucus height curve and/or the mucus deviation curve;
and controlling the mucus height curve and/or the mucus offset curve to change according to the operation information to obtain a changed mucus height curve and/or a changed mucus offset curve.
In some embodiments, the model generation module 114 is specifically configured to:
determining a central point of each annular grid line on the mucus flowing direction curve based on a target height value corresponding to a vertex on each annular grid line, and determining a curve tangent direction of the central point;
performing rotation transformation on the top point on each annular grid line based on the curve tangential direction of the central point corresponding to each annular grid line to obtain the top point after the rotation transformation;
determining the offset direction of the vertex on each annular grid line based on the central point corresponding to each annular grid line and the vertex after the rotation transformation;
and controlling the vertex after the rotation transformation on the annular grid line to move to the central point along the mucus flowing direction curve, and controlling the vertex after the rotation transformation to shift along the shift direction according to the target shift value so as to generate the flowing animation of the mucus model.
In some embodiments, the model generation module 114 is further specifically configured to:
acquiring the normal direction of a vertex on each annular grid line;
determining a quaternion corresponding to the vertex on each annular grid line based on the normal direction corresponding to the vertex on each annular grid line and the tangent direction of the curve;
and performing rotation transformation on the vertex on each annular grid line based on the quaternion corresponding to the vertex on each annular grid line to obtain the vertex after the rotation transformation.
In some embodiments, the flow animation generating device further includes a first baking module, where the first baking module is specifically configured to:
acquiring a first map for storing flowing animation information, wherein in two coordinate axes of the first map, one coordinate axis indicates the frame number of flowing animation, and the other coordinate axis indicates the layer number of annular grid lines in the grid-shaped plane model;
determining a first pixel position of the mucus attribute information of each annular grid line of the current image frame stored in the first map based on the number of layers of each annular grid line in the latticed planar model and the number of frames of the image frame currently processed by the flow animation;
and baking the quaternion corresponding to each annular grid line to a first pixel position in the first map, wherein the baked first map is used for providing the quaternion for a mucus model of the current image frame in the flowing animation.
In some embodiments, the flow animation generating device further includes a second baking module, where the second baking module is specifically configured to:
determining the position of the central point of each annular grid line on the mucus flowing direction curve based on the target height value corresponding to the vertex on each annular grid line;
acquiring a second map for storing flowing animation information, wherein in two coordinate axes of the second map, one coordinate axis indicates the frame number of the flowing animation, and the other coordinate axis indicates the layer number of annular grid lines in the latticed plane model;
determining a second pixel position of the mucus attribute information of each annular grid line of the current image frame stored in the second map based on the number of layers of each annular grid line in the latticed planar model and the number of frames of the image frame currently processed by the flow animation;
and baking the position of the central point and the target offset value corresponding to each annular grid line to a second pixel position in the second map, wherein the baked second map is used for providing the position of the central point and the target offset value for a mucus model of a current image frame in the flow animation.
As can be seen from the above, the apparatus for generating a flow animation according to this embodiment obtains, by using the model obtaining module 111, a grid-shaped plane model of a mucus model to be generated, where a grid on the grid-shaped plane model is divided by at least two annular grid lines and at least two segmentation grid lines intersecting the annular grid lines, and an intersection point of the annular grid lines and the segmentation grid lines is a vertex of the mucus model, so as to determine a structure of the mucus model on a plane based on the grid-shaped plane model. Then, a mucus flowing direction curve is obtained through the curve obtaining module 112, so that the flowing direction of the mucus model is determined based on the curve. And then, the information obtaining module 113 obtains a target height value and a target offset value corresponding to the vertex, so as to determine a position where the vertex on the circular grid line should be located in the mucus model based on the target height value and the target offset value, and the model generating module 114 controls the vertex to offset along the mucus flowing direction curve according to the target height value and the target offset value, so as to generate the flowing animation of the mucus model, thereby improving the generation efficiency of the flowing animation.
Correspondingly, the embodiment of the present application further provides an electronic device, where the electronic device may be a terminal, and the terminal may be a terminal device such as a smart phone, a tablet Computer, a notebook Computer, a touch screen, a game machine, a Personal Computer (PC), a Personal Digital Assistant (PDA), and the like. As shown in fig. 12, fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device 120 includes a processor 121 having one or more processing cores, a memory 122 having one or more computer-readable storage media, and a computer program stored on the memory 122 and executable on the processor. The processor 121 is electrically connected to the memory 122. Those skilled in the art will appreciate that the electronic device configurations shown in the figures do not constitute limitations of the electronic device, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
The processor 121 is a control center of the electronic device 120, connects various parts of the whole electronic device 120 by using various interfaces and lines, performs various functions of the electronic device 120 and processes data by running or loading software programs and/or modules stored in the memory 122, and calling data stored in the memory 122, thereby performing overall monitoring of the electronic device 120.
In the embodiment of the present application, the processor 121 in the electronic device 120 loads instructions corresponding to processes of one or more application programs into the memory 122, and the processor 121 executes the application programs stored in the memory 122 according to the following steps, so as to implement various functions:
acquiring a latticed plane model of a mucus model to be generated, wherein a grid on the latticed plane model is divided by at least two annular grid lines and at least two segmentation grid lines intersected with the annular grid lines, and the intersection points of the annular grid lines and the segmentation grid lines are vertexes of the mucus model;
obtaining a mucus flowing direction curve;
obtaining a target height value and a target deviation value corresponding to the vertex;
and controlling the vertex to shift along the mucus flowing direction curve according to the target height value and the target deviation value so as to generate the flowing animation of the mucus model.
In some embodiments, the obtaining the target height value and the target offset value corresponding to the vertex includes:
acquiring a mucus height curve, wherein one coordinate axis coordinate of two coordinate axes of the mucus height curve is used for indicating the number of layers of the annular grid lines in the grid-shaped plane model, and the other coordinate axis coordinate is used for indicating the height corresponding to the top points on the annular grid lines;
acquiring a target height value corresponding to a vertex on each annular grid line from the mucus height curve based on the number of layers of each annular grid line in the latticed plane model;
acquiring a mucus offset curve, wherein in two coordinate axes of the mucus offset curve, one coordinate axis is used for indicating the number of layers of the annular grid lines in the grid-shaped plane model, and the other coordinate axis is used for indicating the offset value corresponding to the vertex on the annular grid lines;
and acquiring a target offset value corresponding to a vertex on each annular grid line from the mucus offset curve based on the number of layers of each annular grid line in the latticed plane model.
In some embodiments, further comprising:
displaying a mucus regulation panel, wherein the mucus regulation panel comprises the mucus height curve and/or the mucus offset curve;
acquiring operation information of the mucus height curve and/or the mucus deviation curve;
and controlling the mucus height curve and/or the mucus deviation curve to change according to the operation information to obtain a changed mucus height curve and/or a changed mucus deviation curve.
In some embodiments, the controlling the vertex to shift along the mucus flowing direction curve according to the target height value and the target shift value to generate the flowing animation of the mucus model includes:
determining a central point of each annular grid line on the mucus flowing direction curve based on a target height value corresponding to a vertex on each annular grid line, and determining a curve tangent direction of the central point;
performing rotation transformation on the top point on each annular grid line based on the curve tangential direction of the central point corresponding to each annular grid line to obtain the top point after the rotation transformation;
determining the offset direction of the vertex on each annular grid line based on the central point corresponding to each annular grid line and the vertex after the rotation transformation;
and controlling the vertex after the rotation transformation on the annular grid line to move to the central point along the mucus flowing direction curve, and controlling the vertex after the rotation transformation to shift along the shift direction according to the target shift value so as to generate the flowing animation of the mucus model.
In some embodiments, the rotationally transforming the vertex on each circular grid line based on the tangent direction of the curve of the central point corresponding to each circular grid line to obtain the rotationally transformed vertex includes:
acquiring the normal direction of a vertex on each annular grid line;
determining a quaternion corresponding to the vertex on each annular grid line based on the normal direction corresponding to the vertex on each annular grid line and the tangent direction of the curve;
and performing rotation transformation on the vertex on each annular grid line based on the quaternion corresponding to the vertex on each annular grid line to obtain the vertex after the rotation transformation.
In some embodiments, after determining the quaternion corresponding to the vertex on each of the circular grid lines, the method further includes:
acquiring a first map for storing flowing animation information, wherein in two coordinate axes of the first map, one coordinate axis indicates the frame number of flowing animation, and the other coordinate axis indicates the layer number of annular grid lines in the grid-shaped plane model;
determining a first pixel position of the mucus attribute information of each annular grid line of the current image frame stored in the first map based on the number of layers of each annular grid line in the latticed planar model and the number of frames of the image frame currently processed by the flow animation;
and baking the quaternion corresponding to each annular grid line to a first pixel position in the first map, wherein the baked first map is used for providing the quaternion for a mucus model of the current image frame in the flowing animation.
In some embodiments, after obtaining the target height value and the target offset value corresponding to the vertex, the method further includes:
determining the position of the central point of each annular grid line on the mucus flowing direction curve based on the target height value corresponding to the vertex on each annular grid line;
acquiring a second map for storing flowing animation information, wherein in two coordinate axes of the second map, one coordinate axis indicates the frame number of flowing animation, and the other coordinate axis indicates the layer number of annular grid lines in the grid-shaped planar model;
determining a second pixel position of the mucus attribute information of each annular grid line of the current image frame stored in the second map based on the number of layers of each annular grid line in the latticed planar model and the number of frames of the image frame currently processed by the flow animation;
and baking the position of the central point and the target offset value corresponding to each annular grid line to a second pixel position in the second map, wherein the baked second map is used for providing the position of the central point and the target offset value for a mucus model of a current image frame in the flow animation.
Therefore, the electronic device 120 provided by the embodiment can bring the following technical effects: the generation efficiency of the flow animation is improved.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Optionally, as shown in fig. 12, the electronic device 120 further includes: a touch display screen 123, a radio frequency circuit 124, an audio circuit 125, an input unit 126, and a power supply 127. The processor 121 is electrically connected to the touch display screen 123, the radio frequency circuit 124, the audio circuit 125, the input unit 126, and the power source 127. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 12 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The touch display screen 123 can be used for displaying a graphical user interface and receiving an operation instruction generated by a user acting on the graphical user interface. The touch display screen 123 may include a display panel and a touch panel. The display panel may be used, among other things, to display information entered by or provided to a user and various graphical user interfaces of the electronic device, which may be made up of graphics, text, icons, video, and any combination thereof. Alternatively, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations of a user (for example, operations of the user on or near the touch panel by using a finger, a stylus pen, or any other suitable object or accessory) and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 121, and can receive and execute commands sent by the processor 121. The touch panel may cover the display panel, and when the touch panel detects a touch operation thereon or nearby, the touch panel transmits the touch operation to the processor 121 to determine the type of the touch event, and then the processor 121 provides a corresponding visual output on the display panel according to the type of the touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 123 to realize input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two separate components to perform the input and output functions. That is, the touch display screen 123 may also be used as a part of the input unit 126 to implement an input function.
The rf circuit 124 may be used for transceiving rf signals to establish wireless communication with a network device or other electronic devices via wireless communication, and for transceiving signals with the network device or other electronic devices.
The audio circuit 125 may be used to provide an audio interface between the user and the electronic device through a speaker, microphone. The audio circuit 125 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 125 and converted into audio data, which is then processed by the audio data output processor 121 and then transmitted to, for example, another electronic device via the radio frequency circuit 124, or the audio data is output to the memory 122 for further processing. The audio circuitry 125 may also include an earbud jack to provide communication of peripheral headphones with the electronic device.
The input unit 126 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The power supply 127 is used to power the various components of the electronic device 120. Optionally, the power supply 127 may be logically connected to the processor 121 through a power management system, so as to implement functions of managing charging, discharging, power consumption management, and the like through the power management system. The power supply 127 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown in fig. 12, the electronic device 120 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which are not described in detail herein.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer programs can be loaded by a processor to execute the steps in any one of the flow animation generation methods provided by the present application. For example, the computer program may perform the steps of:
acquiring a latticed plane model of a mucus model to be generated, wherein a grid on the latticed plane model is divided by at least two annular grid lines and at least two segmentation grid lines intersected with the annular grid lines, and the intersection points of the annular grid lines and the segmentation grid lines are vertexes of the mucus model;
obtaining a mucus flowing direction curve;
acquiring a target height value and a target offset value corresponding to a vertex on each annular grid line on the grid-shaped plane model;
and controlling the vertex to shift along the mucus flowing direction curve according to the target height value and the target deviation value so as to generate the flowing animation of the mucus model.
In some embodiments, the obtaining the target height value and the target offset value corresponding to the vertex includes:
acquiring a mucus height curve, wherein one coordinate axis coordinate of two coordinate axes of the mucus height curve is used for indicating the number of layers of the annular grid lines in the grid-shaped plane model, and the other coordinate axis coordinate is used for indicating the height corresponding to the top points on the annular grid lines;
acquiring a target height value corresponding to a vertex on each annular grid line from the mucus height curve based on the number of layers of each annular grid line in the latticed plane model;
acquiring a mucus offset curve, wherein in two coordinate axes of the mucus offset curve, one coordinate is used for indicating the number of layers of an annular grid line in a grid-shaped plane model, and the other coordinate is used for indicating an offset value corresponding to a vertex on the annular grid line;
and acquiring a target offset value corresponding to a vertex on each annular grid line from the mucus offset curve based on the number of layers of each annular grid line in the latticed plane model.
In some embodiments, further comprising:
displaying a mucus regulation panel, wherein the mucus regulation panel comprises the mucus height curve and/or the mucus offset curve;
acquiring operation information of the mucus height curve and/or the mucus deviation curve;
and controlling the mucus height curve and/or the mucus offset curve to change according to the operation information to obtain a changed mucus height curve and/or a changed mucus offset curve.
In some embodiments, the controlling the vertex to shift along the mucus flowing direction curve according to the target height value and the target shift value to generate the flowing animation of the mucus model includes:
determining a central point of each annular grid line on the mucus flowing direction curve based on a target height value corresponding to a vertex on each annular grid line, and determining a curve tangent direction of the central point;
performing rotation transformation on the vertex on each annular grid line based on the curve tangent direction of the central point corresponding to each annular grid line to obtain the vertex after the rotation transformation;
determining the offset direction of the vertex on each annular grid line based on the central point corresponding to each annular grid line and the vertex after the rotation transformation;
and controlling the vertex after the rotation transformation on the annular grid line to move to the central point along the mucus flowing direction curve, and controlling the vertex after the rotation transformation to shift along the shift direction according to the target shift value so as to generate the flowing animation of the mucus model.
In some embodiments, the rotationally transforming vertices on each annular grid line based on the tangential direction of the curve of the central point corresponding to each annular grid line to obtain the rotationally transformed vertices includes:
acquiring the normal direction of a vertex on each annular grid line;
determining a quaternion corresponding to the vertex on each annular grid line based on the normal direction corresponding to the vertex on each annular grid line and the tangent direction of the curve;
and performing rotation transformation on the vertex on each annular grid line based on the quaternion corresponding to the vertex on each annular grid line to obtain the vertex after the rotation transformation.
In some embodiments, after determining the quaternion corresponding to the vertex on each of the circular grid lines, the method further includes:
acquiring a first map for storing flowing animation information, wherein in two coordinate axes of the first map, one coordinate axis indicates the frame number of flowing animation, and the other coordinate axis indicates the layer number of annular grid lines in the grid-shaped plane model;
determining a first pixel position of the mucus attribute information of each annular grid line of the current image frame stored in the first map based on the number of layers of each annular grid line in the latticed planar model and the number of frames of the image frame currently processed by the flow animation;
and baking the quaternion corresponding to each annular grid line to a first pixel position in the first map, wherein the baked first map is used for providing the quaternion for a mucus model of the current image frame in the flowing animation.
In some embodiments, after obtaining the target height value and the target offset value corresponding to the vertex, the method further includes:
determining the position of the central point of each annular grid line on the mucus flowing direction curve based on the target height value corresponding to the vertex of each annular grid line;
acquiring a second map for storing flowing animation information, wherein in two coordinate axes of the second map, one coordinate axis indicates the frame number of the flowing animation, and the other coordinate axis indicates the layer number of annular grid lines in the latticed plane model;
determining a second pixel position of the mucus attribute information of each annular grid line of the current image frame stored in the second map based on the number of layers of each annular grid line in the latticed planar model and the number of frames of the image frame currently processed by the flow animation;
and baking the position of the central point and the target offset value corresponding to each annular grid line to a second pixel position in the second map, wherein the baked second map is used for providing the position of the central point and the target offset value for the mucus model of the current image frame in the flowing animation.
It can be seen that the computer program can be loaded by a processor to execute the steps in any of the methods for generating a flow animation provided by the embodiments of the present application, so as to achieve the following technical effects: the generation efficiency of the flow animation is improved.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the computer-readable storage medium may include: read Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, and the like.
Since the computer program stored in the computer-readable storage medium can execute the steps of any flow animation generation method provided in the embodiment of the present application, beneficial effects that can be achieved by any flow animation generation method provided in the embodiment of the present application can be achieved, for details, see the foregoing embodiments, and are not described herein again.
The foregoing detailed description is directed to a method, an apparatus, an electronic device, and a computer-readable storage medium for generating a flow animation provided in an embodiment of the present application, and a specific example is applied in the detailed description to explain the principles and embodiments of the present application, where the description of the foregoing embodiment is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method for generating a flow animation, the method comprising:
acquiring a latticed plane model of a mucus model to be generated, wherein a grid on the latticed plane model is divided by at least two annular grid lines and at least two segmentation grid lines intersected with the annular grid lines, and the intersection points of the annular grid lines and the segmentation grid lines are the vertexes of the mucus model;
obtaining a mucus flowing direction curve;
acquiring a target height value and a target offset value corresponding to the vertex;
and controlling the vertex to shift along the mucus flowing direction curve according to the target height value and the target shift value so as to generate a flowing animation of the mucus model.
2. The method for generating a flow animation according to claim 1, wherein the obtaining of the target height value and the target offset value corresponding to the vertex comprises:
acquiring a mucus height curve, wherein one coordinate axis coordinate of two coordinate axes of the mucus height curve is used for indicating the number of layers of the annular grid lines in the grid-shaped plane model, and the other coordinate axis coordinate is used for indicating the height corresponding to the top points on the annular grid lines;
acquiring a target height value corresponding to a vertex on each annular grid line from the mucus height curve based on the number of layers of each annular grid line in the latticed plane model;
acquiring a mucus offset curve, wherein in two coordinate axes of the mucus offset curve, one coordinate axis is used for indicating the number of layers of the annular grid lines in the grid-shaped plane model, and the other coordinate axis is used for indicating the offset value corresponding to the vertex on the annular grid lines;
and acquiring a target offset value corresponding to a vertex on each annular grid line from the mucus offset curve based on the number of layers of each annular grid line in the latticed plane model.
3. The flow animation generation method as claimed in claim 2, further comprising:
displaying a mucus regulation panel comprising the mucus height profile and/or the mucus deflection profile therein;
obtaining operational information on the mucus height curve and/or the mucus deflection curve;
and controlling the mucus height curve and/or the mucus deviation curve to change according to the operation information to obtain a changed mucus height curve and/or a changed mucus deviation curve.
4. The method for generating flow animation according to claim 1, wherein the controlling the vertex to shift along the mucus flow direction curve according to the target height value and the target shift value to generate the flow animation of the mucus model comprises:
determining a central point of each annular grid line on the mucus flowing direction curve based on a target height value corresponding to a vertex on each annular grid line, and determining a curve tangent direction of the central point;
performing rotation transformation on the top point on each annular grid line based on the curve tangential direction of the central point corresponding to each annular grid line to obtain the top point after the rotation transformation;
determining the offset direction of the vertex on each annular grid line based on the central point corresponding to each annular grid line and the vertex after the rotation transformation;
and controlling the vertex after the rotation transformation on the annular grid line to move to the central point along the mucus flowing direction curve, and controlling the vertex after the rotation transformation to shift along the shift direction according to the target shift value so as to generate the flowing animation of the mucus model.
5. The method for generating a flow animation according to claim 4, wherein the step of performing a rotation transformation on the vertex on each of the circular grid lines based on the curve tangential direction of the center point corresponding to each of the circular grid lines to obtain a vertex after the rotation transformation comprises:
acquiring the normal direction of a vertex on each annular grid line;
determining a quaternion corresponding to the vertex on each annular grid line based on the normal direction of the vertex on each annular grid line and the tangent direction of the curve;
and performing rotation transformation on the vertex on each annular grid line based on the quaternion corresponding to the vertex on each annular grid line to obtain the vertex after the rotation transformation.
6. The flow animation generation method as claimed in claim 5, further comprising, after determining the quaternion corresponding to the vertex on each of the circular mesh lines:
acquiring a first map for storing flowing animation information, wherein in two coordinate axes of the first map, one coordinate axis indicates the frame number of the flowing animation, and the other coordinate axis indicates the layer number of annular grid lines in the grid-shaped plane model;
determining each ring net storing the current image frame in the first map based on the number of layers of each ring grid line in the latticed planar model and the number of frames of the image frame currently processed by the flow animation
A first pixel position of the mucus attribute information of the ruled line;
and baking the quaternion corresponding to each annular grid line to a first pixel position in the first map, wherein the baked first map is used for providing the quaternion for a mucus model of the current image frame in the flowing animation.
7. The method for generating a flow animation according to any one of claims 1 to 6, further comprising, after obtaining the target height value and the target offset value corresponding to the vertex:
determining the position of the central point of each annular grid line on the mucus flowing direction curve based on the target height value corresponding to the vertex on each annular grid line;
acquiring a second map for storing flowing animation information, wherein in two coordinate axes of the second map, one coordinate axis indicates the frame number of the flowing animation, and the other coordinate axis indicates the layer number of annular grid lines in the grid-shaped planar model;
determining a second pixel position of the second map, which stores mucus attribute information of each annular grid line of the current image frame, based on the number of layers of each annular grid line in the latticed planar model and the number of frames of the image frame currently processed by the flow animation;
and baking the position of the central point and the target offset value corresponding to each annular grid line to a second pixel position in the second map, wherein the baked second map is used for providing the position of the central point and the target offset value for a mucus model of a current image frame in the flow animation.
8. A flow animation generation apparatus, characterized in that the apparatus comprises:
the model obtaining module is used for obtaining a grid-shaped plane model of the mucus model to be generated, wherein a grid on the grid-shaped plane model is divided by at least two annular grid lines and at least two segmentation grid lines intersected with the annular grid lines, and the intersection points of the annular grid lines and the segmentation grid lines are the vertexes of the mucus model;
the curve acquisition module is used for acquiring a mucus flowing direction curve;
the information acquisition module is used for acquiring a target height value and a target offset value corresponding to the vertex;
and the model generation module is used for controlling the vertex to shift along the mucus flowing direction curve according to the target height value and the target shift value so as to generate the flowing animation of the mucus model.
9. An electronic device comprising a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to perform the steps in the flow animation generation method of any of claims 1 to 7.
10. A computer-readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the method for generating a flow animation according to any one of claims 1 to 7.
CN202211578874.6A 2022-12-05 2022-12-05 Flow animation generation method and device, electronic equipment and readable storage medium Pending CN115880402A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211578874.6A CN115880402A (en) 2022-12-05 2022-12-05 Flow animation generation method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211578874.6A CN115880402A (en) 2022-12-05 2022-12-05 Flow animation generation method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN115880402A true CN115880402A (en) 2023-03-31

Family

ID=85766748

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211578874.6A Pending CN115880402A (en) 2022-12-05 2022-12-05 Flow animation generation method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN115880402A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118379202A (en) * 2024-06-27 2024-07-23 山东捷瑞数字科技股份有限公司 Streamer enhancement method, streamer enhancement system, streamer enhancement equipment and streamer enhancement storage medium for three-dimensional graphics

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118379202A (en) * 2024-06-27 2024-07-23 山东捷瑞数字科技股份有限公司 Streamer enhancement method, streamer enhancement system, streamer enhancement equipment and streamer enhancement storage medium for three-dimensional graphics

Similar Documents

Publication Publication Date Title
CN112370783B (en) Virtual object rendering method, device, computer equipment and storage medium
CN112138386A (en) Volume rendering method and device, storage medium and computer equipment
CN112053423A (en) Model rendering method and device, storage medium and computer equipment
CN111445563B (en) Image generation method and related device
CN112802172A (en) Texture mapping method and device of three-dimensional model, storage medium and computer equipment
CN113952720A (en) Game scene rendering method and device, electronic equipment and storage medium
CN113398583A (en) Applique rendering method and device of game model, storage medium and electronic equipment
CN113516742A (en) Model special effect manufacturing method and device, storage medium and electronic equipment
CN114782605A (en) Rendering method and device of hair virtual model, computer equipment and storage medium
CN115880402A (en) Flow animation generation method and device, electronic equipment and readable storage medium
CN118135081A (en) Model generation method, device, computer equipment and computer readable storage medium
CN117893668A (en) Virtual scene processing method and device, computer equipment and storage medium
CN112734900A (en) Baking method, baking device, baking equipment and computer-readable storage medium of shadow map
CN112950753B (en) Virtual plant display method, device, equipment and storage medium
CN115222867A (en) Overlap detection method, overlap detection device, electronic equipment and storage medium
CN115588066A (en) Rendering method and device of virtual object, computer equipment and storage medium
CN113350792B (en) Contour processing method and device for virtual model, computer equipment and storage medium
CN116212374A (en) Model processing method, device, computer equipment and storage medium
CN114797109A (en) Object editing method and device, electronic equipment and storage medium
CN114266849A (en) Model automatic generation method and device, computer equipment and storage medium
CN114663560A (en) Animation realization method and device of target model, storage medium and electronic equipment
CN115035231A (en) Shadow baking method, shadow baking device, electronic apparatus, and storage medium
CN112348955A (en) Object rendering method
CN115761160A (en) Mountain terrain generation method and device, electronic equipment and readable storage medium
CN114494551A (en) Three-dimensional model map processing method and device, computer equipment and storage medium

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