Animation processing method and device, equipment, storage medium and program product

By calculating the current coordinates and normal vectors of the target point in the animation frame, and updating the animation point selection results, the problem of repeated point selection operations in animation playback is solved, and the calculation amount of animation processing is reduced.

CN119399335APending Publication Date: 2025-02-07BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411548307.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

During the animation playback process, screen picking can only obtain the point selection results of the current animation frame. If the object action changes in the next animation frame, it is necessary to repeat the interactive point selection operations to update the point selection results of the animation, resulting in the calculation of the animation processing Larger.

Method used

By responding to the selection operation on the model, determine the initial coordinates and normal vectors of the target point, establish the association relationship between the target unit grid and the model motion process, calculate the current coordinates and normal vectors of the target point to update the selection operation correspondence Selection results of the point.

Benefits of technology

After one selection operation, you can get the point selection result that matches the model, without repeated selection operations, which reduces the calculation amount of animation processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399335A_ABST
    Figure CN119399335A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to an animation processing method and device, equipment, a storage medium and a program product. The method comprises the following steps: in response to a selection operation acting on a model, determining an initial coordinate and an initial normal vector of a selected first target point, determining an initial point selection result of the selection operation, determining an incidence relation between each vertex of a target unit grid and a motion process of the model, and determining an initial point selection result of the selection operation based on the initial coordinate of each vertex; determining the coordinates of a second target point, the coordinates of which do not change along with the shape of the grid, in the target unit grid, determining the current frame information of the animation in response to the operation of playing the animation, and determining the current coordinates of the first target point and the current normal vector of the target unit grid based on the current frame information, the association relationship and the coordinates of the second target point, therefore, the current point selection result of the animation is determined, the point selection result matched with the selection operation of the model can be obtained through one-time selection operation, repeated point selection operation is not needed, and the animation processing calculation amount can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to an animation processing method, device, equipment, storage medium and program product. Background Art

[0002] With the continuous development of computer graphics and interactive design, screen picking technology has become an important tool in many application fields.

[0003] In the related art, during animation playback, screen picking can usually only obtain the point selection results of the current animation frame. If the movement of the object changes in the next animation frame, the interactive point selection operation needs to be repeated to update the point selection results of the animation, resulting in a large amount of calculation for animation processing. Summary of the invention

[0004] In order to solve the above technical problems, the embodiments of the present disclosure provide an animation processing method, apparatus, device, storage medium and program product.

[0005] In a first aspect, an embodiment of the present disclosure provides an animation processing method, the method comprising:

[0006] In response to a selection operation on the model, determining initial coordinates of a selected first target point and an initial normal vector of a target unit grid of the model belonging to the first target point, and determining an initial point selection result of the selection operation based on the initial coordinates of the first target point and the initial normal vector;

[0007] Determine the association relationship between each vertex of the target unit grid and the motion process of the model, and determine the coordinates of a second target point in the target unit grid based on the initial coordinates of each vertex of the target unit grid; the second target point is a point in the target unit grid whose coordinates do not change with the shape of the grid;

[0008] In response to an operation of playing an animation, current frame information of the animation is determined, and based on the current frame information, the association relationship and the coordinates of the second target point, the current coordinates of the first target point and the current normal vector of the target unit grid are determined; the animation corresponds to the motion process of the model;

[0009] Based on the current coordinates of the first target point and the current normal vector, a current point selection result of the selection operation is determined.

[0010] In a second aspect, an embodiment of the present disclosure further provides an animation processing device, the device comprising:

[0011] A first determination module, configured to determine, in response to a selection operation on the model, initial coordinates of a selected first target point and an initial normal vector of a target unit grid of the model belonging to the first target point, and determine an initial point selection result of the selection operation based on the initial coordinates of the first target point and the initial normal vector;

[0012] A second determination module is used to determine the association relationship between each vertex of the target unit grid and the motion process of the model, and determine the coordinates of a second target point in the target unit grid based on the initial coordinates of each vertex of the target unit grid; the second target point is a point in the target unit grid whose coordinates do not change with the shape of the grid;

[0013] a third determination module, configured to determine the current frame information of the animation in response to the operation of playing the animation, and determine the current coordinates of the first target point and the current normal vector of the target unit grid based on the current frame information, the association relationship and the coordinates of the second target point; the animation corresponds to the motion process of the model;

[0014] The fourth determination module is used to determine the current point selection result of the selection operation based on the current coordinates of the first target point and the current normal vector.

[0015] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:

[0016] processor;

[0017] A memory for storing executable instructions;

[0018] The processor is used to read executable instructions from the memory and execute the executable instructions to implement the animation processing method described in any embodiment of the present disclosure.

[0019] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the animation processing method described in any embodiment of the present disclosure.

[0020] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, which is used to execute the animation processing method described in any embodiment of the present disclosure.

[0021] The animation processing method, apparatus, device, storage medium and program product of the embodiments of the present disclosure calculate the current coordinates and the current normal vector of the target point to update the point selection result corresponding to the selection operation on the model. Thus, after one selection operation, the point selection result matching the selection operation of the model can be obtained without repeating the selection operation, thereby reducing the amount of animation processing calculations. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0023] Figure 1 A schematic diagram of an animation frame of an animation processing method provided by an embodiment of the present disclosure;

[0024] Figure 2 A schematic diagram of an animation frame of another animation processing method provided by an embodiment of the present disclosure;

[0025] Figure 3 A flowchart of an animation processing method provided by an embodiment of the present disclosure;

[0026] Figure 4 A flowchart of another animation processing method provided by an embodiment of the present disclosure;

[0027] Figure 5 A schematic diagram of the structure of an animation processing device provided by an embodiment of the present disclosure;

[0028] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0030] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0031] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0032] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0033] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0034] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0035] During animation playback, screen picking can usually only obtain the point selection results of the current animation frame. If the movement of the object changes in the next animation frame, the interactive point selection operation needs to be repeated to update the animation point selection results, resulting in a large amount of calculation for animation processing.

[0036] like Figure 1 As shown in the figure, point E is the target point of the current animation frame. By performing interactive point selection operations on point E, the normal vector of point E can be displayed. During the animation playback, when the action of the object in the next animation frame changes, such as Figure 2 As shown, compared to Figure 1 , the actual position of point E has changed, Figure 1 Point E in becomes Figure 2 Point F in the prior art can only be Figure 2 The normal vector of E1 is shown in Figure 1 If you need to determine the normal vector of point F in the animation frame, you need to perform interactive point selection on point F.

[0037] Based on the above situation, an embodiment of the present disclosure provides an animation processing solution, which responds to a selection operation on a model, determines the initial coordinates of a selected first target point and the initial normal vector of a target unit grid of the model belonging to the first target point, and determines the initial point selection result of the selection operation based on the initial coordinates and the initial normal vector of the first target point, determines the association relationship between each vertex of the target unit grid and the movement process of the model, and determines the coordinates of a second target point in the target unit grid based on the initial coordinates of each vertex of the target unit grid; the second target point is a point in the target unit grid whose coordinates do not change with the shape of the grid, and in response to an operation of playing an animation, determines the current frame information of the animation, and determines the current coordinates of the first target point and the current normal vector of the target unit grid based on the current frame information, the association relationship and the coordinates of the second target point; the animation corresponds to the movement process of the model, and determines the current point selection result of the selection operation based on the current coordinates and the current normal vector of the first target point. According to an embodiment of the present disclosure, the current coordinates and the current normal vector of the target point are calculated to update the point selection result corresponding to the selection operation on the model. Thus, after one selection operation, the point selection result matching the selection operation of the model can be obtained without repeating the selection operation, thereby reducing the amount of animation processing calculations.

[0038] The animation processing method provided in the embodiment of the present disclosure can be applied to the case where animation processing and voice broadcasting are performed in a scenario where resources are transferred online. The method can be performed by an animation processing device, which can be implemented by software and / or hardware, and the device can be integrated in an electronic device for animation processing. Among them, the electronic device can include but is not limited to mobile terminals such as smart phones, laptops, tablet personal computers (Tablet Personal Computer, Tablet PC), etc. and fixed terminals such as desktop computers, etc.

[0039] Figure 3 FIG. 1 is a flow chart of an animation processing method provided by an embodiment of the present disclosure. Figure 3 As shown, the animation processing method may include the following steps:

[0040] S310, in response to a selection operation on the model, determining the initial coordinates of the selected first target point and the initial normal vector of the target unit grid of the model belonging to the first target point, and determining the initial point selection result of the selection operation based on the initial coordinates and the initial normal vector of the first target point.

[0041] The selection operation on the model refers to the operation of selecting any point in the model during the screen picking process. Specifically, it can be achieved by mouse clicks, touch screen touch operations, or voice commands.

[0042] The first target point can be any selected point in the model, such as Figure 1 Correspondingly, the initial coordinates of the first target point refer to the coordinates of the point in the local coordinate system (ie, the model coordinate system) of the model constituting the animation at the time of point selection.

[0043] The target unit grid refers to the grid structure used for interactive point selection operations in the model, which can be different shapes such as triangles and quadrilaterals.

[0044] In the disclosed embodiment, the target unit mesh is usually a triangular surface mesh composed of triangles. The triangular surface mesh uses triangles as basic units. In addition, the shape of the target unit mesh can also be a quadrilateral. The disclosed embodiment does not impose any limitation on the shape of the target unit mesh.

[0045] For ease of understanding, the embodiments of the present disclosure are introduced with the target unit mesh being a triangular surface mesh.

[0046] The initial normal vector refers to a vector perpendicular to a given surface. Accordingly, the initial normal vector of the target unit grid of the model to which the first target point belongs refers to a vector perpendicular to the target unit grid at the first target point.

[0047] Specifically, there are multiple ways to determine the initial normal vector.

[0048] In an optional implementation, an initial normal vector of the first target point on the target unit grid may be determined based on the initial coordinates of the first target point and the initial coordinates of each vertex of the target unit grid.

[0049] In the disclosed embodiment, two vectors in the target unit mesh may be determined based on the initial coordinates of the vertices of the target unit mesh, and an initial normal vector may be determined based on a cross product result of the two vectors.

[0050] In another optional implementation, the initial normal vector of the first target point on the target unit grid may be determined by means of a normal map. The embodiment of the present disclosure does not impose any limitation on the method for determining the initial normal vector.

[0051] The initial point selection result refers to the point selection result obtained in a specific application scenario based on the initial coordinates and initial normal vector of the first target point and combined with the specific application scenario. The initial point selection result includes the position and normal of the selected point on the model and the animation frame that matches the application scenario. For example, in the scene of wearing a hat, the initial point selection result indicates that the hat is correctly worn in the current animation frame corresponding to the selected point. The initial point selection result will be used to achieve animation effects in specific application scenarios.

[0052] S320, determining the correlation between each vertex of the target unit grid and the motion process of the model, and determining the coordinates of a second target point in the target unit grid based on the initial coordinates of each vertex of the target unit grid; the second target point is a point in the target unit grid whose coordinates do not change with the shape of the grid.

[0053] Among them, the association relationship between the vertices of the target unit grid and the movement process of the model refers to the relationship between the vertices of the target unit grid determined after the model generates movement and the various control nodes contained in the model. This relationship describes how the vertices of the target unit grid change with the movement of the model when the model moves.

[0054] Specifically, the control node may be a skeleton node or other types of nodes, and the embodiments of the present disclosure do not impose any limitation thereto.

[0055] The above-mentioned association relationship can be obtained through information obtained during model building, or through statistical analysis of the relationship between the movement type and the vertex position during the model movement process.

[0056] The coordinates of the second target point in the target unit grid whose coordinates do not change with the shape of the grid refer to a fixed point that does not change with the deformation of the target unit grid when the target unit grid is deformed, that is, the coordinates of the fixed point remain unchanged during the deformation of the target unit grid. Specifically, taking the target unit grid as a triangular surface grid as an example, the coordinates of the second target point can be centroid coordinates, Fermat point coordinates, etc.

[0057] When the coordinates of the second target point are the barycentric coordinates, the specific method of determining the second target coordinate point is as follows:

[0058] In an optional implementation, based on the cell grid identifier of the target cell grid, the initial coordinates contained in the model are queried to determine the initial coordinates of each vertex of the target cell grid, and based on the initial coordinates of each vertex, the centroid coordinates of the target cell grid are determined as the coordinates of the second target point.

[0059] The unit grid identification refers to an identification used to distinguish the unit grids, and may be formed by one or more of numbers, letters or symbols, such as a unit grid ID.

[0060] In the embodiment of the present disclosure, the initial coordinates of each vertex of the target unit grid can be obtained by indexing from each initial coordinate included in the model according to the unit grid identifier of the target unit grid.

[0061] In the disclosed embodiment, the centroid coordinates of the target unit grid refer to the distance ratio of the first target point relative to each vertex in the target unit grid.

[0062] For example, taking the target unit mesh as a triangular mesh as an example, assuming that the first target point is point P, the barycentric coordinates corresponding to point P are (Pa, Pb, Pc). The barycentric coordinates represent the distance ratio of point P relative to the three vertices A, B, and C of the triangular mesh.

[0063] Specifically, the barycentric coordinates are defined as follows:

[0064] Pa = (S(BCP) / S(ABC)).

[0065] Pb = (S(CAP) / S(ABC)).

[0066] Pc = (S(ABP) / S(ABC)).

[0067] Among them, S(BCP), S(CAP), S(ABP) represent the areas of triangles BCP, CAP, and ABP respectively, and S(ABC) represents the area of ​​the entire triangle ABC.

[0068] S330. In response to the operation of playing the animation, determine the current frame information of the animation, and based on the current frame information, the association relationship and the coordinates of the second target point, determine the current coordinates of the first target point and the current normal vector of the target unit grid, and the animation corresponds to the movement process of the model.

[0069] In the embodiment of the present disclosure, when the animation is played, the initial coordinates of the first target point and the initial normal vector of the target unit grid will change as the animation is played, such as Figure 1 As shown, point E is the first target point. After the animation movement, the first target point is Figure 1 The point E in the Figure 2 Point F in (i.e., the current coordinates of the first target point), therefore, it is necessary to determine the current coordinates of the first target point and the current normal vector of the target unit grid.

[0070] The current frame information refers to the various information contained when the animation is played to the current frame, such as information related to the variables in the association relationship between the vertices of the target unit mesh and the movement process of the model. For example, if the association relationship is realized through bone weight values, the current frame information will include the current coordinates of each bone node.

[0071] In the disclosed embodiment, the current coordinates of each vertex of the target unit grid can be determined based on the current frame information and the association relationship, and then the current coordinates of the first target point and the current normal vector of the target unit grid can be determined according to the current coordinates of each vertex of the target unit grid and the coordinates of the second target point.

[0072] Since the coordinates of the second target point are points in the target unit grid whose coordinates do not change with the shape of the grid, that is, during the animation playback, the coordinates of the second target point do not change at all. Taking the coordinates of the second target point as the coordinates of the center of gravity as an example, according to the current coordinates of each vertex of the target unit grid and the coordinates of the second target point, the current coordinates of the first target point are determined as follows: the current coordinates of each vertex of the target unit grid are respectively multiplied by the coordinates of the second target point to obtain the current coordinates of the first target point.

[0073] In the disclosed embodiment, the current normal vector of the target unit grid may be obtained based on a cross product of two vectors in the target unit grid.

[0074] S340: Determine a current point selection result of the selection operation based on the current coordinates and the current normal vector of the first target point.

[0075] In the disclosed embodiment, after receiving the animation playback operation, the current point selection result of the selection operation can be continuously updated according to the current coordinates and the current normal vector of the first target point until the end of the next selection operation is received.

[0076] The current point selection result refers to the point selection result obtained in a specific application scenario based on the current coordinates and the current normal vector of the first target point and combined with the specific application scenario. The current point selection result includes the current position of the selected point in the current frame, the current normal, and the animation frame that matches the application scenario. For example, in a scene of wearing a hat, the current point selection result indicates that the hat is correctly worn in the current animation frame at the current position of the selection point.

[0077] The animation processing method provided by the above-mentioned embodiments of the present disclosure responds to a selection operation on a model, determines the initial coordinates of a selected first target point and an initial normal vector of a target unit grid of the model belonging to the first target point, and determines the initial point selection result of the selection operation based on the initial coordinates and the initial normal vector of the first target point, determines the association relationship between each vertex of the target unit grid and the movement process of the model, and determines the coordinates of a second target point in the target unit grid based on the initial coordinates of each vertex of the target unit grid; the second target point is a point in the target unit grid whose coordinates do not change with the shape of the grid, and in response to an operation of playing an animation, determines the current frame information of the animation, and determines the current coordinates of the first target point and the current normal vector of the target unit grid based on the current frame information, the association relationship and the coordinates of the second target point; the animation corresponds to the movement process of the model, and determines the current point selection result of the selection operation based on the current coordinates and the current normal vector of the first target point. According to an embodiment of the present disclosure, the current coordinates and the current normal vector of the target point are calculated to update the point selection result corresponding to the selection operation on the model. Thus, after one selection operation, the point selection result matching the selection operation of the model can be obtained without repeating the selection operation, thereby reducing the amount of animation processing calculations.

[0078] Figure 4 is a flowchart of another animation processing method provided by an embodiment of the present disclosure. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. Figure 4 , the animation processing method includes:

[0079] S410, in response to a selection operation on the model, determining the initial coordinates of the selected first target point and the initial normal vector of the target unit grid of the model belonging to the first target point, and determining the initial point selection result of the selection operation based on the initial coordinates and the initial normal vector of the first target point.

[0080] Among them, step S410 is the same as step S310, and please refer to the description of step S310 for details.

[0081] S420, determining the bone weight values ​​between each vertex of the target unit mesh and each bone node corresponding to the model as an association relationship, and based on the initial coordinates of each vertex of the target unit mesh, determining the coordinates of the second target point in the target unit mesh, the second target point is a point in the target unit mesh whose coordinates do not change with the shape of the mesh.

[0082] Each vertex of the target unit mesh is usually associated with each bone node corresponding to the model. In order to determine the association relationship between each vertex of the target unit mesh and each bone node, as well as the degree of influence of each bone node on each vertex, the bone weight value can be used as the association relationship between each vertex of the target unit mesh and the movement process of the model.

[0083] The bone weight value is a value between 0 and 1, which is used to indicate the degree to which each vertex in the unit mesh is affected by each bone node. The larger the weight value, the greater the influence of the bone node on the vertex; the smaller the weight value, the smaller the influence of the bone node on the vertex. In the bone model, the vertices of the unit mesh are usually assigned to multiple bone nodes, and the degree of influence of each bone node on these vertices is determined by the bone weight. When the bone moves, the assigned vertices are transformed according to the weight value, thereby driving the overall movement of the mesh model.

[0084] For the description of “determining the coordinates of a second target point in the target unit grid based on the initial coordinates of each vertex of the target unit grid, where the second target point is a point in the target unit grid whose coordinates do not change with the grid shape”, please refer to step S320 for details.

[0085] S430. In response to the operation of playing the animation, determine the current frame information of the animation, and based on the current frame information, the association relationship and the coordinates of the second target point, determine the current coordinates of the first target point and the current normal vector of the target unit grid; the animation corresponds to the movement process of the model.

[0086] In an optional implementation, in response to the operation of playing the animation, the current coordinates of each bone node are determined as the current frame information.

[0087] The current coordinates of each bone node refer to the coordinates of each bone node in the world coordinate system in the current frame during the animation playback process.

[0088] Specifically, based on the current frame information, the association relationship and the coordinates of the second target point, the current coordinates of the first target point and the current normal vector of the target unit grid are determined, including S430-1 and S430-2.

[0089] S430-1. Determine the current coordinates of each vertex based on the current frame information and the association relationship.

[0090] In the disclosed embodiment, the current coordinates of each vertex are determined based on the current coordinates of each bone node and the bone weight values ​​between each vertex of the target unit mesh and each bone node corresponding to the model.

[0091] The current coordinates of each vertex may be the coordinates recalculated for each vertex in all unit meshes within the entire animation range, or may be the coordinates recalculated only for each vertex in a target unit mesh.

[0092] In an optional implementation, based on the bone weight value of each vertex, the current coordinates of the bone nodes associated with each vertex are weighted to determine the current coordinates of each vertex.

[0093] In a skeletal model, each vertex of a target unit mesh is usually associated with multiple bone nodes and is assigned a corresponding bone weight value, which is used to determine the extent to which the vertex is affected by each bone node.

[0094] In the disclosed embodiment, for each vertex in the target unit mesh, the current coordinates of its associated bone node are first multiplied by the corresponding position transformation matrix to obtain the coordinates of the bone node in the model coordinate system. The coordinates of the bone node in the model coordinate system are then weighted according to the corresponding bone weight value, and the weighted coordinates are then added together to obtain the current coordinates of each vertex (i.e., the coordinates of each vertex in the model coordinate system).

[0095] Exemplarily, taking vertex A of the target unit mesh as an example, the bone nodes associated with vertex A are Bone1 and Bone2, wherein the weight of Bone1 is 0.7, the weight of Bone2 ​​is 0.3, and the coordinates of Bone1 and Bone2 ​​in the model coordinate system are Coord1 and Coord2 respectively.

[0096] Specifically, the current coordinates of vertex A are determined as follows:

[0097] First, multiply the coordinate Coord1 of the bone node Bone1 associated with vertex A in the model coordinate system by 0.7, and then multiply the coordinate Coord2 of the bone node Bone2 ​​associated with vertex A in the model coordinate system by 0.3. Then add these two weighted coordinates to get the current coordinate of vertex A.

[0098] Specifically, it can be expressed as:

[0099] VertexA=Coord1×0.7+Coord2×0.3.

[0100] Among them, VertexA represents the current coordinates of vertex A.

[0101] S430-2. Based on the current coordinates of each vertex and the coordinates of the second target point, determine the current coordinates of the first target point and the current normal vector of the target unit mesh.

[0102] In the disclosed embodiment, the current coordinates of the first target point are determined based on the current coordinates of each vertex and the coordinates of the second target point, and then the current normal vector of the target unit grid is determined based on the current coordinates of each vertex.

[0103] In an optional implementation, the current coordinates of the first target point are determined based on the current coordinates of each vertex and the coordinates of the second target point, two vectors in the target unit grid are determined based on the current coordinates of each vertex, and the current normal vector is determined based on the cross product result of the two vectors.

[0104] In the disclosed embodiment, the current coordinates of each vertex are multiplied by the coordinates of the second target point to obtain the current coordinates of the first target point.

[0105] In the disclosed embodiment, the cross product result of the two vectors may be normalized, that is, converted into a unit vector, and the unit vector is the current normal vector.

[0106] Continuing with the example of the target unit mesh being a triangular mesh, assuming that the vertices corresponding to the target unit mesh are A1, B1, and C1, two vectors are constructed based on the current coordinates of the vertices corresponding to the target unit mesh:

[0107] vector vector

[0108] Among them, the vector Represents the direction from vertex A1 to B1, vector Indicates the direction from vertex A1 to C1.

[0109] Furthermore, we calculate the vector With vector The cross product result of

[0110] In order to facilitate subsequent calculations, the normal vector is usually normalized:

[0111] in, for The unit vector of the current normal vector, ∥n∥ means Model.

[0112] S440: Determine a current point selection result of the selection operation based on the current coordinates and the current normal vector of the first target point.

[0113] Among them, step S440 is the same as step S340, and please refer to the description of step S340 for details.

[0114] The animation processing method provided by the above-mentioned embodiments of the present disclosure responds to a selection operation on a model, determines the initial coordinates of a selected first target point and an initial normal vector of a target unit grid of the model belonging to the first target point, and determines the initial point selection result of the selection operation based on the initial coordinates and the initial normal vector of the first target point, determines the bone weight values ​​between each vertex of the target unit grid and each bone node corresponding to the model as an association relationship, and determines the coordinates of a second target point in the target unit grid based on the initial coordinates of each vertex of the target unit grid; the second target point is a point in the target unit grid whose coordinates do not change with the shape of the grid, determines the current frame information of the animation in response to an operation of playing the animation, and determines the current coordinates of the first target point and the current normal vector of the target unit grid based on the current frame information, the association relationship and the coordinates of the second target point; the animation corresponds to the movement process of the model, and determines the current point selection result of the selection operation based on the current coordinates and the current normal vector of the first target point. According to an embodiment of the present disclosure, the current coordinates and the current normal vector of the target point are calculated to update the point selection result corresponding to the selection operation on the model. Thus, after one selection operation, the point selection result matching the selection operation of the model can be obtained without repeating the selection operation, thereby reducing the amount of animation processing calculations.

[0115] The following is an embodiment of an animation processing device provided by an embodiment of the present invention. The device and the animation processing methods of the above embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the animation processing device, reference can be made to the embodiments of the above animation processing methods.

[0116] Figure 5 FIG. 2 shows a schematic diagram of the structure of an animation processing device provided by an embodiment of the present disclosure. Figure 5 As shown, the animation processing device 500 may include:

[0117] A first determination module 501 is used to determine, in response to a selection operation on the model, initial coordinates of a selected first target point and an initial normal vector of a target unit grid of the model that the first target point belongs to, and to determine an initial point selection result of the selection operation based on the initial coordinates of the first target point and the initial normal vector;

[0118] The second determination module 502 is used to determine the association relationship between each vertex of the target unit grid and the motion process of the model, and determine the coordinates of a second target point in the target unit grid based on the initial coordinates of each vertex of the target unit grid; the second target point is a point in the target unit grid whose coordinates do not change with the shape of the grid;

[0119] The third determination module 503 is used to determine the current frame information of the animation in response to the operation of playing the animation, and determine the current coordinates of the first target point and the current normal vector of the target unit grid based on the current frame information, the association relationship and the coordinates of the second target point; the animation corresponds to the motion process of the model;

[0120] The fourth determination module 504 is used to determine the current point selection result of the selection operation based on the current coordinates of the first target point and the current normal vector.

[0121] In the animation processing device provided by the embodiment of the present disclosure, in response to the selection operation acting on the model, the initial coordinates of the selected first target point and the initial normal vector of the target unit grid of the model belonging to the first target point are determined, and based on the initial coordinates and the initial normal vector of the first target point, the initial point selection result of the selection operation is determined, the association relationship between each vertex of the target unit grid and the movement process of the model is determined, and based on the initial coordinates of each vertex of the target unit grid, the coordinates of the second target point in the target unit grid are determined; the second target point is a point in the target unit grid whose coordinates do not change with the shape of the grid, in response to the operation of playing the animation, the current frame information of the animation is determined, and based on the current frame information, the association relationship and the coordinates of the second target point, the current coordinates of the first target point and the current normal vector of the target unit grid are determined; the animation corresponds to the movement process of the model, and the current point selection result of the selection operation is determined based on the current coordinates and the current normal vector of the first target point. According to an embodiment of the present disclosure, the current coordinates and the current normal vector of the target point are calculated to update the point selection result corresponding to the selection operation on the model. Thus, after one selection operation, the point selection result matching the selection operation of the model can be obtained without repeating the selection operation, thereby reducing the amount of animation processing calculations.

[0122] In some embodiments, the second determination module 502 includes: a first determination submodule and a second determination submodule;

[0123] The first determination submodule is used to determine the association relationship between each vertex of the target unit grid and the movement process of the model;

[0124] The second determination submodule is used to determine the coordinates of a second target point in the target unit grid based on the initial coordinates of each of the vertices of the target unit grid; the second target point is a point in the target unit grid whose coordinates do not change with the shape of the grid;

[0125] The second determining submodule includes:

[0126] A third determination submodule is used to query each initial coordinate included in the model based on the unit grid identifier of the target unit grid, and determine the initial coordinates of each vertex of the target unit grid;

[0127] The fourth determination submodule is used to determine the coordinates of the center of gravity of the target unit grid based on the initial coordinates of each of the vertices as the coordinates of the second target point.

[0128] In some embodiments, the first determining submodule is specifically configured to:

[0129] Determine the bone weight value between each of the vertices of the target unit mesh and each of the bone nodes corresponding to the model as the association relationship.

[0130] In some embodiments, the third determination module 503 includes a fifth determination submodule and a sixth determination submodule;

[0131] The fifth determining submodule is used to determine the current frame information of the animation in response to the operation of playing the animation;

[0132] The sixth determination submodule is used to determine the current coordinates of the first target point and the current normal vector of the target unit grid based on the current frame information, the association relationship and the coordinates of the second target point; the animation corresponds to the movement process of the model;

[0133] The fifth determining submodule is specifically configured to:

[0134] In response to the operation of playing the animation, the current coordinates of each of the bone nodes are determined as the current frame information.

[0135] The sixth determining submodule comprises:

[0136] A seventh determination submodule, configured to determine the current coordinates of each of the vertices based on the current frame information and the association relationship;

[0137] An eighth determination submodule is used to determine the current coordinates of the first target point and the current normal vector of the target unit mesh based on the current coordinates of each of the vertices and the coordinates of the second target point.

[0138] In some embodiments, the seventh determining submodule is specifically used to:

[0139] Based on the bone weight value of each of the vertices, weighted processing is performed on the current coordinates of the bone nodes associated with each of the vertices to determine the current coordinates of each of the vertices.

[0140] In some embodiments, the eighth determining submodule includes:

[0141] a ninth determination submodule, configured to determine the current coordinates of the first target point based on the current coordinates of each of the vertices and the coordinates of the second target point;

[0142] The tenth determination submodule is used to determine two vectors in the target unit grid based on the current coordinates of each of the vertices, and to determine the current normal vector based on the cross product result of the two vectors.

[0143] The animation processing device provided in the embodiment of the present invention can execute the animation processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0144] It is worth noting that in the embodiment of the above-mentioned animation processing device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present disclosure.

[0145] The disclosed embodiment also provides an electronic device, which may include a processor and a memory, wherein the memory may be used to store executable instructions. The processor may be used to read the executable instructions from the memory and execute the executable instructions to implement the animation processing method in the above embodiment.

[0146] Figure 6 A schematic structural diagram of an electronic device provided by an embodiment of the present disclosure is shown.

[0147] like Figure 6 As shown, the electronic device 600 may include a processing device 601 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output interface (I / O interface) 605 is also connected to the bus 604.

[0148] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data.

[0149] It should be noted that Figure 6 The electronic device 600 shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure. Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0150] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the animation processing method of any embodiment of the present disclosure are executed.

[0151] The embodiments of the present disclosure further provide a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the animation processing method in any embodiment of the present disclosure.

[0152] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0153] In some embodiments, the client and server may communicate using any currently known or future developed network protocol such as HTTP, and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0154] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0155] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the steps of the animation processing method described in any embodiment of the present disclosure.

[0156] In embodiments of the present disclosure, computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as a separate software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0157] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0158] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0159] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0160] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0161] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0162] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. An animation processing method, characterized in that: include: In response to a selection operation on the model, determining initial coordinates of a selected first target point and an initial normal vector of a target unit grid of the model belonging to the first target point, and determining an initial point selection result of the selection operation based on the initial coordinates of the first target point and the initial normal vector; Determine the association relationship between each vertex of the target unit grid and the motion process of the model, and determine the coordinates of a second target point in the target unit grid based on the initial coordinates of each vertex of the target unit grid; the second target point is a point in the target unit grid whose coordinates do not change with the shape of the grid; In response to an operation of playing an animation, current frame information of the animation is determined, and based on the current frame information, the association relationship and the coordinates of the second target point, the current coordinates of the first target point and the current normal vector of the target unit grid are determined; the animation corresponds to the motion process of the model; Based on the current coordinates of the first target point and the current normal vector, a current point selection result of the selection operation is determined.

2. The method according to claim 1, characterized in that: The determining, based on the initial coordinates of each of the vertices of the target unit mesh, the coordinates of the second target point having a deformation invariant characteristic in the target unit mesh comprises: Based on the unit grid identifier of the target unit grid, query the initial coordinates included in the model to determine the initial coordinates of the vertices of the target unit grid; Based on the initial coordinates of each of the vertices, the coordinates of the center of gravity of the target unit grid are determined as the coordinates of the second target point.

3. The method according to claim 1, characterized in that: The determining of the association relationship between each vertex of the target unit grid and the motion process of the model includes: Determine the bone weight value between each of the vertices of the target unit mesh and each of the bone nodes corresponding to the model as the association relationship.

4. The method according to claim 3, characterized in that The step of determining the current frame information of the animation in response to the operation of playing the animation includes: In response to the operation of playing the animation, the current coordinates of each of the bone nodes are determined as the current frame information.

5. The method according to claim 4, characterized in that The determining, based on the current frame information, the association relationship and the coordinates of the second target point, the current coordinates of the first target point and the current normal vector of the target unit grid comprises: Based on the current frame information and the association relationship, determine the current coordinates of each of the vertices; Based on the current coordinates of each of the vertices and the coordinates of the second target point, the current coordinates of the first target point and the current normal vector of the target unit mesh are determined.

6. The method according to claim 5, characterized in that The determining the current coordinates of each of the vertices based on the current frame information and the association relationship includes: Based on the bone weight value of each of the vertices, weighted processing is performed on the current coordinates of the bone nodes associated with each of the vertices to determine the current coordinates of each of the vertices.

7. The method according to claim 5, characterized in that The determining the current coordinates of the first target point and the current normal vector of the target unit mesh based on the current coordinates of each of the vertices and the coordinates of the second target point comprises: Determine the current coordinates of the first target point based on the current coordinates of each of the vertices and the coordinates of the second target point; Based on the current coordinates of each of the vertices, two vectors in the target unit grid are determined, and based on the cross product result of the two vectors, the current normal vector is determined.

8. An animation processing device, characterized in that: include: A first determination module, configured to determine, in response to a selection operation on the model, initial coordinates of a selected first target point and an initial normal vector of a target unit grid of the model belonging to the first target point, and determine an initial point selection result of the selection operation based on the initial coordinates of the first target point and the initial normal vector; A second determination module is used to determine the association relationship between each vertex of the target unit grid and the motion process of the model, and determine the coordinates of the second target point in the target unit grid based on the initial coordinates of each vertex of the target unit grid; The second target point is a point in the target unit grid whose coordinates do not change with the shape of the grid; a third determination module, configured to determine, in response to an operation of playing the animation, current frame information of the animation, and determine current coordinates of the first target point and a current normal vector of the target unit grid based on the current frame information, the association relationship and the coordinates of the second target point; The animation corresponds to the movement process of the model; The fourth determination module is used to determine the current point selection result of the selection operation based on the current coordinates of the first target point and the current normal vector.

9. An electronic device, characterized in that: include: processor; A memory for storing executable instructions; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the animation processing method described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the animation processing method according to any one of claims 1 to 7.

11. A computer program product, characterized in that The computer program product is used to implement the animation processing method described in any one of claims 1 to 7.