A virtual object construction method, device, computer equipment, medium and program product
Through spline function fitting and solving technology, the stiffness and performance consumption problems caused by skeletal animation are solved, flexible virtual object construction and scene adaptation are achieved, and the degree of freedom and efficiency of animation are improved.
Patent Information
- Application Number
- CN202411101053.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-08-12
AI Technical Summary
When generating animations with the existing technology, skeletal animation can easily lead to stiffness for soft objects, excessive number of bones leads to high performance consumption, and vertex animation cannot adapt to specific scenes.
By fitting the initial animation data based on the spline function, the spline curve fitting data of the virtual object is obtained, and is assigned to the bone node. It is solved by the animation engine to reconstruct the motion form in the animation frame and get rid of the skeletal architecture. restrictions to adapt to various virtual scenarios.
It achieves the reconstruction of smooth virtual objects with a small amount of calculation, reduces performance consumption, and creates more flexible virtual objects that can adapt to a variety of virtual scenes and have a higher degree of freedom.
Smart Images

Figure CN118615708B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a method, device, computer equipment, medium and program product for constructing a virtual object. Background Art
[0002] Currently, animation can be generated through skeletal animation or vertex animation. The generated animation can be directly used in the game engine to play the animation in real time.
[0003] Skeletal animation uses a set of skeletons to control the movement of the model. The skeleton has a skin on it. The skin refers to a set of vertices that are affected by the skeleton. The weight of the skin will determine the final position of the model's vertices during the movement of the skeleton. This driving method allows you to get vivid model movements and complete animations by simply adjusting the skeleton movements. However, when this animation generation method is used for soft objects, a small number of bones can easily lead to a stiff model, and a large number of bones can easily cause a large performance consumption.
[0004] Vertex animation does not rely on the skeleton to control the model, so there is no problem of stiffness. In this animation generation method, the movement strategy of the model's vertices at each moment can be indicated by data, and the animator can add animation to the model's vertices. However, it cannot be solved for specific scenes such as game scenes to adapt to the scene. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides a virtual object construction method, device, computer equipment, medium and program product, which can reconstruct smooth virtual objects based on less computing power, get rid of the limitations of the skeletal structure, reduce performance consumption, and the constructed virtual objects are more flexible and can adapt to various virtual scenes.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] In one aspect, the present application provides a method for constructing a virtual object, the method comprising:
[0008] Using a plurality of initial animation frames included in the initial animation data as target animation frames respectively, fitting a first motion form of the virtual object in the target animation frames based on a spline function, and obtaining spline curve fitting data of the virtual object in the target animation frames, wherein the spline curve fitting data includes position information of a plurality of spline control points;
[0009] Assigning the position information of the plurality of spline control points to a plurality of skeleton nodes corresponding to the plurality of spline control points respectively to obtain skeleton data;
[0010] Solving the skeleton data based on the spline function by an animation engine to determine a second motion form of the virtual object in a reconstructed animation frame corresponding to the target animation frame;
[0011] The virtual object is constructed in the reconstructed animation frame according to the second motion form.
[0012] Optionally, the spline control points include a spline starting point, a spline end point, a first actual control point corresponding to the spline starting point, and a second actual control point corresponding to the spline end point, and the position information of the multiple spline control points is assigned to multiple bone nodes corresponding to the multiple spline control points to obtain bone data, including:
[0013] Determine a plurality of skeletal nodes, wherein the plurality of skeletal nodes include a first skeletal node and a second skeletal node, and a child skeletal node of the first skeletal node and a child skeletal node of the second skeletal node;
[0014] Assign the position information of the starting point of the spline to the first skeleton node, and assign the position information of the end point of the spline to the second skeleton node;
[0015] The position information of the first actual control point is assigned to the corresponding child bone node of the first bone node, and the position information of the second actual control point is assigned to the corresponding child bone node of the second bone node.
[0016] Optionally, assigning the position information of the first actual control point to a corresponding child bone node of the first bone node, and assigning the position information of the second actual control point to a corresponding child bone node of the second bone node, includes:
[0017] Performing data conversion on the position information of the first actual control point to obtain first converted position information of the first actual control point relative to the starting point of the spline, wherein the first converted position information includes first rotation information, first scaling information and first displacement information;
[0018] Performing data conversion on the position information of the second actual control point to obtain second converted position information of the second actual control point relative to the spline end point, wherein the second converted position information includes second rotation information, second scaling information, and second displacement information;
[0019] The first conversion position information is assigned to the corresponding child bone node of the first bone node, and the second conversion position information is assigned to the corresponding child bone node of the second bone node.
[0020] Optionally, solving the skeleton data based on the spline function by the animation engine to determine the second motion form of the virtual object in the reconstructed animation frame corresponding to the target animation frame includes:
[0021] Determining, by an animation engine, a target position of a spline end point according to a preset scene of a reconstructed animation frame corresponding to the target animation frame;
[0022] According to the position of the spline endpoint and the interpolation weight corresponding to the reconstructed animation frame, the skeleton data is adjusted to obtain the spline curve reconstruction data of the virtual object in the reconstructed animation frame;
[0023] The spline curve reconstruction data is solved based on the spline function to determine a second motion form of the virtual object in the reconstructed animation frame.
[0024] Optionally, adjusting the skeleton data according to the position of the spline endpoint and the interpolation weight corresponding to the reconstructed animation frame to obtain the spline curve reconstruction data of the virtual object in the reconstructed animation frame includes:
[0025] Updating the rotation information of the spline starting point to face the target position, and adjusting the scaling information of the spline starting point to a preset scaling value, wherein the preset scaling value is determined according to the distance between the spline starting point and the spline end point, and the distance between the spline starting point and the target position;
[0026] The scaling information of the spline endpoint is adjusted to the preset scaling value, the rotation information of the spline endpoint is updated to be toward the target position, and the displacement information of the spline endpoint is set to be an interpolation between the position information of the spline endpoint and the position information of the target position, wherein the interpolation is determined according to the interpolation weight corresponding to the reconstructed animation frame.
[0027] Optionally, adjusting the skeleton data according to the position of the spline endpoint and the interpolation weight corresponding to the reconstructed animation frame to obtain the spline curve reconstruction data of the virtual object in the reconstructed animation frame includes:
[0028] Adjusting the scaling information of the spline starting point to a preset scaling value, wherein the preset scaling value is determined according to the distance between the spline starting point and the spline end point, and the distance between the spline starting point and the target position;
[0029] The scaling information of the spline endpoint is adjusted to the preset scaling value; the rotation information of the spline endpoint is rotationally compensated according to a target rotation angle, wherein the target rotation angle is a rotation angle between a first vector between the spline starting point and the target position and a second vector between the spline starting point and the spline endpoint; the displacement information of the spline endpoint is set to an interpolation between the displacement information of the spline endpoint and the displacement information of the target position, wherein the interpolation is determined according to an interpolation weight corresponding to the reconstructed animation frame.
[0030] Optionally, the spline control point includes a spline starting point, a spline end point and an actual control point, and the multiple initial animation frames included in the initial animation data are respectively used as target animation frames, and the first motion form of the virtual object in the target animation frame is fitted based on the spline function to obtain the spline curve fitting data of the virtual object in the target animation frame, including:
[0031] Using a plurality of initial animation frames included in the initial animation data as target animation frames respectively, obtaining actual position information of a plurality of trajectory feature points on the first motion form of the virtual object in the target animation frames, and position information of the spline start point and the spline end point;
[0032] Determine the predicted position information of the trajectory feature point according to the position information of the spline starting point and the spline end point, the initial position information of the actual control point and the spline function;
[0033] According to the actual position information and the predicted position information of the plurality of trajectory feature points, the initial position information of the actual control point is adjusted to obtain the position information of the actual control point.
[0034] Optionally, the initial animation data is skeletal animation data or vertex animation data;
[0035] If the initial animation data is skeletal animation data, the multiple trajectory feature points include skeletal nodes; if the initial animation data is vertex animation data, the multiple trajectory feature points are discrete points on the curve corresponding to the virtual object.
[0036] Optionally, the taking a plurality of initial animation frames included in the initial animation data as target animation frames respectively, fitting the first motion form of the virtual object in the target animation frames based on a spline function, and obtaining the spline curve fitting data of the virtual object in the target animation frames includes:
[0037] The multiple initial animation frames included in the initial animation data are respectively used as target animation frames, and multiple segments of the first motion form of the virtual object in the target animation frame are fitted based on the spline function to obtain multiple groups of spline curve fitting data corresponding to the multiple segments of the virtual object in the target animation frame.
[0038] Optionally, constructing the virtual object in the reconstructed animation frame according to the second motion form includes:
[0039] Discretely sampling on the curve of the second motion form to obtain a plurality of sampling feature points of the virtual object in the reconstructed animation frame;
[0040] The plurality of sampling feature points are used as trajectory center points of the virtual object, and the virtual object is constructed in the reconstructed animation frame.
[0041] Optionally, sampling on the curve of the second motion form to obtain a plurality of sampling feature points of the virtual object in the reconstructed animation frame includes:
[0042] Discrete sampling is performed on the curve of the second motion form according to a preset sampling rate to obtain multiple sampling feature points of the virtual object in the reconstructed animation frame; the preset sampling rate includes a single sampling rate or multiple sampling rates corresponding to different curve segments of the virtual object.
[0043] On the other hand, the present application provides a virtual object construction device, the device comprising:
[0044] A fitting unit, configured to use the multiple initial animation frames included in the initial animation data as target animation frames, respectively, and fit the first motion form of the virtual object in the target animation frame based on a spline function to obtain spline curve fitting data of the virtual object in the target animation frame, wherein the spline curve fitting data includes position information of multiple spline control points;
[0045] An assignment unit, used for assigning the position information of the plurality of spline control points to a plurality of skeleton nodes corresponding to the plurality of spline control points, respectively, to obtain skeleton data;
[0046] A solving unit, used for solving the skeleton data based on the spline function through an animation engine to determine a second motion form of the virtual object in a reconstructed animation frame corresponding to the target animation frame;
[0047] A construction unit is used to construct the virtual object in the reconstructed animation frame according to the second motion form.
[0048] Optionally, the spline control point includes a spline starting point, a spline end point, a first actual control point corresponding to the spline starting point, and a second actual control point corresponding to the spline end point, and the assignment unit includes:
[0049] A skeleton determination unit, used to determine a plurality of skeleton nodes, wherein the plurality of skeleton nodes include a first skeleton node and a second skeleton node, and a child skeleton node of the first skeleton node and a child skeleton node of the second skeleton node;
[0050] A first assignment unit, used for assigning the position information of the spline starting point to the first skeleton node, and assigning the position information of the spline end point to the second skeleton node;
[0051] The second assignment unit is used to assign the position information of the first actual control point to the corresponding child bone node of the first bone node, and assign the position information of the second actual control point to the corresponding child bone node of the second bone node.
[0052] Optionally, the second assignment unit includes:
[0053] A first conversion unit, configured to perform data conversion on the position information of the first actual control point to obtain first converted position information of the first actual control point relative to the starting point of the spline, wherein the first converted position information includes first rotation information, first scaling information and first displacement information;
[0054] A second conversion unit is used to perform data conversion on the position information of the second actual control point to obtain second converted position information of the second actual control point relative to the spline end point, wherein the second converted position information includes second rotation information, second scaling information and second displacement information;
[0055] An assignment subunit is used to assign the first conversion position information to the corresponding child bone node of the first bone node, and to assign the second conversion position information to the corresponding child bone node of the second bone node.
[0056] Optionally, the solving unit includes:
[0057] A target position determination unit, configured to determine a target position of a spline end point according to a preset scene of a reconstructed animation frame corresponding to the target animation frame through an animation engine;
[0058] A reshaping unit, configured to adjust the skeleton data according to the position of the spline endpoint and the interpolation weight corresponding to the reconstructed animation frame to obtain the spline curve reconstruction data of the virtual object in the reconstructed animation frame;
[0059] A solver unit is used to solve the spline curve reconstruction data based on the spline function to determine the second motion form of the virtual object in the reconstructed animation frame.
[0060] Optionally, the shaping unit is specifically used for:
[0061] Updating the rotation information of the spline starting point to face the target position, and adjusting the scaling information of the spline starting point to a preset scaling value, wherein the preset scaling value is determined according to the distance between the spline starting point and the spline end point, and the distance between the spline starting point and the target position;
[0062] The scaling information of the spline endpoint is adjusted to the preset scaling value, the rotation information of the spline endpoint is updated to be toward the target position, and the displacement information of the spline endpoint is set to be an interpolation between the position information of the spline endpoint and the position information of the target position, wherein the interpolation is determined according to the interpolation weight corresponding to the reconstructed animation frame.
[0063] Optionally, the shaping unit is specifically used for:
[0064] Adjusting the scaling information of the spline starting point to a preset scaling value, wherein the preset scaling value is determined according to the distance between the spline starting point and the spline end point, and the distance between the spline starting point and the target position;
[0065] The scaling information of the spline endpoint is adjusted to the preset scaling value; the rotation information of the spline endpoint is rotationally compensated according to a target rotation angle, wherein the target rotation angle is a rotation angle between a first vector between the spline starting point and the target position and a second vector between the spline starting point and the spline endpoint; the displacement information of the spline endpoint is set to an interpolation between the displacement information of the spline endpoint and the displacement information of the target position, wherein the interpolation is determined according to an interpolation weight corresponding to the reconstructed animation frame.
[0066] Optionally, the spline control points include a spline starting point, a spline end point and an actual control point, and the fitting unit includes:
[0067] A position information acquisition unit, wherein the user uses a plurality of initial animation frames included in the initial animation data as target animation frames, respectively, to acquire actual position information of a plurality of trajectory feature points on the first motion form of the virtual object in the target animation frames, and position information of the spline start point and the spline end point;
[0068] A prediction unit, configured to determine predicted position information of the trajectory feature point according to position information of the spline starting point and the spline end point, initial position information of the actual control point and the spline function;
[0069] The adjustment unit is used to adjust the initial position information of the actual control point according to the actual position information and the predicted position information of the multiple trajectory feature points to obtain the position information of the actual control point.
[0070] Optionally, the initial animation data is skeletal animation data or vertex animation data;
[0071] If the initial animation data is skeletal animation data, the multiple trajectory feature points include skeletal nodes; if the initial animation data is vertex animation data, the multiple trajectory feature points are discrete points on the curve corresponding to the virtual object.
[0072] Optionally, the fitting unit is specifically used for:
[0073] The multiple initial animation frames included in the initial animation data are respectively used as target animation frames, and multiple segments of the first motion form of the virtual object in the target animation frame are fitted based on the spline function to obtain multiple groups of spline curve fitting data corresponding to the multiple segments of the virtual object in the target animation frame.
[0074] Optionally, the construction unit includes:
[0075] A sampling unit, configured to perform discrete sampling on the curve of the second motion form to obtain a plurality of sampling feature points of the virtual object in the reconstructed animation frame;
[0076] The construction subunit is used to use the multiple sampling feature points as the trajectory center points of the virtual object to construct the virtual object in the reconstructed animation frame.
[0077] Optionally, the construction unit is specifically used for:
[0078] Discrete sampling is performed on the curve of the second motion form according to a preset sampling rate to obtain multiple sampling feature points of the virtual object in the reconstructed animation frame; the preset sampling rate includes a single sampling rate or multiple sampling rates corresponding to different curve segments of the virtual object.
[0079] In another aspect, the present application provides a computer device, the device comprising a processor and a memory:
[0080] The memory is used to store a computer program and transmit the computer program to the processor;
[0081] The processor is used to execute the virtual object construction method described in the above aspect according to the instructions in the computer program.
[0082] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the virtual object construction method described in the above aspect.
[0083] On the other hand, an embodiment of the present application provides a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute the virtual object construction method.
[0084] It can be seen from the above technical solution that the multiple initial animation frames included in the initial animation data are respectively used as target animation frames, and the first motion form of the virtual object in the target animation frame can be fitted based on the spline function to obtain the spline curve fitting data of the virtual object in the target animation frame, which is used to represent the first motion form of the virtual object. The spline curve fitting data can include the position information of multiple spline control points, and the spline curve that matches the first motion form can be restored based on the position information of the multiple spline control points and the spline function. The position information of the multiple spline control points is assigned to the multiple bone nodes corresponding to the multiple spline control points to obtain the bone data, and the bone data can be solved based on the spline function by the animation engine to determine the second motion form of the virtual object in the reconstructed animation frame corresponding to the target animation frame, and the virtual object is constructed in the reconstructed animation frame according to the second motion form. In this way, the fitting result is stored in the form of bone data, which can adapt to the existing data flow process. Since the spline function can reconstruct a smooth spline curve based on a small number of spline control points, it gets rid of the limitation of the bone structure, which is conducive to reducing performance consumption, and the constructed virtual object is also more flexible. Virtual objects are dynamically generated through the animation engine and can adapt to the virtual scenes corresponding to the reconstructed animation frames, with a higher degree of freedom. BRIEF DESCRIPTION OF THE DRAWINGS
[0085] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0086] Figure 1 A schematic diagram of an application scenario of a virtual object construction method provided in an embodiment of the present application;
[0087] Figure 2 A flowchart of a virtual object construction method provided in an embodiment of the present application;
[0088] Figure 3 A schematic diagram of a virtual object provided in an embodiment of the present application;
[0089] Figure 4 A schematic diagram of a spline curve provided in an embodiment of the present application;
[0090] Figure 5 A schematic diagram of a skeletal animation provided in an embodiment of the present application;
[0091] Figure 6 A schematic diagram of a skeleton skinning animation provided in an embodiment of the present application;
[0092] Figure 7 A schematic diagram of a gradient descent method fitting result provided in an embodiment of the present application;
[0093] Figure 8 A schematic diagram of a least squares fitting result provided in an embodiment of the present application;
[0094] Fig. 9 A schematic diagram of a skeleton structure provided in an embodiment of the present application;
[0095] Fig.10 A schematic diagram of a skeleton structure in 3ds Max provided in an embodiment of the present application;
[0096] Fig.11 A schematic diagram of a bone structure in Maya provided in an embodiment of the present application;
[0097] Fig.12 A workflow diagram provided for an embodiment of the present application;
[0098] Fig.13 A schematic diagram of an animation modification provided in an embodiment of the present application;
[0099] Fig.14 A schematic diagram of a target rotation angle provided in an embodiment of the present application;
[0100] Fig.15 and Fig.16 The third motion form corresponding to the two initial animation frames in the embodiment of the present application;
[0101] Fig.17 A schematic diagram of a reconstructed virtual object provided in an embodiment of the present application;
[0102] Fig.18 A structural block diagram of a virtual object construction device provided in an embodiment of the present application;
[0103] Fig.19 A structural diagram of a terminal device provided in an embodiment of the present application;
[0104] Fig. 20 A structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0105] The embodiments of the present application are described below in conjunction with the accompanying drawings.
[0106] At present, the construction of soft objects by skeletal animation is prone to problems such as stiffness or high performance consumption, and virtual objects constructed by vertex animation cannot adapt to specific scenes. In order to solve the above technical problems, the present application provides a virtual object construction method and related devices, which can reconstruct smooth virtual objects based on less calculation amount, get rid of the limitations of skeletal architecture, reduce performance consumption, and construct virtual objects that are more flexible and can adapt to various virtual scenes.
[0107] The virtual object construction method provided in the embodiment of the present application can be implemented by a computer device, which can be a terminal device or a server, wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. Terminal devices include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, Extended Reality (XR) devices, etc. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this.
[0108] In order to facilitate understanding of the technical solution provided by the present application, a virtual object construction method provided by an embodiment of the present application will be introduced below in combination with an actual application scenario.
[0109] Figure 1 A schematic diagram of an application scenario of a virtual object construction method provided by an embodiment of the present application is shown, in which a server 10 and a terminal device 20 are included, and an application for virtual object construction is installed in the terminal device 20, and the server 10 and the terminal device 20 corresponding to the application interact through a network. The server 10 or the terminal device 20 can be used as the aforementioned computer device to construct a virtual object in an animation frame. The following will be described by taking the server 10 as the aforementioned computer device as an example.
[0110] The server 10 can use the multiple initial animation frames included in the initial animation data as target animation frames respectively, and can fit the first motion form of the virtual object in the target animation frame based on the spline function to obtain the spline curve fitting data of the virtual object in the target animation frame, which is used to represent the first motion form of the virtual object. The spline curve fitting data may include position information of multiple spline control points, and a spline curve that matches the first motion form can be restored based on the position information of the multiple spline control points and the spline function.
[0111] The server 10 can assign the position information of multiple spline control points to multiple skeleton nodes corresponding to the multiple spline control points to obtain skeleton data. The skeleton data can be solved based on the spline function by the animation engine to determine the second motion form of the virtual object in the reconstructed animation frame corresponding to the target animation frame, and the virtual object is constructed in the reconstructed animation frame according to the second motion form, and then the virtual object in the reconstructed animation frame corresponding to each of the initial animation frames is constructed. In this way, the fitting results are stored in the form of skeleton data, which can adapt to the existing data flow process. Since the spline function can reconstruct a smooth spline curve based on a small number of spline control points, it gets rid of the limitation of the skeleton structure, which is conducive to reducing performance consumption, and the constructed virtual object is also more flexible. The virtual object is dynamically generated by the animation engine, which can adapt to the virtual scene corresponding to the reconstructed animation frame and has a higher degree of freedom.
[0112] Figure 2 A flowchart of a method for constructing a virtual object provided in an embodiment of the present application. In this embodiment, a server is used as the aforementioned computer device for illustration. The method for constructing a virtual object may include:
[0113] S101, taking multiple initial animation frames included in the initial animation data as target animation frames respectively, fitting the first motion form of the virtual object in the target animation frame based on the spline function, and obtaining the spline curve fitting data of the virtual object in the target animation frame, wherein the spline curve fitting data includes the position information of multiple spline control points.
[0114] In the embodiment of the present application, a virtual object can be constructed based on the initial animation data. The virtual object can be an object whose motion form and structure can be described regularly. The motion form can be described regularly, which means that the extension direction of the object can be described regularly, for example, the extension direction is reflected as a curve, which can be represented by a mathematical function. The structure can be described regularly, which means that the object can be described regularly in a plane perpendicular to the extension direction, for example, it appears as a circle or a square in the plane perpendicular to the extension direction, which can also be represented by a mathematical function later. The virtual object is specifically a soft object, such as a tentacles, hooks, whips, etc. Figure 3 As shown, it is a schematic diagram of a virtual object provided in an embodiment of the present application, in which multiple tentacles extend outward from the lower left corner, the extension direction appears as a curve, and appear as a circle in a plane perpendicular to the extension direction. The dotted lines inside the tentacles indicate the connecting lines of the center points of each circle.
[0115] The initial animation data may be skeletal animation data or vertex animation data, and the skeletal animation data may include multiple bones and corresponding bone information, and the bone information may include displacement data, rotation data, and scaling data, etc. The vertex animation data may include multiple vertices and vertex position information.
[0116] The initial animation data can be obtained by using digital content creation (DCC) software, such as Maya or 3ds Max. Maya is a 3D computer graphics software widely used in digital special effects production such as movies, television, and games. 3ds Max is a 3D computer graphics software that can be used for 3D modeling and animation production, and is used in digital special effects creation such as movies and games. Specifically, the artist can use DCC software to perform hand-k animation according to the needs of animation production to obtain the initial animation data. Hand-k animation is an animation production method, where k stands for keyframe, and the animator manually sets the keyframe to control the action of the character in the animation. When the initial animation data is skeletal animation data, the animator can use the skeletal chain to set the skeletal information of each bone in each frame to obtain skeletal animation data. The initial animation data can be unskinned data. When the initial animation data is vertex animation data, the animator can define each vertex and the position information of the vertex to obtain vertex animation data.
[0117] The initial animation data may include data of multiple initial animation frames. Any animation frame among the multiple initial animation frames is used as a target animation frame. Based on the target animation frame, a virtual object in a reconstructed animation frame corresponding to the target animation frame may be constructed. In this way, virtual objects in multiple reconstructed animation frames are constructed based on each initial animation frame. The multiple initial animation frames include virtual objects. The virtual objects may have different motion forms in different initial animation frames. The different motion forms are played in sequence to form a coherent movement of the virtual object. The motion form of the virtual object in the target animation frame is recorded as the first motion form. The first motion form can be represented by a spline curve of the virtual object in the extension direction. For example, it can be Figure 3 The dotted line in the figure indicates the curve. Figure 4 As shown, it is a schematic diagram of a spline curve provided in an embodiment of the present application. The point on the spline curve can be the center point of the virtual object in a plane perpendicular to the extension direction. The spline curve can be represented by a mathematical function, which can be fitted into a spline function, and its morphology is controlled by control points such as P11-P16.
[0118] If the virtual object of the software in the reconstructed animation frame is constructed directly through the skeletal animation data, the runtime effect can be guaranteed when the number of bones is small, but it is easy to have the problem of a relatively rigid model. When the number of bones is large, the number of drawing times of the graphics processing unit (GPU) of the game engine increases, which will cause a large performance consumption. In addition, when adapting to different game scenes, due to the limitations of skeletal animation design, encountering more extreme situations may cause problems such as skin folding and cracking, and difficulty in controlling animation deformation. Reference Figure 5FIG. 1 is a schematic diagram of a skeleton animation provided by an embodiment of the present application, referring to FIG. Figure 6 FIG. 1 is a schematic diagram of a skeleton skinning animation provided by an embodiment of the present application. Figure 5 Skinning the skeletal animation in Figure 6 Skeletal skinning animation in Figure 5 The skeletal animation in is constructed in Maya. Figure 6 The skeleton skin animation shown is formed by skinning in Maya. Figure 5 and Figure 6 It can be seen that the virtual object constructed by skeletal animation has an unnecessary folding effect at the skeletal joints in the rectangular frame.
[0119] In an embodiment of the present application, for a target animation frame, the first motion form of a virtual object in the target animation frame can be fitted based on a spline function to obtain the spline curve fitting data of the virtual object in the target animation frame. The spline function is used to indicate the relationship satisfied by the points on the spline curve. The spline curve fitting data, as the mathematical expression data of the first motion form, can indicate the first motion form of the virtual object, which may include the position information of multiple spline control points. The position information of the spline control points can be restored by combining the spline function to obtain a spline curve. The restored spline curve is relatively consistent with the first motion form. In this way, the first motion form is represented by the spline curve, which achieves data simplification. In the process of restoring the spline curve, the position information of the spline control points is substituted into the spline function, and the position information of any feature point on the spline curve can be determined.
[0120] In summary, for the target animation frame, the first motion form of the virtual object can be expressed by a spline curve, and the spline curve fitting data (i.e., the position information of the spline control points) can be used to represent the spline curve, thereby reflecting the first motion form of the virtual object. In this way, the spline curve fitting data corresponding to each initial animation frame can be obtained to reflect the first motion form of the virtual object in each initial animation frame. In other words, the spline curve fitting data corresponding to each initial animation frame can be used as the encoding data of the animation sequence, and the motion form of the virtual object can be restored by decoding it later.
[0121] Specifically, the spline control points may include a spline start point, a spline end point, and an actual control point. The position information of the spline start point and the spline end point may be obtained from the target animation frame, and the position information of the actual control point is unknown and may be determined by fitting. The actual control point may be one or more, and may include a first actual control point corresponding to the spline start point, and may also include a second actual control point corresponding to the spline end point. The number of the first actual control point may be one or more, and the number of the second actual control point may be one or more. The spline function may be a Bezier curve function, or may be any other spline function or any other three-dimensional function expression.
[0122] In a specific implementation, the multiple initial animation frames included in the initial animation data can be used as target animation frames respectively to obtain the actual position information of multiple trajectory feature points on the first motion form of the virtual object in the target animation frame, as well as the position information of the spline starting point and the spline end point. According to the position information of the spline starting point and the spline end point, as well as the initial position information of the actual control point and the spline function, the predicted position information of the trajectory feature point can be determined. According to the actual position information and the predicted position information of the multiple trajectory feature points, the initial position information of the actual control point is adjusted to obtain the position information of the actual control point, thereby realizing iterative approximation of the position information of the actual control point and completing the fitting of the spline curve.
[0123] If the initial animation data is skeletal animation data, the multiple trajectory feature points may include skeletal nodes, that is, the actual position information of each skeletal node in the target animation frame may be obtained, and the actual position information may be the coordinate value of the world coordinate system constructed by the DCC software. If the initial animation data is vertex animation data, the multiple trajectory feature points are discrete points on the curve corresponding to the virtual object. The curve corresponding to the virtual object may be obtained by abstracting the virtual object, for example, it may be a line connecting the center points of the virtual object in a plane perpendicular to the extension direction. By discretizing the curve, multiple discrete points and their position information may be obtained.
[0124] The following example is given with the number of the first actual control point being one and the number of the second actual control point being one. That is, in the example, the spline control points may include four: the spline start point P0, the spline end point P2, the first actual control point P1, and the second actual control point P3. Through the position information of the four spline control points and the spline function, a spline curve can be restored. In the example, the spline function is a cubic Bezier curve function.
[0125] Taking the initial animation data as skeletal animation data as an example, the actual position information (such as coordinate values) of each skeletal node in the target animation frame can be obtained, and the position information of the root bone is used as the position information of the spline starting point P0, and the position information of the end bone is used as the position information of the spline end point P2. Then, the position information of the spline starting point P0 and the spline end point P2 is known, while the position information of the remaining first actual control point P1 and the second actual control point P2 is unknown.
[0126] The coordinates of the first actual control point P1 and the second actual control point P2 are regarded as unknown parameters that need to be determined by fitting. The coordinates of the first actual control point P1 are marked as (x1, y1, z1), and the coordinates of the second actual control point P2 are marked as (x2, y2, z2). The input of the spline function is the position identifier of the trajectory feature point in the virtual object, such as the percentage t of the trajectory feature point in the overall curve of the virtual object. The output of the spline function is the predicted position information of the trajectory feature point, such as the predicted coordinates (x, y, z). The spline function is denoted as f, and the spline function can be expressed as: f(t | (x1, y1, z1), (x2, y2, z2)) = (x, y, z). In actual operation, since x, y, and z are independent of each other in the formula, the formula can be split into three formulas, namely, the formula related to t and x, the formula related to t and y, and the formula related to t and z. The corresponding spline functions are recorded as f1, f2, and f3, respectively expressed as x=f1(t | x1, x2), y=f2(t | y1, y2), and z=f3(t | z1, z2). At this time, the three functions can be curve fitted respectively, so as to iteratively approximate the coordinates of the first actual control point P1 and the second actual control point P2, so as to obtain the position information of the first actual control point P1 and the second actual control point P2 by fitting.
[0127] Curve fitting methods can include gradient descent method or least square method, both of which are built into 3dsmax and maya for artists to use. During the fitting process, the fitting method and iteration parameters can be set according to the actual situation. The result of the fitting is the spline curve fitting data, specifically the position information of the spline control points. The spline curve can be drawn based on the spline curve fitting data. The spline curve corresponding to the spline curve fitting data determined based on the Bezier curve function can be recorded as a Bezier curve.
[0128] refer to Figure 7 As shown, it is a schematic diagram of the fitting result of a gradient descent method provided in an embodiment of the present application, referring to Figure 8As shown, it is a schematic diagram of the least squares fitting result provided in an embodiment of the present application. The curve with the sphere is a line (Given Points) drawn with the actual position information of the trajectory feature points, and the curve without the sphere is a spline curve (Bezier Curve) obtained by restoring the spline curve fitting data. It can be seen from the figure that both fitting methods can obtain good fitting results.
[0129] In the embodiment of the present application, the first motion form of the virtual object can be obtained by fitting a spline curve, or by fitting multiple spline curves. In this way, when the fitting effect of a spline curve is not ideal, the first motion form can be fitted in segments to improve the fitting effect, and compared with increasing the number of actual control points, it has a lower amount of calculation. Specifically, when fitting multiple spline curves, multiple segments of the first motion form of the virtual object in the target animation frame can be fitted separately based on the spline function to obtain multiple groups of spline curve fitting data corresponding to the multiple segments of the virtual object in the target animation frame, thereby ensuring a lower amount of calculation while ensuring the fitting effect.
[0130] S102, assigning position information of a plurality of spline control points to a plurality of skeleton nodes corresponding to the plurality of spline control points respectively to obtain skeleton data.
[0131] In the embodiment of the present application, after the position information of multiple spline control points in the target animation frame is obtained by fitting, the position information of multiple spline control points can be respectively assigned to multiple skeleton nodes corresponding to the multiple spline control points to obtain skeleton data. Skeleton data can include displacement data, rotation data and scaling data, which are respectively used to represent the displacement information, rotation angle and scaling information of the skeleton nodes. Wherein the spline control points correspond to the skeleton nodes one by one, and the position information of the spline control points is used as the position information of the skeleton nodes, so that the spline curve fitting data can be stored in the form of skeleton data, which is adapted to the existing data flow process.
[0132] Specifically, multiple skeleton nodes can be determined to store spline curve fitting data. Unlike the skeleton nodes in skeleton animation, they are only carriers of spline curve fitting data, and their number is related to the number of spline control points, but has nothing to do with the control strategy and accuracy of the feature point position of the virtual object. In the case where the spline control points include the spline starting point, the spline end point, the first actual control point corresponding to the spline starting point, and the second actual control point corresponding to the spline end point, the multiple skeleton nodes may include the first skeleton node and the second skeleton node, as well as the child skeleton node of the first skeleton node and the child skeleton node of the second skeleton node. This setting facilitates the subsequent shaping control of the skeleton data. Wherein the first skeleton node and the second skeleton node may belong to the same level, and the child skeleton node of the first skeleton node and the child skeleton node of the second skeleton node may belong to the same level. The number of the child skeleton nodes of the first skeleton node is the same as the number of the first actual control points, for example, it can be one or more, and the child skeleton nodes of the first skeleton node correspond to the first actual control points one by one; the number of the child skeleton nodes of the second skeleton node is the same as the number of the second actual control points, for example, it can be one or more, and the child skeleton nodes of the second skeleton node correspond to the second actual control points one by one.
[0133] refer to Fig. 9 As shown, it is a schematic diagram of the skeleton structure provided by the embodiment of the present application. The virtual object is a tentacle (Tentacle), which is denoted as Tentacle1. The skeleton structure of the virtual object includes multiple skeleton nodes: the first skeleton node (Tentacle1_P0), the child skeleton node of the first skeleton node (Tentacle1_P1), the second skeleton node (Tentacle1_P2) and the child skeleton node of the second skeleton node (Tentacle1_P3). Fig.10 , which is a schematic diagram of a skeleton structure in 3ds Max provided by an embodiment of the present application, including six skeleton nodes, of which four skeleton nodes P0-P4 are skeleton nodes corresponding to virtual objects, and the skeleton data of the skeleton nodes are spline curve fitting data, specifically the position information of multiple spline control points. Fig.11 As shown, it is a schematic diagram of a bone structure in Maya provided by an embodiment of the present application, which includes four bone nodes P0-P4, and the bone data of the bone nodes are spline curve fitting data, specifically the position information of multiple spline control points.
[0134] After determining multiple bone nodes, the position information of the spline starting point can be assigned to the first bone node, the position information of the spline end point can be assigned to the second bone node, the position information of the first actual control point can be assigned to the corresponding child bone node of the first bone node, and the position information of the second actual control point can be assigned to the corresponding child bone node of the second bone node. In this way, a group of bone nodes can store a group of spline curve fitting data to represent a spline curve. When an initial animation frame corresponds to a spline curve, it can correspond to a group of bone nodes to represent the spline curve; when an initial animation frame corresponds to multiple spline curves, it can correspond to multiple groups of bone nodes to represent multiple spline curves respectively.
[0135] The position information of the first actual control point and the position information of the second actual control point obtained by fitting are coordinate values relative to the world space. Before assigning the position information of the first actual control point and the second actual control point, data conversion can be performed on the two so that their position information is position information relative to their parent skeleton. Specifically, data conversion can be performed on the position information of the first actual control point to obtain the first converted position information of the first actual control point relative to the starting point of the spline, and data conversion can be performed on the position information of the second actual control point to obtain the second converted position information of the second actual control point relative to the end point of the spline, and then the first converted position information is assigned to the child bone node of the corresponding first bone node, and the second converted position information is assigned to the child bone node of the corresponding second bone node, wherein the first converted position information includes first rotation information, first displacement information and first scaling information, and the second converted position information includes second rotation information, second displacement information and second scaling information.
[0136] In specific implementation, the position information of the first actual control point can be converted into the first converted position information through the coordinate change matrix, and the coordinate change matrix is used to realize the conversion of the position information of the first actual control point in the world coordinate system into the position information in the local space coordinate system determined based on the spline starting point. When the position information of the first actual control point is a world coordinate value, it can be expressed as P1world, and the first converted position information is a local space coordinate value, which can be expressed as P1local. The coordinate change matrix is expressed as M, then P1world = P1local*M, and the coordinate change matrix is determined according to the world coordinates of the spline starting point and the degree of rotation information, so that P1local is determined based on the spline starting point. The world coordinates of the spline starting point have been determined, which is its position information, but the rotation information is unknown, and there are multiple solutions, which can be set according to actual needs. As an example, the rotation information corresponding to the starting point of the spline can be set so that the starting point of the spline faces the first actual control point. In this way, the first actual control point is offset in only one direction relative to the starting point of the spline, and this direction is recorded as the y direction, that is, the first conversion position information only has a value on the y-axis, that is, the first displacement information is the distance from the starting point of the spline to the first actual control point. This can simplify the data expression of the first conversion position information and facilitate the subsequent processing of the first conversion position information.
[0137] Similarly, the position information of the second actual control point can be converted into the second transformed position information through the coordinate change matrix, and the coordinate change matrix is used to realize the conversion of the position information of the second actual control point in the world coordinate system into the position information in the local space coordinate system determined based on the spline end point. The transformation matrix corresponding to the aforementioned first actual control point is a different matrix, and the coordinate change matrix is determined according to the world coordinates and rotation information of the spline end point, so that the second transformed position information is determined based on the spline end point. The world coordinates of the spline end point have been determined, but the rotation information is unknown, and there are multiple solutions, which can be set according to actual needs. As an example, the spline end point can be set to face the second actual control point by setting the rotation information of the spline end point, so that the second actual control point is offset in only one direction relative to the spline end point, that is, the second displacement information is the distance from the spline end point to the second actual control point, which can simplify the data expression of the second transformed position information and facilitate the subsequent processing of the second transformed position information.
[0138] In the embodiment of the present application, the construction of the virtual object can be realized through a one-click workflow, and the aforementioned S101 and S102 can also be executed through the one-click workflow. Fig.12As shown, it is a workflow diagram provided by an embodiment of the present application. The entire workflow is divided into three stages. In the first stage, the artist performs animation production to obtain initial animation data, which can be animated in 3ds max or maya without skinning; in the second stage, the initial animation data is converted into bone data, which corresponds to S101 and S102, including the acquisition of initial animation data, the acquisition of spline curve fitting data through iteration, and the storage of spline curve fitting data in the bone structure to obtain bone data; in the third stage, the animation engine constructs virtual objects according to the bone data, which corresponds to S103 and S104. That is, the one-click workflow can be a workflow from maya to animation engine or 3ds Max to animation engine, realizing the automatic construction of virtual objects.
[0139] In the second stage, the bone generation tool developed in 3ds max or maya can be used to automatically run the bone generation tool after obtaining the initial animation data. The second stage can include reading the initial animation data, iteratively fitting the curve (corresponding to S101) and determining the bone data (corresponding to S102). The process of determining the bone data can include determining the multiple bones included in the bone structure, performing data conversion, and assigning values to the bones. Refer to the process of S102, where the determined bone structure can refer to Fig.10 and Fig.11 The generated skeleton data may be in the format of .fbx, which includes spline curve fitting data corresponding to a plurality of initial animation frames.
[0140] S103, solving the skeleton data based on the spline function by the animation engine to determine the second motion form of the virtual object in the reconstructed animation frame corresponding to the target animation frame.
[0141] In the embodiment of the present application, the skeleton data can be solved by the animation engine based on the spline function, so as to realize the restoration of the motion form of the virtual object, and then realize the construction of the virtual object in the reconstructed animation corresponding to the target animation frame, which is equivalent to decoding and restoring the skeleton data as the encoded data, and this encoding and decoding process is highly controllable. The reconstructed animation frame can be applied to many different types of games such as stealth games and role-playing games, and can also be used in computer virtual production, virtual human development and other scenarios, so that this solution can be applied to the aforementioned game development, computer virtual production or virtual human development and other scenarios.
[0142] The animation engine can restore the spline curve of the skeleton data based on the spline function. The spline curve indicates the second motion form of the virtual object. In this way, the second motion form is close to the first motion form, which is equivalent to realizing the motion restoration of the virtual object in the target animation frame. Since the spline function can reconstruct a smooth spline curve based on a small number of spline control points, it gets rid of the limitation of the skeleton structure, helps to reduce performance consumption, and the constructed virtual objects are also more flexible.
[0143] In the embodiment of the present application, the motion form of the virtual object can also be adapted according to the preset scene corresponding to the reconstructed animation frame. Specifically, the motion form indicated by the spline curve corresponding to the skeleton data can be recorded as the third motion form, and the skeleton data is adjusted to obtain the spline curve reconstruction data. The spline curve corresponding to the spline curve reconstruction data indicates the second motion state of the virtual object, and the motion form adapted to the preset scene during the second motion form. In this way, the virtual object is dynamically generated by the animation engine, and can adapt to the virtual scene corresponding to the reconstructed animation frame, and has a higher degree of freedom. By adjusting the skeleton data, the motion form of the virtual object can be adapted to the preset scene, that is, it is simple to interact with the scene.
[0144] Since the computing unit is a vector, the overhead is relatively small, less storage space is consumed, and it is multi-thread-friendly, and can support the dynamic generation of multiple virtual objects driven by skeletal animation at one time. Virtual objects are dynamically generated and only require unskinned skeletal animation to work. In the case of multiple bones, the performance consumption of this solution can be on par with skeletal animation, or even lower than that of multiple bones, and can provide flexibility that skeletal animation does not have. In addition, models of different forms can be generated based on a piece of animation data, which has high reusability and will reduce storage pressure compared to traditional animation.
[0145] This is because the third motion form restored based on the skeleton data often cannot meet the scene requirements in actual applications. For example, if the initial animation data corresponds to an attack animation, the attack distance of the attack animation is 10 meters, and the angle is angle A relative to the starting point, while in the actual scene, the required attack distance is 15 meters, and the angle is angle B relative to the starting point. At this time, directly using the skeleton data to restore the spline curve cannot adapt to the actual scene, then the skeleton data can be adjusted to make it adapt to the scene of 15 meters and angle B. This process is called animation reshaping.
[0146] Specifically, the starting point of the spline can be set unchanged in the preset scene, and the target position of the spline end point can be determined by the animation engine according to the preset scene of the reconstructed animation frame corresponding to the target animation frame. According to the position of the spline end point and the interpolation weight corresponding to the reconstructed animation frame, the bone data is adjusted to obtain the spline curve reconstruction data of the virtual object in the reconstructed animation frame, and the spline curve reconstruction data is solved based on the spline function to determine the second motion form of the virtual object in the reconstructed animation frame, in which the spline end point tends to the target position. The target position of the spline end point is the position of the spline end point in the last animation frame of all reconstructed animation frames, such as the position of 15 meters in the above example.
[0147] Specifically, the bone data may be adjusted through a transformation matrix, which may include a rotation matrix R, a translation matrix T, and a scaling matrix R, so that the adjustment order is SRT. Different solving effects may be achieved through different transformation matrices.
[0148] refer to Fig.13 As shown, it is a schematic diagram of an animation modification provided by an embodiment of the present application. The spline end point P20 of the third motion form indicates the attack position of the original attack animation, and its position is the upper center point position. The target position P21 of the spline end point is located on the left side. The spline curve corresponding to the third motion form can be rotated and scaled so that its spline end point is on a trajectory close to the target position, so that the reconstructed animation is reflected as the spline end point gradually moving toward the target position.
[0149] As a possible implementation, the following purpose can be achieved by adjusting the bone data: after rotating the spline curve corresponding to the third motion form so that its spline end point is aligned with the target position, it is scaled to facilitate shape preservation, referring to Fig.13 Curve S1 in .
[0150] In the process of adjusting the skeleton data, the rotation information of the spline starting point can be updated to face the target position, and its displacement information is not changed. In this way, the position of the first actual control point changes with the rotation information of the spline starting point without changing the first displacement information.
[0151] The first actual control point is used to control the shape of the curve near the starting point of the spline. The first displacement information can be scaled according to the scaling ratio to meet the transition in shape. Specifically, the scaling value of the starting point of the spline can be adjusted to a preset scaling value. Since the first actual control point corresponds to the child bone node of the bone node corresponding to the starting point of the spline, the first displacement information of the first actual control point and the preset scaling value jointly determine the actual position of the first actual control point, thereby achieving the scaling of the first displacement information. The preset scaling value can be determined based on the distance between the starting point of the spline and the end point of the spline, and the distance between the starting point of the spline and the target position, for example, the ratio of the distance between the starting point of the spline and the target position to the distance between the starting point of the spline and the end point of the spline. Taking the aforementioned attack distance as an example, the preset scaling value can be 15 / 10=1.5.
[0152] Similarly, the rotation information of the spline endpoint can be updated to face the target position, so that the position of the second actual control point changes with the change of the rotation information of the spline endpoint without changing the second displacement information. The second actual control point is used to control the shape of the curve near the spline endpoint, and the second displacement information can be scaled according to the scaling ratio to meet the transition in shape. The scaling information of the spline endpoint can be set to the aforementioned preset scaling value to achieve the scaling of the second displacement information.
[0153] In addition, the displacement information of the spline endpoint can be set as the interpolation between the displacement information of the spline endpoint and the displacement information of the target position. The interpolation is determined according to the interpolation weight corresponding to the reconstructed animation frame. The interpolation weight is used as a parameter of the interpolation, which is the weight of the displacement information of the target position in the interpolation operation. The weight of the displacement information of the spline endpoint is the difference between 1 and the interpolation weight. The corresponding relationship between the difference weight and the reconstructed animation frame can be reflected by the weight curve. The horizontal axis of the weight curve is the length of the animation, and the vertical axis is the interpolation weight, which is a value of 0-1, representing the progress of approaching the target position. The interpolation weight can be controlled by the artist to finely control the progress of the attack.
[0154] As another possible implementation, the following purpose can be achieved by adjusting the bone data: the spline curve corresponding to the third motion form is gradually aligned with the target from the beginning to the end, and when multiple reconstructed animation frames are played in sequence, the end point of the spline gradually approaches the target position. Fig.13 Curve S2 in .
[0155] In the process of adjusting the bone data, the displacement information of the spline starting point can be retained, and its rotation information is not adjusted.
[0156] The first actual control point is used to control the shape of the curve near the starting point of the spline. The first displacement information can be scaled according to the scaling ratio to meet the transition in shape. Specifically, the scaling value of the starting point of the spline can be adjusted to the preset scaling value. Since the first actual control point corresponds to the child bone node of the bone node corresponding to the starting point of the spline, the first displacement information of the first actual control point and the preset scaling value jointly determine the actual position of the first actual control point, thereby realizing the scaling of the first displacement information. The preset scaling value is determined based on the distance between the starting point of the spline and the end point of the spline, and the distance between the starting point of the spline and the target position, for example, the ratio of the distance between the starting point of the spline and the target position to the distance between the starting point of the spline and the end point of the spline. Taking the aforementioned attack distance as an example, the scaling ratio can be 15 / 10=1.5.
[0157] The second actual control point is used to control the shape of the curve near the spline end point, and the second displacement information can be scaled according to the scaling ratio to meet the transition in shape. The scaling information of the spline end point can be set to the aforementioned preset scaling value to achieve the scaling of the second displacement information.
[0158] In addition, the rotation information of the spline endpoint can be rotated and compensated according to the target rotation angle. The target rotation angle is the rotation angle between the first vector between the spline start point and the target position and the second vector between the spline start point and the spline endpoint. The rotation angle is three-dimensional and can be represented by a quaternion. The new rotation angle is the product of the rotation information and the target rotation angle. Fig.14 , which is a schematic diagram of a target rotation angle provided in an embodiment of the present application, a rotation angle α between a first vector V1 between a spline start point and a target position and a second vector V2 between a spline start point and a spline end point can be used as the target rotation angle.
[0159] The displacement information of the spline endpoint is set to the interpolation between the displacement information of the spline endpoint and the displacement information of the target position. The interpolation is determined according to the interpolation weight corresponding to the reconstructed animation frame. The interpolation weight is used as the interpolation parameter, which is the weight of the displacement information of the target position in the interpolation operation. The weight of the displacement information of the spline endpoint is the difference between 1 and the interpolation weight.
[0160] In this way, the second motion form and its corresponding curve can be determined based on the adjusted skeletal data. The aforementioned modification scheme is easy to understand and simple to operate. When the target animation frame corresponds to multiple spline curves, the adjustment method of its skeletal data refers to the aforementioned process; when the number of the first actual control points is multiple or the number of the second actual control points is multiple, the adjustment method of its corresponding skeletal data refers to the aforementioned process.
[0161] In the embodiment of the present application, the second motion form can be previewed, and the third motion form can also be previewed. The third motion form is obtained by restoring the spline curve of the skeleton data through the spline function, which is consistent with the first motion form. That is, after the skeleton data is imported into the animation engine, the third motion form can be generated based on the skeleton data and displayed. This is because the skeleton data has lost the meaning of traditional animation, and the motion form of the animation cannot be intuitively seen. By previewing the third motion form, the original motion form of the virtual object without scene setting can be obtained. Reference Fig.15 and Fig.16 As shown, the third motion form corresponding to the two initial animation frames provided in the embodiment of the present application.
[0162] S104: construct a virtual object in the reconstructed animation frame according to the second motion form.
[0163] After determining the second motion form, a virtual object can be constructed in the reconstructed animation frame according to the second motion form to obtain a virtual object adapted to a specific scene. After the virtual objects of the multiple reconstructed animation frames corresponding to the multiple initial animation frames are constructed, the virtual object can have different motion forms in the multiple reconstructed animation frames, which are recorded as multiple second motion forms. The different motion forms are played in sequence to form a coherent action of the virtual object. A reconstructed animation including a virtual object can be constructed based on multiple reconstructed animation frames, and animation generation is realized. During the animation generation process, the arrangement of the reconstructed animation frames and the setting of the playback duration can be performed according to actual needs, which will not be elaborated here.
[0164] Specifically, discrete sampling can be performed on the curve of the second motion form to obtain multiple sampling feature points of the virtual object in the reconstructed animation frame, and then the multiple sampling feature points are used as the trajectory center points of the virtual object to construct the virtual object in the reconstructed animation frame, that is, the vertex position can be reconstructed based on multiple sampling feature points, and the vertex animation can be constructed in real time, and then the virtual object can be constructed based on the vertex animation. For example, a mesh can be constructed based on the vertex animation and a virtual object can be rendered based on the mesh, thereby realizing the construction of the virtual object. A fragment is a basic concept in graphics, which is a three-dimensional geometric body composed of a set of vertices, edges and faces. It is one of the basic data structures used to represent three-dimensional models and one of the most commonly used data structures in computer graphics.
[0165] In specific implementation, the sampled feature points can be used as the center points of the virtual object's trajectory, and the virtual object can be reconstructed in a plane perpendicular to the virtual object's extension direction in a certain regular expression, such as constructing a circle or square centered on the sampled feature points, thereby obtaining the vertices of the virtual object in order to determine its fragments. After the virtual object is constructed in each reconstructed animation frame, the restoration of the virtual object in each frame is achieved.
[0166] refer to Fig.17 FIG. 1 is a schematic diagram of a reconstructed virtual object provided in an embodiment of the present application. Figure 6 The skeletal animation data shown is reconstructed. Due to the influence of the solution and the perspective, the movement postures of the two look slightly different. Fig.17 It can be seen that the original folded part of the virtual object is smoothed out during reconstruction. The reconstructed virtual object solves the problem of skin folding, and this virtual object reconstruction method gets rid of the limitation of the number of bones in skeletal animation. The obtained virtual object has a smoother motion form without the problem of rigidity. In addition, the overall vertex animation has a higher degree of freedom in runtime control, and can interact according to actual needs. It will be more flexible and can control its animation shape arbitrarily according to needs, which is very important for some highly artistic animations.
[0167] In the traditional process of building virtual objects based on skeletal animation, multiple levels of detail (LOD) can be set. LOD technology refers to determining the resource allocation for object rendering based on the position and importance of the nodes of the object model in the display environment, reducing the number of faces and detail of non-important objects, and thus obtaining efficient rendering operations. For the same virtual object, the artist needs to make separate changes to the virtual object for different LODs, and once the accuracy of the virtual object is determined, it cannot be changed during operation or in the animation engine, resulting in high communication costs and long time consumption.
[0168] In an embodiment of the present application, discrete sampling can be performed on the curve of the second motion form according to a preset sampling rate to obtain multiple sampling feature points of the virtual object in the reconstructed animation frame, so as to construct a virtual object based on multiple sampling feature points. The preset sampling rate can be a single sampling rate, or multiple sampling rates corresponding to different curve segments of the virtual object. In other words, the sampling frequency can be controlled by the preset sampling rate. At a position with a lower sampling rate, the number of sampling points is small, and the precision of the generated virtual object is low, thereby realizing the function of different lods. Different positions of the same virtual object can have the same precision or different precisions, and the same virtual object can have different precisions in different scenes. In this way, different lods can be achieved only through simple parameter adjustment. The precision of the virtual object is arbitrarily set, and can also be changed when entering the animation engine or during operation, without the need for artists to repeatedly adjust the virtual object according to different precisions.
[0169] In an embodiment of the present application, dynamic effects at the vertex level can also be superimposed on the virtual object. For example, the position information of multiple sampling feature points can be adjusted according to the adjustment coefficient corresponding to the reconstructed animation frame. The correspondence between the adjustment coefficient and the reconstructed animation frame can be reflected by a coefficient curve. The horizontal coordinate of the coefficient curve is the length of the animation, and the vertical coordinate is the adjustment coefficient. The coefficient curve can be a sine curve, so as to adjust the center point of the trajectory of the virtual object, thereby adding dynamic effects at the vertex level to the virtual object.
[0170] Based on a virtual object construction method provided in an embodiment of the present application, an embodiment of the present application also provides a virtual object construction device, referring to Fig.18 , which is a structural block diagram of a virtual object construction device provided in an embodiment of the present application, the virtual object construction device 1300 includes:
[0171] A fitting unit 1301 is used to use a plurality of initial animation frames included in the initial animation data as target animation frames, and fit a first motion form of a virtual object in the target animation frame based on a spline function to obtain spline curve fitting data of the virtual object in the target animation frame, wherein the spline curve fitting data includes position information of a plurality of spline control points;
[0172] An assignment unit 1302, used for assigning the position information of the plurality of spline control points to a plurality of skeleton nodes corresponding to the plurality of spline control points, respectively, to obtain skeleton data;
[0173] A solving unit 1303 is used to solve the skeleton data based on the spline function through an animation engine to determine a second motion form of the virtual object in a reconstructed animation frame corresponding to the target animation frame;
[0174] The constructing unit 1304 is configured to construct the virtual object in the reconstructed animation frame according to the second motion form.
[0175] Optionally, the spline control point includes a spline starting point, a spline end point, a first actual control point corresponding to the spline starting point, and a second actual control point corresponding to the spline end point, and the assignment unit includes:
[0176] A skeleton determination unit, used to determine a plurality of skeleton nodes, wherein the plurality of skeleton nodes include a first skeleton node and a second skeleton node, and a child skeleton node of the first skeleton node and a child skeleton node of the second skeleton node;
[0177] A first assignment unit, used for assigning the position information of the spline starting point to the first skeleton node, and assigning the position information of the spline end point to the second skeleton node;
[0178] The second assignment unit is used to assign the position information of the first actual control point to the corresponding child bone node of the first bone node, and assign the position information of the second actual control point to the corresponding child bone node of the second bone node.
[0179] Optionally, the second assignment unit includes:
[0180] A first conversion unit, configured to perform data conversion on the position information of the first actual control point to obtain first converted position information of the first actual control point relative to the starting point of the spline, wherein the first converted position information includes first rotation information, first scaling information and first displacement information;
[0181] A second conversion unit is used to perform data conversion on the position information of the second actual control point to obtain second converted position information of the second actual control point relative to the spline end point, wherein the second converted position information includes second rotation information, second scaling information and second displacement information;
[0182] An assignment subunit is used to assign the first conversion position information to the corresponding child bone node of the first bone node, and to assign the second conversion position information to the corresponding child bone node of the second bone node.
[0183] Optionally, the solving unit includes:
[0184] A target position determination unit, configured to determine a target position of a spline end point according to a preset scene of a reconstructed animation frame corresponding to the target animation frame through an animation engine;
[0185] A reshaping unit, configured to adjust the skeleton data according to the position of the spline endpoint and the interpolation weight corresponding to the reconstructed animation frame to obtain the spline curve reconstruction data of the virtual object in the reconstructed animation frame;
[0186] A solver unit is used to solve the spline curve reconstruction data based on the spline function to determine the second motion form of the virtual object in the reconstructed animation frame.
[0187] Optionally, the shaping unit is specifically used for:
[0188] Updating the rotation information of the spline starting point to face the target position, and adjusting the scaling information of the spline starting point to a preset scaling value, wherein the preset scaling value is determined according to the distance between the spline starting point and the spline end point, and the distance between the spline starting point and the target position;
[0189] The scaling information of the spline endpoint is adjusted to the preset scaling value, the rotation information of the spline endpoint is updated to be toward the target position, and the displacement information of the spline endpoint is set to be an interpolation between the position information of the spline endpoint and the position information of the target position, wherein the interpolation is determined according to the interpolation weight corresponding to the reconstructed animation frame.
[0190] Optionally, the shaping unit is specifically used for:
[0191] Adjusting the scaling information of the spline starting point to a preset scaling value, wherein the preset scaling value is determined according to the distance between the spline starting point and the spline end point, and the distance between the spline starting point and the target position;
[0192] The scaling information of the spline endpoint is adjusted to the preset scaling value; the rotation information of the spline endpoint is rotationally compensated according to a target rotation angle, wherein the target rotation angle is a rotation angle between a first vector between the spline starting point and the target position and a second vector between the spline starting point and the spline endpoint; the displacement information of the spline endpoint is set to an interpolation between the displacement information of the spline endpoint and the displacement information of the target position, wherein the interpolation is determined according to an interpolation weight corresponding to the reconstructed animation frame.
[0193] Optionally, the spline control points include a spline starting point, a spline end point and an actual control point, and the fitting unit includes:
[0194] A position information acquisition unit, wherein the user uses a plurality of initial animation frames included in the initial animation data as target animation frames, respectively, to acquire actual position information of a plurality of trajectory feature points on the first motion form of the virtual object in the target animation frames, and position information of the spline start point and the spline end point;
[0195] A prediction unit, configured to determine predicted position information of the trajectory feature point according to position information of the spline starting point and the spline end point, initial position information of the actual control point and the spline function;
[0196] The adjustment unit is used to adjust the initial position information of the actual control point according to the actual position information and the predicted position information of the multiple trajectory feature points to obtain the position information of the actual control point.
[0197] Optionally, the initial animation data is skeletal animation data or vertex animation data;
[0198] If the initial animation data is skeletal animation data, the multiple trajectory feature points include skeletal nodes; if the initial animation data is vertex animation data, the multiple trajectory feature points are discrete points on the curve corresponding to the virtual object.
[0199] Optionally, the fitting unit is specifically used for:
[0200] The multiple initial animation frames included in the initial animation data are respectively used as target animation frames, and multiple segments of the first motion form of the virtual object in the target animation frame are fitted based on the spline function to obtain multiple groups of spline curve fitting data corresponding to the multiple segments of the virtual object in the target animation frame.
[0201] Optionally, the construction unit includes:
[0202] A sampling unit, configured to perform discrete sampling on the curve of the second motion form to obtain a plurality of sampling feature points of the virtual object in the reconstructed animation frame;
[0203] The construction subunit is used to use the multiple sampling feature points as the trajectory center points of the virtual object to construct the virtual object in the reconstructed animation frame.
[0204] Optionally, the construction unit is specifically used for:
[0205] Discrete sampling is performed on the curve of the second motion form according to a preset sampling rate to obtain multiple sampling feature points of the virtual object in the reconstructed animation frame; the preset sampling rate includes a single sampling rate or multiple sampling rates corresponding to different curve segments of the virtual object.
[0206] It can be seen from the above technical solution that the multiple initial animation frames included in the initial animation data are respectively used as target animation frames, and the first motion form of the virtual object in the target animation frame can be fitted based on the spline function to obtain the spline curve fitting data of the virtual object in the target animation frame, which is used to represent the first motion form of the virtual object. The spline curve fitting data can include the position information of multiple spline control points, and the spline curve that matches the first motion form can be restored based on the position information of the multiple spline control points and the spline function. The position information of the multiple spline control points is assigned to the multiple bone nodes corresponding to the multiple spline control points to obtain the bone data, and the bone data can be solved based on the spline function by the animation engine to determine the second motion form of the virtual object in the reconstructed animation frame corresponding to the target animation frame, and the virtual object is constructed in the reconstructed animation frame according to the second motion form. In this way, the fitting result is stored in the form of bone data, which can adapt to the existing data flow process. Since the spline function can reconstruct a smooth spline curve based on a small number of spline control points, it gets rid of the limitation of the bone structure, which is conducive to reducing performance consumption, and the constructed virtual object is also more flexible. Virtual objects are dynamically generated through the animation engine and can adapt to the virtual scenes corresponding to the reconstructed animation frames, with a higher degree of freedom.
[0207] The embodiment of the present application further provides a computer device, which is the computer device described above and may include a terminal device or a server, and the aforementioned virtual object construction device may be configured in the computer device. The computer device is described below in conjunction with the accompanying drawings.
[0208] If the computer device is a terminal device, see Fig.19 As shown, the embodiment of the present application provides a terminal device, taking the terminal device as a mobile phone as an example:
[0209] Fig.19 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Fig.19 The mobile phone includes: a radio frequency (RF) circuit 1410, a memory 1420, an input unit 1430, a display unit 1440, a sensor 1450, an audio circuit 1460, a wireless fidelity (WiFi) module 1470, a processor 1480, and a power supply 1490. Those skilled in the art will understand that Fig.19 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0210] Combine the following Fig.19 A detailed introduction to the various components of the mobile phone:
[0211] The RF circuit 1410 may be used for receiving and sending signals during information transmission or communication or during a call. In particular, after receiving downlink information from a base station, the information is sent to the processor 1480 for processing. In addition, the uplink data is sent to the base station.
[0212] The memory 1420 can be used to store software programs and modules. The processor 1480 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1420. The memory 1420 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 1420 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0213] The input unit 1430 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the mobile phone. Specifically, the input unit 1430 may include a touch panel 1431 and other input devices 1432 .
[0214] The display unit 1440 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 1440 may include a display panel 1441.
[0215] The mobile phone may also include at least one sensor 1450, such as a light sensor, a motion sensor, and other sensors.
[0216] The audio circuit 1460 , the speaker 1461 , and the microphone 1462 can provide an audio interface between the user and the mobile phone.
[0217] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 1470. It provides users with wireless broadband Internet access.
[0218] Processor 1480 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in memory 1420 and calling data stored in memory 1420.
[0219] The mobile phone also includes a power source 1490 (such as a battery) for supplying power to various components.
[0220] In this embodiment, the processor 1480 included in the terminal device also has the following functions:
[0221] Using a plurality of initial animation frames included in the initial animation data as target animation frames respectively, fitting a first motion form of the virtual object in the target animation frames based on a spline function, and obtaining spline curve fitting data of the virtual object in the target animation frames, wherein the spline curve fitting data includes position information of a plurality of spline control points;
[0222] Assigning the position information of the plurality of spline control points to a plurality of skeleton nodes corresponding to the plurality of spline control points respectively to obtain skeleton data;
[0223] Solving the skeleton data based on the spline function by an animation engine to determine a second motion form of the virtual object in a reconstructed animation frame corresponding to the target animation frame;
[0224] The virtual object is constructed in the reconstructed animation frame according to the second motion form.
[0225] If the computer device is a server, the present application embodiment also provides a server, see Fig. 20 As shown, Fig. 20 The structural diagram of the server 1500 provided in the embodiment of the present application, the server 1500 may have relatively large differences due to different configurations or performances, and may include one or more processors 1522, such as a central processing unit (CPU), a memory 1532, and one or more storage media 1530 (for example, one or more mass storage devices) storing application programs 1542 or data 1544. Among them, the memory 1532 and the storage medium 1530 can be short-term storage or permanent storage. The program stored in the storage medium 1530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the processor 1522 can be configured to communicate with the storage medium 1530 and execute a series of instruction operations in the storage medium 1530 on the server 1500.
[0226] The server 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input and output interfaces 1558, and / or one or more operating systems 1541, such as Windows Server 2003 or Windows Server 2008. TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM etc.
[0227] The steps performed by the server in the above embodiment can be based on Fig. 20 The server structure shown.
[0228] In addition, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method provided in the above embodiment.
[0229] The embodiments of the present application also provide a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute the method provided in the above embodiments.
[0230] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to the computer program, and the aforementioned computer program can be stored in a computer-readable storage medium. When the computer program is executed, it executes the steps of the above method embodiments; and the aforementioned computer-readable storage medium can be at least one of the following media: read-only memory (English: Read-only Memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store computer programs.
[0231] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0232] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a technician familiar with the technical field within the technical scope disclosed in the present application should be included in the protection scope of the present application. Moreover, based on the implementation methods provided in the above aspects, the present application can also be further combined to provide more implementation methods. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for constructing a virtual object, characterized in that: The method comprises: Using a plurality of initial animation frames included in the initial animation data as target animation frames respectively, fitting a first motion form of the virtual object in the target animation frames based on a spline function, and obtaining spline curve fitting data of the virtual object in the target animation frames, wherein the spline curve fitting data includes position information of a plurality of spline control points; Assigning the position information of the plurality of spline control points to a plurality of skeleton nodes corresponding to the plurality of spline control points respectively to obtain skeleton data; Solving the skeleton data based on the spline function by an animation engine to determine a second motion form of the virtual object in a reconstructed animation frame corresponding to the target animation frame; constructing the virtual object in the reconstructed animation frame according to the second motion form; The spline control points include a spline start point, a spline end point and an actual control point. The multiple initial animation frames included in the initial animation data are respectively used as target animation frames, and the first motion form of the virtual object in the target animation frame is fitted based on the spline function to obtain the spline curve fitting data of the virtual object in the target animation frame, including: Using a plurality of initial animation frames included in the initial animation data as target animation frames respectively, obtaining actual position information of a plurality of trajectory feature points on the first motion form of the virtual object in the target animation frames, and position information of the spline start point and the spline end point; Determine the predicted position information of the trajectory feature point according to the position information of the spline starting point and the spline end point, the initial position information of the actual control point and the spline function; According to the actual position information and the predicted position information of the plurality of trajectory feature points, the initial position information of the actual control point is adjusted to obtain the position information of the actual control point.
2. The method according to claim 1, characterized in that The spline control points include a spline starting point, a spline end point, a first actual control point corresponding to the spline starting point, and a second actual control point corresponding to the spline end point. The position information of the plurality of spline control points is assigned to a plurality of bone nodes corresponding to the plurality of spline control points to obtain bone data, including: Determine a plurality of skeletal nodes, wherein the plurality of skeletal nodes include a first skeletal node and a second skeletal node, and a child skeletal node of the first skeletal node and a child skeletal node of the second skeletal node; Assign the position information of the starting point of the spline to the first skeleton node, and assign the position information of the end point of the spline to the second skeleton node; The position information of the first actual control point is assigned to the corresponding child bone node of the first bone node, and the position information of the second actual control point is assigned to the corresponding child bone node of the second bone node.
3. The method according to claim 2, characterized in that The step of assigning the position information of the first actual control point to the corresponding child bone node of the first bone node, and assigning the position information of the second actual control point to the corresponding child bone node of the second bone node includes: Performing data conversion on the position information of the first actual control point to obtain first converted position information of the first actual control point relative to the starting point of the spline, wherein the first converted position information includes first rotation information, first scaling information and first displacement information; Performing data conversion on the position information of the second actual control point to obtain second converted position information of the second actual control point relative to the spline end point, wherein the second converted position information includes second rotation information, second scaling information, and second displacement information; The first conversion position information is assigned to the corresponding child bone node of the first bone node, and the second conversion position information is assigned to the corresponding child bone node of the second bone node.
4. The method according to claim 3, characterized in that The step of solving the skeleton data based on the spline function by the animation engine to determine the second motion form of the virtual object in the reconstructed animation frame corresponding to the target animation frame includes: Determining, by an animation engine, a target position of a spline end point according to a preset scene of a reconstructed animation frame corresponding to the target animation frame; According to the position of the spline endpoint and the interpolation weight corresponding to the reconstructed animation frame, the skeleton data is adjusted to obtain the spline curve reconstruction data of the virtual object in the reconstructed animation frame; The spline curve reconstruction data is solved based on the spline function to determine a second motion form of the virtual object in the reconstructed animation frame.
5. The method according to claim 4, characterized in that The step of adjusting the skeleton data according to the position of the spline endpoint and the interpolation weight corresponding to the reconstructed animation frame to obtain the spline curve reconstruction data of the virtual object in the reconstructed animation frame includes: Updating the rotation information of the spline starting point to face the target position, and adjusting the scaling information of the spline starting point to a preset scaling value, wherein the preset scaling value is determined according to the distance between the spline starting point and the spline end point, and the distance between the spline starting point and the target position; The scaling information of the spline endpoint is adjusted to the preset scaling value, the rotation information of the spline endpoint is updated to be toward the target position, and the displacement information of the spline endpoint is set to be an interpolation between the position information of the spline endpoint and the position information of the target position, wherein the interpolation is determined according to the interpolation weight corresponding to the reconstructed animation frame.
6. The method according to claim 4, characterized in that The step of adjusting the skeleton data according to the position of the spline endpoint and the interpolation weight corresponding to the reconstructed animation frame to obtain the spline curve reconstruction data of the virtual object in the reconstructed animation frame includes: Adjusting the scaling information of the spline starting point to a preset scaling value, wherein the preset scaling value is determined according to the distance between the spline starting point and the spline end point, and the distance between the spline starting point and the target position; The scaling information of the spline endpoint is adjusted to the preset scaling value; the rotation information of the spline endpoint is rotationally compensated according to a target rotation angle, wherein the target rotation angle is a rotation angle between a first vector between the spline starting point and the target position and a second vector between the spline starting point and the spline endpoint; the displacement information of the spline endpoint is set to an interpolation between the displacement information of the spline endpoint and the displacement information of the target position, wherein the interpolation is determined according to an interpolation weight corresponding to the reconstructed animation frame.
7. The method according to claim 1, characterized in that The initial animation data is skeletal animation data or vertex animation data; If the initial animation data is skeletal animation data, the actual position information of the multiple trajectory feature points is the coordinate value in the world coordinate system; if the initial animation data is vertex animation data, the multiple trajectory feature points are discrete points on the curve corresponding to the virtual object.
8. The method according to any one of claims 1 to 6, characterized in that: The method of using the multiple initial animation frames included in the initial animation data as target animation frames respectively and fitting the first motion form of the virtual object in the target animation frames based on a spline function to obtain the spline curve fitting data of the virtual object in the target animation frames comprises: The multiple initial animation frames included in the initial animation data are respectively used as target animation frames, and multiple segments of the first motion form of the virtual object in the target animation frame are fitted based on the spline function to obtain multiple groups of spline curve fitting data corresponding to the multiple segments of the virtual object in the target animation frame.
9. The method according to any one of claims 1 to 6, characterized in that: The constructing the virtual object in the reconstructed animation frame according to the second motion form includes: Discretely sampling on the curve of the second motion form to obtain a plurality of sampling feature points of the virtual object in the reconstructed animation frame; The plurality of sampling feature points are used as trajectory center points of the virtual object, and the virtual object is constructed in the reconstructed animation frame.
10. The method according to claim 9, characterized in that The sampling on the curve of the second motion form to obtain a plurality of sampling feature points of the virtual object in the reconstructed animation frame includes: Discrete sampling is performed on the curve of the second motion form according to a preset sampling rate to obtain multiple sampling feature points of the virtual object in the reconstructed animation frame; the preset sampling rate includes a single sampling rate or multiple sampling rates corresponding to different curve segments of the virtual object.
11. A virtual object construction device, characterized in that: The device comprises: A fitting unit, configured to use the multiple initial animation frames included in the initial animation data as target animation frames, respectively, and fit the first motion form of the virtual object in the target animation frame based on a spline function to obtain spline curve fitting data of the virtual object in the target animation frame, wherein the spline curve fitting data includes position information of multiple spline control points; An assignment unit, used for assigning the position information of the plurality of spline control points to a plurality of skeleton nodes corresponding to the plurality of spline control points, respectively, to obtain skeleton data; A solving unit, used for solving the skeleton data based on the spline function through an animation engine to determine a second motion form of the virtual object in a reconstructed animation frame corresponding to the target animation frame; a construction unit, configured to construct the virtual object in the reconstructed animation frame according to the second motion form; The spline control points include a spline starting point, a spline end point and an actual control point, and the fitting unit includes: A position information acquisition unit, wherein the user uses a plurality of initial animation frames included in the initial animation data as target animation frames, respectively, to acquire actual position information of a plurality of trajectory feature points on the first motion form of the virtual object in the target animation frames, and position information of the spline start point and the spline end point; A prediction unit, configured to determine predicted position information of the trajectory feature point according to position information of the spline starting point and the spline end point, initial position information of the actual control point and the spline function; The adjustment unit is used to adjust the initial position information of the actual control point according to the actual position information and the predicted position information of the multiple trajectory feature points to obtain the position information of the actual control point.
12. A computer device, characterized in that: The computer device comprises a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is used to execute the virtual object construction method described in any one of claims 1 to 10 according to the instructions in the computer program.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the virtual object construction method according to any one of claims 1 to 10.
14. A computer program product comprising a computer program, characterized in that When it is run on a computer device, the computer device executes the virtual object construction method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Animation rendering method and device, equipment and storage medium
CN116188724A
Information processing method and device, computer equipment and computer readable storage medium
CN116704615A
