Virtual image control method, device, apparatus, and storage medium
By dividing the virtual avatar into multiple skeletal chains and acquiring its state information, the motion information of the skeletal points is determined and controlled, thus solving the problem of unnatural virtual avatar movements and achieving the continuity and consistency of the movements.
Patent Information
- Application Number
- CN202210465368.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-22
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2042-04-22
AI Technical Summary
In existing technologies, the full-body joint movements of virtual avatars are unnatural and cannot keep pace with the user's actual movements.
The virtual avatar is divided into multiple skeletal chains, each containing multiple skeletal points. By acquiring the state information of control points and skeletal points, the motion information of each skeletal point is determined, and the skeletal points are controlled to move according to the motion information.
It achieves smooth and natural movements of the virtual avatar, maintaining basic consistency with the user's actual movements.
Smart Images

Figure CN116977501B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for controlling a virtual avatar. Background Technology
[0002] With the rapid development of Virtual Reality (VR) technology, experiencing virtual worlds by wearing VR devices has become a common form of leisure and entertainment. One important application scenario is controlling virtual avatars using VR devices. However, current technologies suffer from unnatural joint movements when controlling the movement of virtual avatars. Summary of the Invention
[0003] This disclosure provides a method, apparatus, device, and storage medium for controlling a virtual avatar, which enables control over the actions of the virtual avatar and ensures that the actions of the virtual avatar are coherent and natural, and remain basically consistent with the user's actual actions.
[0004] In a first aspect, embodiments of this disclosure provide a method for controlling a virtual avatar, including:
[0005] The virtual avatar is divided into multiple skeletal chains; each skeletal chain contains multiple bone points.
[0006] Acquire the state information of at least one control point and the initial state information of each of the skeleton points; wherein the state information includes position information and orientation information;
[0007] Motion information of each bone point is determined based on the state information of the at least one control point and / or the initial state information of each bone point; wherein, the motion information includes translation information and / or rotation information;
[0008] Control each of the aforementioned skeletal points to move according to the motion information.
[0009] Secondly, embodiments of this disclosure also provide a control device for a virtual avatar, comprising:
[0010] The skeletal chain segmentation module is used to divide the virtual image into multiple skeletal chains; each skeletal chain contains multiple bone points.
[0011] A status information acquisition module is used to acquire status information of at least one control point and initial status information of each of the skeleton points; wherein, the status information includes position information and orientation information;
[0012] A motion information determination module is used to determine the motion information of each of the at least one control point and / or the initial state information of each of the skeletal points; wherein the motion information includes translation information and / or rotation information;
[0013] The control module is used to control each of the skeletal points to move according to the motion information.
[0014] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:
[0015] One or more processing devices;
[0016] Storage device for storing one or more programs;
[0017] When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the virtual image control method as described in the embodiments of this disclosure.
[0018] Fourthly, embodiments of this disclosure also provide a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the virtual avatar control method as described in embodiments of this disclosure.
[0019] This disclosure provides a method, apparatus, device, and storage medium for controlling a virtual avatar. The virtual avatar is divided into multiple skeletal chains; each skeletal chain contains multiple bone points; state information of at least one control point and initial state information of each bone point are acquired; the state information includes position information and orientation information; motion information of each bone point is determined based on the state information of at least one control point and / or the initial state information of each bone point; the motion information includes translation information and / or rotation information; and each bone point is controlled to move according to the motion information. The virtual avatar control method provided by this disclosure achieves control over the virtual avatar's movements, ensuring that the virtual avatar's movements are coherent and natural, and remain substantially consistent with the user's actual movements. Attached Figure Description
[0020] Figure 1 This is a flowchart of a virtual avatar control method according to an embodiment of this disclosure;
[0021] Figure 2a This is a schematic diagram of the half-body skeleton of a virtual human figure in an embodiment of this disclosure;
[0022] Figure 2b This is a schematic diagram of the local coordinate system of the upper arm bone points in an embodiment of this disclosure;
[0023] Figure 2c This is an example diagram of the local coordinate system of the whole-body skeletal points in the embodiments of this disclosure.
[0024] Figure 3a This is a schematic diagram illustrating the determination of the orientation of the thoracic bone point target in an embodiment of this disclosure;
[0025] Figure 3b This is an example diagram of head movement in an embodiment of this disclosure;
[0026] Figure 4a This is an example diagram of hand skeletal movement in an embodiment of this disclosure;
[0027] Figure 4b This is an example diagram of hand skeletal movement in an embodiment of this disclosure;
[0028] Figure 4c This is a schematic diagram illustrating the determination of the elbow bone point location in an embodiment of this disclosure;
[0029] Figure 5a This is a schematic diagram illustrating the determination of arm plane information in an embodiment of this disclosure;
[0030] Figure 5b This is a schematic diagram illustrating the determination of arm plane information in an embodiment of this disclosure;
[0031] Figure 5c This is a schematic diagram illustrating the determination of arm plane information in an embodiment of this disclosure;
[0032] Figure 6 This is a schematic diagram of swing-twist decomposition of forearm rotation in an embodiment of this disclosure;
[0033] Figure 7 This is a schematic diagram of the structure of a virtual image control device according to an embodiment of the present disclosure.
[0034] Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of this disclosure. Detailed Implementation
[0035] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0036] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0037] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0038] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0039] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0040] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0041] Figure 1 This is a flowchart illustrating a virtual avatar control method provided in an embodiment of this disclosure. This embodiment is applicable to controlling the movement of a virtual avatar. The method can be executed by a virtual avatar control device, which can consist of hardware and / or software and is generally integrated into a device with virtual avatar control functionality. This device can be an electronic device such as a server, mobile terminal, or server cluster. Figure 1 As shown, the method specifically includes the following steps:
[0042] S110 divides the virtual avatar into multiple skeletal chains.
[0043] Each skeletal chain contains multiple skeletal points; that is, a skeletal chain can be understood as a chain composed of multiple skeletal points connected together, and the skeletal points can drive each other to make the entire skeletal chain move. A virtual avatar is a three-dimensional image constructed in a virtual scene, such as a virtual three-dimensional character or a virtual three-dimensional animal.
[0044] In this embodiment, the entire skeleton of the virtual avatar is a tree-like structure, which can be divided into five skeleton chains: a torso skeleton chain, two arm skeleton chains, and two leg skeleton chains. The torso skeleton chain includes a head bone point and multiple torso bone points; the arm skeleton chain includes shoulder bone points, upper arm bone points, elbow bone points, forearm bone points, and wrist bone points; the leg skeleton chain includes thigh bone points, knee bone points, and ankle bone points. For example, Figure 2aThis is a schematic diagram of the half-body skeleton of the virtual human figure in this embodiment, as shown below. Figure 2a As shown, ABDEF represents bone points on the torso skeletal chain, A represents the head bone point, BDEF represents multiple torso bone points, G (shoulder bone point), H (upper arm bone point), I (elbow bone point), J (forearm bone point), and K (wrist bone point) represent the right arm, and L (thigh bone point), M (knee bone point), and N (ankle bone point) represent the right leg. The left arm is the same as the right arm, including shoulder bone points, upper arm bone points, elbow bone points, forearm bone points, and wrist bone points. The left leg is the same as the right leg, including thigh bone points, knee bone points, and ankle bone points. In this embodiment, the virtual character's skeleton is divided into multiple bone chains, which can accurately drive the movement of each bone point on the bone chain, ensuring that the virtual character's movements are smooth and natural.
[0045] In this embodiment, to accurately determine the position and orientation information of each bone point, a global coordinate system and a local coordinate system for each bone point need to be established. The orientation information of a bone point can be represented by the orientation of the three coordinate axes of its local coordinate system in the global coordinate system. The global coordinate system is established with the root bone point (F) as its origin, as shown below. Figure 2a As described, the three axes in the diagram represent the x-axis, y-axis, and z-axis of the global coordinate system. When determining the local coordinate system for each skeletal point, the initial orientation of the skeletal point is determined based on the standing position of the virtual character. As the skeletal points move, the orientation of the local coordinate system also changes.
[0046] Specifically, for each bone point on the torso skeletal chain, each bone point is the origin, and a local coordinate system is established with the x, y, and z axes aligned with the global coordinate system's x, y, and z axes. Taking head bone point A as an example, rotating the head causes the local coordinate system of head bone point A to rotate accordingly. For limb bone points (i.e., bone points on the arm and leg skeletal chains), the bone point is the origin, the x-axis points towards its child bone points, the y-axis points towards the normal to the plane containing the limb, and the z-axis is the cross product of the x and y axes. For example... Figure 2b This is a schematic diagram of the local coordinate system of the upper arm bone points in this example. For example... Figure 2b As shown, for the arm skeletal chain GHIJK, the normal direction of the plane containing the entire arm is first determined by the cross product of the direction vectors HI and IK. For a point H on the upper arm bone, the x-axis of its local coordinate system is the HI direction, the y-axis is the normal direction of the plane, and the z-axis is the cross product of the x-axis and y-axis. When the arm moves, the local coordinate system is transformed (translated or rotated). For example, Figure 2c This is an example diagram of a local coordinate system for points on the entire skeleton.
[0047] S120, acquire the status information of at least one control point and the initial status information of each skeleton point.
[0048] The state information includes position information and orientation information. Position information can be understood as the position of the skeleton point in the global coordinate system, and orientation information can be determined by the three axes of the local coordinate system corresponding to the skeleton point. Control points include at least one of the following: hand control points and head control points. In this application scenario, the VR device can include a head-mounted device and two controllers. The head-mounted device corresponds to the head control points and is used to collect the user's head state information in real time, while the controllers correspond to the hand control points and are used to collect the user's hand state information in real time. In this embodiment, the user's head state information can be used as the state information of the head skeleton points, and the hand state information can be used as the state information of the wrist skeleton points. The initial state information of each skeleton point can be understood as the state information of each skeleton point in the previous frame.
[0049] Optionally, after obtaining the status information of at least one control point and the initial status information of each skeletal point, it is also necessary to calibrate the virtual image based on the control status information and the initial status information of each skeletal point, and then perform subsequent control based on the calibrated virtual image.
[0050] S130, determine the motion information of each bone point based on the state information of at least one control point and / or the initial state information of each bone point.
[0051] S140 controls the movement of each skeletal point according to the motion information.
[0052] The motion information includes translation and / or rotation information. In this embodiment, each bone point has 6 degrees of freedom of motion information, namely 3 degrees of freedom of translation (translation along the three coordinate axes of the global coordinate system) and 3 degrees of freedom of rotation (rotation around the three coordinate axes of the global coordinate system).
[0053] In this embodiment, the motion information of each skeletal point is determined according to the skeletal chain to which the skeletal point belongs. The motion information of the torso skeletal chain, arm skeletal chain, and leg skeletal chain is determined sequentially.
[0054] Optionally, for multiple trunk skeletal points, the motion information of each skeletal point can be determined based on the state information of at least one control point and / or the initial state information of each skeletal point in the following ways: determining the target orientation of the chest skeletal point based on the state information of the hand control point and the initial state information of the shoulder skeletal point; determining trunk rotation information based on the target orientation and initial orientation of the chest skeletal point; and determining the first rotation information of multiple trunk skeletal points based on the trunk rotation information.
[0055] The first rotation information can be the rotation angle of a torso skeletal point about the y-axis. For example, Figure 3a This is a schematic diagram illustrating the orientation of the target point for the thoracic bones in this embodiment. For example... Figure 3aAs shown, based on the position information of the shoulder bone points and the hand control points, the directions from the two shoulder bone points to the corresponding hand control points (the direction from the left shoulder control point to the left hand control point, and the direction from the right shoulder control point to the right hand control point) are determined. The vectors corresponding to these two directions are added together to obtain the direction vector corresponding to the target orientation of the chest bone point. Determining the torso rotation information based on the target orientation and initial orientation of the chest bone points can be understood as the rotation angle around the y-axis of the chest bone point as it rotates from its initial orientation to its target orientation. In this embodiment, the torso rotation information can be accurately determined.
[0056] In this embodiment, the rotation amplitude of each torso skeletal point can be the same or different. The method for determining the first rotation information of multiple torso skeletal points based on torso rotation information can be: obtaining the rotation ratio of each torso skeletal point; and determining the first rotation information corresponding to each of the multiple torso skeletal points based on the rotation ratio and the first rotation information.
[0057] The rotation ratios can be the same or decrease sequentially from top to bottom. If the rotation ratios of all torso bone points are the same, it indicates that the entire torso rotates by the same angle; if the rotation decreases sequentially from top to bottom, it indicates that the rotation amplitude of the upper body is greater than that of the lower body. The method for determining the first rotation information corresponding to multiple torso bone points based on the rotation ratios and first rotation information can be: multiplying the first rotation information by each rotation ratio to obtain the first rotation information corresponding to each torso bone point. For example, assuming the torso rotation information is 80 degrees, and the rotation ratios of each torso bone point BDEF are 100%, 80%, 50%, and 20% respectively, then the rotation angles of BDEF are 80 degrees, 64 degrees, 40 degrees, and 16 degrees respectively. Accordingly, after determining the first rotation information corresponding to multiple torso bone points, the multiple torso bone points are controlled to rotate according to the first rotation information. In this embodiment, determining the rotation information of each torso bone point according to the rotation ratio allows the virtual image to accurately simulate the rotational movement of the real human torso.
[0058] Optionally, for head bone points, the motion information of each bone point can be determined based on the state information of at least one control point and / or the initial state information of each bone point.
[0059] Specifically, the translation information of the head bone points is determined based on the position information of the head control points and the initial position information of the head bone points. The rotation information of the head bone points is determined based on the orientation information of the head control points and the initial orientation information of the head bone points. Correspondingly, the head bone points are controlled to translate according to the translation information and rotate according to the rotation information. For example, Figure 3b This is an example diagram of head movement in this embodiment, such as... Figure 3b The image shown is an example of a virtual avatar nodding. In this embodiment, by calculating the motion information of the head bone points, multi-directional head movements such as nodding, shaking, and tilting the head can be achieved for the virtual avatar.
[0060] Optionally, when a user nods, it causes a bending motion, so it is also necessary to control the virtual avatar to perform the bending motion. After controlling the head skeleton points to move according to the motion information of the head skeleton points, the following steps are also included: obtaining the target position information of the moved head skeleton points and the initial position information of the root skeleton points; and determining the motion information of the remaining torso skeleton points based on the target position information and the initial position information using a first set algorithm.
[0061] The first setting algorithm can be a reverse dynamics algorithm, such as a forward-backward reverse dynamics algorithm or a cyclic coordinate descent reverse dynamics algorithm. Specifically, based on the position information of head bone point A and root bone point F after movement, the forward-backward reverse dynamics algorithm or the cyclic coordinate descent reverse dynamics algorithm is used to determine the motion information of torso bone points B, D, and E. Correspondingly, the remaining torso bone points (i.e., bone points B, D, and E) are controlled to move according to the determined motion information, thereby driving the virtual image to perform a bending motion. In this embodiment, using the first setting algorithm to determine the motion information of the torso bone points can improve computational efficiency.
[0062] After controlling the movement of the virtual avatar's torso skeletal chain, the movement of the arm skeletal chain is then controlled. The arm skeletal chain includes five bone points: shoulder (G), upper arm (H), elbow (I), forearm (J), and wrist (K). The state information of the hand control point (handheld controller) in the VR device is used as the target state information for the wrist bone point K, and the target state information of the remaining bone points on the arm skeletal chain is calculated in reverse. Since the bone length does not change, the position of each bone is determined by the rotation of its parent bone point; therefore, only the orientation information of the five arm bone points needs to be calculated. This orientation information is the orientation in the global coordinate system. Because the motion calculation of the torso skeletal chain has already been performed before calculating the arm skeletal chain's motion information, meaning the torso skeletal chain has already moved, it needs to be considered when calculating the arm motion. Therefore, the following calculation of the current orientation requires the application of the inverse transformation of torso motion. The calculated bone point motion is the relative motion with respect to the current torso motion; the final result is obtained by superimposing the torso motion.
[0063] Optionally, for shoulder bone points on the arm skeletal chain, the motion information of each bone point can be determined based on the state information of at least one control point and / or the initial state information of each bone point by determining the target orientation of the shoulder bone point based on the position information of the hand control point and the initial position information of the shoulder bone point.
[0064] The initial position information of the shoulder bone point can be understood as the position information of the shoulder bone point after trunk movement. In this embodiment, in order for the wrist bone to reach the target position, the shoulder bone sometimes needs to rotate slightly, such as shrugging or puffing out the chest. The required movement of the shoulder bone point can be determined by the target position of the wrist bone point (i.e., the position information of the hand control point) and the position information of the shoulder bone point. The target orientation can be understood as the rotation angle of the shoulder bone point around the three axes of the global coordinate system.
[0065] The process of determining the target orientation of the shoulder bone point based on the position information of the hand control point and the initial position information of the shoulder bone point can be as follows: The vector connecting the shoulder bone point and the hand control point is decomposed along the three axes of the global coordinate system to obtain three components. Based on these three components, the rotation angle of the shoulder bone point around the three axes is determined. For example, assuming the component along the x-axis is 'a', the component along the y-axis is 'b', and the component along the z-axis is 'c', then the rotation angle around the y-axis is α = arctan(c / a), the rotation angle around the x-axis is β = arctan(b / c), and the rotation angle around the z-axis is arctan(a / b). Accordingly, after determining the target orientation of the shoulder control point, the shoulder bone point is controlled to rotate to the target orientation. In this embodiment, the shoulder bone point is first slightly rotated to make the movement of the virtual avatar more natural.
[0066] Optionally, the target orientation of the shoulder bone point can be determined based on the position information of the hand control point and the initial position information of the shoulder bone point by: projecting the vector from the hand control point to the shoulder bone point onto the three planes of the global coordinate system; and determining the rotation angle of the shoulder bone point around the three axes of the global coordinate system based on the line after projection to obtain the target orientation.
[0067] For example, Figures 4a-4b This is an example diagram of hand skeletal movement in this embodiment, such as... Figure 4a As shown, C is the hand control point, and vector GC is the vector from the shoulder bone point to the hand control point. Project vector GC onto the XY plane, XZ plane, and YZ plane respectively. Figure 4b As shown, taking rotation around the Y-axis as an example, calculations are performed in the XZ plane. The target direction GC is decomposed in the X and Z directions to obtain the angle α = arctan(c / a). In this embodiment, the target orientation is determined by projecting the vector from the shoulder bone point to the hand control point onto the three planes of the global coordinate system, which can improve accuracy.
[0068] Optionally, after determining the rotation angle of the shoulder bone point around the three axes of the global coordinate system based on the projected connection, the following steps are also included: obtaining the constraint information of the target orientation; adjusting the target orientation based on the constraint information to obtain the adjusted target orientation.
[0069] The constraint information can be preset because the shoulder bone point has limited flexibility, requiring constraints on rotations along three axes. In this embodiment, the constraint information for rotation around the Y-axis is (-15, 30), the constraint information for rotation around the X-axis is (-15, 15), and the constraint information for rotation around the Z-axis is (0, 30). Specifically, adjusting the target orientation based on the constraint information can be done by adjusting the rotation angle to within the range corresponding to the constraint information if the determined rotation angle exceeds the range. For example, assuming the determined rotation angle around the Y-axis is 35, the rotation angle around the Y-axis is adjusted to 30. In this embodiment, adjusting the target orientation based on the constraint information can prevent unnatural large-scale rotation of the shoulder bone point.
[0070] Optionally, after determining the rotation angle of the shoulder bone point around the three axes of the global coordinate system based on the projected connection, the following steps are also included: if the rotation angle exceeds the set value, the rotation angle is multiplied by the length of the projected vector to obtain the corrected rotation angle.
[0071] In this embodiment, the target orientation is almost parallel to a certain coordinate axis. Taking the Y-axis as an example, the projected points C and G almost coincide in the XZ plane, resulting in extremely small values for the projection components of vector GC on both the X and Z axes. In this case, the rotation angle calculated in the above manner will exceed the set value; that is, the calculated rotation angle value will experience significant jitter due to small data fluctuations. Multiplying this rotation angle by the length of the projected vector yields the corrected rotation angle. In this embodiment, correcting the rotation angle achieves smoothing, thereby avoiding drastic rotation caused by small data points.
[0072] After rotating the upper arm bone points, the calculation of upper arm and elbow movement information continues. Optionally, after controlling the shoulder bone points to rotate to the target orientation according to the second rotation information, the following steps are also included: determining the target plane information of the arm; determining the target position information of the elbow bone points using a second set algorithm based on the target plane information, the initial position information of the upper arm bone points, and the position information of the hand control points; and controlling the elbow bone points to move to the target position.
[0073] The target plane information of the arm can be understood as the plane information of the arm after the wrist bone point moves to the position of the hand control point, which can be represented by the normal information, that is, by the normal vector of the plane where the arm is located. The second algorithm can be an inverse dynamics algorithm, such as a trigonometric transformation inverse dynamics algorithm. Its principle is to solve the motion calculation problem of three bone points (upper arm bone point, elbow bone point, and wrist bone point) based on the cosine theorem.
[0074] For example, Figure 4c A diagram illustrating the location of the elbow bone points. (See diagram below.) Figure 4c As stated above, when moving the arm, the lengths of the two arms connecting the upper arm bone point, the elbow bone point, and the wrist bone point remain unchanged. The included angle y can be obtained using the law of cosines: cosy = (a...). 2 +d 2 -b 2 Given that f = a*siny, the distance from the elbow bone point I to HC after the movement is f = a*siny, and the projection distance of HI onto HC is p = a*cosy. The new position of the elbow bone is then represented as: OutJointPos = RootPos + p*HC + f*bendNormal. Here, RootPos is the position information of the upper arm bone point, HC is the vector from the upper arm bone point H to the hand control point C, and bendNormal is the normal information of the arm plane. In this embodiment, determining the target position information of the elbow bone point based on the second set algorithm can improve computational efficiency.
[0075] In this embodiment, since there can be an infinite number of solutions in the three-dimensional space OutJointPos, it is necessary to determine bendNormal.
[0076] Optionally, the target plane information of the arm can be determined by using a lookup table. Several pre-specified bendNormal orientations are specified. For example: bendNormal points upwards when the arm is extended horizontally, diagonally upwards at 45 degrees when the hand is placed in front of the chest, and forwards when the arm is raised. After specifying 5-6 preset orientations, the wrist orientation in other positions is determined by interpolation from these preset positions.
[0077] Optionally, the target plane information of the arm can be determined by: determining the target elbow orientation based on the direction of the first upper arm, the direction of the second upper arm, the initial orientation of the elbow, and the orientation of the hand control point; and determining the target plane information of the arm based on the target elbow orientation and the direction of the second upper arm.
[0078] The first upper arm direction can be understood as the direction from the upper arm bone point to the wrist bone point before movement, i.e., vector HK; the second upper arm direction can be understood as the direction from the upper arm bone point to the wrist bone point (i.e., the hand control point) after movement, i.e., vector HC. The initial elbow orientation is determined by the local coordinate system before the elbow bone point moves.
[0079] In this embodiment, determining the target elbow orientation based on the first upper arm direction, the second upper arm direction, the initial elbow orientation, and the orientation of the hand control point can be achieved by: obtaining the rotation angle from the first upper arm direction to the second upper arm direction; determining the intermediate elbow orientation based on the rotation angle and the initial elbow orientation; and determining the target elbow orientation based on the intermediate elbow orientation and the orientation of the hand control point.
[0080] Specifically, Figures 5a-5c This is a schematic diagram for determining the planar information of the arm. After determining the rotation angle from vector HK to vector HC, the elbow bone points are rotated by the same angle to obtain the mid-direction of the elbow, as shown below. Figure 5a As shown. Subtracting the direction the middle of the elbow points from the direction the hand's control point points leads to the target elbow direction. This causes the elbow to rotate in the opposite direction to the wrist, making the elbow direction more consistent with the natural movement patterns of the human body. Figure 5b As shown. After determining the target elbow orientation, the target elbow orientation is cross-multiplied with the direction of the second upper arm to obtain the normal information of the target plane, as shown. Figure 5c As shown in the figure. The solution in this embodiment calculates arm movements that are more consistent with the natural laws of human movement.
[0081] In this embodiment, after controlling the elbow bone point to move to the target position, it is necessary to control the wrist to rotate to the target orientation. Optionally, after controlling the elbow bone point to move to the target position, the following steps are also included: obtaining the first orientation information of the moved wrist bone point; determining the third rotation information based on the first orientation information and the orientation information of the hand control point; and controlling the elbow bone point, forearm bone point, and wrist bone point to rotate based on the third rotation information.
[0082] The first orientation information is determined by the local coordinate system of the wrist bone points after movement. The orientation information of the hand control points can be understood as the target orientation information of the wrist bone points. In this embodiment, to avoid skin distortion and abnormal effects caused by the rotation of a single bone point, the rotation needs to be distributed across 2-3 bone points, that is, the third rotation information needs to be distributed across the elbow bone points, forearm bone points, and wrist bone points. In this embodiment, a coherent and natural arm movement can be reconstructed based on the movement of the arm control points.
[0083] The process of controlling the rotation of the elbow, forearm, and wrist bone points based on the third rotation information can be as follows: decompose the third rotation information into a rocking-torsional component to obtain the rocking and torsional components; distribute the torsional components to the elbow, forearm, and wrist bone points according to a set ratio; distribute the rocking components to the wrist bone points; control the elbow and forearm bone points to rotate according to the distributed torsional components; and control the wrist bone points to rotate according to the distributed torsional and rocking components.
[0084] The method for performing swing-twist decomposition on the third rotation information can be any existing method, and is not limited here. For example, Figure 6 This is a schematic diagram illustrating the swing-twist decomposition of forearm rotation in this embodiment, as shown below. Figure 6 As shown, the third selection information can be decomposed into a twist component (rotating around the forearm) and a swing component (swinging around the forearm). The twist component is further divided proportionally and distributed to three bone points: elbow, forearm, and wrist, respectively, as twist1, twist2, and twist3. The swing component is applied entirely to the wrist bone point. The final rotation of the wrist bone point is twist3 * swing. This embodiment allows the virtual information wrist to face in any direction with almost no skinning "twisting" phenomenon.
[0085] Optionally, for the leg skeleton chain, the method for determining the motion information of each bone point based on the state information of at least one control point and / or the initial state information of each bone point can be as follows: determine the motion mode of the virtual image based on the position information of the head control point; if the motion mode of the virtual image is walking, determine the movement direction and movement speed of the virtual image; obtain the initial running information of each bone point on the leg skeleton chain of the set animation based on the movement direction; adjust the initial motion information based on the movement speed to obtain the target motion information.
[0086] The virtual avatar's movement can include walking, jumping, or crouching. The setup animation can include animations of standing still and walking in four directions (forward, backward, left, and right). The setup animation stores the initial motion information of the bone points on the leg skeletal chain in each frame. The method for adjusting the initial motion information based on movement speed can be as follows: obtain the movement speed of both legs in the setup animation, determine the ratio of the movement speed of both legs in the setup animation to the movement speed of the virtual avatar, and adjust the initial motion information of each frame based on this ratio to obtain the target motion information.
[0087] Specifically, first, the corresponding animation is determined based on the direction of movement. Then, the initial motion information of each bone point on the leg bone chain in each frame of the animation is extracted. Finally, the initial motion information is adjusted based on the movement speed of the virtual character to obtain the target motion information. Accordingly, each bone point on the leg bone chain is controlled to move according to the target motion information.
[0088] In this embodiment, to avoid animation jitter caused by data fluctuations when acquiring the set animation, an interval sampling method is adopted, for example, updating 5 times per second, and the speed is smoothed to avoid frequent animation switching.
[0089] Optionally, if the virtual avatar's movement is jumping or squatting, the target position information of the thigh bone point and the ankle bone point is determined; based on the target position information of the thigh bone point and the ankle bone point, a third-defined algorithm is used to determine the target position information of the knee bone point. Correspondingly, the knee bone point is controlled to move to the target position.
[0090] The third setting algorithm can be an inverse dynamics algorithm, such as a trigonometric transformation inverse dynamics algorithm. Its principle is to solve the motion calculation problem of three leg bone points (thigh bone point, knee bone point, and ankle bone point) based on the cosine theorem. For specific methods, please refer to the above embodiment for determining the target position information of the elbow bone point, which will not be repeated here. In this embodiment, the normal information of the leg plane can be consistent with that in the setting animation. If the movement is a squatting motion, the target position information of the ankle bone point is determined based on the ground height. In this embodiment, control of the virtual character's leg movements is achieved.
[0091] Optionally, if the status information of the detection control points does not change after a set time (e.g., 30 seconds), the virtual character is controlled to move according to a preset animation. For example, in some application scenarios, users may place the controller on a table or other surface and only wear the headset for the experience. To avoid the phenomenon of the virtual character's posture appearing strange due to an odd controller position, a controller stillness detection is added. When the controller remains still for an extended period, it is determined that the user is not holding the controller. At this point, the drive calculation of the hand control points is slowly stopped, and the virtual character's arms gradually transition to the preset animation movement state.
[0092] In this application scenario, the user wears a VR device, which includes a head-mounted display and two controllers. Both the head-mounted display and the controllers are equipped with multiple sensors (such as position sensors and gyroscopes). The head-mounted display can collect real-time information about the user's head (position and orientation), and the controllers can collect real-time information about the hands (position and orientation). Based on this information and the technical solution described in the above embodiment, the motion information of the skeletal points on the five skeletal chains of the virtual avatar is calculated to obtain the translation and rotation of each skeletal point. The movement of each skeletal point is then controlled based on the translation and rotation, achieving a near-consistency between the virtual avatar and the user's actual movements, thus realizing accurate control of the virtual avatar.
[0093] The technical solution of this disclosure divides the virtual avatar into multiple skeletal chains; each skeletal chain contains multiple skeletal points; it acquires the state information of at least one control point and the initial state information of each skeletal point; the state information includes position information and orientation information; it determines the motion information of each skeletal point based on the state information of at least one control point and / or the initial state information of each skeletal point; the motion information includes translation information and / or rotation information; and it controls each skeletal point to move according to the motion information. The virtual avatar control method provided by this disclosure realizes the control of the virtual avatar's actions, ensuring that the virtual avatar's actions are coherent and natural, and basically consistent with the user's actual actions.
[0094] Figure 7 This is a schematic diagram of the structure of a virtual avatar control device disclosed in an embodiment of this disclosure, such as... Figure 7 As shown, the device includes:
[0095] The skeletal chain division module 710 is used to divide the virtual image into multiple skeletal chains; each skeletal chain contains multiple bone points;
[0096] The status information acquisition module 720 is used to acquire the status information of at least one control point and the initial status information of each skeleton point; wherein, the status information includes position information and orientation information;
[0097] The motion information determination module 730 is used to determine the motion information of each bone point based on the state information of at least one control point and / or the initial state information of each bone point; wherein the motion information includes translation information and / or rotation information;
[0098] Control module 740 is used to control the movement of each skeletal point according to motion information.
[0099] Optionally, the skeletal chain includes a trunk skeletal chain, two arm skeletal chains, and two leg skeletal chains; wherein, the trunk skeletal chain includes a skull bone point and multiple trunk bone points; the arm skeletal chain includes a shoulder bone point, upper arm bone point, elbow bone point, forearm bone point, and wrist bone point; the leg skeletal chain includes a thigh bone point, knee bone point, and ankle bone point; the control points include at least one of the following: hand control points and head control points.
[0100] Optionally, for multiple trunk skeletal points, the motion information determination module 730 is also used for:
[0101] The target orientation of the chest bone point is determined based on the state information of the hand control point and the initial state information of the shoulder bone point;
[0102] Determine trunk rotation information based on the target orientation and initial orientation of the thoracic skeletal points;
[0103] The first rotation information of multiple trunk skeletal points is determined based on trunk rotation information.
[0104] Optionally, the motion information determination module 730 is also used for:
[0105] Obtain the rotation ratio of each torso bone point;
[0106] The first rotation information corresponding to multiple trunk skeletal points is determined based on the rotation ratio and the first rotation information;
[0107] Optionally, the control module 740 is also used for:
[0108] Control multiple trunk skeletal points to rotate according to the first rotation information.
[0109] Optionally, for head skeletal points, the motion information determination module 730 is also used for:
[0110] The motion information of the head bone points is determined based on the state information of the head control points and the initial state information of the head bone points.
[0111] Optionally, the control module 740 is also used for:
[0112] Control the head bone points to move according to the motion information of the head bone points.
[0113] Optionally, the motion information determination module 730 is also used for:
[0114] Obtain the target position information of the head bone points and the initial position information of the root bone points after the movement;
[0115] Based on the target position information and the initial position information, the motion information of the remaining trunk bone points is determined using a first preset algorithm;
[0116] Optionally, the control module 740 is also used for:
[0117] Control the remaining skeletal points of the torso to move according to the motion information.
[0118] Optionally, for the shoulder bone points on the arm skeletal chain, the motion information determination module 730 is also used for:
[0119] The target orientation of the shoulder bone points is determined based on the position information of the hand control points and the initial position information of the shoulder bone points;
[0120] Optionally, the control module 740 is also used for:
[0121] Control the shoulder bone points to rotate to the target orientation.
[0122] Optionally, the motion information determination module 730 is also used for:
[0123] Project the vector from the shoulder bone point to the hand control point onto the three planes of the global coordinate system;
[0124] The rotation angle of the shoulder bone point around the three axes of the global coordinate system is determined based on the projected vector to obtain the target orientation.
[0125] Optionally, the motion information determination module 730 is also used for:
[0126] Obtain constraint information regarding the target orientation;
[0127] The target orientation is adjusted based on the constraint information to obtain the adjusted target orientation.
[0128] Optionally, the motion information determination module 730 is also used for:
[0129] If the rotation angle exceeds the set value, the rotation angle is multiplied by the length of the projected vector to obtain the corrected rotation angle.
[0130] Optionally, the motion information determination module 730 is also used for:
[0131] Determine the target plane information for the arm;
[0132] Based on the target plane information, the initial position information of the upper arm bone points, and the position information of the hand control points, the second set algorithm is used to determine the target position information of the elbow bone points;
[0133] Control the elbow bone point to move to the target position.
[0134] Optionally, the motion information determination module 730 is also used for:
[0135] The target elbow orientation is determined based on the direction of the first upper arm, the direction of the second upper arm, the initial elbow orientation, and the orientation of the hand control point.
[0136] The target plane information of the arm is determined based on the direction of the elbow target and the direction of the second upper arm.
[0137] Optionally, the motion information determination module 730 is also used for:
[0138] Obtain the rotation angle from the direction of the first upper arm to the direction of the second upper arm;
[0139] The midpoint orientation of the elbow is determined based on the rotation angle and the initial orientation of the elbow.
[0140] The target elbow orientation is determined based on the direction of the elbow midpoint and the orientation of the hand control point.
[0141] Optionally, the motion information determination module 730 is also used for:
[0142] Obtain the first orientation information of the wrist bone points after movement;
[0143] The third rotation information is determined based on the first orientation information and the orientation information of the hand control point;
[0144] The elbow bone point, forearm bone point, and wrist bone point are rotated according to the third rotation information.
[0145] Optionally, the motion information determination module 730 is also used for:
[0146] The third rotation information is decomposed into rocking and torsional components to obtain the rocking and torsional components.
[0147] Distribute the twist component to the elbow bone point, forearm bone point, and wrist bone point according to the set ratio; distribute the swing component to the wrist bone point.
[0148] Control the elbow and forearm bone points to rotate according to the assigned torsional components; control the wrist bone points to rotate according to the assigned torsional and swaying components.
[0149] Optionally, for the leg skeletal chain, the motion information determination module 730 is also used for:
[0150] The movement mode of the virtual character is determined based on the position information of the head control points;
[0151] If the virtual character's movement mode is walking, then determine the virtual character's movement direction and speed;
[0152] Obtain the initial motion information of each bone point on the leg bone chain of the set animation based on the direction of movement;
[0153] The initial motion information is adjusted based on the movement speed to obtain the target motion information;
[0154] Optionally, the control module 740 is also used for:
[0155] Control each bone point on the leg skeletal chain to move according to the target motion information.
[0156] Optionally, the motion information determination module 730 is also used for:
[0157] If the virtual character's movement is jumping or squatting, determine the target position information of the thigh bone point and the target position information of the ankle bone point;
[0158] The target position information of the knee bone point is determined by a third-defined algorithm based on the target position information of the femoral bone point and the target position information of the ankle bone point.
[0159] Optionally, the control module 740 is also used for:
[0160] Control the kneecap point to move to the target position.
[0161] The above-described apparatus can execute the methods provided in all the foregoing embodiments of this disclosure, and has the corresponding functional modules and beneficial effects for executing the above methods. Technical details not described in detail in this embodiment can be found in the methods provided in all the foregoing embodiments of this disclosure.
[0162] The following is for reference. Figure 8 The diagram illustrates a structural schematic of an electronic device 300 suitable for implementing embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs, desktop computers, or various forms of servers, such as standalone servers or server clusters. Figure 8 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0163] like Figure 8As shown, the electronic device 300 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a memory device 305 into a random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the electronic device 300. The processing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0164] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 308 including, for example, magnetic tapes, hard disks, etc.; and communication devices 309. Communication device 309 allows electronic device 300 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 8 An electronic device 300 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0165] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing a method of word recommendation. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 309, or installed from a storage device, or installed from a ROM 302. When the computer program is executed by the processing device 301, it performs the functions defined above in the methods of embodiments of this disclosure.
[0166] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0167] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0168] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0169] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: divide the virtual image into multiple skeletal chains; wherein each skeletal chain contains multiple bone points; acquire state information of at least one control point and initial state information of each of the bone points; wherein the state information includes position information and orientation information; determine motion information of each of the bone points based on the state information of the at least one control point and / or the initial state information of each bone point; wherein the motion information includes translation information and / or rotation information; and control each of the bone points to move according to the motion information.
[0170] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0171] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0172] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The names of the units are not, in some cases, intended to limit the specific unit.
[0173] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0174] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0175] According to one or more embodiments of the present disclosure, the present disclosure discloses a method for controlling a virtual avatar, including:
[0176] The virtual avatar is divided into multiple skeletal chains; each skeletal chain contains multiple bone points.
[0177] Acquire the state information of at least one control point and the initial state information of each of the skeleton points; wherein the state information includes position information and orientation information;
[0178] Motion information of each bone point is determined based on the state information of the at least one control point and / or the initial state information of each bone point; wherein, the motion information includes translation information and / or rotation information;
[0179] Control each of the aforementioned skeletal points to move according to the motion information.
[0180] Furthermore, the skeletal chain includes a trunk skeletal chain, two arm skeletal chains, and two leg skeletal chains; wherein, the trunk skeletal chain includes a head skeletal point and multiple trunk skeletal points; the arm skeletal chain includes a shoulder skeletal point, upper arm skeletal point, elbow skeletal point, forearm skeletal point, and wrist skeletal point; the leg skeletal chain includes a thigh skeletal point, knee skeletal point, and ankle skeletal point; the control point includes at least one of the following: a hand control point and a head control point.
[0181] Furthermore, for the plurality of trunk skeletal points, motion information of each skeletal point is determined based on the state information of the at least one control point and / or the initial state information of each skeletal point, including:
[0182] The target orientation of the chest bone point is determined based on the state information of the hand control point and the initial state information of the shoulder bone point;
[0183] The trunk rotation information is determined based on the target orientation and initial orientation of the chest bone points.
[0184] The first rotation information of the plurality of trunk skeletal points is determined based on the trunk rotation information.
[0185] Further, determining the first rotation information of the plurality of trunk skeletal points based on the trunk rotation information includes:
[0186] Obtain the rotation ratio of each torso bone point;
[0187] The first rotation information corresponding to the plurality of trunk skeletal points is determined based on the rotation ratio and the first rotation information;
[0188] Controlling each of the aforementioned skeletal points to move according to the motion information includes:
[0189] The multiple trunk skeletal points are controlled to rotate according to the first rotation information.
[0190] Furthermore, for head bone points, motion information of each bone point is determined based on the state information of the at least one control point and / or the initial state information of each bone point, including:
[0191] The motion information of the head bone points is determined based on the state information of the head control points and the initial state information of the head bone points.
[0192] Controlling each of the aforementioned skeletal points to move according to the motion information includes:
[0193] The head bone points are controlled to move according to the motion information of the head bone points.
[0194] Furthermore, after controlling the head bone points to move according to the motion information of the head bone points, the method further includes:
[0195] Obtain the target position information of the head bone points and the initial position information of the root bone points after the movement;
[0196] Based on the target location information and the initial location information, the motion information of the remaining trunk skeletal points is determined using a first set algorithm;
[0197] Controlling each of the aforementioned skeletal points to move according to the motion information includes:
[0198] Control the remaining skeletal points of the torso to move according to the motion information.
[0199] Furthermore, for the shoulder bone point on the arm skeletal chain, the motion information of each bone point is determined based on the state information of the at least one control point and / or the initial state information of each bone point, including:
[0200] The target orientation of the shoulder bone point is determined based on the position information of the hand control point and the initial position information of the shoulder bone point;
[0201] Controlling each of the aforementioned skeletal points to move according to the motion information includes:
[0202] Control the shoulder bone point to rotate to the target orientation.
[0203] Further, determining the target orientation of the shoulder bone point based on the position information of the hand control point and the initial position information of the shoulder bone point includes:
[0204] Project the vector from the shoulder bone point to the hand control point onto the three planes of the global coordinate system;
[0205] The rotation angle of the shoulder bone point around the three axes of the global coordinate system is determined based on the projected vector to obtain the target orientation.
[0206] Furthermore, after determining the rotation angle of the shoulder bone point about the three axes of the global coordinate system based on the projected connection, the method further includes:
[0207] Obtain the constraint information of the target orientation;
[0208] The target orientation is adjusted based on the constraint information to obtain the adjusted target orientation.
[0209] Furthermore, after determining the rotation angle of the shoulder bone point about the three axes of the global coordinate system based on the projected connection, the method further includes:
[0210] If the rotation angle exceeds the set value, the rotation angle is multiplied by the length of the projected vector to obtain the corrected rotation angle.
[0211] Furthermore, after controlling the shoulder bone point to rotate to the target orientation, the method further includes:
[0212] Determine the target plane information for the arm;
[0213] Based on the target plane information, the initial position information of the upper arm bone point, and the position information of the hand control point, the target position information of the elbow bone point is determined using a second set algorithm.
[0214] Control the elbow bone point to move to the target position.
[0215] Furthermore, the target plane information is represented by normal information, and determining the target plane information of the arm includes:
[0216] The target elbow orientation is determined based on the direction of the first upper arm, the direction of the second upper arm, the initial elbow orientation, and the orientation of the hand control point.
[0217] The target plane information of the arm is determined based on the elbow target orientation and the second upper arm direction.
[0218] Furthermore, the target elbow orientation is determined based on the direction of the first upper arm, the direction of the second upper arm, the initial elbow orientation, and the orientation of the hand control point, including:
[0219] Obtain the rotation angle from the first large arm direction to the second large arm direction;
[0220] The mid-point orientation of the elbow is determined based on the rotation angle and the initial orientation of the elbow.
[0221] The target elbow orientation is determined based on the orientation of the elbow midpoint and the orientation of the hand control point.
[0222] Furthermore, after controlling the elbow skeletal point to move to the target position, the method further includes:
[0223] Obtain the first orientation information of the wrist bone points after movement;
[0224] The third rotation information is determined based on the first orientation information and the orientation information of the hand control point;
[0225] The elbow bone point, forearm bone point, and wrist bone point are rotated according to the third rotation information.
[0226] Furthermore, the elbow skeletal point, forearm skeletal point, and wrist skeletal point are rotated according to the third rotation information, including:
[0227] The third rotation information is subjected to rocking-torsion decomposition to obtain rocking and torsional components;
[0228] The torsional component is distributed to the elbow bone point, forearm bone point, and wrist bone point according to a set ratio; the swaying component is distributed to the wrist bone point.
[0229] Control the elbow and forearm bone points to rotate according to the assigned torsional components; control the wrist bone points to rotate according to the assigned torsional and swaying components.
[0230] Furthermore, for the leg skeletal chain, the motion information of each skeletal point is determined based on the state information of the at least one control point and / or the initial state information of each skeletal point, including:
[0231] The movement mode of the virtual image is determined based on the position information of the head control points;
[0232] If the movement mode of the virtual character is walking, then determine the movement direction and movement speed of the virtual character;
[0233] The initial motion information of each bone point on the leg bone chain of the set animation is obtained according to the movement direction;
[0234] The initial motion information is adjusted based on the moving speed to obtain the target motion information;
[0235] Controlling each of the aforementioned skeletal points to move according to the motion information includes:
[0236] Control each bone point on the leg bone chain to move according to the target motion information.
[0237] Furthermore, if the movement of the virtual image is jumping or squatting, the target position information of the thigh bone point and the target position information of the ankle bone point are determined;
[0238] Based on the target position information of the femoral bone point and the target position information of the ankle bone point, the target position information of the knee bone point is determined by a third setting algorithm.
[0239] Controlling each of the aforementioned skeletal points to move according to the motion information includes:
[0240] Control the knee bone point to move to the target position.
[0241] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this disclosure can be achieved, and this is not limited herein.
[0242] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for controlling a virtual avatar, characterized in that, include: The virtual avatar is divided into multiple skeletal chains; each skeletal chain contains multiple bone points, and the skeletal chains include two arm skeletal chains, each of which includes a shoulder bone point, an upper arm bone point, and an elbow bone point. Acquire the state information of at least one control point and the initial state information of each of the skeletal points; wherein, the state information includes position information and orientation information, and the control point includes at least one of the following: hand control point and head control point; Motion information of each bone point is determined based on the state information of the at least one control point and / or the initial state information of each bone point; wherein, the motion information includes translation information and / or rotation information; Control each of the aforementioned skeletal points to move according to the motion information; For the shoulder bone point on the arm skeletal chain, the motion information of each bone point is determined based on the state information of the at least one control point and / or the initial state information of each bone point, including: determining the target orientation of the shoulder bone point based on the position information of the hand control point and the initial position information of the shoulder bone point; controlling each bone point to move according to the motion information, including: controlling the shoulder bone point to rotate to the target orientation; After controlling the rotation of the shoulder bone point to the target orientation, the method further includes: Determine the target plane information of the arm; based on the target plane information, the initial position information of the upper arm bone points, and the position information of the hand control points, use a second setting algorithm to determine the target position information of the elbow bone points; control the elbow bone points to move to the target position.
2. The method according to claim 1, characterized in that, The skeletal chain also includes a trunk skeletal chain and two leg skeletal chains; wherein, the trunk skeletal chain includes a skull bone point and multiple trunk bone points; the arm skeletal chain also includes a forearm bone point and a wrist bone point; the leg skeletal chain includes a thigh bone point, a knee bone point and an ankle bone point.
3. The method according to claim 2, characterized in that, For the plurality of trunk skeletal points, motion information of each skeletal point is determined based on the state information of at least one control point and / or the initial state information of each skeletal point, including: The target orientation of the chest bone point is determined based on the state information of the hand control point and the initial state information of the shoulder bone point; The trunk rotation information is determined based on the target orientation and initial orientation of the chest bone points. The first rotation information of the plurality of trunk skeletal points is determined based on the trunk rotation information.
4. The method according to claim 3, characterized in that, Determining the first rotation information of the plurality of trunk skeletal points based on the trunk rotation information includes: Obtain the rotation ratio of each torso bone point; The first rotation information corresponding to the plurality of trunk skeletal points is determined based on the rotation ratio and the first rotation information; Controlling each of the aforementioned skeletal points to move according to the motion information includes: The multiple trunk skeletal points are controlled to rotate according to the first rotation information.
5. The method according to claim 2 or 4, characterized in that, For head skeletal points, motion information of each skeletal point is determined based on the state information of at least one control point and / or the initial state information of each skeletal point, including: The motion information of the head bone points is determined based on the state information of the head control points and the initial state information of the head bone points. Controlling each of the aforementioned skeletal points to move according to the motion information includes: The head bone points are controlled to move according to the motion information of the head bone points.
6. The method according to claim 5, characterized in that, After controlling the head bone points to move according to the motion information of the head bone points, the method further includes: Obtain the target position information of the head bone points and the initial position information of the root bone points after the movement; Based on the target location information and the initial location information, the motion information of the remaining trunk skeletal points is determined using a first set algorithm; Controlling each of the aforementioned skeletal points to move according to the motion information includes: Control the remaining skeletal points of the torso to move according to the motion information.
7. The method according to claim 1, characterized in that, Determining the target orientation of the shoulder bone point based on the position information of the hand control point and the initial position information of the shoulder bone point includes: Project the vector from the shoulder bone point to the hand control point onto the three planes of the global coordinate system; The rotation angle of the shoulder bone point around the three axes of the global coordinate system is determined based on the projected vector to obtain the target orientation.
8. The method according to claim 7, characterized in that, After determining the rotation angles of the shoulder bone points around the three axes of the global coordinate system based on the projected lines, the process also includes: Obtain the constraint information of the target orientation; The target orientation is adjusted based on the constraint information to obtain the adjusted target orientation.
9. The method according to claim 7, characterized in that, After determining the rotation angles of the shoulder bone points around the three axes of the global coordinate system based on the projected lines, the process also includes: If the rotation angle exceeds the set value, the rotation angle is multiplied by the length of the projected vector to obtain the corrected rotation angle.
10. The method according to claim 1, characterized in that, The target plane information is represented by normal information. Determining the target plane information of the arm includes: The target elbow orientation is determined based on the direction of the first upper arm, the direction of the second upper arm, the initial elbow orientation, and the orientation of the hand control point. The target plane information of the arm is determined based on the elbow target orientation and the second upper arm direction.
11. The method according to claim 10, characterized in that, The target elbow orientation is determined based on the direction of the first upper arm, the direction of the second upper arm, the initial elbow orientation, and the orientation of the hand control point, including: Obtain the rotation angle from the first large arm direction to the second large arm direction; The mid-point orientation of the elbow is determined based on the rotation angle and the initial orientation of the elbow. The target elbow orientation is determined based on the orientation of the elbow midpoint and the orientation of the hand control point.
12. The method according to claim 1, characterized in that, After controlling the elbow skeletal point to move to the target position, the method further includes: Obtain the first orientation information of the wrist bone points after movement; The third rotation information is determined based on the first orientation information and the orientation information of the hand control point; The elbow bone point, forearm bone point, and wrist bone point are rotated according to the third rotation information.
13. The method according to claim 12, characterized in that, The elbow bone point, forearm bone point, and wrist bone point are rotated according to the third rotation information, including: The third rotation information is subjected to rocking-torsion decomposition to obtain rocking and torsional components; The torsional component is distributed to the elbow bone point, forearm bone point, and wrist bone point according to a set ratio; the swaying component is distributed to the wrist bone point. Control the elbow and forearm bone points to rotate according to the assigned torsional components; control the wrist bone points to rotate according to the assigned torsional and swaying components.
14. The method according to claim 2, characterized in that, For the leg skeletal chain, the motion information of each skeletal point is determined based on the state information of the at least one control point and / or the initial state information of each skeletal point, including: The movement mode of the virtual image is determined based on the position information of the head control points; If the movement mode of the virtual character is walking, then determine the movement direction and movement speed of the virtual character; The initial motion information of each bone point on the leg bone chain of the set animation is obtained according to the movement direction; The initial motion information is adjusted based on the moving speed to obtain the target motion information; Controlling each of the aforementioned skeletal points to move according to the motion information includes: Control each bone point on the leg bone chain to move according to the target motion information.
15. The method according to claim 14, characterized in that, If the movement of the virtual avatar is jumping or squatting, determine the target position information of the thigh bone point and the target position information of the ankle bone point; Based on the target position information of the femoral bone point and the target position information of the ankle bone point, the target position information of the knee bone point is determined by a third setting algorithm. Controlling each of the aforementioned skeletal points to move according to the motion information includes: Control the knee bone point to move to the target position.
16. A control device for a virtual avatar, characterized in that, include: The skeletal chain segmentation module is used to divide the virtual image into multiple skeletal chains; each skeletal chain contains multiple bone points, and the skeletal chain includes two arm skeletal chains, each arm skeletal chain including shoulder bone points, upper arm bone points, and elbow bone points. A status information acquisition module is used to acquire status information of at least one control point and initial status information of each of the skeletal points; wherein, the status information includes position information and orientation information, and the control point includes at least one of the following: hand control point and head control point; A motion information determination module is used to determine the motion information of each of the at least one control point and / or the initial state information of each of the skeletal points; wherein the motion information includes translation information and / or rotation information; The control module is used to control each of the skeletal points to move according to the motion information; The motion information determination module is also used to: determine the target orientation of the shoulder bone points based on the position information of the hand control points and the initial position information of the shoulder bone points; Optionally, the control module is also used to: control the rotation of the shoulder bone points to the target orientation; The motion information determination module is also used to: determine the target plane information of the arm; determine the target position information of the elbow bone point using a second set algorithm based on the target plane information, the initial position information of the upper arm bone point and the position information of the hand control point; and control the elbow bone point to move to the target position.
17. An electronic device, characterized in that, The electronic device includes: One or more processing devices; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the virtual avatar control method as described in any one of claims 1-15.
18. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processing device, it implements the control method for the virtual image as described in any one of claims 1-15.
Citation Information
Patent Citations
Transmitter-receiver of three-dimensional skeleton structure motions and method thereof
US20010007452A1
System, method, and recording medium for controlling an object in virtual world
US20130038601A1