A picture data processing system and method for three-dimensional animation
By obtaining and processing keyframe data of three-dimensional animations and generating and saving key change data of transition frames, the problem of insufficient accuracy and distortion caused by the missing data generated by transition frames in three-dimensional animations is solved, and the quality and generation efficiency of video files are improved.
Patent Information
- Application Number
- CN202311424145.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2043-10-30
AI Technical Summary
The lack of generated data of transition frames in 3D animations leads to insufficient accuracy and distortion of video files.
By obtaining the keyframe picture data of the three-dimensional animation, the transition frame picture data between each two adjacent keyframes are generated, and the key change data is obtained from the transition frame picture data, including the vertex coordinate data of the transformation matrix and scene elements, the vertex coordinate data of the scene element will be obtained. It is saved in connection with the point in time.
Improve the accuracy of the video file, reduce the transition frame generation time, and avoid the problems of insufficient accuracy and distortion.
Smart Images

Figure CN117315099B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional animation, and in particular to a picture data processing system and method for three-dimensional animation. Background Art
[0002] 3D animation is an animation that uses computer technology to achieve 3D effects. It uses 3D models, rendering, and animation technology to create realistic 3D environments and objects and realize complex camera movements. Compared with traditional flat animation, 3D animation can provide audiences with a better immersive visual experience. The production of 3D animation usually includes a design part and a generation part. The design part includes two stages: modeling and action design. The modeling stage is mainly designed by the model designer to design the 3D model of the animation scene and various elements in the scene, such as characters, props, and buildings. The action design stage is mainly to add bones and controls to the 3D model to form the position and posture of each component of each model at different times. The generation part includes two stages: rendering and synthesis output. The rendering stage is mainly to add lighting effects and material effects to the scene and model to generate a 2D image corresponding to each picture. The addition of lighting effects and material effects makes the 3D animation content more realistic. The synthesis output stage is to synthesize the rendered images into animation sequences, add visual effects and sounds to them, and then output them as video files. The design content of the design part is usually saved in a 3D animation file of a specific format. Common 3D animation file formats include FBX, 3DS, DAE, XSI, OBJ, LT, MA, MB, LWO, etc. These formats are mainly used to save various information such as 3D models, animations, materials and lighting data, so as to facilitate subsequent rendering, editing and synthesis operations.
[0003] Since each frame of a 3D animation involves a large number of animation element models, each model is composed of a large number of faces, and each face is associated with a large number of vertices. The position, posture and other information of the model are reflected by the coordinate data of each vertex in each frame. If all the vertex data of each frame is saved in the 3D animation file, the amount of data will be very large, and the 3D animation file will also become extremely large, requiring a large amount of storage space. In practical applications, usually only key frame data is saved in the 3D animation file, and transition frames are dynamically generated by interpolating the key frame data, and the transition frame data will be discarded after the image is drawn. The advantage of this approach is that it can save a lot of storage space. At the same time, as long as the interpolation algorithm used is the same, the generation of transition frames between the same key frames is often stable. However, this solution also has shortcomings. On the one hand, the transition frame needs to be regenerated before each rendering. For animations with a high frame rate, the number of transition frames is very large, which requires a lot of time and computing resources; on the other hand, the current common interpolation algorithm is only based on the data of the previous and next two frames. The generation of its transition frame often lacks sufficient computing data, resulting in a large number of images in the generated video file. The problem of insufficient precision and distortion. Summary of the invention
[0004] Based on the above problems, the present invention proposes a picture data processing system and method for three-dimensional animation, which can solve the problem of insufficient precision and distortion of video files caused by missing generation data of transition frames in the prior art.
[0005] In view of this, a first aspect of the present invention provides a picture data processing system for three-dimensional animation, comprising:
[0006] A key frame image data acquisition module is used to acquire key frame image data of a three-dimensional animation, wherein the key frame image data includes the time point of each key frame and the vertex coordinate data of each scene element in the frame image;
[0007] A transition frame picture data generating module, used for generating transition frame picture data between every two adjacent key frames based on the key frame picture data;
[0008] A key change data acquisition module, used to acquire key change data of each transition frame from the transition frame picture data, wherein the key change data includes a transformation matrix of the transition frame relative to the previous key frame and vertex coordinate data of a changed part of a scene element in the transition frame;
[0009] The key change data saving module is used to associate and save the key change data of each transition frame with the time point of the transition frame.
[0010] A second aspect of the present invention provides a method for processing picture data for three-dimensional animation, comprising:
[0011] Acquire key frame picture data of the three-dimensional animation, wherein the key frame picture data includes the time point of each key frame and the vertex coordinate data of each scene element in the frame picture;
[0012] Generate transition frame picture data between every two adjacent key frames based on the key frame picture data;
[0013] Acquire key change data of each transition frame from the transition frame picture data, wherein the key change data includes a transformation matrix of the transition frame relative to a previous key frame and vertex coordinate data of a changed part of a scene element in the transition frame;
[0014] The key change data of each transition frame is associated with the time point of the transition frame and saved.
[0015] Furthermore, in the above-mentioned picture data processing method for three-dimensional animation, the step of generating transition frame picture data between every two adjacent key frames based on the key frame picture data specifically includes:
[0016] Determine two adjacent key frames for which a transition frame needs to be generated as a first key frame and a second key frame;
[0017] Inputting key frame picture data of the first key frame and the second key frame;
[0018] Identifying a first scene element, a second scene element, and a third scene element in the frame picture of the second key frame, wherein the first scene element is a scene element that exists in the frame pictures of both the first key frame and the second key frame and whose difference value is greater than or equal to a preset threshold, the second scene element is a scene element that exists in the frame pictures of both the first key frame and the second key frame and whose difference value is less than a preset threshold, and the third scene element is a scene element that exists in the frame picture of the second key frame but does not exist in the frame picture of the first key frame;
[0019] Determine the number of transition frames between the first key frame and the second key frame according to the time points of the first key frame and the second key frame;
[0020] Generate transition area data of the first scene element, the second scene element and the third scene element in each transition frame;
[0021] The transition frame picture data of each transition frame is constructed based on the transition area data.
[0022] Furthermore, in the above-mentioned picture data processing method for three-dimensional animation, the step of identifying the first scene element, the second scene element and the third scene element in the frame picture of the second key frame specifically includes:
[0023] identifying, in the frame picture of the second key frame, a third scene element that exists in the frame picture of the second key frame but does not exist in the frame picture of the first key frame;
[0024] Determining the scene elements other than the third scene element in the frame picture of the second key frame as target scene elements;
[0025] Get the number n of the target scene elements object and a pre-configured difference threshold d 0 ;
[0026] Traverse each target scene element to calculate the difference value d between the first key frame and the second key frame of each target scene element vari,i , where i∈[1,n object ];
[0027] According to the difference value d vari,i and the difference threshold d 0 The target scene element is determined as the first scene element or the second scene element according to the size of the target scene element.
[0028] Furthermore, in the above-mentioned method for processing picture data for three-dimensional animation, each first scene element is traversed to calculate the difference value d between the first key frame and the second key frame of each first scene element. vari,i The steps specifically include:
[0029] Obtaining a first vertex data sequence of the i-th first scene element in the first key frame and a second vertex data sequence in the second key frame;
[0030] Obtaining a third vertex data sequence according to the correspondence between the vertices in the second vertex data sequence and the vertices in the first vertex data sequence in the i-th first scene element, wherein the vertices in the third vertex data sequence are vertices that exist in the second vertex data sequence but not in the first vertex data sequence;
[0031] Identifying an occlusion area according to coordinates of vertices in the third vertex data sequence;
[0032] Get the number of faces n contained in each occlusion area of the i-th scene element face,k And the area of each face s m,k , where k∈[1,n region ],m∈[1,n face,k],n region is the number of occluded regions in the i-th scene element, n face,k is the number of faces in the kth occluded region;
[0033] Calculate the difference between the first key frame and the second key frame of the i-th scene element:
[0034]
[0035] Wherein α is the pre-configured face number difference coefficient, and β is the pre-configured area difference coefficient.
[0036] Furthermore, in the above-mentioned picture data processing method for three-dimensional animation, the step of identifying the occlusion area according to the coordinates of the vertices in the third vertex data sequence specifically includes:
[0037] Identifying a vertex combination associated with a same face in the third vertex data sequence, wherein the number of vertices in the vertex combination is greater than or equal to 3;
[0038] Determine a target surface corresponding to each vertex combination, wherein the target surface is a surface surrounded by a line connecting vertices in the vertex combination;
[0039] The target faces with common edges are combined to form the occlusion area.
[0040] Furthermore, in the above-mentioned picture data processing method for three-dimensional animation, after the step of identifying the first scene element, the second scene element and the third scene element in the frame picture of the second key frame, it also includes:
[0041] Identifying a first change region and a second change region of each first scene element in the frame picture of the second key frame, wherein the first change region is a region where vertices on the first scene element exist in the frame picture of the first key frame, and the second change region is a region where vertices on the first scene element do not exist in the frame picture of the first key frame;
[0042] The step of generating transition area data of the first scene element, the second scene element and the third scene element in each transition frame specifically includes:
[0043] Generate first transition region data of the first change region of the first scene element in each transition frame in an interpolation mode;
[0044] Generate the second change area of the first scene element and the second transition area data of the third scene element in each transition frame by using a mapping mode;
[0045] The third transition area data of the second scene element in the frame picture of each transition frame is generated in a copy mode.
[0046] Furthermore, in the above-mentioned picture data processing method for three-dimensional animation, the step of using the interpolation mode to generate the first transition area data of the first change area of the first scene element in each transition frame frame specifically includes:
[0047] Determine interpolation parameters of the interpolation mode, wherein the interpolation parameters include the time points of the first key frame, the second key frame, and the target transition frame, and the first vertex data sequence and the second vertex data sequence corresponding to each scene element;
[0048] Calculate the time ratio of the time point of the target transition frame to the time points of the first key frame and the second key frame:
[0049]
[0050] where t target is the time point of the target transition frame, t ahead is the time point of the first key frame, t after is the time point of the second key frame;
[0051] Calculate the coordinate data of the vertices of the first vertex data sequence in the target transition frame according to the time ratio:
[0052] vtarget i,j =v1 i,j ·(1-ratio target )+v2 i,j ·ratio target ,
[0053] where j∈[1,n vertex ],n vertex is the number of vertices in the first change region of the first scene element, v1 i,j is the coordinate of each vertex in the first vertex data sequence, v2 i,j The coordinates of each vertex in the second vertex data sequence.
[0054] Furthermore, in the above-mentioned picture data processing method for three-dimensional animation, the step of using a mapping mode to generate the second change area data of the first scene element and the second transition area data of the third scene element in each transition frame frame specifically includes:
[0055] Determining mapping parameters of a mapping mode, wherein the mapping parameters include time points of the first key frame, the second key frame, and a target transition frame;
[0056] Constructing a first scene space corresponding to a time point of the first key frame and a second scene space corresponding to a time point of the second key frame, wherein the first scene space and the second scene space are three-dimensional spaces;
[0057] Loading the three-dimensional models of the first scene element and the third scene element in the first scene space and the second scene space respectively;
[0058] Calculate the second change area of the first scene element and the spatial posture of the third scene element at the time point of the target transition frame based on the second change area of the first scene element and the posture of the third scene element in the first scene space and the second scene space and the time points of the first key frame, the second key frame, and the target transition frame;
[0059] The coordinate data of the second change region of the first scene element and the vertices of the third scene element in the target transition frame are obtained according to the spatial posture.
[0060] Furthermore, in the above-mentioned picture data processing method for three-dimensional animation, the step of using the copy mode to generate the third transition area data of the second scene element in each transition frame frame specifically includes:
[0061] Determine copy parameters of the copy mode, wherein the copy parameters include the first key frame, the second key frame, a time point of a target transition frame, and a third vertex data sequence corresponding to the second scene element;
[0062] Determine, based on the copy parameter, an occlusion area of the second scene element corresponding to the third vertex data sequence in each target transition frame;
[0063] The vertex coordinate data of the occluded area of the second scene element in the previous frame of the target transition frame is copied as the coordinate data in the target transition frame.
[0064] The present invention provides a picture data processing system and method for three-dimensional animation. By acquiring key frame picture data of the three-dimensional animation, the key frame picture data includes the time point of each key frame and the vertex coordinate data of each scene element in its frame picture, generating transition frame picture data between every two adjacent key frames based on the key frame picture data, acquiring key change data of each transition frame from the transition frame picture data, the key change data includes the transformation matrix of the transition frame relative to the previous key frame and the vertex coordinate data of the changed part of the scene element in the transition frame, and the key change data of each transition frame is associated with the time point of the transition frame and saved, which can solve the problem of insufficient accuracy and distortion of video files caused by missing generation data of transition frames in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 is a schematic diagram of a picture data processing system for three-dimensional animation provided by an embodiment of the present invention;
[0066] Figure 2 The present invention is a flowchart of a method for processing picture data for three-dimensional animation provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0067] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0068] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0069] In the description of the present invention, the term "multiple" refers to two or more. Unless otherwise clearly defined, the orientation or positional relationship indicated by the terms "upper", "lower", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation of the present invention. The terms "connection", "installation", "fixation", etc. should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected or indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances. In addition, the terms "first", "second", etc. are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first", "second", etc. can explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, the meaning of "multiple" is two or more.
[0070] In the description of this specification, the description of the terms "one embodiment", "some implementations", "specific embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0071] A picture data processing system and method for three-dimensional animation provided according to some embodiments of the present invention will be described below with reference to the accompanying drawings.
[0072] like Figure 1 As shown, the first aspect of the present invention provides a picture data processing system for three-dimensional animation, comprising:
[0073] A key frame image data acquisition module is used to acquire key frame image data of a three-dimensional animation, wherein the key frame image data includes the time point of each key frame and the vertex coordinate data of each scene element in the frame image;
[0074] A transition frame picture data generating module, used for generating transition frame picture data between every two adjacent key frames based on the key frame picture data;
[0075] A key change data acquisition module, used to acquire key change data of each transition frame from the transition frame picture data, wherein the key change data includes a transformation matrix of the transition frame relative to the previous key frame and vertex coordinate data of a changed part of a scene element in the transition frame;
[0076] The key change data saving module is used to associate and save the key change data of each transition frame with the time point of the transition frame.
[0077] Specifically, the frame is an instantaneous scene image corresponding to a certain data frame in the image data of the three-dimensional animation. Each frame generally contains a number of scene elements. The three-dimensional model of these scene elements is composed of a large number of faces (Face), and these faces are usually composed of a large number of vertices (Vertex) and polygons (Polygon) composed of edges (Edgd) connecting these vertices. The vertex coordinate data is used to describe the position information of each vertex of the three-dimensional model in the three-dimensional space. The geometric structure of each model in the three-dimensional animation, that is, its corresponding position and posture, can be restored through the vertex coordinate data.
[0078] The key frame picture data is the data input frame by frame by the modeler when designing the animation. Specifically, the time point corresponding to the key frame is selected, and the scene elements are placed in the scene picture of the three-dimensional animation and the position and posture are adjusted to form a freeze-frame picture corresponding to the time point of the frame. Similar to the key frame picture data, the transition frame picture data also includes the corresponding time point of each transition frame and the vertex coordinate data of each scene element in its frame picture.
[0079] Furthermore, in the above-mentioned picture data processing system for three-dimensional animation, the transition frame picture data generating module includes:
[0080] A key frame determination module, used for determining two adjacent key frames for which transition frames need to be generated as a first key frame and a second key frame;
[0081] A key frame picture data input module, used for inputting the key frame picture data of the first key frame and the second key frame;
[0082] a scene element recognition module, configured to recognize a first scene element, a second scene element, and a third scene element in a frame picture of the second key frame, wherein the first scene element is a scene element that exists in both the frame pictures of the first key frame and the second key frame and whose difference value is greater than or equal to a preset threshold, the second scene element is a scene element that exists in both the frame pictures of the first key frame and the second key frame and whose difference value is less than a preset threshold, and the third scene element is a scene element that exists in the frame picture of the second key frame but does not exist in the frame picture of the first key frame;
[0083] a transition frame number determination module, configured to determine the number of transition frames between the first key frame and the second key frame according to time points of the first key frame and the second key frame;
[0084] A transition area data generating module, used to generate transition area data of the first scene element, the second scene element and the third scene element in each transition frame;
[0085] The transition frame picture data generating module is also used to construct the transition frame picture data of each transition frame based on the transition area data.
[0086] It should be known that the first key frame and the second key frame do not refer to two specific key frames, but when generating transition frame picture data between any two adjacent key frames, the first key frame and the second key frame refer to one of the two adjacent key frames. Specifically, the first key frame refers to the key frame with an earlier time point among the adjacent key frames, and correspondingly, the second key frame refers to the key frame with a later time point among the adjacent key frames. In the technical solution of the above implementation, the transition frame number determination module includes:
[0087] A 3D animation frame rate acquisition module is used to obtain a preset 3D animation frame rate fps;
[0088] A time point acquisition module is used to acquire the time point t of the first key frame. aheaf and the time point t of the second key frame after ;
[0089] A transition frame number calculation module is used to calculate the number of transition frames between the first key frame and the second key frame:
[0090] count inbetweens =(t after -t ahead )·fps.
[0091] Specifically, the frame picture of the first key frame is specifically composed of the key frame picture data of the first key frame, and corresponds to the still picture at the time point where the first key frame is located. Similarly, the frame picture of the second key frame is specifically composed of the key frame picture data of the second key frame, and corresponds to the still picture at the time point where the second key frame is located. In the technical solution of the above-mentioned implementation mode, when a scene element appears partially or entirely in the frame picture of a key frame, it is determined whether the scene element exists in the frame picture of the key frame.
[0092] In the technical solutions of some embodiments of the present invention, the picture data processing system for three-dimensional animation further includes:
[0093] A matrix generation module, used to generate a translation matrix, a scaling matrix and a rotation matrix for performing position offset, scaling ratio and angle offset transformation of each transition frame relative to the first key frame;
[0094] The key change data determination module is used to determine the translation matrix, the scaling matrix and the rotation matrix of each transition frame as the key change data of the corresponding transition frame.
[0095] Furthermore, in the above-mentioned picture data processing system for three-dimensional animation, the scene element recognition module includes:
[0096] A third scene element identification module, used to identify, in the frame picture of the second key frame, a third scene element that exists in the frame picture of the second key frame but does not exist in the frame picture of the first key frame;
[0097] a target scene element determination module, configured to determine the scene elements other than the third scene element in the frame picture of the second key frame as target scene elements;
[0098] A scene parameter acquisition module is used to obtain the number n of the target scene elements. object and a pre-configured difference threshold d 0 ;
[0099] A difference value calculation module is used to traverse each target scene element to calculate the difference value d between the first key frame and the second key frame of each target scene element. vari,i , where i∈[1,n object [;
[0100] The scene element recognition module is further configured to identify the scene element according to the difference value d vari,i and the difference threshold d 0 The target scene element is determined as the first scene element or the second scene element according to the size of the target scene element.
[0101] Specifically, the scene element recognition module further includes:
[0102] The first scene element determination module is used when d vari,i ≥d 0 , determining the target scene element as the first scene element;
[0103] The second scene element determination module is used when d vari,i <d 0 , determining the target scene element as the second scene element.
[0104] Furthermore, in the above-mentioned picture data processing system for three-dimensional animation, the difference value calculation module includes:
[0105] A vertex data sequence acquisition module, used for acquiring a first vertex data sequence of the i-th first scene element in the first key frame and a second vertex data sequence in the second key frame;
[0106] A third vertex data sequence generating module, used for obtaining a third vertex data sequence according to the correspondence between the vertices in the second vertex data sequence and the vertices in the first vertex data sequence in the i-th first scene element, wherein the vertices in the third vertex data sequence are vertices that exist in the second vertex data sequence but not in the first vertex data sequence;
[0107] An occlusion region identification module, used for identifying an occlusion region according to the coordinates of the vertices in the third vertex data sequence;
[0108] The occlusion area parameter acquisition module is used to obtain the number of faces n contained in each occlusion area of the i-th scene element face,k And the area of each face s m,k , where k∈[1,n region ],m∈[1,n face,k ],n region is the number of occluded regions in the i-th scene element, n face,k is the number of faces in the kth occluded region;
[0109] The difference value calculation module is specifically used to calculate the difference value of the i-th scene element between the first key frame and the second key frame:
[0110]
[0111] Wherein α is the pre-configured face number difference coefficient, and β is the pre-configured area difference coefficient.
[0112] Specifically, after the three-dimensional model of a scene element is completed, the number of vertices, one of the main elements used to represent its geometric structure, remains unchanged. Each vertex and the face formed by the vertex and its adjacent edges together constitute the local structure of the three-dimensional model. Therefore, each vertex is an independent existence in the scene element, and its coordinate data in the three-dimensional space at different times is associated and saved by assigning it a unique identification number. The first vertex data sequence and the second vertex data sequence are the coordinate data of each vertex of the i-th scene element in the three-dimensional space corresponding to the scene screen at two different times. It should be known that the first vertex data sequence, the second vertex data sequence and the third vertex data sequence only contain the coordinate data of the vertices of the visible area of the model surface of the i-th scene element in the first key frame or the second key frame. Therefore, the third vertex data sequence is obtained according to the correspondence between the vertices in the second vertex data sequence and the vertices in the first vertex data sequence in the i-th first scene element, specifically by eliminating the coordinate data of the vertices contained in the second vertex data sequence that have the same unique identification number as any vertex in the first vertex data sequence, and constructing the coordinate data of the remaining vertices into the third vertex data sequence.
[0113] In the technical solution of the above embodiment, the area s of each surface is m,k is a relative value. Specifically, a reference surface of a reference object is determined in the three-dimensional animation, and the area of the reference surface in the three-dimensional animation is taken as the standard area s 0In this 3D animation, the area of any surface is compared with the standard area s 0 The quotient of is the area of the surface s m,k . It should be known that, in the technical solution of the present invention, the larger the area of each face in an occlusion region, the greater the difference value of the scene elements containing the occlusion region between the two key frames. Similarly, the more faces the occlusion region contains, the more complex the geometric structure of the occlusion region, and accordingly, the greater the difference value of the scene elements containing the occlusion region between the two key frames. In the technical solution of the above-mentioned implementation, the configuration of the face number difference coefficient α and the area difference coefficient β is mainly used to adjust the weights of the face number and area in the difference value calculation process, and is also used to adjust the numerical range of the difference value.
[0114] Furthermore, in the above-mentioned picture data processing system for three-dimensional animation, the occlusion area recognition module includes:
[0115] A vertex combination identification module, used to identify, in the third vertex data sequence, a vertex combination associated with the same face, wherein the number of vertices in the vertex combination is greater than or equal to 3;
[0116] A target surface determination module is used to determine a target surface corresponding to each vertex combination, wherein the target surface is a surface surrounded by a line connecting vertices in the vertex combination;
[0117] The occlusion region combination module is used to combine target faces with common edges to form the occlusion region.
[0118] Specifically, the combination of vertices associated with the same face specifically refers to the line connecting these vertices being the edge of the same face. The same face referred to here, i.e., the target face, is one of the smallest elements constituting the three-dimensional model. When these lines span more than one face, these vertices cannot be said to be associated with the same face. In the technical solution of the above-mentioned implementation, the target face with a common edge refers to two adjacent target faces with the same edge. When two adjacent target faces have a common edge, the two target faces can form a continuous area.
[0119] Furthermore, in the above-mentioned picture data processing system for three-dimensional animation, the transition frame picture data generation module also includes:
[0120] a change region identification module, used to identify a first change region and a second change region of each first scene element in the frame picture of the second key frame, wherein the first change region is a region where vertices on the first scene element exist in the frame picture of the first key frame, and the second change region is a region where vertices on the first scene element do not exist in the frame picture of the first key frame;
[0121] The transition area data generation module comprises:
[0122] A first transition region data generating module, configured to generate first transition region data of a first change region of the first scene element in a frame picture of each transition frame by adopting an interpolation mode;
[0123] A second transition area data generating module, configured to generate the second change area of the first scene element and the second transition area data of the third scene element in each transition frame by using a mapping mode;
[0124] The third transition area data generating module is used to generate the third transition area data of the second scene element in the frame picture of each transition frame by adopting a copy mode.
[0125] In the technical solution of the above-mentioned embodiment, the step of constructing the transition frame picture data of each transition frame based on the transition area data is specifically to construct the transition frame picture data of each transition frame based on the first transition area data, the second transition area data and the third transition area data.
[0126] Furthermore, in the above-mentioned picture data processing system for three-dimensional animation, the first transition area data generating module includes:
[0127] An interpolation parameter determination module, used to determine interpolation parameters of an interpolation mode, wherein the interpolation parameters include the time points of the first key frame, the second key frame, and the target transition frame, and the first vertex data sequence and the second vertex data sequence corresponding to each scene element;
[0128] A time ratio calculation module is used to calculate the time ratio of the time point of the target transition frame relative to the time points of the first key frame and the second key frame:
[0129]
[0130] where t target is the time point of the target transition frame, t ahead is the time point of the first key frame, t after is the time point of the second key frame;
[0131] A coordinate data calculation module is used to calculate the coordinate data of the vertices of the first vertex data sequence in the target transition frame according to the time ratio:
[0132] vtarget i,j =v1 i,j ·(1-ratio target )+v2 i,j ·ratio target,
[0133] where j∈[1,n vertex ],n vertex is the number of vertices in the first change region of the first scene element, v1 i,j is the coordinate of each vertex in the first vertex data sequence, v2 i,j The coordinates of each vertex in the second vertex data sequence.
[0134] It should be known that the above implementation is only an example of a linear interpolation calculation method provided by the present invention. In the technical solutions of other implementations of the present invention, similar ideas can also be used to change it into a corresponding nonlinear calculation method.
[0135] Furthermore, in the above-mentioned picture data processing system for three-dimensional animation, the second transition area data generating module includes:
[0136] A mapping parameter determination module, used to determine mapping parameters of a mapping mode, wherein the mapping parameters include time points of the first key frame, the second key frame, and a target transition frame;
[0137] A scene space construction module, used to construct a first scene space corresponding to a time point of the first key frame and a second scene space corresponding to a time point of the second key frame, wherein the first scene space and the second scene space are three-dimensional spaces;
[0138] A three-dimensional model loading module, used to load the three-dimensional models of the first scene element and the third scene element in the first scene space and the second scene space respectively;
[0139] A spatial posture calculation module, used to calculate the second change area of the first scene element and the spatial posture of the third scene element at the time point of the target transition frame based on the second change area of the first scene element and the posture of the third scene element in the first scene space and the second scene space and the time points of the first key frame, the second key frame, and the target transition frame;
[0140] A coordinate data calculation module is used to calculate the coordinate data of the second change area of the first scene element and the vertices of the third scene element in the target transition frame according to the spatial posture.
[0141] In the technical solution of the above-mentioned implementation mode, a mapping mode is used to process the occluded area of the first scene element in the frame picture of the first key frame and the third scene element that is invisible in the frame picture of the first key frame. In the steps of loading the first scene element and the three-dimensional model of the three scene elements in the first scene space and the second scene space respectively, it also includes loading the vertex data that is invisible in the frame picture of the first key frame. The vertex data that is invisible in the frame picture of the first key frame includes the vertex data that is still in the frame picture of the first key frame from the perspective but is occluded by the surface formed by other vertices, and the vertex data that is located outside the frame picture of the first key frame at the time point of the first key frame and moves into the frame picture of the second key frame before the time point of the second key frame. The movement includes the movement of the scene element itself and the movement of the perspective.
[0142] In the technical solutions of some embodiments of the present invention, before the step of obtaining the key change data of each transition frame from the transition frame picture data, it also includes determining the coordinate data of the second change area of the first scene element and the vertex of the third scene element in the target transition frame as the key change data of the target transition frame.
[0143] Furthermore, in the above-mentioned picture data processing system for three-dimensional animation, the third transition area data generating module includes:
[0144] A replication parameter determination module, used to determine replication parameters of a replication mode, wherein the replication parameters include the first key frame, the second key frame, a time point of a target transition frame, and a third vertex data sequence corresponding to the second scene element;
[0145] An occlusion region determination module, configured to determine, based on the replication parameters, an occlusion region of the second scene element corresponding to the third vertex data sequence in each target transition frame;
[0146] A coordinate data copying module is used to copy the vertex coordinate data of the occlusion area of the second scene element in the previous frame of the target transition frame as the coordinate data in the target transition frame.
[0147] In the technical solution of the above-mentioned embodiment, the second scene element is a scene element that changes less between the time point of the first key frame and the time point of the second key frame. When the vertices of the occlusion area of the second scene element begin to appear in any transition frame, the vertex coordinate data of the same position in the previous frame is directly copied as the coordinate data of the vertices corresponding to the occlusion area in the target transition frame, that is, the vertex coordinate data of the occlusion area of the second scene element in the previous frame of the target transition frame is copied as the coordinate data in the target transition frame.
[0148] In the technical solutions of some embodiments of the present invention, the copy parameters also include a first vertex data sequence and a second vertex data sequence corresponding to the second scene element. In the copy mode, the interpolation method is also used to calculate the coordinate data of the vertices corresponding to the first vertex data sequence and the second vertex data sequence in the target transition frame.
[0149] like Figure 2 As shown, the second aspect of the present invention provides a method for processing picture data for three-dimensional animation, comprising:
[0150] Acquire key frame picture data of the three-dimensional animation, wherein the key frame picture data includes the time point of each key frame and the vertex coordinate data of each scene element in the frame picture;
[0151] Generate transition frame picture data between every two adjacent key frames based on the key frame picture data;
[0152] Acquire key change data of each transition frame from the transition frame picture data, wherein the key change data includes a transformation matrix of the transition frame relative to a previous key frame and vertex coordinate data of a changed part of a scene element in the transition frame;
[0153] The key change data of each transition frame is associated with the time point of the transition frame and saved.
[0154] Specifically, the frame is an instantaneous scene image corresponding to a certain data frame in the image data of the three-dimensional animation. Each frame generally contains a number of scene elements. The three-dimensional model of these scene elements is composed of a large number of faces (Face), and these faces are usually composed of a large number of vertices (Vertex) and polygons (Polygon) composed of edges (Edgd) connecting these vertices. The vertex coordinate data is used to describe the position information of each vertex of the three-dimensional model in the three-dimensional space. The geometric structure of each model in the three-dimensional animation, that is, its corresponding position and posture, can be restored through the vertex coordinate data.
[0155] The key frame picture data is the data input frame by frame by the modeler when designing the animation. Specifically, the time point corresponding to the key frame is selected, and the scene elements are placed in the scene picture of the three-dimensional animation and the position and posture are adjusted to form a freeze-frame picture corresponding to the time point of the frame. Similar to the key frame picture data, the transition frame picture data also includes the corresponding time point of each transition frame and the vertex coordinate data of each scene element in its frame picture.
[0156] Furthermore, in the above-mentioned picture data processing method for three-dimensional animation, the step of generating transition frame picture data between every two adjacent key frames based on the key frame picture data specifically includes:
[0157] Determine two adjacent key frames for which a transition frame needs to be generated as a first key frame and a second key frame;
[0158] Inputting key frame picture data of the first key frame and the second key frame;
[0159] Identifying a first scene element, a second scene element, and a third scene element in the frame picture of the second key frame, wherein the first scene element is a scene element that exists in the frame pictures of both the first key frame and the second key frame and whose difference value is greater than or equal to a preset threshold, the second scene element is a scene element that exists in the frame pictures of both the first key frame and the second key frame and whose difference value is less than a preset threshold, and the third scene element is a scene element that exists in the frame picture of the second key frame but does not exist in the frame picture of the first key frame;
[0160] Determine the number of transition frames between the first key frame and the second key frame according to the time points of the first key frame and the second key frame;
[0161] Generate transition area data of the first scene element, the second scene element and the third scene element in each transition frame;
[0162] The transition frame picture data of each transition frame is constructed based on the transition area data.
[0163] It should be known that the first key frame and the second key frame do not refer to two specific key frames, but when generating transition frame picture data between any two adjacent key frames, the first key frame and the second key frame refer to one of the two adjacent key frames. Specifically, the first key frame refers to the key frame with an earlier time point among the adjacent key frames, and correspondingly, the second key frame refers to the key frame with a later time point among the adjacent key frames. In the technical solution of the above-mentioned implementation, the step of determining the number of transition frames between the first key frame and the second key frame according to the time points of the first key frame and the second key frame specifically includes:
[0164] Get the preset 3D animation frame rate fps;
[0165] Get the time point t of the first key frame ahead and the time point t of the second key frame after ;
[0166] Calculate the number of transition frames between the first key frame and the second key frame:
[0167] count inbetweens =(t after -t ahead )·fps.
[0168] Specifically, the frame picture of the first key frame is specifically composed of the key frame picture data of the first key frame, and corresponds to the still picture at the time point where the first key frame is located. Similarly, the frame picture of the second key frame is specifically composed of the key frame picture data of the second key frame, and corresponds to the still picture at the time point where the second key frame is located. In the technical solution of the above-mentioned implementation mode, when a scene element appears partially or entirely in the frame picture of a key frame, it is determined whether the scene element exists in the frame picture of the key frame.
[0169] In the technical solutions of some embodiments of the present invention, after the step of constructing the transition frame picture data of each transition frame based on the transition area data, the step further includes:
[0170] Generate a translation matrix, a scaling matrix and a rotation matrix for performing position offset, scaling ratio and angle offset transformation of each transition frame relative to the first key frame;
[0171] The translation matrix, the scaling matrix and the rotation matrix of each transition frame are determined as key change data of the corresponding transition frame.
[0172] Furthermore, in the above-mentioned picture data processing method for three-dimensional animation, the step of identifying the first scene element, the second scene element and the third scene element in the frame picture of the second key frame specifically includes:
[0173] identifying, in the frame picture of the second key frame, a third scene element that exists in the frame picture of the second key frame but does not exist in the frame picture of the first key frame;
[0174] Determining the scene elements other than the third scene element in the frame picture of the second key frame as target scene elements;
[0175] Get the number n of the target scene elements object and a pre-configured difference threshold d 0 ;
[0176] Traverse each target scene element to calculate the difference value d between the first key frame and the second key frame of each target scene element vari,i , where i∈[1,n object ];
[0177] According to the difference value d vari,i and the difference threshold d0 The target scene element is determined as the first scene element or the second scene element according to the size of the target scene element.
[0178] Specifically, according to the difference value d vari,i and the difference threshold d 0 The step of determining the target scene element as the first scene element or the second scene element according to the size of the target scene element specifically comprises:
[0179] When vari,i ≥d 0 , determining the target scene element as the first scene element;
[0180] When vari,i <d 0 , determining the target scene element as the second scene element.
[0181] Furthermore, in the above-mentioned method for processing picture data for three-dimensional animation, each first scene element is traversed to calculate the difference value d between the first key frame and the second key frame of each first scene element. vari,i The steps specifically include:
[0182] Obtaining a first vertex data sequence of the i-th first scene element in the first key frame and a second vertex data sequence in the second key frame;
[0183] Obtaining a third vertex data sequence according to the correspondence between the vertices in the second vertex data sequence and the vertices in the first vertex data sequence in the i-th first scene element, wherein the vertices in the third vertex data sequence are vertices that exist in the second vertex data sequence but not in the first vertex data sequence;
[0184] Identifying an occlusion area according to coordinates of vertices in the third vertex data sequence;
[0185] Get the number of faces n contained in each occlusion area of the i-th scene element face,k And the area of each face s m,k , where k∈[1,n region ],m∈[1,n face,k ],n region is the number of occluded regions in the i-th scene element, n face,k is the number of faces in the kth occluded region;
[0186] Calculate the difference between the first key frame and the second key frame of the i-th scene element:
[0187]
[0188] Wherein α is the pre-configured face number difference coefficient, and β is the pre-configured area difference coefficient.
[0189] Specifically, after the three-dimensional model of a scene element is completed, the number of vertices, one of the main elements used to represent its geometric structure, remains unchanged. Each vertex and the face formed by the vertex and its adjacent edges together constitute the local structure of the three-dimensional model. Therefore, each vertex is an independent existence in the scene element, and its coordinate data in the three-dimensional space at different times is associated and saved by assigning it a unique identification number. The first vertex data sequence and the second vertex data sequence are the coordinate data of each vertex of the i-th scene element in the three-dimensional space corresponding to the scene screen at two different times. It should be known that the first vertex data sequence, the second vertex data sequence and the third vertex data sequence only contain the coordinate data of the vertices of the visible area of the model surface of the i-th scene element in the first key frame or the second key frame. Therefore, the third vertex data sequence is obtained according to the correspondence between the vertices in the second vertex data sequence and the vertices in the first vertex data sequence in the i-th first scene element, specifically by eliminating the coordinate data of the vertices contained in the second vertex data sequence that have the same unique identification number as any vertex in the first vertex data sequence, and constructing the coordinate data of the remaining vertices into the third vertex data sequence.
[0190] In the technical solution of the above embodiment, the area s of each surface is m,k is a relative value. Specifically, a reference surface of a reference object is determined in the three-dimensional animation, and the area of the reference surface in the three-dimensional animation is taken as the standard area s 0 In this 3D animation, the area of any surface is compared with the standard area s 0 The quotient of is the area of the surface s m,k . It should be known that, in the technical solution of the present invention, the larger the area of each face in an occlusion region, the greater the difference value of the scene elements containing the occlusion region between the two key frames. Similarly, the more faces the occlusion region contains, the more complex the geometric structure of the occlusion region, and accordingly, the greater the difference value of the scene elements containing the occlusion region between the two key frames. In the technical solution of the above-mentioned implementation, the configuration of the face number difference coefficient α and the area difference coefficient β is mainly used to adjust the weights of the face number and area in the difference value calculation process, and is also used to adjust the numerical range of the difference value.
[0191] Furthermore, in the above-mentioned picture data processing method for three-dimensional animation, the step of identifying the occlusion area according to the coordinates of the vertices in the third vertex data sequence specifically includes:
[0192] Identifying a vertex combination associated with a same face in the third vertex data sequence, wherein the number of vertices in the vertex combination is greater than or equal to 3;
[0193] Determine a target surface corresponding to each vertex combination, wherein the target surface is a surface surrounded by a line connecting vertices in the vertex combination;
[0194] The target faces with common edges are combined to form the occlusion area.
[0195] Specifically, the combination of vertices associated with the same face specifically refers to the line connecting these vertices being the edge of the same face. The same face referred to here, i.e., the target face, is one of the smallest elements constituting the three-dimensional model. When these lines span more than one face, these vertices cannot be said to be associated with the same face. In the technical solution of the above-mentioned implementation, the target face with a common edge refers to two adjacent target faces with the same edge. When two adjacent target faces have a common edge, the two target faces can form a continuous area.
[0196] Furthermore, in the above-mentioned picture data processing method for three-dimensional animation, after the step of identifying the first scene element, the second scene element and the third scene element in the frame picture of the second key frame, it also includes:
[0197] Identifying a first change region and a second change region of each first scene element in the frame picture of the second key frame, wherein the first change region is a region where vertices on the first scene element exist in the frame picture of the first key frame, and the second change region is a region where vertices on the first scene element do not exist in the frame picture of the first key frame;
[0198] The step of generating transition area data of the first scene element, the second scene element and the third scene element in each transition frame specifically includes:
[0199] Generate first transition region data of the first change region of the first scene element in each transition frame in an interpolation mode;
[0200] Generate the second change area of the first scene element and the second transition area data of the third scene element in each transition frame by using a mapping mode;
[0201] The third transition area data of the second scene element in the frame picture of each transition frame is generated in a copy mode.
[0202] In the technical solution of the above-mentioned embodiment, the step of constructing the transition frame picture data of each transition frame based on the transition area data is specifically to construct the transition frame picture data of each transition frame based on the first transition area data, the second transition area data and the third transition area data.
[0203] Furthermore, in the above-mentioned picture data processing method for three-dimensional animation, the step of using the interpolation mode to generate the first transition area data of the first change area of the first scene element in each transition frame frame specifically includes:
[0204] Determine interpolation parameters of the interpolation mode, wherein the interpolation parameters include the time points of the first key frame, the second key frame, and the target transition frame, and the first vertex data sequence and the second vertex data sequence corresponding to each scene element;
[0205] Calculate the time ratio of the time point of the target transition frame to the time points of the first key frame and the second key frame:
[0206]
[0207] where t target is the time point of the target transition frame, t ahead is the time point of the first key frame, t after is the time point of the second key frame;
[0208] Calculate the coordinate data of the vertices of the first vertex data sequence in the target transition frame according to the time ratio:
[0209] vtarget i,j =v1 i,j ·(1-ratio target )+v2 i,j ·ratio target ,
[0210] where j∈[1,n vertex ],n vertex is the number of vertices in the first change region of the first scene element, v1 i,j is the coordinate of each vertex in the first vertex data sequence, v2 i,j The coordinates of each vertex in the second vertex data sequence.
[0211] It should be known that the above implementation is only an example of a linear interpolation calculation method provided by the present invention. In the technical solutions of other implementations of the present invention, similar ideas can also be used to change it into a corresponding nonlinear calculation method.
[0212] Furthermore, in the above-mentioned picture data processing method for three-dimensional animation, the step of using a mapping mode to generate the second change area data of the first scene element and the second transition area data of the third scene element in each transition frame frame specifically includes:
[0213] Determining mapping parameters of a mapping mode, wherein the mapping parameters include time points of the first key frame, the second key frame, and a target transition frame;
[0214] Constructing a first scene space corresponding to a time point of the first key frame and a second scene space corresponding to a time point of the second key frame, wherein the first scene space and the second scene space are three-dimensional spaces;
[0215] Loading the three-dimensional models of the first scene element and the third scene element in the first scene space and the second scene space respectively;
[0216] Calculate the second change area of the first scene element and the spatial posture of the third scene element at the time point of the target transition frame based on the second change area of the first scene element and the posture of the third scene element in the first scene space and the second scene space and the time points of the first key frame, the second key frame, and the target transition frame;
[0217] The coordinate data of the second change region of the first scene element and the vertices of the third scene element in the target transition frame are obtained according to the spatial posture.
[0218] In the technical solution of the above-mentioned implementation mode, a mapping mode is used to process the occluded area of the first scene element in the frame picture of the first key frame and the third scene element that is invisible in the frame picture of the first key frame. In the steps of loading the first scene element and the three-dimensional model of the three scene elements in the first scene space and the second scene space respectively, it also includes loading the vertex data that is invisible in the frame picture of the first key frame. The vertex data that is invisible in the frame picture of the first key frame includes the vertex data that is still in the frame picture of the first key frame from the perspective but is occluded by the surface formed by other vertices, and the vertex data that is located outside the frame picture of the first key frame at the time point of the first key frame and moves into the frame picture of the second key frame before the time point of the second key frame. The movement includes the movement of the scene element itself and the movement of the perspective.
[0219] In the technical solutions of some embodiments of the present invention, before the step of obtaining the key change data of each transition frame from the transition frame picture data, it also includes determining the coordinate data of the second change area of the first scene element and the vertex of the third scene element in the target transition frame as the key change data of the target transition frame.
[0220] Furthermore, in the above-mentioned picture data processing method for three-dimensional animation, the step of using the copy mode to generate the third transition area data of the second scene element in each transition frame frame specifically includes:
[0221] Determine copy parameters of the copy mode, wherein the copy parameters include the first key frame, the second key frame, a time point of a target transition frame, and a third vertex data sequence corresponding to the second scene element;
[0222] Determine, based on the copy parameter, an occlusion area of the second scene element corresponding to the third vertex data sequence in each target transition frame;
[0223] The vertex coordinate data of the occluded area of the second scene element in the previous frame of the target transition frame is copied as the coordinate data in the target transition frame.
[0224] In the technical solution of the above-mentioned embodiment, the second scene element is a scene element that changes less between the time point of the first key frame and the time point of the second key frame. When the vertices of the occlusion area of the second scene element begin to appear in any transition frame, the vertex coordinate data of the same position in the previous frame is directly copied as the coordinate data of the vertices corresponding to the occlusion area in the target transition frame, that is, the vertex coordinate data of the occlusion area of the second scene element in the previous frame of the target transition frame is copied as the coordinate data in the target transition frame.
[0225] In the technical solutions of some embodiments of the present invention, the copy parameters also include a first vertex data sequence and a second vertex data sequence corresponding to the second scene element. In the copy mode, the interpolation method is also used to calculate the coordinate data of the vertices corresponding to the first vertex data sequence and the second vertex data sequence in the target transition frame.
[0226] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0227] According to the embodiments of the present invention as described above, these embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and changes can be made based on the above description. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can make good use of the present invention and the modified use based on the present invention. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. A picture data processing system for three-dimensional animation, characterized in that: include: A key frame picture data acquisition module is used to acquire key frame picture data of a three-dimensional animation, wherein the key frame picture data includes the time point of each key frame and the vertex coordinate data of each scene element in the frame picture; A transition frame picture data generating module, used for generating transition frame picture data between every two adjacent key frames based on the key frame picture data; A key change data acquisition module, used to acquire key change data of each transition frame from the transition frame picture data, wherein the key change data includes a transformation matrix of the transition frame relative to the previous key frame and vertex coordinate data of a changed part of a scene element in the transition frame; A key change data storage module, used for storing the key change data of each transition frame in association with the time point of the transition frame; The transition frame picture data generation module comprises: A key frame determination module, used for determining two adjacent key frames for which transition frames need to be generated as a first key frame and a second key frame; A key frame picture data input module, used for inputting the key frame picture data of the first key frame and the second key frame; a scene element recognition module, configured to recognize a first scene element, a second scene element, and a third scene element in a frame picture of the second key frame, wherein the first scene element is a scene element that exists in both the frame pictures of the first key frame and the second key frame and whose difference value is greater than or equal to a preset threshold, the second scene element is a scene element that exists in both the frame pictures of the first key frame and the second key frame and whose difference value is less than a preset threshold, and the third scene element is a scene element that exists in the frame picture of the second key frame but does not exist in the frame picture of the first key frame; a transition frame number determination module, configured to determine the number of transition frames between the first key frame and the second key frame according to time points of the first key frame and the second key frame; A transition area data generating module, used to generate transition area data of the first scene element, the second scene element and the third scene element in each transition frame; The transition frame picture data generation module is also used to construct the transition frame picture data of each transition frame based on the transition area data; The transition frame picture data generation module also includes: a change region identification module, used to identify a first change region and a second change region of each first scene element in the frame picture of the second key frame, wherein the first change region is a region where vertices on the first scene element exist in the frame picture of the first key frame, and the second change region is a region where vertices on the first scene element do not exist in the frame picture of the first key frame; The transition area data generation module comprises: A first transition region data generating module, configured to generate first transition region data of a first change region of the first scene element in a frame picture of each transition frame by adopting an interpolation mode; A second transition area data generating module, configured to generate the second change area of the first scene element and the second transition area data of the third scene element in each transition frame by using a mapping mode; The third transition area data generating module is used to generate the third transition area data of the second scene element in the frame picture of each transition frame by adopting a copy mode.
2. A method for processing picture data for three-dimensional animation, characterized in that: include: Acquire key frame picture data of the three-dimensional animation, wherein the key frame picture data includes the time point of each key frame and the vertex coordinate data of each scene element in the frame picture; Generate transition frame picture data between every two adjacent key frames based on the key frame picture data; Acquire key change data of each transition frame from the transition frame picture data, wherein the key change data includes a transformation matrix of the transition frame relative to a previous key frame and vertex coordinate data of a changed part of a scene element in the transition frame; The key change data of each transition frame is associated with the time point of the transition frame and stored; The step of generating transition frame picture data between every two adjacent key frames based on the key frame picture data specifically includes: Determine two adjacent key frames for which a transition frame needs to be generated as a first key frame and a second key frame; Inputting key frame picture data of the first key frame and the second key frame; Identifying a first scene element, a second scene element, and a third scene element in the frame picture of the second key frame, wherein the first scene element is a scene element that exists in the frame pictures of both the first key frame and the second key frame and whose difference value is greater than or equal to a preset threshold, the second scene element is a scene element that exists in the frame pictures of both the first key frame and the second key frame and whose difference value is less than a preset threshold, and the third scene element is a scene element that exists in the frame picture of the second key frame but does not exist in the frame picture of the first key frame; Determine the number of transition frames between the first key frame and the second key frame according to the time points of the first key frame and the second key frame; Generate transition area data of the first scene element, the second scene element and the third scene element in each transition frame; Constructing transition frame picture data of each transition frame based on the transition region data; After the step of identifying the first scene element, the second scene element and the third scene element in the frame picture of the second key frame, the method further includes: Identifying a first change region and a second change region of each first scene element in the frame picture of the second key frame, wherein the first change region is a region where vertices on the first scene element exist in the frame picture of the first key frame, and the second change region is a region where vertices on the first scene element do not exist in the frame picture of the first key frame; The step of generating transition area data of the first scene element, the second scene element and the third scene element in each transition frame specifically includes: Generate first transition region data of the first change region of the first scene element in each transition frame in an interpolation mode; Generate the second change area of the first scene element and the second transition area data of the third scene element in each transition frame by using a mapping mode; The third transition area data of the second scene element in the frame picture of each transition frame is generated in a copy mode.
3. The method for processing picture data for three-dimensional animation according to claim 2, characterized in that: The step of identifying the first scene element, the second scene element and the third scene element in the frame picture of the second key frame specifically includes: identifying, in the frame picture of the second key frame, a third scene element that exists in the frame picture of the second key frame but does not exist in the frame picture of the first key frame; Determining the scene elements other than the third scene element in the frame picture of the second key frame as target scene elements; Get the number of target scene elements and pre-configured difference thresholds ; Traverse each target scene element to calculate the difference value of each target scene element between the first key frame and the second key frame ,in ; According to the difference value and the difference threshold The target scene element is determined as the first scene element or the second scene element according to the size of the target scene element.
4. The method for processing picture data for three-dimensional animation according to claim 3, characterized in that: Traverse each first scene element to calculate the difference value of each first scene element between the first key frame and the second key frame The steps specifically include: Get the a first vertex data sequence of a first scene element in the first key frame and a second vertex data sequence in the second key frame; According to the vertices in the second vertex data sequence and the vertices in the first vertex data sequence, a first scene element, wherein the vertices in the third vertex data sequence are vertices that exist in the second vertex data sequence but not in the first vertex data sequence; Identifying an occlusion area according to coordinates of vertices in the third vertex data sequence; Get the The number of faces contained in each occlusion region of a scene element And the area of each face ,in , , For the The number of occluded regions in the scene elements, For the The number of faces in the occluded region; No. The difference value of a scene element between the first key frame and the second key frame: , in is the pre-configured face number difference coefficient, is a preconfigured area difference coefficient.
5. The method for processing picture data for three-dimensional animation according to claim 4, characterized in that: The step of identifying the occlusion area according to the coordinates of the vertices in the third vertex data sequence specifically includes: Identifying a vertex combination associated with a same face in the third vertex data sequence, wherein the number of vertices in the vertex combination is greater than or equal to 3; Determine a target surface corresponding to each vertex combination, wherein the target surface is a surface surrounded by a line connecting vertices in the vertex combination; The target faces with common edges are combined to form the occlusion area.
6. The method for processing picture data for three-dimensional animation according to claim 2, characterized in that: The step of using the interpolation mode to generate first transition area data of the first change area of the first scene element in each transition frame also includes: Determine interpolation parameters of the interpolation mode, wherein the interpolation parameters include the time points of the first key frame, the second key frame, and the target transition frame, and the first vertex data sequence and the second vertex data sequence corresponding to each scene element; Calculate the time ratio of the time point of the target transition frame to the time points of the first key frame and the second key frame: , in is the time point of the target transition frame, is the time point of the first key frame, is the time point of the second key frame; Calculate the coordinate data of the vertices of the first vertex data sequence in the target transition frame according to the time ratio: , in , is the number of vertices in the first change region of the first scene element, is the coordinate of each vertex in the first vertex data sequence, The coordinates of each vertex in the second vertex data sequence.
7. The method for processing picture data for three-dimensional animation according to claim 2, characterized in that: The step of using the mapping mode to generate the second change area data of the first scene element and the second transition area data of the third scene element in each transition frame specifically includes: Determining mapping parameters of a mapping mode, wherein the mapping parameters include time points of the first key frame, the second key frame, and a target transition frame; Constructing a first scene space corresponding to a time point of the first key frame and a second scene space corresponding to a time point of the second key frame, wherein the first scene space and the second scene space are three-dimensional spaces; Loading the three-dimensional models of the first scene element and the third scene element in the first scene space and the second scene space respectively; Calculate the second change area of the first scene element and the spatial posture of the third scene element at the time point of the target transition frame based on the second change area of the first scene element and the posture of the third scene element in the first scene space and the second scene space and the time points of the first key frame, the second key frame, and the target transition frame; The coordinate data of the second change region of the first scene element and the vertices of the third scene element in the target transition frame are obtained according to the spatial posture.
8. The method for processing picture data for three-dimensional animation according to claim 2, characterized in that: The step of using the copy mode to generate the third transition area data of the second scene element in each transition frame specifically includes: Determine copy parameters of the copy mode, wherein the copy parameters include the first key frame, the second key frame, a time point of a target transition frame, and a third vertex data sequence corresponding to the second scene element; Determine, based on the copy parameter, an occlusion area of the second scene element corresponding to the third vertex data sequence in each target transition frame; The vertex coordinate data of the occluded area of the second scene element in the previous frame of the target transition frame is copied as the coordinate data in the target transition frame.
