Virtual object control method and device, related equipment and computer program product
By dynamically simulating the muscle hardness of virtual characters, the problem of fixed muscle hardness in virtual interaction is solved, and a more realistic and immersive interactive experience is achieved, enhancing the fidelity and nature of the virtual scene.
Patent Information
- Application Number
- CN202510550745.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-07-01
AI Technical Summary
In the existing virtual interaction technology, the interaction process between virtual characters and virtual environments cannot reflect biomechanical characteristics, resulting in unreal user experience and insufficient immersion, and manual operation is inefficient and poor results.
By obtaining the target state of the virtual object, calculating the target displacement and hardness of the muscle vertex corresponding to its bones, using nonlinear coefficients, velocity and acceleration influence values, etc., the changes in muscle hardness are dynamically simulated, and combined with optical motion capture technology calibration, the dynamic simulation and presentation of muscle hardness is achieved.
It significantly improves the realism and delicateness of the character's actions in the virtual scene, making the action performance of the virtual characters more in line with the laws of biomechanics, and enhances the immersion and fidelity.
Smart Images

Figure CN120227648A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of virtual technology, and more specifically, to a method and device for controlling virtual objects, related devices, and computer program products. Background Art
[0002] In today's virtual interaction field, users' requirements for the interaction experience between virtual characters and virtual environments are increasing day by day. Taking VR games as an example, most VR games enable the characters controlled by players to interact with objects in the game world, but the interaction process is not delicate enough to reflect biomechanical characteristics, such as details like muscle hardening, and cannot allow players to truly immerse themselves and feel an immersive experience, thus failing to meet players' demands for realism and immersion. To enhance users' virtual interaction experience, staff need to spend a lot of time and effort to achieve force interaction effects through manual operations, but this is not only inefficient but also difficult to ensure the naturalness and authenticity of the interaction effects, and it is easy to have situations where the interaction effects are inconsistent or do not conform to physical laws, thereby affecting users' experience. Summary of the Invention
[0003] In view of the above problems, the present application proposes a method and device for controlling virtual objects, related devices, and computer program products to improve the authenticity of the interaction between virtual characters and virtual environments. The specific solutions are as follows:
[0004] In a first aspect, a method for controlling a virtual object is provided, including:
[0005] Obtain the target state of the virtual object;
[0006] Determine the target displacement of the muscle vertices corresponding to the bones of the virtual object according to the target state, where the target displacement is the shortest distance from the muscle vertices to the bones when the virtual object is in the target state;
[0007] Determine the target muscle vertex hardness corresponding to the muscle vertices according to the target displacement, where the target muscle vertex hardness is used to characterize the muscle hardness of the target muscle area corresponding to the muscle vertices.
[0008] In a possible design, in another implementation manner of the first aspect of the embodiments of the present application, the process of determining the target muscle vertex hardness corresponding to the muscle vertices according to the target displacement includes:
[0009] Obtain the initial muscle vertex hardness and the initial displacement of the bones in the initial state, where the initial muscle vertex hardness is used to characterize the muscle hardness of the target muscle area corresponding to the muscle vertices when the virtual object is in the initial state, and the initial displacement is the shortest distance from the muscle vertices to the bones when the virtual object is in the initial state;
[0010] Determine the target muscle vertex hardness corresponding to the muscle vertex according to the target displacement, the initial muscle vertex hardness, the initial displacement, and the configured displacement nonlinear coefficient, where the displacement nonlinear coefficient is used to quantify the change rate of the target muscle vertex hardness with respect to the ratio of the target displacement to the initial displacement.
[0011] In a possible design, in another implementation manner of the first aspect of the embodiments of the present application, the process of determining the target muscle vertex hardness corresponding to the muscle vertex according to the target displacement includes:
[0012] Obtain the movement speed and movement acceleration of the virtual object in the target state, and obtain the initial muscle vertex hardness and initial displacement of the bone in the initial state. The initial muscle vertex hardness is used to characterize the muscle hardness of the target muscle region corresponding to the muscle vertex when the virtual object is in the initial state, and the initial displacement is the shortest distance from the muscle vertex to the bone when the virtual object is in the initial state;
[0013] Determine the target muscle vertex hardness corresponding to the muscle vertex according to the movement speed, the movement acceleration, the target displacement, the initial muscle vertex hardness, the initial displacement, the configured displacement nonlinear coefficient, the configured speed influence value, and the configured acceleration influence value. The displacement nonlinear coefficient is used to quantify the change rate of the target muscle vertex hardness with respect to the ratio of the target displacement to the initial displacement, the speed influence value is used to quantify the change rate of the target muscle vertex hardness with respect to the movement speed, and the acceleration influence value is used to quantify the change rate of the target muscle vertex hardness with respect to the movement acceleration.
[0014] In a possible design, in another implementation manner of the first aspect of the embodiments of the present application, the process of determining the target displacement of the muscle vertex corresponding to the bone of the virtual object according to the target state includes:
[0015] Obtain the rotation angle of the bone when the virtual object is in the target state, and obtain the initial displacement of the bone in the initial state. The initial displacement is the shortest distance from the muscle vertex to the bone when the virtual object is in the initial state;
[0016] Determine the target displacement of the muscle vertex corresponding to the bone according to the rotation angle, the configured deformation coefficient, and the initial displacement. The target displacement is proportional to the rotation angle, and the deformation coefficient is used to quantify the change rate of the target displacement with respect to the rotation angle.
[0017] In a possible design, in another implementation manner of the first aspect of the embodiments of the present application, it further includes:
[0018] Calibrate the displacement nonlinear coefficient, the velocity influence value, and the acceleration influence value by using optical motion capture technology.
[0019] In a possible design, in another implementation manner of the first aspect of the embodiments of the present application, before obtaining the target state of the virtual object corresponding to the user, it further includes:
[0020] In response to a drawing instruction for the muscle area of the virtual object, draw the muscle area for the virtual object, and calibrate the initial muscle vertex hardness of each muscle vertex of the muscle area.
[0021] In a second aspect, a control device for a virtual object is provided, including:
[0022] A target state acquisition unit, configured to acquire the target state of the virtual object;
[0023] A target displacement determination unit, configured to determine the target displacement of the muscle vertex corresponding to the bone of the virtual object according to the target state, where the target displacement is the shortest distance from the muscle vertex to the bone when the virtual object is in the target state;
[0024] A vertex hardness determination unit, configured to determine the target muscle vertex hardness corresponding to the muscle vertex according to the target displacement, where the target muscle vertex hardness is used to characterize the muscle hardness of the target muscle area corresponding to the muscle vertex.
[0025] In a third aspect, an electronic device is provided, including: a memory and a processor;
[0026] The memory is configured to store a program;
[0027] The processor is configured to execute the program to implement each step of the control method for the virtual object described in any one of the foregoing first aspects of the present application.
[0028] In a fourth aspect, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, each step of the control method for the virtual object described in any one of the foregoing first aspects of the present application is implemented.
[0029] In a fifth aspect, a computer program product is provided, including a computer program. When the computer program is executed by a processor, each step of the control method for the virtual object described in any one of the foregoing first aspects of the present application is implemented.
[0030] With the above technical solution, a control method for a virtual object proposed by this application can achieve dynamic simulation and presentation of the muscle hardness of a virtual character, significantly improving the realism and fineness of the character's actions in a virtual scene. By obtaining the target state of the virtual object corresponding to the user, and then determining the target displacement of the muscle vertices corresponding to the bones of the virtual object according to the target state, the target displacement reflects the deformation degree of the muscle under a specific action. Based on this target displacement, the target muscle vertex hardness corresponding to the muscle vertex is further calculated to characterize the muscle hardness of the target muscle area. It not only breaks through the limitation of the fixed muscle hardness in traditional virtual character interactions, but also makes the action performance of the virtual character more in line with biomechanical laws, enhancing the immersion and vividness of the virtual scene. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of this application. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0032] Figure 1 It is a schematic flowchart of a control method for a virtual object provided by an embodiment of this application;
[0033] Figure 2 It is a schematic diagram of the bones and muscle vertices of a virtual object provided by an embodiment of this application;
[0034] Figure 3 It is a schematic diagram of the displacement change between the muscle vertices and the bones of a virtual object in the initial state and the target state provided by an embodiment of this application;
[0035] Figure 4 It is a schematic diagram of a person wearing an optical motion capture suit provided by an embodiment of this application;
[0036] Figure 5 It is a schematic diagram of optical motion capture calibration provided by an embodiment of this application;
[0037] Figure 6 It is a partial schematic diagram of hardness annotation of the calf area provided by an embodiment of this application;
[0038] Figure 7 It is a schematic structural diagram of a control device for a virtual object provided by an embodiment of this application;
[0039] Figure 8 It is a schematic structural diagram of an electronic device provided by an embodiment of this application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0040] Before introducing the solution of this application, some technical terms involved in the embodiments of this application are first explained and described:
[0041] Skin binding to bones: Skin binding to bones is applied to 3D animation and virtual character production. It connects the character model (skin) with the bone system, enabling the model to deform naturally as the bones move. During the production process, the bones are designed to be flexible structures, and different parts of the model are assigned to different bones according to their relative positions and functions with respect to the bones. Skin binding can ensure that the character exhibits natural and smooth movements when moving, enabling it to perform various complex actions in the virtual world.
[0042] The embodiments of this application are described below with reference to the accompanying drawings in the embodiments of this application. The terms used in the embodiments of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.
[0043] The terms "first", "second", etc. in the specification of this application are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances, which is only a way of distinction used when describing objects with the same attributes in the embodiments of this application. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, so that a process, method, system, product or device including a series of units does not have to be limited to those units, but may include other units not clearly listed or inherent to these processes, methods, products or devices.
[0044] This application can be applied in the field of virtual interaction technology. Taking virtual reality game development as an example, the application scenario of this application is introduced below. In virtual reality games, when a virtual character performs high-intensity actions such as running, jumping, or fighting, not only does the muscle produce displacement and deformation, but its hardness also changes accordingly. The change in muscle hardness can affect the defense value and attack value of the character, adding more realistic physical feedback and strategy to the game. For example, in melee combat, when the virtual character punches, the muscle hardens and the attack value increases; while in the defensive state, the muscle is tense and the defense value also increases accordingly. In addition, the change in muscle hardness can also affect the interaction between the character and the virtual environment. For example, when climbing or carrying heavy objects, the increase in muscle hardness can improve the character's load-bearing capacity and climbing efficiency.
[0045] In order to further bring a richer and more realistic virtual experience to players, this application can dynamically simulate the change in muscle hardness of virtual characters by simulating biomechanical characteristics and closely associate it with the actions and interaction effects of the characters, bringing a richer and more realistic virtual experience to players.
[0046] The solution of this application can be implemented based on a terminal with data processing capabilities, and the terminal can be a mobile phone, a computer, a server, etc.
[0047] Next, refer to Figure 1 , Figure 1 which is a schematic flowchart of a method for controlling a virtual object provided by an embodiment of this application. The method for controlling the virtual object of this application can be implemented through a control system of the virtual object deployed on the terminal. As described below, it specifically includes the following steps:
[0048] Step S100: Obtain the target state of the virtual object.
[0049] Specifically, to obtain the target state of the virtual object, the target state can be the form, position, posture, or other attributes that the virtual object is expected to present in the virtual scene. Obtaining the target state provides a basis for subsequent steps.
[0050] Step S110: Determine the target displacement of the muscle vertices corresponding to the bones of the virtual object according to the target state.
[0051] Specifically, to determine the target displacement of the muscle vertices corresponding to the bones of the virtual object according to the target state, the target displacement can be the shortest distance from the muscle vertices to the bones when the virtual object is in the target state. The target displacement can be the positional relationship between the muscle vertices and the bones when the virtual character presents an action or posture in the target state. Refer to Figure 2 , Figure 2 which is a schematic diagram of the bones and muscle vertices of a virtual object provided by an embodiment of this application. Figure 2 shows the bone structure of a virtual character and the distribution of muscle vertices.
[0052] When the virtual character is in the target state, the shape and position of its muscles can change accordingly with the change of the action. At this time, the position of the muscle vertices relative to the bones in this state can be determined by calculation, that is, the target displacement. The target displacement reflects the shortest distance between the muscle vertices and the bones in the target state, and the target displacement can be comprehensively determined based on factors such as the bone structure, muscle distribution, and action posture of the virtual character. By determining the target displacement, a basis can be provided for the subsequent calculation of the hardness of the target muscle vertices, thereby realizing the simulation and control of the change of the muscle hardness of the virtual character.
[0053] Step S120: Determine the target muscle vertex hardness corresponding to the muscle vertices according to the target displacement.
[0054] Specifically, the target muscle vertex hardness corresponding to the muscle vertex is determined according to the target displacement. The target muscle vertex hardness is used to characterize the muscle hardness of the target muscle area corresponding to the muscle vertex. When the virtual character is in the target state, the position of the muscle vertex will change, and the change in the position of the muscle vertex will affect the hardness of the muscle vertex. By calculating the target displacement, the hardness of the muscle vertex in this action or posture can be obtained, and the muscle vertex hardness can reflect the actual hardness of the corresponding muscle area in the target state.
[0055] A control method for a virtual object proposed in this embodiment can realize the dynamic simulation and rendering of the muscle hardness of a virtual character, significantly improving the realism and fineness of the character's actions in the virtual scene. By obtaining the target state of the virtual object corresponding to the user, and then determining the target displacement of the muscle vertex corresponding to the skeleton of the virtual object according to the target state, the target displacement reflects the deformation degree of the muscle under a specific action. Based on this target displacement, the target muscle vertex hardness corresponding to the muscle vertex is further calculated to characterize the muscle hardness of the target muscle area. It not only breaks through the limitation of the fixed muscle hardness in traditional virtual character interaction, but also makes the action performance of the virtual character more in line with the biomechanical law, enhancing the immersion and realism of the virtual scene.
[0056] An optional way is to change the initial state of the virtual object to the target state according to the user's action instruction, voice instruction or keyboard input, etc. For example, when the user issues an instruction through body movements in the virtual environment, such as making gestures of grasping, pushing and pulling in a virtual reality (VR) scene, these actions can be captured in real time and converted into the target state of the virtual object, so that the virtual object can perform corresponding grasping actions or move positions. Similarly, when the user inputs specific commands or operations through the keyboard, such as inputting parameters or pressing shortcut keys in 3D modeling software, the system will adjust the attributes or positions of the virtual object according to these inputs to determine the new target state of the virtual object.
[0057] In some embodiments of the present application, the target displacement of the muscle vertex can also be determined by the rotation angle of the skeleton. The following will introduce this part of the content in detail.
[0058] An optional way is that during the process of determining the target displacement of the muscle vertices corresponding to the bones of the virtual object, first, the rotation angle of the bone when the virtual object is in the target state can be obtained. The rotation angle reflects the degree of rotation of the bone relative to the initial state. At the same time, the initial displacement of the bone in the initial state also needs to be obtained, that is, when the virtual object is in the initial state, the shortest distance from the muscle vertex to the bone. Then, based on the rotation angle, the configured deformation coefficient, and the initial displacement, the target displacement of the muscle vertices corresponding to the bone is determined. The target displacement is proportional to the rotation angle, that is, when the rotation angle of the bone increases, the displacement of the muscle vertex will also increase accordingly. See Figure 3 , Figure 3 which is a schematic diagram of the displacement change between the muscle vertices and the bones of a virtual object in the initial state and the target state provided by an embodiment of the present application. In the initial state on the left side of the figure, the muscle vertex is located above the bone joint, and the bone joint is represented by A and B in the figure, which constitute a part of the bone. The initial displacement is the shortest distance from the muscle vertex to the bone joint, reflecting the position of the muscle vertex in the static or initial state. In the target state on the right side of the figure, as the bone joints A and B move or rotate, the muscle vertex also undergoes a corresponding displacement, that is, the target displacement. The target displacement is the muscle deformation caused by the bone movement.
[0059] An optional way is that the target displacement of the muscle vertex can be determined according to the configured first muscle hardness formula, the rotation angle, the configured deformation coefficient, and the initial displacement. That is, first, the rotation angle of the bone when the virtual object is in the target state needs to be obtained , and at the same time, the initial displacement of the bone in the initial state also needs to be obtained , that is, when the virtual object is in the initial state, the shortest distance from the muscle vertex to the center point of the bone. The target displacement can be determined through the following relationship: , is the configured deformation coefficient, which is used to quantify the change rate of the target displacement with the rotation angle . The deformation coefficient reflects the displacement change amount of the muscle vertex under a unit rotation angle, that is, for each additional unit of rotation angle, the displacement of the muscle vertex will increase by
[0060] units.
[0061] Furthermore, in some embodiments of the present application, the target muscle vertex hardness can also be determined according to the target displacement of the muscle vertex. The following is a detailed introduction to this part of the content.
[0062] An optional method is to first obtain the initial muscle vertex hardness and the initial displacement of the bone in the initial state. The initial state can refer to the virtual character being in a standard static pose (such as A-POSE). At this time, the initial muscle vertex hardness is used to characterize the muscle hardness of the target muscle area corresponding to the muscle vertex when the virtual object is in the initial state. The initial muscle vertex hardness can be measured through experiments or custom-set according to the characteristics of the character (such as Superman or ordinary people). The initial displacement refers to the shortest distance from the muscle vertex to the bone when the virtual object is in the initial state. In three-dimensional space, the shortest distance can be obtained by calculating the Euclidean distance between the muscle vertex and the center point of the bone.
[0063] Next, the target muscle vertex hardness corresponding to the muscle vertex is determined according to the target displacement, the initial muscle vertex hardness, the initial displacement, and the configured displacement non-linear coefficient. The displacement non-linear coefficient is used to quantify the change rate of the target muscle vertex hardness with respect to the ratio of the target displacement to the initial displacement. The non-linear relationship reflects the complexity of the hardness change of biological soft tissues (such as muscles) when subjected to external forces, that is, the hardness does not simply have a linear relationship with the displacement, but shows a non-linear hardening characteristic as the displacement changes. By introducing the displacement non-linear coefficient, the hardness change of the muscle in different motion states can be more realistically simulated.
[0064] In the specific calculation process, the following formula can be used to determine the target muscle vertex hardness:
[0065] ;
[0066] where, represents the target muscle vertex hardness, is the initial muscle vertex hardness, is the target displacement, is the initial displacement, is the displacement non-linear coefficient. Through this formula, the hardness and displacement relationship in the initial state can be mapped to the hardness and displacement relationship in the target state, thereby realizing the dynamic simulation of the muscle vertex hardness.
[0067] In this embodiment, a displacement non - linear coefficient is introduced to quantify the change rate of the hardness of the target muscle vertex, so as to reflect the complex non - linear characteristics of the change in the hardness of biological soft tissues, abandon the simple linear relationship, and more realistically simulate the change in muscle hardness. Combined with a specific formula, the relationship between hardness and displacement in the initial and target states can be accurately mapped, realizing the dynamic simulation of the hardness of the muscle vertex, greatly improving the realism and accuracy of the muscle performance of virtual characters, bringing better effects to fields such as virtual simulation, animation production, and game development, and enhancing the immersive experience of users.
[0068] Furthermore, in some embodiments of the present application, the hardness of the target muscle vertex can also be calculated through the target displacement, movement speed, and movement acceleration. The following will introduce this part of the content in detail.
[0069] An optional method. In order to accurately simulate the hardness of the muscle vertex of a virtual character, not only static displacement changes can be considered, but also dynamic motion characteristics can be combined to achieve a comprehensive simulation of muscle hardness. The specific steps are as follows:
[0070] First, the movement speed and movement acceleration of the virtual object in the target state can be obtained, which reflect the instantaneous state of the virtual character during the movement process. For example, when the character is running fast or suddenly stops, the hardness of the muscle will change due to inertial forces and dynamic stresses. The movement speed and movement acceleration of the virtual character in the target state can be measured through motion capture technology or other sensor devices.
[0071] Secondly, obtain the initial muscle vertex hardness and initial displacement of the bone in the initial state. The initial state can refer to the virtual character being in a static pose. The initial muscle vertex hardness at this time is used to characterize the muscle hardness of the target muscle area corresponding to the muscle vertex of the virtual object in the initial state. And the initial displacement refers to the shortest distance from the muscle vertex to the bone when the virtual object is in the initial state.
[0072] Next, based on the movement speed, movement acceleration, target displacement, initial muscle vertex hardness, initial displacement, configured displacement non-linear coefficient, configured speed influence value, and configured acceleration influence value, the target muscle vertex hardness corresponding to the muscle vertex is determined. Among them, the displacement non-linear coefficient is used to quantify the rate of change of the target muscle vertex hardness with respect to the ratio of the target displacement to the initial displacement. The speed influence value can be used to quantify the rate of change of the target muscle vertex hardness with respect to the movement speed. According to the mechanical properties of viscoelastic materials, the faster the movement speed, the greater the frictional resistance of the molecular chains inside the muscle may be, resulting in an increase in hardness. By introducing the speed influence value, this dynamic hardening effect can be simulated, making the change in muscle hardness more in line with physical laws. The acceleration influence value can be used to quantify the rate of change of the target muscle vertex hardness with respect to the movement acceleration. According to Newton's second law, acceleration causes inertial stress, increasing the resistance inside the muscle. For example, in the case of rapid acceleration or deceleration, the muscle will tense up due to inertia and the hardness will increase. By introducing the acceleration influence value, the dynamic change in muscle hardness can be further refined to make it closer to the real human movement characteristics.
[0073] In the specific calculation process, the following formula can be used for calculation:
[0074] ;
[0075] Where: represents the target muscle vertex hardness, is the initial muscle vertex hardness, is the target displacement, is the initial displacement, is the displacement non-linear coefficient, used to quantify the rate of change of the target muscle vertex hardness with respect to the ratio of the target displacement to the initial displacement, is the movement speed, is the speed influence value, used to quantify the rate of change of the target muscle vertex hardness with respect to the movement speed, is the movement acceleration, is the acceleration influence value, used to quantify the rate of change of the target muscle vertex hardness with respect to the movement acceleration.
[0076] In this embodiment, by combining the target displacement, movement speed, and movement acceleration to calculate the target muscle vertex hardness, the accurate simulation of the muscle characteristics of the virtual character in multiple dimensions is realized. It breaks through the simple consideration of static displacement, incorporates dynamic characteristics such as movement speed and acceleration, and reflects the instant state changes during the movement of the virtual character. And with the help of a specific formula, multiple factors are comprehensively considered to achieve the accurate calculation of the muscle vertex hardness, making the muscle performance of the virtual character approach the real human movement characteristics, significantly improving the realism and credibility of the character performance in the virtual scene, and bringing a more vivid and immersive experience to users.
[0077] In some embodiments of the present application, in order to further improve the accuracy of simulation, vertex displacement data in real human motion can also be obtained through optical motion capture technology and compared with the hardness values predicted by the hardness model for calibration. The following provides a detailed introduction to this part of the content.
[0078] Optical Motion Capture technology is abbreviated as optical motion capture technology. Optical motion capture technology records the body movements of the wearer by capturing the position changes of reflective markers on the clothing. The markers can be on the main joints and limb parts of the human body, such as the head, spine, shoulders, elbows, wrists, hips, knees, and ankles, etc., to ensure that detailed movements of the whole body can be captured. Refer to Figure 4 , Figure 4 which is a schematic diagram of a person wearing an optical motion capture suit provided by an embodiment of the present application, Figure 4 and the white dots in
[0079] are the reflective markers of the capture clothing. Figure 5 , Figure 5 Refer to
[0080] which is a schematic diagram of optical motion capture calibration provided by an embodiment of the present application. First, the rotation angle of the bone is obtained. Then, the target displacement is calculated based on the rotation angle of the bone, that is, the expected position change of the muscle vertex under a specific action. To ensure the accuracy of the calculation results, an optical motion capture calibration step is introduced. The actual target displacement is obtained through optical motion capture technology, that is, the actual target displacement of the muscle vertex is obtained by capturing the movements of a real human body or a model. The actual target displacement is compared with the calculated target displacement. Finally, the hardness model is updated according to the calibration results, so that the muscle hardness of the virtual character can more realistically reflect the biomechanical characteristics under different actions and postures. The hardness model can be a formula for calculating the muscle vertex hardness of a virtual object.
[0081] Calibration of the deformation coefficient : By setting markers corresponding to the muscle vertices of the virtual model on the motion capture suit, the displacement of the skin surface during movement can be captured. The data of the markers are used to measure the target displacement from the vertex to the center point of the bone in actual motion . By comparing the target displacement predicted by the model with the actually captured displacement, the deformation coefficient can be calibrated. The deformation coefficient reflects the rate of distance change caused by a unit rotation angle .
[0082] Displacement non - linear coefficient Calibration: By capturing the muscle vertex stiffness at different bone rotation angles and comparing it with the predicted target muscle vertex stiffness, the displacement non - linear coefficient can be calibrated .
[0083] Velocity influence value Calibration: By capturing the time series of vertex displacements , the movement speed can be calculated . Combining the force sensor data, the velocity influence value can be calibrated , and the velocity influence value reflects the visco - elastic enhancement effect of velocity on stiffness.
[0084] Acceleration influence value Calibration: By calculating the second - order derivative of the captured muscle vertex displacements, the acceleration can be obtained . Combining the inertial measurement unit (IMU) data, the acceleration influence value can be calibrated , and the acceleration influence value reflects the increase in stiffness caused by the muscle being tensed due to inertia during rapid acceleration.
[0085] An alternative method: When it is restricted by conditions and it is impossible to calibrate the marker points equivalent to the virtual model vertices for the motion capture suit, another method can be adopted for calibration. That is, calibration based on the human muscle map. First, group the human muscle groups. The muscle regions can be drawn on the virtual model using methods such as the mask technique. Subsequently, mark the center points of each group of muscles. The muscle can be approximated as an elastic rod, assuming that the stretching and contraction of the muscle follow the elastic mechanics principles such as Hooke's law. Hooke's law states that within the elastic limit, the deformation of a material is proportional to the force applied. According to the mechanical equation of the elastic rod, the strain and displacement generated at different positions of the muscle due to overall stretching and contraction can be calculated.
[0086] The calibration in this embodiment can ensure that the muscle vertex stiffness model of the virtual character more accurately reflects the physical characteristics of real human muscles. This multi - dimensional calibration method not only improves the accuracy of the model but also enhances the realism and immersion of the virtual character animation.
[0087] Furthermore, in some embodiments of the present application, before obtaining the target state of the virtual object corresponding to the user, the muscle region of the virtual object can also be drawn first. The following provides a detailed introduction to this part of the content.
[0088] An optional way is that, first, in response to a drawing instruction for the muscle area of the virtual object, a drawing tool can be used to draw the muscle area on the virtual object. Among them, the mask technology or other drawing tools can be used to draw the muscle area on the virtual object. The muscle area can be divided based on the anatomical knowledge of the human muscle structure to ensure that each muscle group is identified and distinguished. The muscle area can also be divided by means such as weights. Optionally, the weights of the bone area, joint area, and tendon area can be set to 1, and the weight of the muscle area can be set within the range of 0 to 1. The areas with a weight of 1 (bone area, joint area, and tendon area) are set to white. Refer to Figure 6 , Figure 6 which is a partial schematic diagram of the hardness annotation of the calf area provided by the embodiment of the present application. Figure 6 In the figure, the bone area, joint area, and tendon area of the calf part are set to white. At the same time, the initial muscle vertex hardness of each muscle vertex in the muscle area is calibrated. The initial muscle vertex hardness can be determined by experimental measurement or custom setting. For example, it can be determined according to the characteristics of the character (such as the muscle hardness of Superman or an ordinary person).
[0089] In addition, the tendon area can also be drawn on the virtual object. Tendons are connective tissue fiber cords at the ends of muscles, through which muscles attach to bones or other structures. They are tougher and smaller in volume than muscles and are mainly composed of parallel bundles of collagen fibers and have no contraction ability. After calibrating the tendon area on the virtual character, the hardness of the area where the tendon is located can be separated separately and set to a fixed value. For example, the default value is 1, indicating that the hardness will not change.
[0090] In this embodiment, by drawing the muscle area and tendon area and calibrating their initial hardness values, it provides a basis for subsequent vertex hardness change calculation and model dynamic simulation.
[0091] Next, the control device of the virtual object provided by the embodiment of the present application will be described. The control device of the virtual object described below can be mutually corresponding and referred to with the control method of the virtual object described above.
[0092] Refer to Figure 7 , Figure 7 which is a schematic structural diagram of a control device of a virtual object provided by the embodiment of the present application.
[0093] As Figure 7 shown, the device may include:
[0094] A target state acquisition unit 11, configured to acquire the target state of the virtual object;
[0095] A target displacement determination unit 12, configured to determine a target displacement of a muscle vertex corresponding to a bone of the virtual object according to the target state, where the target displacement is the shortest distance from the muscle vertex to the bone when the virtual object is in the target state;
[0096] A vertex hardness determination unit 13, configured to determine a target muscle vertex hardness corresponding to the muscle vertex according to the target displacement, where the target muscle vertex hardness is used to characterize the muscle hardness of a target muscle area corresponding to the muscle vertex.
[0097] A possible implementation manner, the process by which the vertex hardness determination unit 13 determines the target muscle vertex hardness corresponding to the muscle vertex according to the target displacement includes:
[0098] Obtain an initial muscle vertex hardness and an initial displacement of the bone in an initial state, where the initial muscle vertex hardness is used to characterize the muscle hardness of a target muscle area corresponding to the muscle vertex when the virtual object is in the initial state, and the initial displacement is the shortest distance from the muscle vertex to the bone when the virtual object is in the initial state;
[0099] Determine the target muscle vertex hardness corresponding to the muscle vertex according to the target displacement, the initial muscle vertex hardness, the initial displacement, and a configured displacement non - linear coefficient, where the displacement non - linear coefficient is used to quantify the change rate of the target muscle vertex hardness with respect to the ratio of the target displacement to the initial displacement.
[0100] A possible implementation manner, the process by which the vertex hardness determination unit 13 determines the target muscle vertex hardness corresponding to the muscle vertex according to the target displacement includes:
[0101] Obtain the movement speed and movement acceleration of the virtual object when it is in the target state, and obtain the initial muscle vertex hardness and the initial displacement of the bone in the initial state, where the initial muscle vertex hardness is used to characterize the muscle hardness of a target muscle area corresponding to the muscle vertex when the virtual object is in the initial state, and the initial displacement is the shortest distance from the muscle vertex to the bone when the virtual object is in the initial state;
[0102] Determine the target muscle vertex hardness corresponding to the muscle vertex according to the movement speed, the movement acceleration, the target displacement, the initial muscle vertex hardness, the initial displacement, the configured displacement non-linear coefficient, the configured speed influence value, and the configured acceleration influence value. The displacement non-linear coefficient is used to quantify the change rate of the target muscle vertex hardness with respect to the ratio of the target displacement to the initial displacement. The speed influence value is used to quantify the change rate of the target muscle vertex hardness with respect to the movement speed. The acceleration influence value is used to quantify the change rate of the target muscle vertex hardness with respect to the movement acceleration.
[0103] A possible implementation manner. The process of the target displacement determination unit 12 determining the target displacement of the muscle vertex corresponding to the bone of the virtual object according to the target state includes:
[0104] Obtain the rotation angle of the bone when the virtual object is in the target state, and obtain the initial displacement of the bone in the initial state. The initial displacement is the shortest distance from the muscle vertex to the bone when the virtual object is in the initial state.
[0105] Determine the target displacement of the muscle vertex corresponding to the bone according to the rotation angle, the configured deformation coefficient, and the initial displacement. The target displacement is proportional to the rotation angle. The deformation coefficient is used to quantify the change rate of the target displacement with respect to the rotation angle.
[0106] A possible implementation manner. A control device for a virtual object according to an embodiment of the present application further includes:
[0107] A numerical calibration unit, configured to calibrate the displacement non-linear coefficient, the speed influence value, and the acceleration influence value by using an optical motion capture technology.
[0108] A possible implementation manner. A control device for a virtual object according to an embodiment of the present application further includes:
[0109] A muscle region drawing unit, configured to, before the target state acquisition unit 11 processes, in response to a drawing instruction for the muscle region of the virtual object, draw the muscle region for the virtual object, and calibrate the initial muscle vertex hardness of each muscle vertex of the muscle region.
[0110] An electronic device is further provided in an embodiment of the present application. Refer to Figure 8 As shown, it shows a schematic structural diagram of an electronic device suitable for implementing the electronic device in an embodiment of the present application. The electronic device in an embodiment of the present application may include, but is not limited to, fixed terminals such as mobile phones, tablet computers, wearable devices, and the like. Figure 8The electronic device shown is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.
[0111] As Figure 8 shown, the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage device 608 into the random access memory (RAM) 603, so as to implement the control method of the virtual object in the foregoing embodiments of the present application. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.
[0112] Generally, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 can allow the electronic device to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 8 an electronic device with various devices is shown, it should be understood that it is not required to implement or include all the shown devices. Instead, more or fewer devices may be implemented or included.
[0113] In the embodiments of the present application, a computer-readable storage medium is further provided. The storage medium carries one or more computer programs, and when the one or more computer programs are executed by the electronic device, the electronic device can implement the control method of the virtual object in the foregoing embodiments of the present application.
[0114] In the embodiments of the present application, a computer program product is further provided. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are fully or partially generated.
[0115] In addition, it should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the attached drawings of the device embodiments provided in this application, the connection relationships between the modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines.
[0116] Through the description of the above embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by dedicated hardware including application-specific integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. Generally, functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits or dedicated circuits. However, in more cases, software program implementation is a better implementation method for this application. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk or optical disc of a computer, and includes several instructions to enable a computer device (which can be a personal computer, training device, or network device, etc.) to execute the methods described in various embodiments of this application.
[0117] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product.
[0118] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from a website, a computer, a training device, or a data center to another website, a computer, a training device, or a data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a training device or a data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0119] In the embodiments of the present application, terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0120] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present application. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.
[0121] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
Claims
1. A method for controlling a virtual object, characterized in that: include: Get the target state of the virtual object; Determine a target displacement of a muscle vertex corresponding to the skeleton of the virtual object according to the target state, wherein the target displacement is the shortest distance from the muscle vertex to the skeleton when the virtual object is in the target state; The target muscle vertex hardness corresponding to the muscle vertex is determined according to the target displacement, and the target muscle vertex hardness is used to characterize the muscle hardness of the target muscle area corresponding to the muscle vertex.
2. The method according to claim 1, characterized in that The process of determining the target muscle vertex hardness corresponding to the muscle vertex according to the target displacement includes: Acquire the initial muscle vertex hardness and initial displacement of the skeleton in the initial state, wherein the initial muscle vertex hardness is used to characterize the muscle hardness of the target muscle area corresponding to the muscle vertex of the virtual object in the initial state, and the initial displacement is the shortest distance from the muscle vertex to the skeleton of the virtual object in the initial state; The target muscle vertex hardness corresponding to the muscle vertex is determined according to the target displacement, the initial muscle vertex hardness, the initial displacement, and a configured displacement nonlinear coefficient, wherein the displacement nonlinear coefficient is used to quantify the rate of change of the target muscle vertex hardness with the ratio of the target displacement to the initial displacement.
3. The method according to claim 1, characterized in that The process of determining the target muscle vertex hardness corresponding to the muscle vertex according to the target displacement includes: Acquire the movement speed and movement acceleration of the virtual object when it is in the target state, and acquire the initial muscle vertex hardness and initial displacement of the skeleton in the initial state, wherein the initial muscle vertex hardness is used to characterize the muscle hardness of the target muscle area corresponding to the muscle vertex of the virtual object in the initial state, and the initial displacement is the shortest distance from the muscle vertex to the skeleton of the virtual object in the initial state; The target muscle vertex hardness corresponding to the muscle vertex is determined according to the movement speed, the movement acceleration, the target displacement, the initial muscle vertex hardness, the initial displacement, the configured displacement nonlinear coefficient, the configured speed influence value, and the configured acceleration influence value. The displacement nonlinear coefficient is used to quantify the rate of change of the target muscle vertex hardness with the ratio of the target displacement to the initial displacement, the speed influence value is used to quantify the rate of change of the target muscle vertex hardness with the movement speed, and the acceleration influence value is used to quantify the rate of change of the target muscle vertex hardness with the movement acceleration.
4. The method according to claim 1, characterized in that The process of determining the target displacement of the muscle vertices corresponding to the skeleton of the virtual object according to the target state includes: Acquire the rotation angle of the bone when the virtual object is in the target state, and acquire the initial displacement of the bone in the initial state, wherein the initial displacement is the shortest distance from the muscle vertex to the bone when the virtual object is in the initial state; The target displacement of the muscle vertex corresponding to the bone is determined according to the rotation angle, the configured deformation coefficient and the initial displacement, wherein the target displacement is proportional to the rotation angle, and the deformation coefficient is used to quantify the rate of change of the target displacement with the rotation angle.
5. The method according to claim 3, characterized in that: Also includes: The optical motion capture technology is used to calibrate the displacement nonlinear coefficient, the velocity influence value and the acceleration influence value.
6. The method according to any one of claims 1 to 5, characterized in that Before obtaining the target state of the virtual object corresponding to the user, it also includes: In response to a drawing instruction for a muscle region of the virtual object, the muscle region is drawn for the virtual object, and initial muscle vertex hardness of each muscle vertex of the muscle region is calibrated.
7. A control device for a virtual object, characterized in that: include: A target state acquisition unit, used to acquire a target state of a virtual object; A target displacement determination unit, configured to determine a target displacement of a muscle vertex corresponding to the skeleton of the virtual object according to the target state, wherein the target displacement is the shortest distance from the muscle vertex to the skeleton of the virtual object when the virtual object is in the target state; The vertex hardness determination unit is used to determine the target muscle vertex hardness corresponding to the muscle vertex according to the target displacement, and the target muscle vertex hardness is used to characterize the muscle hardness of the target muscle area corresponding to the muscle vertex.
8. An electronic device, characterized in that: include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the virtual object control method according to any one of claims 1 to 6.
9. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the method for controlling a virtual object according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, each step of the method for controlling a virtual object according to any one of claims 1 to 6 is implemented.