Control method and device of snake-shaped virtual object, storage medium, and electronic device
By dividing the snake-shaped virtual object into multiple component parts and establishing the binding relationship between multiple bones and the controller, the problem of poor motion control effect of the snake-shaped virtual object in the existing technology is solved, and flexible twisting and fineness are achieved. control effect.
Patent Information
- Application Number
- CN202011088478.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-13
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-10-13
AI Technical Summary
It is difficult to effectively control the movement of a snake-shaped virtual object with existing technology, especially in achieving flexible twisting, local zooming in and out, and muscle stretching effects.
Divide the snake-shaped virtual object into multiple component parts, set up multiple bones at the target part, establish a binding relationship between the main controller and the bones, and coordinate the movement of the bones through the main controller and secondary controller to achieve Flexible control.
It realizes the flexible twisting and fine control of snake-shaped virtual objects, reduces the difficulty of control, and optimizes the effect in animation production.
Smart Images

Figure CN112169337B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a control method and a control device for a snake-shaped virtual object, a computer-readable storage medium, and an electronic device. Background Art
[0002] At present, with the development of the Internet, online games have become another hot area, and at the same time, higher requirements have been put forward for game animation production. Snake-like creatures are often encountered in game animation production. The difficulty of making snake-like creatures is often high, which is determined by the basic characteristics of snake-like creatures. For example, snake-like creatures can perform S-shaped movements, or keep their heads still while twisting their bodies, or snake-like creatures have soft bodies, etc.
[0003] In animation implementation, model resources are usually bound and skinned, and the model skin is applied to the skeleton to drive the model to move. However, the binding of snake-like creatures usually binds the body to a skeleton, and the skeleton movement is controlled by only one displacement control point, which cannot make the snake-like creature move perfectly along the preset route, and cannot realize the local zooming in and out function in animation production, nor can it produce the effect of muscle stretching.
[0004] In view of this, there is an urgent need in the art to develop a new control method and device for a snake-shaped virtual object.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] The purpose of the present disclosure is to provide a control method for a snake-shaped virtual object, a control device for a snake-shaped virtual object, a computer-readable storage medium and an electronic device, thereby overcoming the problem of poor control effect of a snake-shaped virtual object due to limitations of related technologies at least to a certain extent.
[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0008] According to a first aspect of an embodiment of the present invention, there is provided a method for controlling a snake-shaped virtual object, the method comprising: dividing the snake-shaped virtual object into a plurality of component parts according to the structure of the snake-shaped virtual object;
[0009] For a target part among the multiple component parts, two or more bones are erected in a target direction, wherein the target direction is determined according to a direction in which the target part is to be twisted;
[0010] Main controllers are respectively set up at key positions in the target part, and a binding relationship is established between each of the main controllers and a bone among the two or more bones;
[0011] The movements of the bound bones are controlled respectively according to the main controller.
[0012] In an exemplary embodiment of the present invention, the method further comprises:
[0013] A master controller is established for the snake-shaped virtual object, and the master controller is used to control all the main controllers.
[0014] In an exemplary embodiment of the present invention, the master controller is located at an origin position in a spatial coordinate system, and the master controller is used to control the position of the snake-shaped virtual object in the spatial coordinate system.
[0015] In an exemplary embodiment of the present invention, the method further comprises:
[0016] The control strength of the master controller over each of the main controllers is determined according to the distance between each of the main controllers and the master controller.
[0017] In an exemplary embodiment of the present invention, the target part is a body part or a tail part of the snake-shaped virtual object.
[0018] In an exemplary embodiment of the present invention, the method further comprises:
[0019] One or more secondary controllers are generated for any of the main controllers, and a binding relationship is established between each of the secondary controllers and a target bone. The target bone is determined based on the bone that has a binding relationship with the corresponding main controller. The main controller is used to control the corresponding one or more secondary controllers.
[0020] In an exemplary embodiment of the present invention, generating one or more secondary controllers for any of the primary controllers includes:
[0021] determining a target number of secondary controllers to be established based on the distance between the target primary controller and the adjacent primary controllers;
[0022] The target number of secondary controllers is generated for the target primary controller.
[0023] In an exemplary embodiment of the present invention, the method further comprises:
[0024] The control strength of the main controller on each corresponding secondary controller is determined according to the distance between the main controller and each corresponding secondary controller.
[0025] In an exemplary embodiment of the present invention, the step of erecting two or more bones in a target direction for a target part among the multiple component parts includes:
[0026] Two or more bones are erected at a preset interval in a direction perpendicular to the central axis of the target part.
[0027] In an exemplary embodiment of the present invention, the two or more bones take the center point of the target part as a starting point, and the center point is a point on the central axis.
[0028] In an exemplary embodiment of the present invention, the key positions are joints of the snake-shaped virtual object.
[0029] According to a second aspect of an embodiment of the present invention, there is provided a control device for a snake-shaped virtual object, the device comprising: an object division module configured to divide the snake-shaped virtual object into a plurality of component parts according to the structure of the snake-shaped virtual object;
[0030] A skeleton erection module is configured to erect two or more skeletons toward a target direction for a target part among the multiple component parts, wherein the target direction is determined according to a direction in which the target part is to be twisted;
[0031] A relationship binding module is configured to respectively set up main controllers at key positions in the target part, and establish a binding relationship between each of the main controllers and a bone in the two or more bones;
[0032] The skeleton motion module is configured to control the motion of the bound skeletons respectively according to the main controller.
[0033] According to a third aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a processor and a memory; wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the control method of the snake-shaped virtual object in any of the above exemplary embodiments is implemented.
[0034] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for controlling a snake-shaped virtual object in any of the above exemplary embodiments is implemented.
[0035] It can be seen from the above technical solutions that the control method of the snake-shaped virtual object, the control device of the snake-shaped virtual object, the computer storage medium and the electronic device in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
[0036] In the method and device provided by the exemplary embodiments of the present disclosure, on the one hand, multiple bones are set up towards the target direction of the target part, so as to flexibly control the movement of the snake-like virtual object and meet the demand for flexible twisting of the snake-like virtual object; on the other hand, a main controller is set up at the key position of the target part, and the rotation and displacement of the corresponding bones are controlled by the controller to reduce the difficulty of controlling the snake-like virtual object and optimize the control effect of the snake-like virtual object.
[0037] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0039] Figure 1 A schematic diagram schematically illustrates the effect of a control method for a snake-shaped virtual object in the related art;
[0040] Figure 2 A schematic diagram schematically illustrates a flow chart of a method for controlling a snake-shaped virtual object in an exemplary embodiment of the present disclosure;
[0041] Figure 3 A flowchart schematically illustrating a method for generating a secondary controller in an exemplary embodiment of the present disclosure;
[0042] Figure 4 A schematic diagram schematically shows the effect of setting up a main controller in an application scenario in an exemplary embodiment of the present disclosure;
[0043] Figure 5 A schematic diagram schematically shows the effect of further setting up a main controller in an application scenario in an exemplary embodiment of the present disclosure;
[0044] Figure 6 A schematic diagram schematically shows the effect of generating a secondary controller in an application scenario in an exemplary embodiment of the present disclosure;
[0045] Figure 7 A schematic diagram schematically shows the effect of erecting a skeleton in an application scenario in an exemplary embodiment of the present disclosure;
[0046] Figure 8 A schematic diagram schematically shows the effect of arranging bones in the tail part in an application scenario in an exemplary embodiment of the present disclosure;
[0047] Fig. 9A schematic diagram schematically illustrates the effect of a method for controlling a snake-shaped virtual object in an application scenario in an exemplary embodiment of the present disclosure;
[0048] Fig.10 A schematic diagram schematically shows a structure of a control device for a snake-shaped virtual object in an exemplary embodiment of the present disclosure;
[0049] Fig.11 An electronic device for implementing a control method of a snake-shaped virtual object in an exemplary embodiment of the present disclosure is schematically shown;
[0050] Fig.12 A computer-readable storage medium for implementing a control method of a snake-shaped virtual object in an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0051] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0052] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.
[0053] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings represent the same or similar parts, and their repeated descriptions will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities.
[0054] Figure 1 The schematic diagram of the effect of the control method of the snake-shaped virtual object in the related art is shown as follows: Figure 1As shown, the skeleton of the snake virtual object is processed into two parts. Specifically, with the neck as the dividing point, a skeleton chain is established from the neck to the tail, and a skeleton is established in the opposite direction of the head.
[0055] It can be seen that this method has only one displacement control point, and all bones will move according to the displacement control point. The body cannot be freely controlled and cannot satisfy the free twisting of the snake-like body.
[0056] Furthermore, due to the large limitation of one bone, the snake-shaped virtual object cannot move along a predetermined movement route.
[0057] In addition, in the animation process, local zooming in or out is often used, and this method cannot achieve the zooming in and out function. Furthermore, since the bones on the bone chain are connected one by one, the snake-shaped virtual object cannot produce a stretching effect.
[0058] In view of the problems existing in the related art, the present disclosure proposes a control method for a snake-shaped virtual object. Figure 2 A flow chart showing a method for controlling a snake-shaped virtual object is shown. Figure 2 As shown, the control method of the snake-shaped virtual object at least includes the following steps:
[0059] Step S210: Divide the snake-shaped virtual object into a plurality of component parts according to the structure of the snake-shaped virtual object.
[0060] Step S220. For a target part among the multiple component parts, two or more bones are erected toward a target direction, where the target direction is determined according to the direction in which the target part is to be twisted.
[0061] Step S230: Main controllers are respectively set up at key positions in the target part, and a binding relationship is established between each main controller and bones in more than two bones.
[0062] Step S240: Control the movement of the bound bones respectively according to the main controller.
[0063] In an exemplary embodiment of the present disclosure, on the one hand, multiple bones are set up towards the target direction of the target part to flexibly control the movement of the snake-like virtual object and meet the demand for flexible twisting of the snake-like virtual object; on the other hand, a main controller is set up at a key position of the target part, and the rotation and displacement of the corresponding bones are controlled by the controller to reduce the difficulty of controlling the snake-like virtual object and optimize the control effect of the snake-like virtual object.
[0064] The following describes in detail the various steps of the method for controlling the snake-shaped virtual object.
[0065] In step S210 , the snake-shaped virtual object is divided into a plurality of component parts according to the structure of the snake-shaped virtual object.
[0066] In an exemplary embodiment of the present disclosure, the snake-shaped virtual object may be a virtual object such as a snake or a dragon, or may be other virtual objects, and this exemplary embodiment does not specifically limit this.
[0067] The structure of the snake-shaped virtual object may be divided according to key points of the snake-shaped virtual object.
[0068] The key point may be determined according to the loop line of the snake-shaped virtual object. Specifically, the more loop lines the snake-shaped virtual object has, the more components that can be separated.
[0069] Therefore, after dividing the snake-shaped virtual object according to key points, multiple component parts can be obtained.
[0070] In step S220, two or more bones are erected toward a target direction for a target part among the multiple component parts, and the target direction is determined according to the direction in which the target part is to be twisted.
[0071] In an exemplary embodiment of the present disclosure, the target part may be determined from among a plurality of component parts of the snake-shaped virtual object.
[0072] In an optional embodiment, the target part is a body part or a tail part of the snake-shaped virtual object.
[0073] In addition, other component parts may also be determined as target parts according to actual conditions, and this exemplary embodiment does not specifically limit this.
[0074] After determining the target part, multiple bones can be set up according to the target direction.
[0075] In an optional embodiment, two or more bones are arranged at a preset interval in a direction perpendicular to the central axis of the target site.
[0076] Since the model of the body or tail of the snake-shaped virtual object is a whole segment, the whole segment model can be divided into N segments at a preset interval, and the length of each segment is kept consistent.
[0077] Furthermore, the target direction may be determined by the direction to be twisted. Specifically, the target direction may be a direction perpendicular to the central axis of the target part.
[0078] For example, when the central axis of the target part is in the horizontal direction, the direction of the bone to be erected can be determined to be the vertical direction; when the central axis of the target part is in the vertical direction, the direction of the bone to be erected can be determined to be the horizontal direction. In addition, when the central axis of the target part is in other directions, the direction of the bone to be erected can also be determined in a vertical relationship.
[0079] After determining the direction in which the bones are to be erected, you can determine the positions of the bones to be erected in order to erect more than two bones.
[0080] In an optional embodiment, two or more bones start from a center point of the target part, and the center point is a point on the central axis.
[0081] For example, the center point of the target part may be determined according to the highest point and the lowest point of the model of the target part, that is, the center point is the center of the highest point and the lowest point of the model.
[0082] Therefore, two or more bones can be set up for the target part in a predetermined direction with the center point as the starting point and the preset interval as the interval size. Moreover, setting up two or more bones can flexibly control the movement of the target part to meet the free twisting of the snake-shaped virtual object.
[0083] In addition, when the head is the target part, the corresponding skeleton can be erected with the neck as the axis. Moreover, the erection direction can be the forward direction of the central axis of the target part, or other directions, which is not specifically limited in this exemplary embodiment.
[0084] Correspondingly, the skeleton construction of the tail part can also be the same as that of the body part, or it can be constructed with the tail key point of a skeleton chain as the center of the circle, and the construction direction can be the backward direction of the central axis of the target part. This exemplary embodiment does not make any special limitation on this.
[0085] In step S230, main controllers are respectively set up at key positions in the target part, and a binding relationship is established between each main controller and bones in more than two bones.
[0086] In an exemplary embodiment of the present disclosure, before setting up the main controller, a master controller may be established first.
[0087] In an optional embodiment, a master controller is established for the snake-shaped virtual object, and the master controller is used to control all the main controllers. In an optional embodiment, the master controller is located at the origin position in the spatial coordinate system, and the master controller is used to control the position of the snake-shaped virtual object in the spatial coordinate system.
[0088] It is worth mentioning that the master controller has a marking function. That is, in the process of setting up the controller, the master controller will be regarded as the origin of the spatial coordinates, so that other structures have position information in the world coordinate system.
[0089] After establishing the master controller first, the main controller can be further set up at the key location of the target area.
[0090] In an optional embodiment, the key positions are joints of the snake-shaped virtual object.
[0091] The joint parts of the snake-shaped virtual object are the connection parts among the head, body and tail parts of the snake-shaped virtual object.
[0092] The number of master controllers set up at key positions can be set up according to the length and effect of the snake-shaped virtual object.
[0093] Specifically, after the main controller is installed at the key position, the main controller can be further added according to the principle of equal division.
[0094] For example, when the distance between two key positions is 10 meters, a main controller can be set up at 5 meters. If you want to achieve a more flexible effect, you can continue to set up two main controllers at 5 meters.
[0095] It is worth noting that the master controller can control the rotation and displacement of the main controller, but the main controller cannot reversely control the master controller.
[0096] After setting up the primary controller, you can continue to set up the secondary controller.
[0097] In an optional embodiment, one or more secondary controllers are generated for any main controller, and a binding relationship is established between each secondary controller and a target bone. The target bone is determined based on the bone that has a binding relationship with the corresponding main controller, and the main controller is used to control the corresponding one or more secondary controllers.
[0098] In an alternative embodiment, Figure 3 A flow chart of a method for generating a secondary controller is shown, Figure 3 As shown, the method includes at least the following steps: In step S310, the target number of secondary controllers to be established is determined according to the distance between the target main controller and the adjacent main controllers.
[0099] Since the secondary controller is used to connect the transition between the main controllers, the target number can be determined by dividing the distance between the target main controller and the adjacent main controller into equal parts. For example, when the distance between the target main controller and an adjacent main controller is 2 meters, the target number can be obtained by dividing 2 meters into equal parts.
[0100] In step S320 , a target number of secondary controllers is generated for the target primary controller.
[0101] After determining the target number, an equal number of secondary controllers may be generated evenly between the target primary controller and the adjacent primary controllers.
[0102] In this exemplary embodiment, the target number of secondary controllers may be determined based on the distance between the target main controller and the adjacent main controllers, and the secondary controllers may be installed to achieve accurate installation of the secondary controllers.
[0103] After setting up the secondary controller, you can create a binding relationship between the secondary controller and the target bone.
[0104] Since the bone itself has the properties of rotation and displacement, but the rotation and displacement properties of the bone are assigned to the main controller, the target bone is the bone that has a binding relationship with the main controller. In addition, the main controller can also control one or more secondary controllers.
[0105] Furthermore, in an optional embodiment, the control strength of the main controller over each corresponding secondary controller is determined according to the distance between the main controller and each corresponding secondary controller.
[0106] Since the primary controller can control the secondary controllers, the constraints of the secondary controllers can be evenly distributed to the corresponding primary controllers.
[0107] For example, when a secondary controller is controlled by two primary controllers, any one of the two primary controllers can control 50% of the rotation properties of the secondary controller.
[0108] In addition, the control strength of the main controller over the secondary controller can be reflected in the size of the rotation angle. Specifically, when a main controller controls multiple secondary controllers, the rotation angle of the secondary controller closer to the main controller is larger; the rotation angle of the secondary controller farther from the main controller is smaller.
[0109] Furthermore, a binding relationship between the main controller and the skeleton can be further established, that is, the position constraint and rotation constraint of the skeleton are given to the secondary controller, and the secondary controller gives the rotation constraint and position constraint to the main controller, so as to establish the binding between the main controller and the skeleton.
[0110] In addition, the position constraint and rotation constraint of the main controller will also be bound by the master controller.
[0111] In an optional embodiment, the control strength of the master controller over each main controller is determined according to the distance between each main controller and the master controller.
[0112] Specifically, the main controller close to the main controller receives the strongest control force, so the control strength of the main controller over it is the greatest; the main controller far from the main controller receives the weakest control force, so the control strength of the main controller over it is the smallest.
[0113] The control strength can be increased by a value from 0 to 100, and the value decreases proportionally from far to near.
[0114] In step S240, the movements of the bound bones are controlled respectively according to the main controller.
[0115] In an exemplary embodiment of the present disclosure, after the main controller and the skeleton are bound, the movements of the bound skeletons can be controlled by the main controller.
[0116] Specifically, the master controller can drive the main controller, secondary controller and skeleton to move, and present the overall movement effect without local displacement or rotation. The main controller can move independently, and the secondary controller can move evenly with the main controller. In the case of adding controllers, the skeleton will not move or rotate independently.
[0117] The following is a detailed description of the control method of the snake-shaped virtual object in the embodiment of the present disclosure in conjunction with an application scenario.
[0118] Figure 4 The schematic diagram of the effect of setting up the main controller in the application scenario is shown as follows: Figure 4 As shown, the main controller 410 is located at the junction of the head and body parts of the snake-shaped virtual object, and the main controllers 420 and 430 are located at the junction of the limbs and body parts, and so on.
[0119] Figure 5 The schematic diagram of the effect of further setting up the main controller in the application scenario is shown as follows: Figure 5 As shown, the distance between the main controller 420 and the main controller 430 is relatively large, and the main controller 440 and the main controller 450 can be further added according to the principle of equal division.
[0120] Figure 6 The schematic diagram of the effect of generating a secondary controller in the application scenario is shown as follows: Figure 6 As shown, after the main controller of the snake-shaped virtual object is set up, a secondary controller can be generated to further transition the connection between the main controllers.
[0121] Specifically, the secondary controller may be generated by equally dividing the distance between the target main controller and the adjacent main controller. That is, two secondary controllers, namely, secondary controller 610 and secondary controller 620, may be generated between main controller 410 and main controller 420; secondary controller 630 and secondary controller 640 may be generated between main controller 420 and main controller 440; secondary controller 650 may be generated between main controller 440 and main controller 430; and secondary controller 660 may be generated between main controller 430 and main controller 450.
[0122] Figure 7 The schematic diagram of the effect of setting up the skeleton in the application scenario is shown as follows: Figure 7 As shown, when the head part is the target part, the corresponding skeleton can be erected with the neck as the axis, and the erection direction can be the forward direction of the central axis of the target part.
[0123] When the target part is a body part, since the central axis of the body part is in the horizontal direction, the direction of the bone to be erected can be determined to be the vertical direction. More than two bones can be erected for the body part, and the center point of the body part is used as the starting point. The center point can be determined based on the highest point and the lowest point of the model of the body part, that is, the center point is the center of the highest point and the lowest point of the model.
[0124] Therefore, the body part can be set up with two or more bones in the vertical direction with the center point as the starting point and the preset interval as the interval size. Moreover, setting up two or more bones can flexibly control the movement of the body part to meet the free twisting of the snake-shaped virtual object.
[0125] When the target part is the tail, it can be erected with the key point of a bone chain as the center of the circle, and the erection direction can be the backward direction of the central axis of the tail. That is, at this time, multiple bones can be erected for the tail to form a bone chain.
[0126] Figure 8 The schematic diagram of the effect of setting up the skeleton in the tail part in the application scenario is shown as follows: Figure 8 As shown, in addition to setting up a bone chain for the tail, a bone can also be set up for the tail in the backward direction of the central axis. This method is suitable for the case where the snake-like virtual object is small in size or the animation effect of the snake-like virtual object is not the focus of attention.
[0127] Fig. 9 is a schematic diagram showing the effect of the control method of the snake-shaped virtual object in the application scenario, such as Fig. 9As shown, two secondary controllers 930 and 940 are established between the two main controllers 910 and 920, and the two secondary controllers 930 and 940 equally divide the distance between the two main controllers 910 and 920. When the distance between the two main controllers 910 and 920 is extended from 2 meters to 4 meters, the distance of the secondary virtual bodies in the middle will also change accordingly, and the two secondary controllers 930 and 940 still equally divide the two main controllers 910 and 920.
[0128] The control method of the snake-like virtual object in this application scenario, on the one hand, sets up multiple bones towards the target direction of the target part, flexibly controls the movement of the snake-like virtual object, and meets the demand for flexible twisting of the snake-like virtual object; on the other hand, sets up a main controller at the key position of the target part, and controls the rotation and displacement of the corresponding bones through the controller to reduce the difficulty of controlling the snake-like virtual object, while optimizing the control effect of the snake-like virtual object.
[0129] In addition, in an exemplary embodiment of the present disclosure, a control device for a snake-shaped virtual object is also provided. Fig.10 A schematic diagram of the structure of a control device for a snake-shaped virtual object is shown. Fig.10 As shown, the control device 1000 of the snake-shaped virtual object may include: an object division module 1010, a skeleton erection module 1020, a relationship binding module 1030 and a skeleton movement module 1040. Among them:
[0130] The object division module 1010 is configured to divide the snake-shaped virtual object into a plurality of component parts according to the structure of the snake-shaped virtual object; the skeleton erection module 1020 is configured to erect two or more skeletons in a target direction for a target part among the plurality of component parts, and the target direction is determined according to the direction in which the target part is to be twisted; the relationship binding module 1030 is configured to respectively erect main controllers at key positions in the target part, and establish a binding relationship between each main controller and a skeleton among the two or more skeletons; the skeleton movement module 1040 is configured to respectively control the movement of the bound skeleton according to the main controller.
[0131] The specific details of the control device 1000 for the above-mentioned snake-shaped virtual object have been described in detail in the corresponding control method for the snake-shaped virtual object, so they will not be repeated here.
[0132] It should be noted that, although several modules or units of the control device 1000 for the snake-shaped virtual object are mentioned in the above detailed description, such division is not mandatory. In fact, according to the embodiment of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units for embodiment.
[0133] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0134] Refer to the following Fig.11 1100 according to this embodiment of the present invention will be described. Fig.11 The electronic device 1100 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0135] like Fig.11 As shown, the electronic device 1100 is in the form of a general computing device. The components of the electronic device 1100 may include, but are not limited to: the at least one processing unit 1110, the at least one storage unit 1120, a bus 1130 connecting different system components (including the storage unit 1120 and the processing unit 1110), and a display unit 1140.
[0136] The storage unit stores program codes, which can be executed by the processing unit 1110, so that the processing unit 1110 executes the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification.
[0137] The storage unit 1120 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 1121 and / or a cache memory unit 1122 , and may further include a read-only memory unit (ROM) 1123 .
[0138] The storage unit 1120 may also include a program / utility 1124 having a set (at least one) of program modules 1125, such program modules 1125 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0139] Bus 1130 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0140] The electronic device 1100 may also communicate with one or more external devices 1300 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1100, and / or communicate with any device that enables the electronic device 1100 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1150. Furthermore, the electronic device 1100 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1160. As shown, the network adapter 1140 communicates with other modules of the electronic device 1100 via a bus 1130. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0141] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0142] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible embodiments, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to perform the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0143] refer to Fig.12 As shown, a program product 1200 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0144] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0145] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0146] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0147] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0148] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
Claims
1. A control method for a snake-shaped virtual object, characterized in that: The method comprises: Dividing the snake-shaped virtual object into a plurality of component parts according to the structure of the snake-shaped virtual object; For a target part among the multiple component parts, two or more bones are erected in a target direction, wherein the target direction is determined according to a direction in which the target part is to be twisted; Main controllers are respectively set up at key positions in the target part, and a binding relationship is established between each of the main controllers and a bone in the two or more bones; the key positions are joints of the snake-shaped virtual object; Controlling the movement of the bound bones respectively according to the main controller; The step of erecting two or more bones in a target direction for a target part among the multiple component parts includes: Two or more bones are erected at a preset interval in a direction perpendicular to the central axis of the target part.
2. The control method according to claim 1, characterized in that: The method further comprises: A master controller is established for the snake-shaped virtual object, and the master controller is used to control all the main controllers.
3. The control method according to claim 2, characterized in that: The master controller is located at the origin position in the space coordinate system, and the master controller is used to control the position of the snake-shaped virtual object in the space coordinate system.
4. The control method according to claim 2, characterized in that: The method further comprises: The control strength of the master controller over each of the main controllers is determined according to the distance between each of the main controllers and the master controller.
5. The control method according to claim 1, characterized in that: The target part is a body part or a tail part of the snake-shaped virtual object.
6. The control method according to claim 1, characterized in that: The method further comprises: One or more secondary controllers are generated for any of the main controllers, and a binding relationship is established between each of the secondary controllers and a target bone. The target bone is determined based on the bone that has a binding relationship with the corresponding main controller. The main controller is used to control the corresponding one or more secondary controllers.
7. The control method according to claim 6, characterized in that: The step of generating one or more secondary controllers for any of the primary controllers comprises: determining a target number of secondary controllers to be established based on the distance between the target primary controller and the adjacent primary controllers; The target number of secondary controllers is generated for the target primary controller.
8. The control method according to claim 6, characterized in that: The method further comprises: The control strength of the main controller on each corresponding secondary controller is determined according to the distance between the main controller and each corresponding secondary controller.
9. The control method according to claim 1, characterized in that: The two or more bones take the center point of the target part as a starting point, and the center point is a point on the central axis.
10. A control device for a snake-shaped virtual object, characterized in that: include: An object division module, configured to divide the snake-shaped virtual object into a plurality of component parts according to the structure of the snake-shaped virtual object; A skeleton erection module is configured to erect two or more skeletons toward a target direction for a target part among the multiple component parts, wherein the target direction is determined according to a direction in which the target part is to be twisted; A relationship binding module is configured to respectively set up main controllers at key positions in the target part and establish a binding relationship between each of the main controllers and a bone in the two or more bones; the key position is a joint part of the snake-shaped virtual object; A skeleton motion module, configured to control the motion of the bound skeletons respectively according to the main controller; The step of erecting two or more bones in a target direction for a target part among the multiple component parts includes: Two or more bones are erected at a preset interval in a direction perpendicular to the central axis of the target part.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the control method of the snake-shaped virtual object according to any one of claims 1 to 9 is implemented.
12. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; The processor is configured to execute the method for controlling a snake-shaped virtual object according to any one of claims 1 to 9 by executing the executable instructions.
