Virtual character posture generation method and device and nonvolatile storage medium
By setting foot target points, calculating bone angles, and optimizing the upper body posture using inverse kinematics and physics engines in the virtual character posture generation method, the problem of low efficiency in animation character posture generation is solved, natural and efficient posture generation is achieved, and the realism and animation quality of the virtual character are improved.
Patent Information
- Application Number
- CN202510882664.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-10-17
AI Technical Summary
The existing technology is not efficient in generating realistic and natural poses for animated characters, especially when large amounts of data need to be processed and real-time feedback is required, resulting in low pose generation efficiency.
By obtaining the environment in which the virtual character is located, setting the foot target point as the landing point on the ground, calculating the bone angles of the legs and feet, adjusting the upper body posture based on these angles, using inverse kinematics and physics engines to optimize the posture, and combining it with a neural network model for fine-tuning, a natural and efficient posture is generated.
The efficiency of generating animated character poses is improved, resulting in natural, stable and expressive animation effects, enhancing the realism and immersive experience of virtual characters.
Smart Images

Figure CN120807729A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of metaverse, in particular to a virtual character posture generation method and device and a nonvolatile storage medium. BACKGROUND
[0002] At present, a motion capture technology is generally used to match a corresponding posture for an animation character. Specifically, a sensor is used to capture the motion of a real human or other creatures, and the data is applied to an animation character. This method can provide very natural movements, but the cost is high, and a large number of equipment and space are required. Although the posture obtained by the motion capture technology is real and natural, some animation postures cannot be realized by a real human. Physical driven animation and machine learning technologies require more computing resources, especially in the case of processing a large amount of data and real-time feedback, resulting in low posture generation efficiency.
[0003] In view of the low posture generation efficiency of a real and natural animation character in the related art, an effective solution has not been proposed yet. SUMMARY
[0004] The main purpose of the present application is to provide a virtual character posture generation method, device and nonvolatile storage medium, so as to solve the problem of low posture generation efficiency of a real and natural animation character in the related art.
[0005] In order to achieve the above purpose, according to one aspect of the present application, a virtual character posture generation method is provided. The method comprises: acquiring an environment in which a virtual character is located; setting a target point for a foot of the virtual character based on the environment, wherein the target point is a landing point of the virtual character on the ground; calculating the bone angles of the leg and foot of the virtual character based on the position of the target point; adjusting the posture of the upper body of the virtual character based on the bone angles of the leg and foot of the virtual character, to obtain a target posture of the virtual character.
[0006] Optionally, setting the target point for the foot of the virtual character based on the environment comprises: acquiring the motion requirements of the virtual character; determining the ground information corresponding to the ground where the virtual character is located based on the environment, wherein the ground information comprises the ground height, the ground inclination and the ground obstacles; setting the target point for the foot of the virtual character based on the motion requirements and the ground information.
[0007] Optionally, the bone angles of the leg and the foot of the virtual character are calculated based on the position of the target point, including: establishing a coordinate system for the bone of the leg and the foot of the virtual character; determining the initial position and direction of the joint in the leg and the foot of the virtual character based on the coordinate system; adjusting the angle of the joint by using an inverse kinematics solver to calculate reversely from the target point, to determine the bone angles of the leg and the foot of the virtual character.
[0008] Optionally, the upper body posture of the virtual character is adjusted based on the bone angles of the leg and the foot of the virtual character to obtain a target posture of the virtual character, including: determining a gravity center point of the virtual character according to the bone angles of the leg and the foot of the virtual character; determining a support surface of the virtual character according to the area occupied by the foot of the virtual character; judging whether the gravity center point is located in the support surface; in the case that the gravity center point is not located in the support surface, adjusting the trunk angle of the virtual character until the gravity center point is located in the support surface, and determining the target posture of the virtual character.
[0009] Optionally, the upper body posture of the virtual character is adjusted based on the bone angles of the leg and the foot of the virtual character to obtain a target posture of the virtual character, including: adjusting the upper body posture of the virtual character based on the bone angles of the leg and the foot of the virtual character to obtain an initial posture of the virtual character; simulating the movement of the virtual character in the environment based on a physics engine to obtain posture feedback information of the virtual character; adjusting the initial posture of the virtual character based on the posture feedback information to obtain the target posture.
[0010] Optionally, the upper body posture of the virtual character is adjusted based on the bone angles of the leg and the foot of the virtual character to obtain a target posture of the virtual character, including: adjusting the upper body posture of the virtual character based on the bone angles of the leg and the foot of the virtual character to obtain an initial posture of the virtual character; obtaining a picture of the virtual character in the initial posture; inputting the picture into a preset target neural network model to obtain a recommended posture picture, wherein the neural network model is used to recommend a posture picture with a similarity to the input picture exceeding a preset threshold; adjusting the initial posture of the virtual character based on the recommended posture picture to obtain the target posture.
[0011] To achieve the above-mentioned purpose, according to another aspect of the present application, a virtual character posture generation device is provided. The device comprises: an acquisition module configured to acquire an environment in which a virtual character is located; a setting module configured to set a target point for the foot of the virtual character based on the environment, wherein the target point is a landing point of the virtual character on the ground of the environment; a calculation module configured to calculate bone angles of the leg and the foot of the virtual character based on the position of the target point; and an adjustment module configured to adjust an upper body posture of the virtual character based on the bone angles of the leg and the foot of the virtual character to obtain a target posture of the virtual character.
[0012] In order to achieve the above object, according to another aspect of the present application, there is further provided a computer readable storage medium comprising a stored executable program, wherein the computer readable storage medium is caused to perform any of the above-mentioned virtual character posture generation methods when the executable program is run.
[0013] In order to achieve the above object, according to another aspect of the present application, there is provided an electronic device comprising: a memory storing an executable program; and a processor configured to execute the program, wherein the program is caused to perform any of the above-mentioned virtual character posture generation methods when the program is executed.
[0014] In order to achieve the above object, according to another aspect of the present application, there is provided a computer program product comprising computer instructions configured to cause a processor to perform the steps of any of the above-mentioned virtual character posture generation methods when the computer instructions are executed.
[0015] In the embodiments of the present application, the virtual character posture generation method is adopted, the environment in which the virtual character is located is obtained, a target point is set for the feet of the virtual character based on the environment, the target point is the landing position of the virtual character on the ground, the bone angles of the legs and the feet of the virtual character are calculated based on the position of the target point, the posture of the upper body of the virtual character is adjusted based on the bone angles of the legs and the feet of the virtual character, and the target posture of the virtual character is obtained, thereby achieving the purpose of confirming the whole body posture based on the target point of the feet, improving the generation efficiency of the posture of the animation character, and solving the problem of low posture generation efficiency of the real and natural animation character in the related art. BRIEF DESCRIPTION OF DRAWINGS
[0016] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application and are incorporated herein for a purpose of explanations and are not intended to constitute an improper limitation to the present application. In the drawings:
[0017] Figure 1 Fig. 1 shows a hardware structure block diagram of a computer terminal for implementing the virtual character posture generation method;
[0018] Figure 2 Fig. 2 is a flow chart of the virtual character posture generation method according to an embodiment of the present application;
[0019] Figure 3 Fig. 3 is a structure block diagram of the virtual character posture generation device according to an embodiment of the present application;
[0020] Figure 4 Fig. 4 is a structure block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to better understand the technical scheme of the present application, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work should fall within the scope of protection of the present application.
[0022] It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units need not be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0023] It should be noted that the information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for display, analyzed data, etc.) involved in the present application are information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards, necessary security measures are taken, do not violate public order and good customs, and provide corresponding operation portal for user to choose authorization or refusal. For example, the system and related users or institutions are provided with an interface to provide the user with a corresponding operation portal for the user to choose to agree or refuse the automatic decision result; if the user chooses to refuse, the expert decision process is entered.
[0024] Embodiment 1
[0025] According to the embodiments of the present application, a method for generating a posture of a virtual character is also provided. It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0026] The method embodiment provided by the embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1A hardware structure block diagram of a computer terminal for implementing a posture generation method of a virtual character is shown. As shown in Figure 1 The computer terminal 10 (or mobile device) can include one or more processors 102 (the processor 102 can include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports in the BUS bus), a network interface, a power supply and / or a camera. Those skilled in the art can understand that Figure 1 The structure shown is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 can include more or fewer components than those shown in Figure 1 or have a different configuration than that shown in Figure 1 .
[0027] It should be noted that the one or more processors 102 and / or other data processing circuits described above can be referred to herein as "data processing circuits" in general. The data processing circuit can be embodied in whole or in part as software, hardware, firmware or any combination thereof. In addition, the data processing circuit can be a single independent processing module, or any one of the other elements combined into the computer terminal 10 (or mobile device) in whole or in part. As referred to in the embodiments of the present application, the data processing circuit serves as a processor to control (for example, selection of a variable resistance terminal path connected to an interface).
[0028] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the posture generation method of a virtual character in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the posture generation method of a virtual character described above. The memory 104 can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 can further include a memory remotely disposed with respect to the processor 102, which can be connected to the computer terminal 10 through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0029] The transmission device 106 is configured to receive or send data via a network. The network can include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network interface controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module configured to communicate with the Internet wirelessly.
[0030] The display can be a liquid crystal display (LCD) that is touch screen, for example, which can enable a user to interact with the user interface of the computer terminal 10 (or mobile device).
[0031] In the above operating environment, the present application provides a virtual character posture generation method as shown in Figure 2 Figure 2 is a flowchart of a virtual character posture generation method according to an embodiment of the present application.
[0032] In step S201, an environment in which a virtual character is located is obtained.
[0033] In step S202, a target point is set for a foot of the virtual character based on the environment, wherein the target point is a landing point of the virtual character on the ground of the environment.
[0034] The posture of the foot of the virtual character is very important because it is directly related to the authenticity and naturalness of various actions such as walking, running, and standing of the virtual character. Therefore, determining the target point of the foot is a crucial step. Therefore, the environment in which the virtual character is located can be determined first, and the target point can be set by analyzing the terrain. The target point should be a stable and reasonable position on the ground to ensure that the foot of the character can land. The virtual character here can be an animation character, a game character, or a virtual character in a metaverse system. In the process of determining the target point, the motion trajectory and action requirements of the character also need to be considered to ensure that the foot posture can meet the action requirements of the character.
[0035] It can identify the current or expected actions of the virtual character, such as walking, running, jumping, etc. The movement intention will determine the position of the foot target point. Based on factors such as the virtual character's movement speed, direction, and jump height, predict the point where the foot will touch the ground. This usually involves certain physical calculations, such as using a dynamic model to predict the landing point. Taking into account that the ground may be uneven, the coordinates of the foot target point need to be adjusted according to the height map and inclination angle of the ground. If there are obstacles on the ground, strategies for bypassing or crossing the obstacles need to be considered. Make sure that the selection of the foot target point can provide sufficient stability. In multi-legged characters (such as quadrupeds), this may involve calculating the support area and center of gravity stability range of each foot.
[0036] By following these steps, you can set reasonable target points for the virtual character's feet, especially in complex dynamic environments. This helps the virtual character show more natural and stable walking and other movements in animation.
[0037] Step S203 : Calculate the bone angles of the legs and feet of the virtual character based on the position of the target point.
[0038] In this step, the angles of the virtual character's legs and feet bones are calculated based on the position of the target point, mainly through inverse kinematics (IK) technology. Inverse kinematics is a method of reversely calculating joint angles from the target position of the end effector. The skeletal structure of the legs and feet, including the hip joint, knee joint, ankle joint, etc., as well as the link relationship between them, can be determined. Then a local coordinate system is set for each joint to describe rotation and translation. There are many IK solution methods, including but not limited to the Jacobian matrix method, iterative method (such as DLS), hybrid strategy, etc. Then the objective function can be defined, which usually attempts to minimize the distance between the actual position of the foot and the target point, and ensure that the joint angle is within a reasonable range to avoid movement beyond the physiological range. Then the IK solution is performed. A Jacobian matrix can be constructed, and each column of the matrix describes the influence of the joint on the position of the end effector. The pseudo-inverse of the Jacobian matrix is used to calculate the change in joint angle to minimize the distance.
[0039] Based on the IK calculations, you may also need to manually adjust the foot angles to ensure that the foot contacts the ground naturally and ergonomically. For example, you can adjust the degree of bend in the ankle and knee to simulate a realistic walking or standing posture.
[0040] Through these steps, the bone angles of the virtual character's legs and feet can be calculated based on the position of the target point, thereby generating more natural and coordinated animation poses.
[0041] At step S204, the upper body pose of the virtual character is adjusted based on the leg and foot bone angles to obtain a target pose of the virtual character.
[0042] In this step, the upper body pose is adjusted based on the leg and foot bone angles to obtain a target pose of the overall body, ensuring natural and realistic animation. The stability of the character can be evaluated based on the leg and foot bone angles first. Ensuring that the contact points of the feet on the ground provide sufficient support to avoid the character appearing to sway or lose balance in the animation. Then the torso balance adjustment is performed. For example, the center of gravity of the virtual character can be calculated to ensure it is within the support area defined by the foot contact points. If the center of gravity is offset, the weight is redistributed by adjusting the angles of the torso, especially the spine and pelvis, to maintain body stability. Then the degree of curvature of the spine is adjusted according to the leg pose to simulate natural human mechanics. For example, when the legs are bent, the spine may need to be slightly tilted forward to balance the body weight. Arm pose adjustments can also be made, as the arm pose not only helps maintain balance, but also coordinates with the leg movements or scene interactions of the character. For example, when running, the arms will naturally swing; when climbing a mountain, the arms may be stretched out to find support. According to the style of the animation and the personality of the character, the position and angle of the arms are appropriately adjusted to enhance the visual effect and emotional expression of the animation. The angle of the head and the direction of the face need to match the direction of the character's movement and the focus of attention. For example, the head may be slightly tilted forward when running, and the head will turn towards the target when looking. Adjust the facial expression according to the character's emotions and the needs of the scene, which helps to enhance the realism and expressiveness of the animation.
[0043] The adjusted upper body pose can also be verified using a physics engine to ensure that the pose complies with physical rules such as gravity and joint limits. This step can help identify unnatural or impossible poses and make corrections. The entire process may need to be iterated repeatedly until the overall pose of the virtual character not only complies with physical laws but also has good visual effects. Manual fine-tuning can also be performed to ensure the artistic and smoothness of the motion.
[0044] Through these steps, the upper body pose of the virtual character can be coordinated with the leg and foot bone angles to generate natural and artistically beautiful animation effects.
[0045] As an optional embodiment, based on the environment, a target point is set for the feet of the virtual character, including: obtaining the motion requirements of the virtual character; based on the environment, determining the ground information corresponding to the ground where the virtual character is located, wherein the ground information includes the ground height, the ground inclination and the ground obstacles; based on the motion requirements and the ground information, setting a target point for the feet of the virtual character.
[0046] Optionally, the motion requirements of the virtual character can be obtained, such as walking, running, jumping, dodging, etc. The motion requirements can be converted into numerical parameters such as speed, acceleration, direction angle, and jumping height, etc., which will guide the subsequent ground target point prediction. Then determine the ground information where the virtual character is located, which can use a three-dimensional environment model containing detailed information of the terrain, such as height map and texture data. By accessing the ground height map at the location of the virtual character, the ground height at that point is obtained. Based on the ground height information, the inclination angle of the ground at the virtual character's location is calculated using differential or approximation methods. Obstacles such as rocks, trees, stairs, or puddles can also be detected in the environment model, recording the position and shape of the obstacles. According to the current speed, direction, and motion requirements (such as jumping) of the virtual character, the movement path of the foot is predicted. Combined with the foot movement trajectory and the ground height, the exact position of each foot that will contact the ground in the next step is predicted. This needs to take into account the step length, step frequency, and possible jumping. Check if the predicted foot landing point conflicts with known obstacles. If so, adjust the target point to ensure that the foot can be placed safely and naturally on the obstacle-free ground. If the ground is inclined, the height and position of the foot target point can be adjusted to ensure that the character can maintain a stable posture on the slope, such as slightly lowering the trailing foot to adapt to the ground inclination.
[0047] Through the above steps, the foot target point of the virtual character can be accurately set in different environments and motion requirements, generating realistic animation effects that conform to physical rules and adapt to complex terrain.
[0048] As an optional embodiment, based on the position of the target point, the bone angles of the legs and feet of the virtual character are calculated, including: establishing a coordinate system for the bones of the legs and feet of the virtual character; based on the coordinate system, determining the initial position and direction of the joints in the legs and feet of the virtual character; based on the initial position and direction of the joints, using an inverse kinematics solver to reverse calculate from the target point, adjusting the angles of the joints, and determining the bone angles of the legs and feet of the virtual character.
[0049] Optionally, inverse kinematics (IK) technology can be used to reverse calculate the angles of the bone chains of the legs and feet based on the position of the foot target point. The IK solver will try to find the most suitable combination of angles so that the foot can accurately reach the target point. Based on the IK calculation, manual adjustment of the foot angles may also be needed to ensure that the foot contacts the ground naturally and ergonomically. For example, adjust the degree of bending of the ankle and knee to simulate a realistic walking or standing posture.
[0050] Specifically, a coordinate system can be established for the leg and foot bones of the virtual character, and the bone angles can be adjusted using an inverse kinematics (IK) solver based on this coordinate system. The connection method of each bone segment in the leg and foot, including the hip joint, knee joint, ankle joint, etc., can be defined first. A certain key point in the bone, usually the hip joint, is selected as the origin of the coordinate system, and the directions of the x, y, and z axes are defined, usually with the x axis pointing left and right, the y axis pointing up and down, and the z axis pointing forward. At the beginning of the animation sequence, a basic standing or static posture is set for all joints as the initial position. The initial direction of each joint relative to the coordinate system is recorded in three-dimensional space, which serves as the basis for subsequent angle adjustment. The previously determined foot target point is input into the IK solver. The solver starts from the target point and calculates backward to the hip joint, adjusting the angles of the intermediate joints (knee joint, ankle joint, etc.) to enable the foot to reach the target point. During the solving process, the IK solver must follow physical constraints such as the rotation range of the bone and the physiological limitations of the joint. There may be multiple bone configuration schemes that satisfy the target point, and the IK solver needs to select the most natural and most consistent with human kinematics joint angle configuration. The IK solver gradually approaches the optimal bone angle that enables the foot to touch the target point through iterative adjustment. In some extreme postures, IK solving may encounter "singular points" (cases where it cannot be solved), which need to be corrected manually or through pre-set rules. When adjusting the bone angles, ensure smooth transitions between animation frames to avoid abrupt posture changes. The adjusted bone angles can be checked to ensure they comply with physical laws such as gravity and joint mechanics limits. The adjusted posture can be previewed to ensure it looks natural and meets the expected motion requirements. The solved bone angles are updated to the character model in the animation system to generate new animation frames.
[0051] Through the above steps, the inverse kinematics solver can be effectively used to adjust the bone angles of the virtual character's legs and feet based on the target point and the initial bone angles, creating an animation effect that is both physically correct and natural and smooth.
[0052] As an optional embodiment, based on the bone angles of the virtual character's legs and feet, the posture of the upper body of the virtual character is adjusted to obtain a target posture of the virtual character, including: determining the center of gravity of the virtual character according to the bone angles of the legs and feet of the virtual character; determining the support surface of the virtual character according to the area occupied by the feet of the virtual character; judging whether the center of gravity is located within the support surface; in the case where the center of gravity is not located within the support surface, adjusting the angle of the torso of the virtual character until the center of gravity is located within the support surface; and determining the target posture of the virtual character.
[0053] Optionally, adjusting the upper body pose of the virtual character based on the leg and foot bone angles to obtain a natural target pose for the entire virtual character can first determine the center point of the virtual character (usually the pelvis position) and the support surface formed by the two feet based on the leg bone angles. The support surface refers to the area of the ground that can be stably supported by the two feet. Using the adjusted foot pose, the center of gravity of the virtual character is calculated. In a standing or walking state, the center of gravity should be within the support surface to ensure the stability of the character. If the center of gravity is not within the support surface, the angle of the torso needs to be adjusted to redistribute the body weight, so that the center of gravity is adjusted. This usually involves rotation of the spine joints, including the waist, back and neck, to ensure that the character appears visually stable. To maintain the balance and naturalness of the character, the pose of the arms may need to be adjusted. When the legs and torso change significantly, the swinging of the arms can help the character maintain balance while increasing the realism of the motion. Adjust the pose of the head to match the changes in the upper body while ensuring that the line of sight direction is consistent with the direction of the character's action. In addition, appropriate facial expressions can enhance the emotional expression of the character, making the motion more lively. The adjusted pose can be checked for coherence with the previous and subsequent motions. If the pose changes suddenly, it may cause the animation to appear jarring. Through gradual transitions or keyframe interpolation, ensure that the animation is smooth and natural. The entire process may need to be iterated repeatedly until the pose of the virtual character meets both the physical laws and the good visual appeal.
[0054] Through these steps, the body balance of the character is considered while adjusting the foot pose. First is the center of gravity adjustment, ensuring that the center of gravity of the character is within the support surface (i.e. the area between the two feet) to maintain balance. Second is the upper body adjustment, which adjusts the pose of the upper body according to the changes in the foot pose, such as tilting the body, swinging the arms, etc., to enhance the naturalness and smoothness of the overall motion. This can make the pose of the animated character look more realistic and lively.
[0055] As an optional embodiment, adjusting the upper body pose of the virtual character based on the leg and foot bone angles of the virtual character to obtain a target pose of the virtual character includes: adjusting the upper body pose of the virtual character based on the leg and foot bone angles of the virtual character to obtain an initial pose of the virtual character; simulating the movement of the virtual character in the environment based on a physics engine to obtain pose feedback information of the virtual character; adjusting the initial pose of the virtual character based on the pose feedback information to obtain the target pose.
[0056] Optionally, to provide real-time feedback and help find potential problems, a physics engine can be used to simulate the interaction of the character with the ground. The physics engine can simulate factors such as the weight, inertia and friction of the character with the ground, helping to adjust the foot pose and maintain the balance of the character. Through real-time feedback, the pose of the character can be adjusted in a timely manner, making the animation effect more realistic.
[0057] For example, the center of mass position of the character in the current leg and foot pose is calculated, and the upper body pose, especially the degree of spinal curvature, is adjusted according to the center of mass position to maintain balance. The poses of the arms, head, and torso are adjusted to match the movements of the legs. For example, when running, the amplitude and frequency of arm swings will change with the intensity of leg movements. After completing the above adjustments, the upper body pose of the virtual character will be consistent with the leg and foot pose, forming a preliminary, stable initial pose. Set the physical properties of the virtual character in the physics engine, such as mass, density, gravity influence, etc., to ensure that its behavior in the virtual environment conforms to the laws of the real world. Use the physics engine to simulate the movement of the virtual character on different terrains (such as flat ground, slopes, or terrains with obstacles), as well as collisions or interactions with other objects. Collect feedback information on the stability and coordination of the virtual character's pose during movement from the physics engine, including but not limited to: whether the upper body has excessive sway or tilt when the feet contact the ground. Whether the dynamic of the arms and head is synchronized with the movement of the lower limbs. Whether the character maintains proper balance on slopes or uneven terrain. Based on the pose feedback information, analyze the inconsistencies between the upper body pose and the lower limb movements, as well as the physical stability problems. Make targeted adjustments to the upper body pose to address the detected problems and ensure that the overall movement is natural and smooth and physically stable. Repeat the above steps until the virtual character's pose is both stable and expressive in the physics simulation. This may involve multiple iterations until the optimal target pose is obtained.
[0058] By gradually optimizing the upper body pose of the virtual character, a natural, stable, and expressive target pose is ultimately generated. This method not only significantly improves the realism of virtual character animation, but also enhances the immersive experience in games and virtual reality applications. By integrating the simulation feedback of the physics engine into the animation adjustment process, it can ensure that the virtual character can exhibit the best dynamic performance under any conditions.
[0059] As an optional embodiment, based on the bone angles of the legs and feet of the virtual character, the upper body pose of the virtual character is adjusted to obtain a target pose of the virtual character, comprising: based on the bone angles of the legs and feet of the virtual character, adjusting the upper body pose of the virtual character to obtain an initial pose of the virtual character; obtaining a picture of the virtual character in the initial pose; inputting the picture into a preset target neural network model to obtain a recommended pose picture, wherein the neural network model is used to recommend a pose picture with a similarity exceeding a preset threshold to the input picture; based on the recommended pose picture, adjusting the initial pose of the virtual character to obtain a target pose.
[0060] Optionally, the animation character's foot pose can be further refined by detecting and fine-tuning. The generated pose image can be input into a neural network model, which judges whether the pose is similar to a natural pose and recommends a similar pose. Fine-tune the animation character's pose based on the recommended pose to make it more consistent with real human movements and poses. This can improve the realism and watchability of the animation.
[0061] Based on the virtual character's leg and foot bone angle data, the IK (Inverse Kinematics) technique or custom algorithm can be used to adjust the upper body pose, ensuring the overall pose is coordinated. Then, a picture of the virtual character in the current initial pose is taken from the adjusted model. This picture contains all the pose information of the character and is the object of subsequent deep learning model processing. The picture can be preprocessed as needed, such as size normalization, color correction or feature extraction, to meet the input requirements of the neural network model. The processed picture is input into the pre-trained deep learning neural network model. This model is trained based on a large number of real or naturally generated pose pictures and can identify and recommend reference pictures with high similarity to the input picture. The model outputs a recommended pose picture that has a similarity to the input picture exceeding a preset threshold, providing a visual reference for optimizing the virtual character's pose. The recommended pose picture can be analyzed for details such as the spine curve, arm and head pose. Using this information, the initial pose of the virtual character, especially the upper body, is fine-tuned to be closer to the recommended natural pose. Repeat the above process, re-take the picture after each adjustment and input it into the neural network model until the virtual character's pose meets the preset optimization criteria, generating the final target pose.
[0062] For example, in the game development process, when the character changes from crawling to standing, the system first adjusts the upper body pose based on the leg and foot bone angle data using IK technology to form a preliminary "standing preparation" pose. Then, a screenshot of this pose is input into a pre-trained convolutional neural network model, which returns a set of real human standing pose pictures with high similarity. Animators or systems can further refine the virtual character's upper body based on the recommended pictures, such as the natural curvature of the spine and the natural droop of the arms. This process may need to be iterated several times until the character's pose meets both physical rules and has strong expressiveness and realism.
[0063] The above steps use the natural pose recommended by the model as a reference to efficiently generate virtual character movements that are both realistic and expressive, greatly enriching the possibilities of animation production.
[0064] The method for generating a posture of a virtual character provided in the embodiments of the present application comprises the following steps: obtaining an environment in which a virtual character is located; setting a target point for a foot of the virtual character based on the environment, wherein the target point is a landing position of the virtual character on a ground surface of the environment; calculating a bone angle of a leg and a foot of the virtual character based on a position of the target point; and adjusting an upper body posture of the virtual character based on the bone angle of the leg and the foot of the virtual character to obtain a target posture of the virtual character. The method solves the problem of low efficiency in generating a real and natural animation character posture in the related art. Thus, the effect of D is achieved.
[0065] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown.
[0066] Embodiment 2
[0067] The embodiments of the present application also provide a device for generating a posture of a virtual character. It should be noted that the device for generating a posture of a virtual character in the embodiments of the present application can be used to execute the method for generating a posture of a virtual character provided in the embodiments of the present application. The device for generating a posture of a virtual character provided in the embodiments of the present application is introduced as follows.
[0068] According to the embodiments of the present application, a device for implementing the above-mentioned method for generating a posture of a virtual character is also provided, Figure 3 is a structural block diagram of the device for generating a posture of a virtual character provided in the embodiments of the present application, as Figure 3 shown, the device comprises:
[0069] The obtaining module 301 is configured to obtain an environment in which a virtual character is located.
[0070] The setting module 302 is connected with the obtaining module 301 and is configured to set a target point for a foot of the virtual character based on the environment, wherein the target point is a landing position of the virtual character on a ground surface of the environment.
[0071] The calculating module 303 is connected with the setting module 302 and is configured to calculate a bone angle of a leg and a foot of the virtual character based on a position of the target point.
[0072] The adjusting module 304 is connected with the calculating module 303 and is configured to adjust an upper body posture of the virtual character based on the bone angle of the leg and the foot of the virtual character to obtain a target posture of the virtual character.
[0073] The device for generating a virtual character's posture provided in an embodiment of the present application obtains the virtual character's environment; based on the environment, sets a target point for the virtual character's feet, where the target point is the virtual character's landing point on the ground of the environment; calculates the skeletal angles of the virtual character's legs and feet based on the position of the target point; and adjusts the virtual character's upper body posture based on the skeletal angles of the virtual character's legs and feet to obtain the target posture of the virtual character. This solves the problem of low efficiency in generating realistic and natural animated character postures in related technologies, thereby achieving the effect of D.
[0074] Optionally, in the posture generation device for a virtual character provided in an embodiment of the present application, a setting module is used to set a target point for the feet of the virtual character based on the environment, including: a first acquisition unit, used to obtain the action requirements of the virtual character; a first determination unit, used to determine the ground information corresponding to the ground on which the virtual character is located based on the environment, wherein the ground information includes the ground height, the ground inclination and the ground obstacles; and a setting unit, used to set the target point for the feet of the virtual character based on the action requirements and the ground information.
[0075] Optionally, in the posture generation device for a virtual character provided in an embodiment of the present application, a calculation module is used to calculate the bone angles of the virtual character's legs and feet based on the position of the target point, including: an establishment unit for establishing a coordinate system for the bones of the virtual character's legs and feet; a second determination unit for determining the initial position and direction of the joints in the legs and feet of the virtual character based on the coordinate system; and a first adjustment unit for using an inverse kinematics solver to reversely calculate from the target point based on the initial position and direction of the joints, adjust the angles of the joints, and determine the bone angles of the legs and feet of the virtual character.
[0076] Optionally, in the posture generation device for a virtual character provided in an embodiment of the present application, an adjustment module is used to adjust the upper body posture of the virtual character based on the skeletal angles of the virtual character's legs and feet to obtain the target posture of the virtual character, including: a third determination module, used to determine the center of gravity of the virtual character according to the skeletal angles of the virtual character's legs and feet; a fourth determination module, used to determine the support surface of the virtual character according to the area occupied by the virtual character's feet; and to determine whether the center of gravity is located within the support surface; a second adjustment unit, used to adjust the torso angle of the virtual character until the center of gravity is located within the support surface when the center of gravity is not located within the support surface, and thereby determine the target posture of the virtual character.
[0077] Optionally, in the posture generation device for a virtual character provided in an embodiment of the present application, an adjustment module is used to adjust the upper body posture of the virtual character based on the bone angles of the virtual character's legs and feet to obtain the target posture of the virtual character, including: a third adjustment module unit, used to adjust the upper body posture of the virtual character based on the bone angles of the virtual character's legs and feet to obtain the initial posture of the virtual character; a simulation unit, used to simulate the movement of the virtual character in the environment based on a physics engine to obtain posture feedback information of the virtual character; and a fourth adjustment unit, used to adjust the initial posture of the virtual character based on the posture feedback information to obtain the target posture.
[0078] Optionally, in the posture generation device for a virtual character provided in an embodiment of the present application, an adjustment module is used to adjust the upper body posture of the virtual character based on the bone angles of the virtual character's legs and feet to obtain the target posture of the virtual character, including: a third adjustment unit, used to adjust the upper body posture of the virtual character based on the bone angles of the virtual character's legs and feet to obtain the initial posture of the virtual character; a second acquisition unit, used to obtain a picture of the virtual character in the initial posture; an input unit, used to input the picture into a preset target neural network model to obtain a recommended posture picture, wherein the neural network model is used to recommend a posture picture whose similarity to the input picture exceeds a preset threshold; a fifth adjustment unit, used to adjust the initial posture of the virtual character based on the recommended posture picture to obtain the target posture.
[0079] It should be noted that the acquisition module 301, setting module 302, calculation module 303, and adjustment module 304 correspond to steps S201 to S204 in Example 1. The examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above-mentioned modules can also be run as part of the device in the computer terminal 10 provided in Example 1.
[0080] Example 3
[0081] An embodiment of the present application may provide an electronic device, Figure 4 This is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 4 As shown, the electronic device may include: one or more ( Figure 4 Only one is shown) processor 402, memory 404, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0082] The memory can be used to store software programs and modules, such as program instructions / modules corresponding to the method and device in the embodiments of the present application. The processor executes various functions and data processing by running the software programs and modules stored in the memory, that is, implements the above method. The memory can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory can further include a memory remotely arranged with respect to the processor, which can be connected to the terminal through a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0083] The processor can call information and applications stored in the memory through the transmission device to perform the following steps: obtaining an environment in which a virtual character is located; setting a target point for the feet of the virtual character based on the environment, wherein the target point is a landing position of the virtual character in the ground; calculating the bone angles of the legs and feet of the virtual character based on the position of the target point; adjusting the posture of the upper body of the virtual character based on the bone angles of the legs and feet of the virtual character to obtain a target posture of the virtual character.
[0084] The processor can also call information and applications stored in the memory through the transmission device to perform the following steps: setting a target point for the feet of the virtual character based on the environment, including: obtaining the action requirements of the virtual character; determining the ground information corresponding to the ground where the virtual character is located based on the environment, wherein the ground information includes the ground height, the ground inclination and the ground obstacles; setting the target point for the feet of the virtual character based on the action requirements and the ground information.
[0085] The processor can also call information and applications stored in the memory through the transmission device to perform the following steps: calculating the bone angles of the legs and feet of the virtual character based on the position of the target point, including: establishing a coordinate system for the bones of the legs and feet of the virtual character; determining the initial positions and directions of the joints in the legs and feet of the virtual character based on the coordinate system; adjusting the angles of the joints by using an inverse kinematics solver to start from the target point and calculate reversely to determine the bone angles of the legs and feet of the virtual character based on the initial positions and directions of the joints.
[0086] The processor can further call information and application programs stored in the memory through the transmission device to perform the following steps: adjusting the upper body posture of the virtual character based on the bone angles of the legs and feet of the virtual character to obtain a target posture of the virtual character, including: determining the center of gravity of the virtual character according to the bone angles of the legs and feet of the virtual character; determining the support surface of the virtual character according to the area occupied by the feet of the virtual character; judging whether the center of gravity is located in the support surface; in the case that the center of gravity is not located in the support surface, adjusting the trunk angle of the virtual character until the center of gravity is located in the support surface, and determining the target posture of the virtual character.
[0087] The processor can further call information and application programs stored in the memory through the transmission device to perform the following steps: adjusting the upper body posture of the virtual character based on the bone angles of the legs and feet of the virtual character to obtain a target posture of the virtual character, including: adjusting the upper body posture of the virtual character based on the bone angles of the legs and feet of the virtual character to obtain an initial posture of the virtual character; simulating the movement of the virtual character in the environment based on the physical engine to obtain posture feedback information of the virtual character; adjusting the initial posture of the virtual character based on the posture feedback information to obtain the target posture.
[0088] The processor can further call information and application programs stored in the memory through the transmission device to perform the following steps: adjusting the upper body posture of the virtual character based on the bone angles of the legs and feet of the virtual character to obtain a target posture of the virtual character, including: adjusting the upper body posture of the virtual character based on the bone angles of the legs and feet of the virtual character to obtain an initial posture of the virtual character; obtaining a picture of the virtual character in the initial posture; inputting the picture into a preset target neural network model to obtain a recommended posture picture, wherein the neural network model is used to recommend a posture picture with a similarity to the input picture exceeding a preset threshold; adjusting the initial posture of the virtual character based on the recommended posture picture to obtain the target posture.
[0089] By adopting the embodiment of the present application, a method for generating a posture of a virtual character is provided, which comprises the following steps: obtaining an environment in which a virtual character is located; setting a target point for the feet of the virtual character based on the environment, wherein the target point is a landing point of the virtual character on the ground of the environment; calculating bone angles of the legs and feet of the virtual character based on the position of the target point; and adjusting the upper body posture of the virtual character based on the bone angles of the legs and feet of the virtual character to obtain a target posture of the virtual character. The method achieves the purpose of confirming the whole body posture based on the target point of the feet, thereby realizing the technical effect of improving the generation efficiency of the posture of an animation character, and further solving the problem of low posture generation efficiency of a real and natural animation character in the related art.
[0090] Those skilled in the art can understand that, Figure 4The structure shown is only schematic, and the electronic device can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, or the like. Figure 4 This does not limit the structure of the electronic device described above. For example, the electronic device can further include more or fewer components (such as a network interface, a display device, etc.) than those shown in the middle, or have a different configuration from that shown. Figure 4 Figure 4
[0091] Those of ordinary skill in the art can understand that all or part of the steps of the various methods in the above embodiments can be instructed by a program to related hardware of a terminal device, and the program can be stored in a computer readable storage medium, which can include a flash disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, etc.
[0092] Embodiment 4
[0093] The embodiments of the present application also provide a storage medium. Optionally, in the embodiments, the storage medium can be used to store program codes executed by any one of the posture generation methods of the virtual character provided in the embodiment 1.
[0094] Optionally, in the embodiments, the storage medium can be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the mobile terminals in a mobile terminal group.
[0095] The present application also provides a computer program product adapted to execute the steps of any one of the posture generation methods of the virtual character when executed on a data processing device.
[0096] The serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0097] In the above embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0098] In several embodiments provided in the present application, it should be understood that the disclosed technology can be implemented by other ways. Among them, the above-described device embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, units or modules, and can be electrical or other forms.
[0099] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0100] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0101] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part of the prior art that contributes to the technical solutions or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0102] The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. A method for generating a virtual character's posture, characterized in that: include: Obtain the environment in which the virtual character is located; Based on the environment, setting a target point for the feet of the virtual character, wherein the target point is the landing point of the virtual character on the ground of the environment; Calculating the bone angles of the legs and feet of the virtual character based on the position of the target point; Based on the bone angles of the legs and feet of the virtual character, the upper body posture of the virtual character is adjusted to obtain the target posture of the virtual character.
2. The method according to claim 1, characterized in that The step of setting a target point for the foot of the virtual character based on the environment includes: Obtaining the action requirements of the virtual character; Based on the environment, determining ground information corresponding to the ground where the virtual character is located, wherein the ground information includes ground height, ground inclination, and ground obstacles; Based on the action requirement and the ground information, target points are set for the feet of the virtual character.
3. The method according to claim 1, characterized in that The step of calculating the bone angles of the legs and feet of the virtual character based on the position of the target point includes: Establishing a coordinate system for the skeleton of the legs and feet of the virtual character; Determining initial positions and orientations of joints in the legs and feet of the avatar based on the coordinate system; Based on the initial position and orientation of the joint, an inverse kinematics solver is used to reversely calculate from the target point, adjust the angle of the joint, and determine the bone angles of the legs and feet of the virtual character.
4. The method according to claim 1, wherein The adjusting the upper body posture of the virtual character based on the bone angles of the legs and feet of the virtual character to obtain the target posture of the virtual character includes: Determining the center of gravity of the virtual character based on the bone angles of the legs and feet of the virtual character; determining a support surface of the virtual character according to an area occupied by the feet of the virtual character; Determining whether the center of gravity is located within the support surface; When the center of gravity is not located within the support surface, the torso angle of the avatar is adjusted until the center of gravity is located within the support surface, and a target posture of the avatar is determined.
5. The method according to claim 1, wherein The adjusting the upper body posture of the virtual character based on the bone angles of the legs and feet of the virtual character to obtain the target posture of the virtual character includes: Adjusting the upper body posture of the virtual character based on the bone angles of the legs and feet of the virtual character to obtain an initial posture of the virtual character; Based on a physics engine, simulating the movement of the virtual character in the environment to obtain posture feedback information of the virtual character; Based on the posture feedback information, the initial posture of the virtual character is adjusted to obtain the target posture.
6. The method according to claim 1, characterized in that The adjusting the upper body posture of the virtual character based on the bone angles of the legs and feet of the virtual character to obtain the target posture of the virtual character includes: Adjusting the upper body posture of the virtual character based on the bone angles of the legs and feet of the virtual character to obtain an initial posture of the virtual character; Obtaining a picture of the virtual character in the initial posture; Inputting the picture into a preset target neural network model to obtain a recommended posture picture, wherein the neural network model is used to recommend posture pictures whose similarity to the input picture exceeds a preset threshold; Based on the recommended posture image, the initial posture of the virtual character is adjusted to obtain the target posture.
7. A device for generating a virtual character's posture, characterized in that: include: An acquisition module is used to obtain the environment in which the virtual character is located; a setting module, configured to set a target point for the feet of the virtual character based on the environment, wherein the target point is the landing point of the virtual character on the ground of the environment; a calculation module, configured to calculate the bone angles of the legs and feet of the virtual character based on the position of the target point; The adjustment module is used to adjust the upper body posture of the virtual character based on the bone angles of the legs and feet of the virtual character to obtain the target posture of the virtual character.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the computer-readable storage medium is located is controlled to execute the method for generating a virtual character's posture according to any one of claims 1 to 6.
9. An electronic device, characterized in that: include: a memory storing an executable program; A processor is used to run the program, wherein the program, when running, executes the method for generating a posture of a virtual character as described in any one of claims 1 to 6.
10. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the steps of the method for generating a posture of a virtual character according to any one of claims 1 to 6 are implemented.