A mode switching method, system, device and storage medium for making skeletal animation
By using the switching between absolute displacement mode and reverse dynamic mode in skeletal animation production, the motion path is calculated using the constraint relationship between skeletal nodes, the problem of inefficient skeletal animation production in the existing technology is solved, and efficient and realistic skeletal animation production is achieved.
Patent Information
- Application Number
- CN202110285903.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-17
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2041-03-17
AI Technical Summary
In the prior art, when creating skeleton animations, multiple bone nodes need to be adjusted, which is inefficient, especially when creating complex skeleton animations, the process is cumbersome and difficult to achieve ideal results.
Provide a mode switching method, which adds anchor position to the bone node through absolute displacement mode and switches to the reverse dynamic mode, and calculates the motion path of other bones by using the constraint relationship between the bone nodes to achieve efficient production of skeleton animation.
Through the mode switching method, users can easily create complex skeleton animations, improve the efficiency of skeleton animation production, and be able to perform motion simulation to create more realistic skeleton animations, improving the user experience.
Smart Images

Figure CN113034650B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of animation production technology, and in particular to a mode switching method, system, device and storage medium for producing skeletal animation. Background Art
[0002] With the continuous development of the animation production industry, animation production technology has been widely used in film production, education, medical and other fields. Animation production technology plays a vital role in modern life.
[0003] Skeletal animation is a type of animation. In skeletal animation, the model has a skeleton structure composed of interconnected bones, and skeletal animation is created by changing the orientation and position of the bones.
[0004] In the solution provided by the prior art, in the process of making skeletal animation, when a certain skeletal node needs to be moved, the position of the skeletal node is generally adjusted directly, and then the skeletal animation is obtained by interpolation calculation. However, when there are multiple skeletal nodes, the position of each skeletal node needs to be adjusted, which is inefficient. Especially when some complex skeletal animations need to be made, when this method is used to make skeletal animations, the process is very cumbersome, it is difficult to achieve the ideal effect, and the efficiency is low. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides a mode switching method, system, device and storage medium for producing skeletal animation, which are used to improve the production efficiency of skeletal animation.
[0006] In a first aspect, the present application provides a mode switching method for producing a skeletal animation, the method being applied in a three-dimensional virtual world, the three-dimensional virtual world comprising a virtual object, the virtual object being configured with a virtual skeleton, the virtual skeleton comprising a first skeleton node, a second skeleton node, and a third skeleton node connected in series via a connecting line, the method comprising:
[0007] Acquire a first operation instruction from a user, and start an absolute displacement mode according to the first operation instruction;
[0008] Obtaining a first movement instruction from a user for moving the first skeleton node; adding an anchor point position to the first skeleton node according to the first movement instruction;
[0009] Obtaining a second operation instruction from the user, and switching to the inverse kinematics mode according to the second operation instruction;
[0010] Determine a constraint relationship between the first bone node, the second bone node and the third bone node in the inverse kinematics mode;
[0011] Obtaining a second movement instruction of the user for the second skeleton node;
[0012] Moving the second bone node to a second bone position according to the constraint relationship and the second movement instruction;
[0013] The third bone node is moved to a third bone position according to the constraint relationship, and the movement of the first bone is constrained according to the constraint relationship and the anchor point position.
[0014] Optionally, when there are multiple anchor point positions, constraining the movement of the first skeletal node according to the constraint relationship and the anchor point positions includes:
[0015] Determine the constraint path of the first skeletal node according to the positions of each of the anchor points;
[0016] The first motion path of the first skeletal node is constrained by the constraint path.
[0017] Optionally, determining the constraint path of the first skeletal node according to the positions of the anchor points includes:
[0018] Obtaining a moving path of the user moving the first skeleton node between various anchor point positions;
[0019] Determine a constraint path of the first skeletal node according to the movement path;
[0020] or
[0021] Determine the shortest path between the anchor positions, where the shortest path passes through the anchor positions;
[0022] The shortest path is determined as a constraint path of the first skeleton node.
[0023] Optionally, moving the third bone node to a third bone position according to the constraint relationship includes:
[0024] Calculate a third motion path of the third skeletal node according to the constraint relationship;
[0025] Control the third bone node to move to a third bone position according to the third motion path.
[0026] Optionally, the constraint relationship includes the constrained rotation angles of the first bone node, the second bone node and the third bone node, and the constrained lengths of the connecting lines connecting the various bone nodes.
[0027] Optionally, the constraint relationship includes the constraint rotation angles of the first bone node, the second bone node and the third bone node, and the constraint lengths of the connecting lines connecting the respective bone nodes; when the first bone node is located between the second bone node and the third bone node, calculating the third motion path of the third bone node according to the constraint relationship includes:
[0028] Determine a first constrained rotation angle of the first skeletal node and determine a second constrained rotation angle of the third skeletal node;
[0029] Determine a first constraint length between the third skeletal node and the first skeletal node, and determine a second constraint length between the first skeletal node and the second skeletal node;
[0030] Determine a motion plane of the third bone node according to the first constraint rotation angle, the second constraint rotation angle, the first constraint length, and the second constraint length;
[0031] A third motion path is determined on the motion plane.
[0032] Optionally, the third motion path is a motion path with the shortest distance on the motion surface or the third motion path is a motion path that does not pass through any obstacles on the motion surface.
[0033] A second aspect of the present application provides a mode switching system for producing skeletal animation, comprising:
[0034] A first acquisition unit, used to acquire a first operation instruction of a user, and start an absolute displacement mode according to the first operation instruction;
[0035] A second acquisition unit is used to acquire a first movement instruction of a user for moving the first skeleton node; and add an anchor point position to the first skeleton node according to the first movement instruction;
[0036] A third acquisition unit, used to acquire a second operation instruction of the user, and switch to the inverse dynamics mode according to the second operation instruction;
[0037] a determining unit, configured to determine, in the inverse kinematics mode, a constraint relationship between the first skeletal node, the second skeletal node, and the third skeletal node,
[0038] A fourth acquisition unit, configured to acquire a second movement instruction of the user for the second skeleton node;
[0039] a moving unit, configured to move the second bone node to a second bone position according to the constraint relationship and the second moving instruction,
[0040] A control unit is used to move the third bone node to a third bone position according to the constraint relationship, and to constrain the movement of the first bone according to the constraint relationship and the anchor point position.
[0041] A third aspect of the present application provides a mode switching device for producing skeletal animation, the device comprising:
[0042] Processor, memory, input-output unit, and bus;
[0043] The processor is connected to the memory, the input and output unit, and the bus;
[0044] The memory stores a program, and the processor calls the program to execute the first aspect and any optional method in the first aspect.
[0045] A fourth aspect of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, the program executes the first aspect and any optional method in the first aspect.
[0046] It can be seen from the above technical solutions that this application has the following advantages:
[0047] In the mode switching method for producing skeletal animation provided by the present application, the user can first add an anchor point position for the first skeletal node through the absolute displacement mode. After switching to the inverse dynamics mode, the first skeletal node will be restricted to the anchor point position. In the inverse dynamics mode, there is a certain constraint relationship between the first skeletal node, the second skeletal node and the third skeletal node. When the user moves the second skeletal node, the motion path of the third skeletal node will be calculated according to the constraint relationship, and the third skeletal node will be controlled to move according to the motion path. At this time, the first skeletal node will be restricted to the anchor point position, and the movement of each skeletal node will also satisfy the constraint relationship.
[0048] Therefore, when the user produces skeletal animation through the method provided by the present application, by switching between the absolute displacement mode and the inverse dynamics mode, the path planning can be performed for some of the bones, and then the terminal will calculate the motion paths of other bones connected to it. The user can easily produce various complex skeletal animations, which greatly improves the efficiency of skeletal animation production. In the method provided by the present application, each skeletal node has a certain constraint relationship. When the user produces skeletal animation through this method, motion simulation can be performed, and then a more realistic skeletal animation can be produced, which greatly improves the user's experience in producing skeletal animation. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solution in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0050] Figure 1 A schematic flow chart of an embodiment of a method for switching modes of producing skeletal animation in the present application;
[0051] Figure 2 A flowchart of another embodiment of a mode switching method for producing skeletal animation in the present application;
[0052] Figure 3 A schematic diagram of the structure of an embodiment of a mode switching system for producing skeletal animation in this application;
[0053] Figure 4 This is a schematic diagram of the structure of an embodiment of a mode switching device for producing skeletal animation in this application. DETAILED DESCRIPTION
[0054] In order to solve the above technical problems, the present application provides a mode switching method for producing skeletal animation, which is used to improve the efficiency of skeletal animation production.
[0055] It should be noted that the mode switching method for making skeletal animation provided by the present application can be applied to a terminal or a server. For example, the terminal can be a smart phone or a computer, a tablet computer, a smart TV, a smart watch, a portable computer terminal, or a fixed terminal such as a desktop computer. For the convenience of explanation, the present application uses the terminal as the execution subject for example.
[0056] See also Figure 1 , Figure 1 The present invention provides a flow chart of an embodiment of a mode switching method for producing skeletal animation, wherein the mode switching method for producing skeletal animation includes:
[0057] 101. Obtain a first operation instruction, and start an absolute displacement mode according to the first operation instruction;
[0058] The mode switching method for producing skeletal animation provided in the present application is applied to a three-dimensional virtual world, which contains virtual objects. The three-dimensional virtual world refers to a virtual world with virtual three-dimensional features. There are various scenes and virtual objects in the three-dimensional virtual world. Generally, when producing a skeletal animation, it is necessary to dynamically edit static virtual objects to achieve animation effects. The virtual objects mentioned or discussed can be character objects such as virtual people, animals, plants, vehicles, science fiction characters, etc., or can be terrain objects in the scene such as walls, ditches, cliffs, cables, ladders, bosses, etc., or can be other objects in the scene.
[0059] In practical applications, the virtual object is configured with a virtual skeleton, which is composed of skeleton nodes and connecting lines connecting the skeleton nodes. The dynamic editing of the virtual object can be achieved by adjusting the position of the virtual skeleton. In the present application, the virtual object includes a first skeleton node, a second skeleton node and a third skeleton node. The three skeleton nodes are connected in series through connecting lines. The relative positions of the three skeleton nodes are not limited. In the method provided in the present application, the three skeleton nodes used are only for schematic illustration. In practical applications, there can be more than three skeleton nodes. The method can be applied to a virtual object with multiple skeleton nodes, and the implementation principle is substantially the same.
[0060] In the present application, the terminal first obtains the user's first operation instruction, such as the user's click instruction, and opens the absolute displacement mode according to the first operation instruction. The absolute displacement mode in the present application refers to a mode for editing bones when making skeletal animation. In this mode, the user's position adjustment of the bone is absolute, that is, the user can adjust any bone node to any position in the virtual world, and the length of the connecting line can also be changed arbitrarily. There are no constraints on the bone nodes and connecting lines.
[0061] 102. Obtain a first movement instruction from a user for moving a first skeleton node; and add an anchor point position to the first skeleton node according to the first movement instruction.
[0062] After the user turns on the absolute displacement mode, the user can move the first bone node through the first movement instruction in this mode. The user moves the first bone node to a certain position.
[0063] The terminal adds an anchor point position to the first skeleton node according to the first movement instruction. The anchor point position mentioned or discussed in the present application refers to the position used to limit the movement of the skeleton node. For example, when an anchor point position is added to the first skeleton node, the first skeleton node can only be restricted to the anchor point position when moving, that is, the first skeleton node cannot move. For another example, when multiple anchor point positions are added to the first skeleton node, the first skeleton node can only move between the multiple anchor points.
[0064] Since the various bone nodes and connecting lines are not constrained in absolute displacement mode, the user can move the first bone node to the desired position in this mode and add this position as the anchor position of the first bone node, that is, the user wants the first bone node to be constrained to the anchor position when moving.
[0065] 103. Obtain a second operation instruction from the user, and switch to the inverse dynamics mode according to the second operation instruction;
[0066] The user can switch to the inverse kinematics mode through a second operation instruction, such as switching through the keys on the keyboard. The inverse kinematics mode in this application refers to a mode for dynamically editing bones when making skeletal animation. In this inverse kinematics mode, there are constraints on each bone node and connecting line. For example, the length of the connecting line is constrained to the constrained length, for example, the connecting line will be fixed at the constrained length, and the bone nodes have constrained rotation angles, such as the maximum or minimum rotation angle of the bone nodes. The anchor point position added in the absolute displacement mode will also constrain the corresponding bone nodes.
[0067] 104. Determine a constraint relationship between the first bone node, the second bone node, and the third bone node in the inverse dynamics mode;
[0068] After the terminal turns on the inverse kinematics mode, the constraint relationship between the first bone node, the second bone node and the third bone node is determined, such as the length of the connecting line between the first bone node and the second bone node, the maximum rotation angle of the first bone node or the anchor point position of the first bone node. In the inverse kinematics mode, all bone movements need to satisfy this constraint relationship.
[0069] 105. Obtain a second movement instruction of the user for the second skeleton node;
[0070] In absolute displacement mode, users can add anchor points to bone nodes to add constraints to bone nodes. After turning on inverse kinematics mode, users can dynamically edit virtual bones to make the required bone movements. Users move the second bone node through the second movement instruction, that is, how the user wants the second bone node to move or to which position, and then adjust the second bone node.
[0071] 106. Move the second bone node to the second bone position according to the constraint relationship and the second movement instruction;
[0072] Specifically, the terminal needs to determine the second movement instruction and constraint relationship of the second bone node, that is, the user drags the second bone node to a certain position, and during the movement, it also needs to comply with the constraint relationship, such as the length of the connecting line between the second bone node and the first bone node is kept within the constraint length, or the maximum or minimum rotation angle of the first bone node.
[0073] 107. Move the third bone node to the third bone position according to the constraint relationship, and constrain the movement of the first bone according to the constraint relationship and the anchor point position.
[0074] After the terminal moves the second bone node to the second bone position, it controls the third bone node to move according to the constraint relationship. Specifically, the motion parameters of the third bone node can be obtained through reverse calculation, and then the third bone node is controlled to move according to the motion parameters. At the same time, the movement of the first bone node is constrained according to the constraint relationship and the anchor point position. That is, the first bone node not only needs to comply with the constraint relationship when moving, but also needs to be constrained by the anchor point position.
[0075] The following will further illustrate the mode switching method for producing skeletal animation provided by the present application by way of examples;
[0076] When making skeletal animation, for example, when making hand movement animation for a character object, the hand contains three skeletal nodes, namely the wrist node, elbow node and shoulder node. The user can add an anchor point position to the elbow skeletal node in the absolute displacement mode to constrain the movement of the elbow node. For example, add an anchor point position to the elbow node so that the elbow node can be fixed on the desktop, and then switch to the inverse dynamics mode and move the wrist node to plan the movement position and path of the wrist. In order to better simulate human joint movement, the wrist node, elbow node and shoulder node can be configured with constrained rotation angles. In line with the real human joint movement, the terminal reversely calculates the movement trajectory of the elbow and shoulder based on these constraints. In practical applications, the upper-level bone node can drive the movement of the lower-level bone node. For example, the rotation of the shoulder node can drive the movement of the elbow node. For example, the movement of the wrist node is actually driven by the rotation of the elbow node. The rotation of the shoulder node can drive the movement of the elbow node. Therefore, the terminal reversely calculates the movement trajectory of the shoulder node based on all the constraints. In this way, the difficulty of making skeletal animation can be reduced. Users can easily make complex skeletal movement animations and improve the efficiency of skeletal animation production.
[0077] In the mode switching method for producing skeletal animation provided by the present application, the user can first add an anchor point position for the first skeletal node through the absolute displacement mode. After switching to the inverse dynamics mode, the first skeletal node will be restricted to the anchor point position. In the inverse dynamics mode, there is a certain constraint relationship between the first skeletal node, the second skeletal node and the third skeletal node. When the user moves the second skeletal node, the motion path of the third skeletal node will be calculated according to the constraint relationship, and the third skeletal node will be controlled to move according to the motion path. At this time, the first skeletal node will be restricted to the anchor point position, and the movement of each skeletal node will also satisfy the constraint relationship.
[0078] Therefore, when the user produces skeletal animation through the method provided by the present application, by switching between the absolute displacement mode and the inverse dynamics mode, the path planning can be performed for some of the bones, and then the terminal will calculate the motion paths of other bones connected to it. The user can easily produce various complex skeletal animations, which greatly improves the efficiency of skeletal animation production. In the method provided by the present application, each skeletal node has a certain constraint relationship. When the user produces skeletal animation through this method, motion simulation can be performed, and then a more realistic skeletal animation can be produced, which greatly improves the user's experience in producing skeletal animation.
[0079] In practical applications, when adding an anchor point position for the first skeletal node, one anchor point position may be added or multiple anchor point positions may be added. When multiple anchor point positions are added, the motion path of the first skeletal node needs to be determined according to the multiple anchor point positions.
[0080] Therefore, in some embodiments, the terminal can add multiple anchor positions for the first skeleton node according to the first movement instruction. For example, the user drags the first skeleton node and adds multiple anchor positions for the first skeleton node by pausing multiple times during the movement.
[0081] When there are multiple anchor point positions, constraining the movement of the first bone node according to the constraint relationship and the anchor point positions includes: generating a constraint path of the first bone node according to each anchor point position, and constraining the movement of the first bone node through the constraint path.
[0082] Specifically, the constraint path of the first skeleton node passes through each anchor point position, so that the first skeleton node is constrained to the constraint path when moving. Specifically, determining the constraint path of the first skeleton node through the anchor point position can be to obtain the moving path of the first skeleton node moved by the user between the anchor point positions; for example, when the user drags the first skeleton node, a dragging moving path is formed, and the terminal determines the constraint path of the first skeleton node based on the moving path; it can also be, for example, when the user adds two moving paths for the first skeleton node, the terminal determines the shortest path between the two anchor point positions, and the anchor point position can also be more than 2. It should be noted that the shortest path is not an absolute shortest path, but a path with the shortest distance among all paths passing through each anchor point position, and the shortest path is determined as the constraint path of the first skeleton node.
[0083] There can be multiple positions between the first bone node, the second bone node and the third bone node. This embodiment will take the case where the first bone node is located between the second bone node and the third bone node as an example, and the following embodiments will be described in detail with reference to the accompanying drawings.
[0084] See also Figure 2 , Figure 2 The present invention is a flowchart of an embodiment of a method for switching a skeletal animation mode provided in the present application. The method for switching a skeletal animation mode includes:
[0085] 201. Obtain a first operation instruction from a user, and start an absolute displacement mode according to the first operation instruction;
[0086] 202. Obtain a first movement instruction from a user for moving a first skeleton node; and add an anchor point position to the first skeleton node according to the first movement instruction.
[0087] In this embodiment, the terminal adds multiple anchor positions to the first skeleton node according to the first movement instruction. For example, the user drags the first skeleton node to move it, and multiple anchor positions are added to the first skeleton node by pausing multiple times during the movement.
[0088] 203. Obtain a second operation instruction from the user, and switch to the inverse kinematics mode according to the second operation instruction;
[0089] The user can switch to the reverse kinematics mode through a second operating instruction, such as switching through a case on the keyboard.
[0090] 204. Determine a constraint relationship between the first bone node, the second bone node, and the third bone node in the inverse dynamics mode;
[0091] After the terminal turns on the inverse dynamics mode, the constraint relationship between the first bone node, the second bone node and the third bone node is determined, such as the length of the connection line between the first bone node and the second bone node, the maximum rotation angle of the first bone node or the anchor point position of the first bone node. In the inverse dynamics mode, all bone movements need to satisfy the constraint relationship. For the first bone node, the first bone node also needs to satisfy the constraints of multiple anchor point positions.
[0092] 205. Obtain a second movement instruction of the user for the second skeleton node;
[0093] In absolute displacement mode, users can add anchor points to bone nodes to add constraints to bone nodes. After turning on inverse kinematics mode, users can dynamically edit virtual bones to make the required bone movements. Users move the second bone node through the second movement instruction, that is, how the user wants the second bone node to move or to which position, and then adjust the second bone node.
[0094] 206. Move the second bone node to the second bone position according to the constraint relationship and the second movement instruction;
[0095] The terminal moves the second bone node to the second bone position. During the movement, the second bone node needs to be determined according to the second movement instruction, for example, according to the user's dragging instruction to the second bone node, that is, the user drags the second bone node to a certain position, and in the process of moving, it is also necessary to comply with the constraint relationship, such as the length of the connecting line between the second bone node and the first bone node is kept within the constraint length, or the maximum or minimum rotation angle of the first bone node.
[0096] 207. Calculate a third motion path of the third skeletal node according to the constraint relationship;
[0097] The terminal calculates the third motion path of the third bone node based on the constraint relationship between the three bone nodes. Specifically, the terminal determines the first constraint rotation angle of the first bone node and the second constraint rotation angle of the third bone node. The terminal determines the first constraint length between the third bone node and the first bone node, and the second constraint length between the first bone node and the second bone node; the terminal determines the motion surface of the third bone node based on the first constraint rotation angle, the second constraint rotation angle, the first constraint length and the second constraint length; and determines the third motion path on the motion surface.
[0098] When the first skeletal node is located between the second skeletal node and the third skeletal node, the user moves the second skeletal node, that is, when the skeletal node is moving, the third skeletal node drives the first skeletal node to move, and the first skeletal node drives the second skeletal node to move. The movement of the first skeletal node is limited by the constrained rotation angle of the third skeletal node, and the movement of the second skeletal node is limited by the constrained rotation angle of the first skeletal node, and is limited by the first and second constraint lengths of the connection line between the second skeletal node and the first skeletal node and the first constraint length of the connection line between the first skeletal node and the third skeletal node. According to these constraint relationships, the range of movement of the third skeletal node is actually a motion surface that satisfies all constraint relationships, and then the terminal determines the motion path of the third skeletal node on the constraint surface. Specifically, the third path can be the motion path with the shortest distance on the motion surface or the motion path of the third skeletal node without passing through any obstacles.
[0099] 208. Control the third skeletal node to move to the third skeletal position according to the third motion path; determine the constraint path of the first skeletal node according to the positions of each anchor point; and constrain the movement of the first skeletal node through the constraint path.
[0100] The terminal controls the third bone node to move to the third bone position according to the third motion path.
[0101] The above embodiment describes the mode switching method for producing skeletal animation in the present application. The following describes the mode switching system, device and computer storage medium for producing skeletal animation provided in the present application.
[0102] See also Figure 3 , Figure 3 This is a schematic diagram of an embodiment of a mode switching system for producing skeletal animation in the present application. The mode switching system for producing skeletal animation includes:
[0103] A first acquisition unit 301 is used to acquire a first operation instruction of a user and start an absolute displacement mode according to the first operation instruction;
[0104] The second acquisition unit 302 is used to acquire a first movement instruction of a user for moving the first skeleton node; and add an anchor point position to the first skeleton node according to the first movement instruction;
[0105] A third acquisition unit 303 is used to acquire a second operation instruction of the user and switch to the inverse dynamics mode according to the second operation instruction;
[0106] The determination unit 304 is used to determine the constraint relationship between the first skeletal node, the second skeletal node and the third skeletal node in the inverse kinematics mode.
[0107] A fourth acquisition unit 305 is used to acquire a second movement instruction of the user for the second skeleton node;
[0108] A moving unit 306 is used to move the second bone node to a second bone position according to the constraint relationship and the second moving instruction.
[0109] The control unit 307 is used to move the third bone node to a third bone position according to the constraint relationship, and constrain the movement of the first bone according to the constraint relationship and the anchor point position.
[0110] Optionally, the control unit 307 is specifically configured to:
[0111] Determine the constraint path of the first skeletal node according to the positions of each of the anchor points;
[0112] The first motion path of the first skeletal node is constrained by the constraint path.
[0113] Optionally, the determining unit 304 is specifically configured to:
[0114] Obtaining a moving path of the user moving the first skeleton node between various anchor point positions;
[0115] Determine a constraint path of the first skeletal node according to the movement path;
[0116] or
[0117] Determine the shortest path between the anchor positions, where the shortest path passes through the anchor positions;
[0118] The shortest path is determined as a constraint path of the first skeleton node.
[0119] Optionally, the control unit 307 is specifically configured to:
[0120] Calculate a third motion path of the third skeletal node according to the constraint relationship;
[0121] Control the third bone node to move to a third bone position according to the third motion path.
[0122] Optionally, the constraint relationship includes the constrained rotation angles of the first bone node, the second bone node and the third bone node, and the constrained lengths of the connecting lines connecting the various bone nodes.
[0123] Optionally, the constraint relationship includes the constraint rotation angles of the first skeletal node, the second skeletal node and the third skeletal node, and the constraint lengths of the connecting lines connecting the skeletal nodes; when the first skeletal node is located between the second skeletal node and the third skeletal node, the control unit 307 is specifically used to:
[0124] Determine a first constrained rotation angle of the first skeletal node and determine a second constrained rotation angle of the third skeletal node;
[0125] Determine a first constraint length between the third skeletal node and the first skeletal node, and determine a second constraint length between the first skeletal node and the second skeletal node;
[0126] Determine a motion plane of the third bone node according to the first constraint rotation angle, the second constraint rotation angle, the first constraint length, and the second constraint length;
[0127] A third motion path is determined on the motion plane.
[0128] Optionally, the third motion path is a motion path with the shortest distance on the motion surface or the third motion path is a motion path that does not pass through any obstacles on the motion surface.
[0129] The present application also provides a mode switching device for producing skeletal animation, comprising:
[0130] Processor 401, memory 402, input and output unit 403, bus 404;
[0131] The processor 401 is connected to the memory 402, the input and output unit 403 and the bus 404;
[0132] The memory 402 stores a program, and the processor 401 calls the program to execute any of the above-mentioned mode switching methods for producing skeletal animation.
[0133] The present application also relates to a computer-readable storage medium on which a program is stored, wherein when the program is run on a computer, the computer is caused to execute any of the above-mentioned mode switching methods for producing skeletal animation.
[0134] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0135] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0136] 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 on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0137] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0138] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.
Claims
1. A mode switching method for making skeletal animation, characterized in that: The method is applied in a three-dimensional virtual world, wherein the three-dimensional virtual world includes a virtual object, wherein the virtual object is configured with a virtual skeleton, wherein the virtual skeleton includes a first skeleton node, a second skeleton node, and a third skeleton node connected in series via a connecting line, and the method comprises: Obtaining a first operation instruction, and starting an absolute displacement mode according to the first operation instruction; Obtain a first movement instruction, move the first skeleton node according to the first movement instruction, and add an anchor point position for the first skeleton node; Obtaining a second operation instruction, and switching to an inverse dynamics mode according to the second operation instruction; Determine a constraint relationship between the first bone node, the second bone node and the third bone node in the inverse kinematics mode; Obtaining a second movement instruction for the second skeletal node; Moving the second bone node to a second bone position according to the constraint relationship and the second movement instruction; The third bone node is moved to a third bone position according to the constraint relationship, and the movement of the first bone node is constrained according to the constraint relationship and the anchor point position.
2. The mode switching method for producing skeletal animation according to claim 1, characterized in that: When there are multiple anchor point positions, constraining the movement of the first skeletal node according to the constraint relationship and the anchor point positions includes: Determine the constraint path of the first skeletal node according to the positions of each of the anchor points; The movement of the first skeletal node is constrained by the constraint path.
3. The mode switching method for producing skeletal animation according to claim 2, characterized in that: The step of determining the constraint path of the first skeletal node according to the positions of the anchor points includes: Obtaining a moving path of the user moving the first skeleton node between various anchor point positions; Determine a constraint path of the first skeletal node according to the movement path; or Determine the shortest path between the anchor positions, where the shortest path passes through the anchor positions; The shortest path is determined as a constraint path of the first skeleton node.
4. The mode switching method for producing skeletal animation according to claim 1, characterized in that: The moving the third bone node to the third bone position according to the constraint relationship comprises: Calculate a third motion path of the third skeletal node according to the constraint relationship; Control the third bone node to move to a third bone position according to the third motion path.
5. The mode switching method for producing skeletal animation according to claim 1, characterized in that: The constraint relationship includes the constraint rotation angles of the first bone node, the second bone node and the third bone node, and the constraint lengths of the connection lines connecting the various bone nodes.
6. The mode switching method for producing skeletal animation according to claim 4, characterized in that: The constraint relationship includes the constraint rotation angles of the first bone node, the second bone node and the third bone node, and the constraint lengths of the connecting lines connecting the bone nodes; when the first bone node is located between the second bone node and the third bone node, the third motion path of the third bone node is calculated according to the constraint relationship, including: Determine a first constrained rotation angle of the first skeletal node and determine a second constrained rotation angle of the third skeletal node; Determine a first constraint length between the third skeletal node and the first skeletal node, and determine a second constraint length between the first skeletal node and the second skeletal node; Determine a motion plane of the third bone node according to the first constraint rotation angle, the second constraint rotation angle, the first constraint length, and the second constraint length; A third motion path is determined on the motion plane.
7. The mode switching method for producing skeletal animation according to claim 6, characterized in that: The third motion path is a motion path with the shortest distance on the motion surface or the third motion path is a motion path that does not pass through any obstacles on the motion surface.
8. A mode switching system for producing skeletal animation, characterized in that: include: A first acquisition unit, used to acquire a first operation instruction of a user, and start an absolute displacement mode according to the first operation instruction; A second acquisition unit is used to acquire a first movement instruction of a user for moving a first skeleton node; and add an anchor point position to the first skeleton node according to the first movement instruction; A third acquisition unit, used to acquire a second operation instruction of the user, and switch to the inverse dynamics mode according to the second operation instruction; a determining unit, configured to determine, in the inverse kinematics mode, a constraint relationship between the first skeletal node, the second skeletal node, and the third skeletal node, A fourth acquisition unit, configured to acquire a second movement instruction of the user for the second skeleton node; a moving unit, configured to move the second bone node to a second bone position according to the constraint relationship and the second moving instruction, A control unit is used to move the third bone node to a third bone position according to the constraint relationship, and constrain the movement of the first bone node according to the constraint relationship and the anchor point position.
9. A mode switching device for producing skeletal animation, characterized in that: The device comprises: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; The memory stores a program, and the processor calls the program to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a program stored thereon, wherein the program, when executed on a computer, performs the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Animated character constructing method capable of modifying binding mode
CN103426192A
Robot animation method using inverse dynamical simulation
CN104517310A