Orientation correction method, apparatus and device, and computer readable storage medium

By acquiring and filtering the root node data in the motion capture data, the rotation data is automatically updated to correct the root node orientation, solving the problems of low human correction efficiency and insufficient accuracy in the prior art, and achieving efficient orientation consistency.

CN119027573APending Publication Date: 2024-11-26NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310608673.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-23
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

In the prior art, the correction of the root node orientation of the motion capture data requires artificial operation, resulting in low accuracy of the rotation angle and low efficiency.

Method used

By obtaining the root node data and root motion data of the target model, filtering and mapping, and updating the rotation data to automatically correct the orientation of the root node to ensure that it is consistent with the target model.

Benefits of technology

Automatic correction of the direction of the root node is realized, the accuracy of the rotation angle is improved, and the correction efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119027573A_ABST
    Figure CN119027573A_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer graphics processing, and provides an orientation correction method, apparatus and device, and a computer readable storage medium, the method comprising: obtaining root node data of a root node and root motion data of a root motion in a target model, the root node data comprising first rotation data; performing filtering operation on the root motion data to obtain a filtering result; mapping the filtering result to the first rotation data, and updating the first rotation data; and correcting the orientation of the root node in the target model according to the updated first rotation data. In the mode, the root motion data related to the orientation of the target model is filtered and then mapped to the rotation data of the root node, the root node is rotated to the orientation consistent with the target model, automatic correction of the orientation of the root node is achieved, and due to the fact that the orientation of the target model is related to the root motion data, the accuracy of the orientation of the root node is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer graphics processing, and in particular to an orientation correction method, device, equipment and computer-readable storage medium. Background Art

[0002] In recent years, with the rapid development of the computer graphics (CG) industry, motion capture has become increasingly mature and has become a widely used technology that can realistically reproduce the details of the motion of moving objects. Motion capture is a technology used to accurately measure the motion of moving objects in three-dimensional space. When correcting the motion capture data, the root node orientation of the character model must be consistent with the actual orientation of the model; in the original data of motion capture, the difference between the two orientations is usually large, so manual modification is required. However, manual modification requires correction of each frame, which is inefficient, and the accuracy of the rotation angle after manual correction is low. Summary of the invention

[0003] The present application discloses a solution to the existing technical problem of low accuracy of the rotation angle after artificial correction of the root node orientation.

[0004] In a first aspect, the present application provides a method for correcting an orientation, the method comprising:

[0005] Acquire root node data of a root node in a target model and root motion data of a root motion, wherein the root node data includes first rotation data;

[0006] Performing a filtering operation on the root motion data to obtain a filtering result;

[0007] Mapping the filtering result to the first rotation data, and updating the first rotation data;

[0008] The orientation of the root node in the target model is corrected according to the updated first rotation data.

[0009] A second aspect of the present application provides a direction correction device, comprising:

[0010] An acquisition module, used for acquiring root node data of a root node in a target model and root motion data of a root motion, wherein the root node data includes first rotation data;

[0011] A filtering module, used for filtering the root motion data to obtain a filtering result;

[0012] A mapping module, used for mapping the filtering result to the first rotation data, and updating the first rotation data;

[0013] The correction module is used to correct the orientation of the root node in the target model according to the updated first rotation data.

[0014] The third aspect of the present application provides an orientation correction device, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected via lines; the at least one processor calls the instructions in the memory so that the orientation correction device performs the steps of the above-mentioned orientation correction method.

[0015] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the steps of the above-mentioned orientation correction method.

[0016] The present application obtains the root node data of the root node in the target model and the root motion data of the root motion, wherein the root node data includes the first rotation data; performs a filtering operation on the root motion data to obtain a filtering result; maps the filtering result to the first rotation data, and updates the first rotation data; and corrects the orientation of the root node in the target model according to the updated first rotation data. In this method, the root motion data related to the orientation of the target model is filtered and mapped to the rotation data of the root node, and the root node is rotated to an orientation consistent with the target model, thereby realizing automatic correction of the orientation of the root node, and since the orientation of the target model is related to the root motion data, the accuracy of the orientation of the root node is also guaranteed.

[0017] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application are realized and obtained by the structures specifically pointed out in the description, claims and drawings.

[0018] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A schematic diagram of an embodiment of the orientation correction method in the embodiment of the present application;

[0020] Figure 2 It is a schematic diagram of another embodiment of the orientation correction method in the embodiment of the present application;

[0021] Figure 3 It is a schematic diagram of another embodiment of the orientation correction method in the embodiment of the present application;

[0022] Figure 4A schematic diagram of an embodiment of a direction correction device in an embodiment of the present application;

[0023] Figure 5 It is a schematic diagram of another embodiment of the orientation correction device in the embodiment of the present application;

[0024] Figure 6 It is a schematic diagram of an embodiment of the orientation correction device in the embodiment of the present application. DETAILED DESCRIPTION

[0025] The embodiment of the present application provides a method, device, equipment and computer-readable storage medium for correcting the orientation, which obtains the root node data of the root node in the target model and the root motion data of the root motion, wherein the root node data includes the first rotation data; performs a filtering operation on the root motion data to obtain a filtering result; maps the filtering result to the first rotation data, and updates the first rotation data; and corrects the orientation of the root node in the target model according to the updated first rotation data. In this method, the root motion data related to the orientation of the target model is filtered and mapped to the rotation data of the root node, and the root node is rotated to the orientation consistent with the target model, thereby realizing automatic correction of the orientation of the root node, and because the orientation of the target model is related to the root motion data, the accuracy of the orientation of the root node is also guaranteed.

[0026] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] For ease of understanding, the specific process of the embodiment of the present application is described below. Figure 1 , the first embodiment of the correction method in the embodiment of the present application includes:

[0028] 101. Acquire root node data of a root node and root motion data of a root motion in a target model, wherein the root node data includes first rotation data;

[0029] It is understandable that the execution subject of the present application may be a terminal or a server, which is not specifically limited here. The present application embodiment is described by taking a terminal as the execution subject as an example.

[0030] In practical applications, the root node is usually the node representing the entire model, also known as the "master node". All other nodes are child nodes of the root node. For example, if the target model is a character model, the root node of the character model represents various aspects of the character, such as the body, head, arms, legs, etc. The root node is usually located at the center of the model. It can be used to control the movement, rotation and scaling of the entire model. The root motion refers to the movement, rotation and scaling of the root node itself during the animation playback process. The root motion of the root node can be used to control the movement of the entire character model, including the position, direction and speed of the character, so that the character's movements are more realistic and natural. In the game engine, developers can calculate the character's movement trajectory based on the root motion of the root node, so as to achieve more sophisticated character control and action performance. At the same time, the root motion of the root node can also be used to create attack actions and movement actions with displacement.

[0031] In this embodiment, the root node data of the root node includes the rotation data of the root node, that is, the first rotation data, wherein the rotation data of the root node refers to the rotation attribute of the root node in the scene, which is usually expressed in the form of Euler angles, quaternions or rotation matrices. It describes the rotation transformation of the scene root node relative to its parent node (usually the world coordinate system), and the effects of changing the direction and viewing angle of the scene can be achieved by changing the rotation data.

[0032] 102. Perform a filtering operation on the root motion data to obtain a filtering result;

[0033] In the present embodiment, the root motion data mainly includes the rotation data of the root motion. Since the data of the X-axis value in the rotation data of the root motion is the same as the orientation of the target model and is accurate data, in order to ensure that the orientation of the root node is consistent with the actual orientation of the target model, the rotation data of the root node can be modified according to the rotation data of the root motion, and the orientation of the root node can be corrected based on the changed rotation data. Among them, the rotation data of the root motion is three-dimensional data. Since the rotation data of the root motion is three-dimensional data and the rotation data of the root node is two-dimensional data, it is necessary to filter and convert the root motion data of the root motion to obtain a filtered conversion result.

[0034] 103. Map the filtering result to the first rotation data, and update the first rotation data;

[0035] In this embodiment, the filtered and converted data is mapped to the first rotation data of the root node, and overwritten to generate new first rotation data, and the new first rotation data is the required correct root node orientation data.

[0036] 104. Correct the orientation of the root node in the target model according to the updated first rotation data.

[0037] In this embodiment, the orientation of the root node in the target model is corrected by the updated first rotation data, so that the z-axis orientation of the local space corresponding to the root node is adjusted to be the same as the x-axis of the root movement, wherein, in actual applications, the z-axis orientation is used to refer to the front, the z-axis of the local space corresponding to the root node is the orientation of the root node, the x-axis orientation is used to refer to the right, and the x-axis orientation of the root movement is consistent with the orientation of the target model. Therefore, adjusting the z-axis orientation of the local space corresponding to the root node to be the same as the x-axis of the root movement can adjust the orientation of the root node to be consistent with the model orientation.

[0038] In this embodiment, the root node data of the root node in the target model and the root motion data of the root motion are obtained, wherein the root node data includes the first rotation data; the root motion data is filtered to obtain the filtering result; the filtering result is mapped to the first rotation data, and the first rotation data is updated; and the orientation of the root node in the target model is corrected according to the updated first rotation data. In this method, the root motion data related to the orientation of the target model is filtered and mapped to the rotation data of the root node, and the root node is rotated to the orientation consistent with the target model, thereby realizing automatic correction of the root node orientation, and since the orientation of the target model is related to the root motion data, the accuracy of the root node orientation is also guaranteed.

[0039] See also Figure 2 , another embodiment of the correction method in the embodiment of the present application includes:

[0040] 201. Acquire root node data of a root node and root motion data of a root motion in a target model, wherein the root node data includes first rotation data;

[0041] In this embodiment, step 201 is similar to step 101 and will not be described in detail herein.

[0042] 202. Generate a unit vector in the local space where the root motion is located according to the coordinate axis information in the root motion data;

[0043] In this embodiment, it is necessary to obtain a unit vector representing the X-axis in the local space where the root motion is located, and the unit vector is recorded as mx_local.

[0044] 203. Convert the unit vector into the first vector in the preset world space;

[0045] In this embodiment, converting the unit vector into a first vector in a preset world space includes: obtaining a first transformation matrix between the root node and the world space and a second transformation matrix between the root motion and the world space; multiplying the starting point coordinate value of the unit vector with the first transformation matrix and the second transformation matrix in sequence to obtain the first vector in the world space.

[0046] Specifically, since the root node is the parent node of the root motion, the unit vector of the local space where the root motion is located is converted to the world space to obtain the first vector in the world space, which needs to be multiplied with the first transformation matrix and the second transformation matrix in sequence. The obtained first vector is recorded as mx_world.

[0047] 204. Perform numerical processing on the first vector to obtain a second vector;

[0048] In this embodiment, the numerical processing of the first vector to obtain the second vector includes: setting the y value in the first vector to zero to obtain a zero-set vector; and normalizing the zero-set vector to obtain the second vector.

[0049] In this embodiment, since mx_world now points to a direction in the xyz three-dimensional space, in this embodiment, only the direction in the xz plane is needed, so the y value of mx_world is set to 0 to obtain a new vector, which is the zero vector.

[0050] In practical applications, normalizing a vector is the process of scaling down or enlarging a vector so that its length is 1, also known as vector normalization. Common normalization methods include L1 normalization and L2 normalization. L1 normalization refers to dividing each element in a vector by the L1 norm of the vector, that is, the sum of the absolute values ​​of all elements in the vector. L2 normalization: dividing each element in a vector by the L2 norm of the vector, that is, the square root of the sum of the squares of all elements in the vector. The embodiment of the present invention does not limit how to normalize a vector. The second vector is obtained by normalizing the vector, denoted as mx_xz_world.

[0051] 205. Calculate the angle between the second vector and the unit vector of the target coordinate axis in the world space to obtain angle information, and use the angle information as the filtering result;

[0052] In this embodiment, the target coordinate axis is the z-axis in the world space. The angle between the second vector and the unit vector of the target coordinate axis in the world space is calculated, that is, the angle between mx_xz_world and the unit vector (z_world) representing the z-axis in the world space is calculated. The angle between the unit vector of the target coordinate axis and the second vector can be calculated using the formula of vector dot product and vector modulus. The angle θ can be calculated by the following formula:

[0053] cosθ=(mx_xz_world·z_world) / (|mx_xz_world|*|z_world|)

[0054] 206. Map the filtering result to the first rotation data, and update the first rotation data;

[0055] 207. Correct the orientation of the root node in the target model according to the updated first rotation data.

[0056] It should be noted that steps 206-207 are similar to steps 103-104, and will not be described in detail here.

[0057] In this embodiment, the root node data of the root node in the target model and the root motion data of the root motion are obtained, wherein the root node data includes the first rotation data; the root motion data is filtered to obtain the filtering result; the filtering result is mapped to the first rotation data, and the first rotation data is updated; and the orientation of the root node in the target model is corrected according to the updated first rotation data. In this method, the root motion data related to the orientation of the target model is filtered and mapped to the rotation data of the root node, and the root node is rotated to the orientation consistent with the target model, thereby realizing automatic correction of the root node orientation, and since the orientation of the target model is related to the root motion data, the accuracy of the root node orientation is also guaranteed.

[0058] See also Figure 3 , another embodiment of the correction method in the embodiment of the present application includes:

[0059] 301. Obtain root node data of a root node and root motion data of a root motion in a target model, wherein the root node data includes first rotation data;

[0060] In this embodiment, step 301 is similar to step 101 in the first number, and will not be described in detail here. 302, obtaining a first space conversion matrix between a model space corresponding to a target model and a preset world space;

[0061] In practical applications, the space transformation matrix is ​​a mathematical matrix used to describe the transformation method of objects in three-dimensional space in a coordinate system. In this embodiment, the first space transformation matrix between the model space corresponding to the target model and the preset world space is obtained by prior calculation.

[0062] 303. Convert the second rotation data of the root motion from the model space corresponding to the target model to the world space according to the first space conversion matrix to obtain third rotation data;

[0063] In this embodiment, since the root node is the parent node of the root motion, changing the rotation of the root node will also change the rotation of the root motion. Therefore, the rotation data of the root motion is converted to the world space to obtain the third rotation data, which is recorded in m_rotation_world for later use.

[0064] 304. Perform a filtering operation on the root motion data to obtain a filtering result;

[0065] 305. Map the filtering result to the first rotation data, and update the first rotation data;

[0066] 306. Correct the orientation of the root node in the target model according to the updated first rotation data;

[0067] In this embodiment, steps 304-306 are similar to steps 302-304 in the first embodiment and are not described in detail herein.

[0068] 307. Calculate the inverse matrix of the first space conversion matrix to obtain a second space conversion matrix;

[0069] In this embodiment, since only linear transformations such as translation, rotation, and uniform scaling are involved, the transformation matrix from model space to world space, that is, the first space matrix and the transformation matrix from world space to model space are inverse matrices of each other. Therefore, as long as the inverse matrix of the first space matrix is ​​calculated, the transformation matrix from world space to model space can be obtained.

[0070] 308. Convert the third rotation data from the world space to the model space corresponding to the target model to obtain fourth rotation data;

[0071] In this embodiment, the third rotation data is converted from the world space to the model space corresponding to the target model through the conversion matrix from the world space to the model space, thereby obtaining the rotation data converted to the world space in advance.

[0072] 309. Restore the second rotation data according to the fourth rotation data.

[0073] In this embodiment, when the root motion data includes the second rotation data of the root motion, since the root node is the parent node of the root motion, changing the rotation of the root node will also change the rotation of the root motion, resulting in errors in the second rotation data representing the direction of the root motion. Therefore, the rotation data that has been converted to the world space in advance is restored to the model space and replaced with the erroneous second rotation space to obtain the correct second rotation data.

[0074] In this embodiment, the root node data of the root node in the target model and the root motion data of the root motion are obtained, wherein the root node data includes the first rotation data; the root motion data is filtered to obtain the filtering result; the filtering result is mapped to the first rotation data, and the first rotation data is updated; and the orientation of the root node in the target model is corrected according to the updated first rotation data. In this method, the root motion data related to the orientation of the target model is filtered and mapped to the rotation data of the root node, and the root node is rotated to the orientation consistent with the target model, thereby realizing automatic correction of the orientation of the root node, and since the orientation of the target model is related to the root motion data, the accuracy of the orientation of the root node is also guaranteed.

[0075] The above describes the orientation correction method in the embodiment of the present application. The following describes the orientation correction device in the embodiment of the present application. Figure 4 , an embodiment of the orientation correction device in the embodiment of the present application includes:

[0076] An acquisition module 401 is used to acquire root node data of a root node in a target model and root motion data of a root motion, wherein the root node data includes first rotation data;

[0077] A filtering module 402 is used to filter the root motion data to obtain a filtering result;

[0078] A mapping module 403, configured to map the filtering result to the first rotation data, and update the first rotation data;

[0079] The correction module 404 is used to correct the orientation of the root node in the target model according to the updated first rotation data.

[0080] In this embodiment, the root node data of the root node in the target model and the root motion data of the root motion are obtained, wherein the root node data includes the first rotation data; the root motion data is filtered to obtain the filtering result; the filtering result is mapped to the first rotation data, and the first rotation data is updated; and the orientation of the root node in the target model is corrected according to the updated first rotation data. In this method, the root motion data related to the orientation of the target model is filtered and mapped to the rotation data of the root node, and the root node is rotated to the orientation consistent with the target model, thereby realizing automatic correction of the root node orientation, and since the orientation of the target model is related to the root motion data, the accuracy of the root node orientation is also guaranteed.

[0081] See also Figure 5 , another embodiment of the orientation correction device in the embodiment of the present application includes:

[0082] An acquisition module 401 is used to acquire root node data of a root node in a target model and root motion data of a root motion, wherein the root node data includes first rotation data;

[0083] A filtering module 402 is used to filter the root motion data to obtain a filtering result;

[0084] A mapping module 403, configured to map the filtering result to the first rotation data, and update the first rotation data;

[0085] The correction module 404 is used to correct the orientation of the root node in the target model according to the updated first rotation data.

[0086] In a feasible implementation manner, the filtering module 402 includes:

[0087] A unit vector generating unit 4021, configured to generate a unit vector in a local space where the root motion is located according to the coordinate axis information in the root motion data;

[0088] A conversion unit 4022, configured to convert the unit vector into a first vector in a preset world space;

[0089] A numerical processing unit 4023, configured to perform numerical processing on the first vector to obtain a second vector;

[0090] The angle calculation unit 4024 is used to calculate the angle between the second vector and the unit vector of the target coordinate axis in the world space, obtain angle information, and use the angle information as the filtering result.

[0091] In a feasible implementation manner, the conversion unit 4022 is specifically used for:

[0092] Obtain a first transformation matrix between the root node and the world space and a second transformation matrix between the root motion and the world space;

[0093] The coordinate value of the starting point of the unit vector is multiplied by the first transformation matrix and the second transformation matrix in sequence to obtain a first vector in the world space.

[0094] In a feasible implementation manner, the numerical processing unit 4023 is specifically used for:

[0095] Setting the y value in the first vector to zero to obtain a zero-setting vector;

[0096] The zero-set vector is normalized to obtain a second vector.

[0097] In a feasible implementation manner, the mapping module 403 is specifically used for:

[0098] The angle information is mapped to the y component in the first rotation data to obtain updated first rotation data.

[0099] In a feasible implementation manner, the root motion data includes the second rotation data of the root motion; the orientation correction device further includes a data storage module 405, and the data storage module 405 is specifically used for:

[0100] Obtain a first space conversion matrix between a model space and a preset world space corresponding to the target model;

[0101] The second rotation data is converted from the model space corresponding to the target model to the world space according to the first space conversion matrix to obtain third rotation data.

[0102] In a feasible implementation manner, the orientation correction device further includes a data restoration module 406, and the data restoration module 406 is specifically used to:

[0103] Calculating the inverse matrix of the first space transformation matrix to obtain a second space transformation matrix;

[0104] Converting the third rotation data from the world space to the model space corresponding to the target model to obtain fourth rotation data;

[0105] The second rotation data is restored according to the fourth rotation data.

[0106] In this embodiment, the root node data of the root node in the target model and the root motion data of the root motion are obtained, wherein the root node data includes the first rotation data; the root motion data is filtered to obtain the filtering result; the filtering result is mapped to the first rotation data, and the first rotation data is updated; and the orientation of the root node in the target model is corrected according to the updated first rotation data. In this method, the root motion data related to the orientation of the target model is filtered and mapped to the rotation data of the root node, and the root node is rotated to the orientation consistent with the target model, thereby realizing automatic correction of the orientation of the root node, and since the orientation of the target model is related to the root motion data, the accuracy of the orientation of the root node is also guaranteed.

[0107] above Figure 4 and Figure 5 The orientation correction device in the embodiment of the present application is described in detail from the perspective of modular functional entities, and the orientation correction device in the embodiment of the present application is described in detail from the perspective of hardware processing.

[0108] Figure 6: is a structural schematic diagram of a direction correction device provided in an embodiment of the present application. The direction correction device 600 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 610 (for example, one or more processors) and a memory 620, and one or more storage media 630 (for example, one or more massive storage devices) storing application programs 633 or data 632. Among them, the memory 620 and the storage medium 630 may be short-term storage or permanent storage. The program stored in the storage medium 630 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the direction correction device 600. Furthermore, the processor 610 may be configured to communicate with the storage medium 630, and execute a series of instruction operations in the storage medium 630 on the direction correction device 600 to implement the following steps:

[0109] Obtain root node data of a root node in a target model and root motion data of a root motion, wherein the root node data includes first rotation data; filter the root motion data to obtain a filtering result; map the filtering result to the first rotation data, and update the first rotation data; and correct the orientation of the root node in the target model according to the updated first rotation data. In this method, the root motion data related to the orientation of the target model is filtered and mapped to the rotation data of the root node, and the root node is rotated to an orientation consistent with the target model, thereby realizing automatic correction of the orientation of the root node. Since the orientation of the target model is related to the root motion data, the accuracy of the orientation of the root node is also guaranteed.

[0110] Optionally, the above-mentioned filtering operation on the root motion data to obtain the filtering result includes: generating a unit vector in the local space where the root motion is located according to the coordinate axis information in the root motion data; converting the unit vector into a first vector in a preset world space; performing numerical processing on the first vector to obtain a second vector; calculating the angle between the second vector and the unit vector of the target coordinate axis in the world space to obtain angle information, and using the angle information as the filtering result.

[0111] The above method performs data conversion on the root motion data of the root motion to obtain the angle information that the root node needs to rotate. The rotation correction of the root node can be achieved through the angle information.

[0112] Optionally, the above-mentioned conversion of the unit vector into a first vector in a preset world space includes: obtaining a first transformation matrix between the root node and the world space and a second transformation matrix between the root motion and the world space; multiplying the starting point coordinate value of the unit vector with the first transformation matrix and the second transformation matrix in sequence to obtain the first vector in the world space.

[0113] The above method realizes the conversion from the unit vector to the world space through the space conversion matrix to obtain the first vector.

[0114] Optionally, the above-mentioned numerical processing of the first vector to obtain the second vector includes: setting the y value in the first vector to zero to obtain a zero-set vector; and normalizing the zero-set vector to obtain the second vector.

[0115] The above method obtains a two-dimensional vector that meets the requirements by setting the y value in the first vector to zero, thereby achieving mapping coverage of the first rotation data which is also a two-dimensional vector.

[0116] Optionally, mapping the filtering result to the first rotation data and updating the first rotation data includes: mapping the angle information to a y component in the first rotation data to obtain updated first rotation data.

[0117] The above method obtains updated first rotation data by mapping the angle information to the y component in the first rotation data.

[0118] Optionally, the above-mentioned root motion data includes second rotation data of the root motion; before the root motion data is filtered to obtain a filtering result, it also includes: obtaining a first space conversion matrix of a model space corresponding to the target model and a preset world space; converting the second rotation data from the model space corresponding to the target model to the world space according to the first space conversion matrix to obtain third rotation data.

[0119] The above method converts the second rotation data of the root motion into the world space before performing the filtering operation to achieve storage of the second rotation data, thereby avoiding the wrong direction of the root motion due to the parent-child relationship between the root node and the root motion.

[0120] Optionally, after correcting the orientation of the root node in the target model according to the updated first rotation data, the method further includes: calculating the inverse matrix of the first space transformation matrix to obtain a second space transformation matrix; converting the third rotation data from the world space to the model space corresponding to the target model to obtain fourth rotation data; and restoring the second rotation data according to the fourth rotation data.

[0121] The above method corrects the orientation error of the root movement caused by the parent-child relationship with the root node by converting the third rotation data stored in the world space into the model space.

[0122] The orientation correction device 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input and output interfaces 660, and / or one or more operating systems 631, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 6 The structure of the orientation correction device shown does not constitute a limitation on the orientation correction device provided in the present application, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0123] The present application also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions, which, when executed on a computer, cause the computer to perform the following steps:

[0124] Obtain root node data of a root node in a target model and root motion data of a root motion, wherein the root node data includes first rotation data; filter the root motion data to obtain a filtering result; map the filtering result to the first rotation data, and update the first rotation data; and correct the orientation of the root node in the target model according to the updated first rotation data. In this method, the root motion data related to the orientation of the target model is filtered and mapped to the rotation data of the root node, and the root node is rotated to an orientation consistent with the target model, thereby realizing automatic correction of the orientation of the root node. Since the orientation of the target model is related to the root motion data, the accuracy of the orientation of the root node is also guaranteed.

[0125] Optionally, the above-mentioned filtering operation on the root motion data to obtain the filtering result includes: generating a unit vector in the local space where the root motion is located according to the coordinate axis information in the root motion data; converting the unit vector into a first vector in a preset world space; performing numerical processing on the first vector to obtain a second vector; calculating the angle between the second vector and the unit vector of the target coordinate axis in the world space to obtain angle information, and using the angle information as the filtering result.

[0126] The above method performs data conversion on the root motion data of the root motion to obtain the angle information that the root node needs to rotate. The rotation correction of the root node can be achieved through the angle information.

[0127] Optionally, the above-mentioned conversion of the unit vector into a first vector in a preset world space includes: obtaining a first transformation matrix between the root node and the world space and a second transformation matrix between the root motion and the world space; multiplying the starting point coordinate value of the unit vector with the first transformation matrix and the second transformation matrix in sequence to obtain the first vector in the world space.

[0128] The above method realizes the conversion from the unit vector to the world space through the space conversion matrix to obtain the first vector.

[0129] Optionally, the above-mentioned numerical processing of the first vector to obtain the second vector includes: setting the y value in the first vector to zero to obtain a zero-set vector; and normalizing the zero-set vector to obtain the second vector.

[0130] The above method obtains a two-dimensional vector that meets the requirements by setting the y value in the first vector to zero, thereby achieving mapping coverage of the first rotation data which is also a two-dimensional vector.

[0131] Optionally, mapping the filtering result to the first rotation data and updating the first rotation data includes: mapping the angle information to a y component in the first rotation data to obtain updated first rotation data.

[0132] The above method obtains updated first rotation data by mapping the angle information to the y component in the first rotation data.

[0133] Optionally, the above-mentioned root motion data includes second rotation data of the root motion; before the root motion data is filtered to obtain a filtering result, it also includes: obtaining a first space conversion matrix of a model space corresponding to the target model and a preset world space; converting the second rotation data from the model space corresponding to the target model to the world space according to the first space conversion matrix to obtain third rotation data.

[0134] The above method converts the second rotation data of the root motion into the world space before performing the filtering operation to achieve storage of the second rotation data, thereby avoiding the wrong direction of the root motion due to the parent-child relationship between the root node and the root motion.

[0135] Optionally, after correcting the orientation of the root node in the target model according to the updated first rotation data, the method further includes: calculating the inverse matrix of the first space transformation matrix to obtain a second space transformation matrix; converting the third rotation data from the world space to the model space corresponding to the target model to obtain fourth rotation data; and restoring the second rotation data according to the fourth rotation data.

[0136] The above method corrects the orientation error of the root movement caused by the parent-child relationship with the root node by converting the third rotation data stored in the world space into the model space.

[0137] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device, or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.

[0138] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0139] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for correcting a direction, characterized in that: The orientation correction method comprises: Acquire root node data of a root node in a target model and root motion data of a root motion, wherein the root node data includes first rotation data; Performing a filtering operation on the root motion data to obtain a filtering result; Mapping the filtering result to the first rotation data, and updating the first rotation data; The orientation of the root node in the target model is corrected according to the updated first rotation data.

2. The orientation correction method according to claim 1, characterized in that: The filtering operation is performed on the root motion data to obtain the filtering result, which includes: Generate a unit vector in the local space where the root motion is located according to the coordinate axis information in the root motion data; Convert the unit vector into a first vector in a preset world space; Performing numerical processing on the first vector to obtain a second vector; The angle between the second vector and the unit vector of the target coordinate axis in the world space is calculated to obtain angle information, and the angle information is used as the filtering result.

3. The orientation correction method according to claim 2, characterized in that: The converting the unit vector into a first vector in a preset world space comprises: Obtain a first transformation matrix between the root node and the world space and a second transformation matrix between the root motion and the world space; The coordinate value of the starting point of the unit vector is multiplied by the first transformation matrix and the second transformation matrix in sequence to obtain a first vector in the world space.

4. The orientation correction method according to claim 2, characterized in that: The performing numerical processing on the first vector to obtain the second vector comprises: Setting the y value in the first vector to zero to obtain a zero-setting vector; The zero-set vector is normalized to obtain a second vector.

5. The orientation correction method according to claim 2, characterized in that: Mapping the filtering result to the first rotation data and updating the first rotation data comprises: The angle information is mapped to the y component in the first rotation data to obtain updated first rotation data.

6. The orientation correction method according to any one of claims 1 to 5, characterized in that: The root motion data includes second rotation data of the root motion; Before filtering the root motion data to obtain the filtering result, the method further includes: Obtain a first space conversion matrix between a model space and a preset world space corresponding to the target model; The second rotation data is converted from the model space corresponding to the target model to the world space according to the first space conversion matrix to obtain third rotation data.

7. The orientation correction method according to claim 5, characterized in that: After correcting the orientation of the root node in the target model according to the updated first rotation data, the method further includes: Calculating the inverse matrix of the first space transformation matrix to obtain a second space transformation matrix; Converting the third rotation data from the world space to the model space corresponding to the target model to obtain fourth rotation data; The second rotation data is restored according to the fourth rotation data.

8. A direction correction device, characterized in that: The orientation correction device comprises: An acquisition module, used for acquiring root node data of a root node in a target model and root motion data of a root motion, wherein the root node data includes first rotation data; A filtering module, used for filtering the root motion data to obtain a filtering result; A mapping module, used for mapping the filtering result to the first rotation data, and updating the first rotation data; The correction module is used to correct the orientation of the root node in the target model according to the updated first rotation data.

9. A device for correcting orientation, characterized in that: The orientation correction device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instruction in the memory to enable the orientation correction device to execute the orientation correction method as described in any one of claims 1-7.

10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the orientation correction method as described in any one of claims 1-7 is implemented.