CN112169337A - Control method and device of snake-shaped virtual object, storage medium and electronic equipment - Google Patents

Control method and device of snake-shaped virtual object, storage medium and electronic equipment Download PDF

Info

Publication number
CN112169337A
CN112169337A CN202011088478.6A CN202011088478A CN112169337A CN 112169337 A CN112169337 A CN 112169337A CN 202011088478 A CN202011088478 A CN 202011088478A CN 112169337 A CN112169337 A CN 112169337A
Authority
CN
China
Prior art keywords
virtual object
controller
target
bones
snake
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011088478.6A
Other languages
Chinese (zh)
Inventor
夏祁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202011088478.6A priority Critical patent/CN112169337A/en
Publication of CN112169337A publication Critical patent/CN112169337A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/57Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images
    • A63F2300/6607Methods for processing data by generating or executing the game program for rendering three dimensional images for animating game characters, e.g. skeleton kinematics

Abstract

The disclosure belongs to the technical field of computers, and relates to a control method and device of a snake-shaped virtual object, a storage medium and electronic equipment. The method comprises the following steps: dividing the snake-shaped virtual object into a plurality of component parts according to the structure of the snake-shaped virtual object; erecting more than two bones towards a target direction aiming at a target part in a plurality of component parts, wherein the target direction is determined according to the direction to be twisted of the target part; erecting main controllers at key positions in a target part respectively, and establishing a binding relationship between each main controller and bones of more than two bones; and respectively controlling the motion of the bound bones according to the master controller. On one hand, the movement of the snake-shaped virtual object is flexibly controlled, and the requirement of flexible twisting of the snake-shaped virtual object is met; on the other hand, the controller controls the rotation and the displacement of the corresponding skeleton to reduce the control difficulty of the snake-shaped virtual object and optimize the control effect of the snake-shaped virtual object.

Description

Control method and device of snake-shaped virtual object, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method for controlling a serpentine virtual object, a control apparatus for a serpentine virtual object, a computer-readable storage medium, and an electronic device.
Background
At present, with the development of the internet, network games become another hot field at present, and meanwhile, higher requirements are also put forward for game animation production. Snakelike creatures are often encountered in game animation production, and the production difficulty of the snakelike creatures is often high in production difficulty, which is determined by the basic characteristics of the snakelike creatures. For example, the serpentine can perform an S-shaped motion, or the head can be held stationary while the body twists, or the serpentine has a soft body, etc.
In animation implementations, model resources are typically skinned by binding the model resources to the bones to drive the model into motion. However, generally, the body of the serpentine creature is bound on one skeleton, and the skeleton motion is controlled only by one displacement control point, so that the serpentine creature cannot perfectly move according to a preset route, and the local enlarging and reducing functions in animation production cannot be realized, and the muscle stretching effect cannot be achieved.
In view of the above, there is a need in the art to develop a new method and apparatus for controlling a snake-shaped virtual object.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure is directed to a method for controlling a serpentine virtual object, a control device for a serpentine virtual object, a computer-readable storage medium, and an electronic device, so as to overcome at least some of the problems of poor control effect on a serpentine virtual object due to limitations of related art.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of embodiments of the present invention, there is provided a method for controlling a serpentine virtual object, the method including: dividing the snake-shaped virtual object into a plurality of component parts according to the structure of the snake-shaped virtual object;
erecting more than two bones towards a target direction aiming at a target part in the plurality of component parts, wherein the target direction is determined according to the direction to be twisted of the target part;
erecting main controllers at key positions in the target part respectively, and establishing a binding relationship between each main controller and bones of the more than two bones;
and respectively controlling the motion of the bound bones according to the main controller.
In an exemplary embodiment of the invention, the method further comprises:
and establishing a master controller for the snake-shaped virtual object, wherein the master controller is used for controlling all the master controllers.
In an exemplary embodiment of the invention, the overall controller is located at an origin position in a spatial coordinate system, and the overall controller is configured to control the position of the serpentine virtual object in the spatial coordinate system.
In an exemplary embodiment of the invention, the method further comprises:
and determining the control intensity of each master controller to each master controller according to the distance between each master controller and the master controller.
In an exemplary embodiment of the invention, the target portion is a body portion or a tail portion of the serpentine virtual object.
In an exemplary embodiment of the invention, the method further comprises:
generating one or more secondary controllers for any one of the primary controllers, and establishing a binding relationship between each secondary controller and a target skeleton, wherein the target skeleton is determined according to the skeleton having the binding relationship with the corresponding primary controller, and the primary controller is used for controlling the corresponding one or more secondary controllers.
In an exemplary embodiment of the invention, said generating one or more secondary controllers for any of said primary controllers comprises:
determining the target number of the secondary controllers to be established according to the distance between the target main controller and the adjacent main controller;
generating the target number of secondary controllers for the target primary controller.
In an exemplary embodiment of the invention, the method further comprises:
and determining the control intensity of the main controller to each corresponding secondary controller according to the distance between the main controller and each corresponding secondary controller.
In an exemplary embodiment of the invention, the erecting two or more bones in a target direction for a target site of the plurality of component sites includes:
at least two bones are erected in a direction perpendicular to a central axis of the target portion at a predetermined interval.
In an exemplary embodiment of the present invention, the two or more bones start from a center point of the target site, the center point being a point on the central axis.
In an exemplary embodiment of the invention, the key location is a joint location of the serpentine virtual object.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for controlling a serpentine virtual object, the apparatus including: an object dividing module configured to divide a serpentine virtual object into a plurality of component parts according to a structure of the serpentine virtual object;
a bone erecting module configured to erect two or more bones in a target direction for a target site of the plurality of component sites, the target direction being determined according to a direction in which the target site is to be twisted;
a relationship binding module configured to respectively erect main controllers at key positions in the target part and establish a binding relationship between each main controller and a bone of the more than two bones;
a bone motion module configured to control motion of the bound bones according to the master controller, respectively.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus including: a processor and a memory; wherein the memory has stored thereon computer readable instructions which, when executed by the processor, implement a method of controlling a serpentine virtual object in any of the exemplary embodiments described above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of controlling a serpentine virtual object in any of the exemplary embodiments described above.
As can be seen from the foregoing technical solutions, the method for controlling a serpentine virtual object, the apparatus for controlling a serpentine 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:
in the method and the device provided by the exemplary embodiment of the disclosure, on one hand, a plurality of bones are erected towards a target direction for a target part, so that the movement of the snake-shaped virtual object is flexibly controlled, and the requirement of flexible twisting of the snake-shaped virtual object is met; on the other hand, a main controller is erected at the key position of the target part, and the controller controls the rotation and displacement of the corresponding skeleton, so that the control difficulty of the snake-shaped virtual object is reduced, and the control effect of the snake-shaped virtual object is optimized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
Fig. 1 is a schematic diagram illustrating an effect of a control method of a serpentine virtual object in the related art;
FIG. 2 is a flow chart schematically illustrating a method for controlling a serpentine virtual object according to an exemplary embodiment of the disclosure;
FIG. 3 schematically illustrates a flow diagram of a method of generating a secondary controller in an exemplary embodiment of the disclosure;
FIG. 4 is a schematic diagram illustrating an effect of setting up a master controller in an application scenario according to an exemplary embodiment of the disclosure;
FIG. 5 is a schematic diagram illustrating an effect of further setting up a main controller in an application scenario according to an exemplary embodiment of the disclosure;
FIG. 6 is a schematic diagram illustrating an effect of generating a secondary controller in an application scenario according to an exemplary embodiment of the disclosure;
FIG. 7 is a schematic diagram illustrating an effect of setting bones in an application scenario according to an exemplary embodiment of the disclosure;
fig. 8 is a schematic diagram illustrating an effect of a tail part skeleton under an application scenario in an exemplary embodiment of the disclosure;
fig. 9 is a schematic diagram illustrating an effect of the control method for the serpentine virtual object in the application scene according to the exemplary embodiment of the disclosure;
fig. 10 schematically illustrates a structural diagram of a control device of a serpentine virtual object in an exemplary embodiment of the present disclosure;
fig. 11 schematically illustrates an electronic device for implementing a control method of a serpentine virtual object in an exemplary embodiment of the present disclosure;
fig. 12 schematically illustrates a computer-readable storage medium for implementing a control method of a serpentine virtual object in an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
The terms "a," "an," "the," and "said" are used in this specification to denote the presence of one or more elements/components/parts/etc.; the terms "comprising" and "having" are intended to be inclusive and mean that there may be additional elements/components/etc. other than the listed elements/components/etc.; the terms "first" and "second", etc. are used merely as labels, and are not limiting on the number of their objects.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities.
Fig. 1 is a schematic diagram illustrating an effect of a control method of a snake-shaped virtual object in the related art, as shown in fig. 1, a skeleton of the snake-shaped virtual object is processed in two parts. Specifically, a bone chain is established from the neck to the tail and a bone is established from the head in a reverse direction by taking the neck as a demarcation point.
It can be seen that there is only one displacement control point, and all bones can move according to the displacement control point, so that the body cannot be freely controlled, and the free twisting of the body of the snakelike organism cannot be met.
And, because the limitation of one bone is large, the snake-shaped virtual object can not move according to the preset movement route.
In addition, during animation, a local enlarging or reducing expression effect is often used, and the enlarging and reducing functions cannot be realized in this way. Further, the skeleton chain is connected with one another, so that the snake-shaped virtual object cannot make stretching effect.
In view of the problems in the related art, the present disclosure provides a control method of a serpentine virtual object. Fig. 2 shows a flow chart of a control method of a serpentine virtual object, as shown in fig. 2, the control method of a serpentine virtual object comprises at least the following steps:
and S210, dividing the snake-shaped virtual object into a plurality of component parts according to the structure of the snake-shaped virtual object.
S220, aiming at a target part in the plurality of component parts, erecting more than two bones towards a target direction, wherein the target direction is determined according to the direction to be twisted of the target part.
And S230, erecting main controllers at key positions in the target part respectively, and establishing a binding relationship between each main controller and bones of more than two bones.
And S240, respectively controlling the motion of the bound bones according to the main controller.
In the exemplary embodiment of the present disclosure, on one hand, a plurality of bones are erected towards a target direction for a target part, so that the movement of the snake-shaped virtual object is flexibly controlled, and the requirement of flexible twisting of the snake-shaped virtual object is met; on the other hand, a main controller is erected at the key position of the target part, and the controller controls the rotation and displacement of the corresponding skeleton, so that the control difficulty of the snake-shaped virtual object is reduced, and the control effect of the snake-shaped virtual object is optimized.
The following describes each step of the control method of the serpentine virtual object in detail.
In step S210, the serpentine virtual object is divided into a plurality of component parts according to the structure of the serpentine virtual object.
In an exemplary embodiment of the present disclosure, the snake-shaped virtual object may be a snake or a dragon or other virtual objects, and this exemplary embodiment is not particularly limited to this.
The structure of the snake-shaped virtual object is divided, and the division can be carried out according to key points of the snake-shaped virtual object.
Wherein the key point may be determined according to a loop line of the serpentine-shaped virtual object. Specifically, the more the loop lines of the serpentine-shaped virtual object are, the more the detachable component parts are.
Therefore, after the serpentine virtual object is divided by the key points, a plurality of component parts can be obtained.
In step S220, two or more bones are erected in a target direction for a target portion among the plurality of component portions, the target direction being determined according to a direction in which the target portion is to be twisted.
In an exemplary embodiment of the present disclosure, the target site may be determined among a plurality of constituent sites of the serpentine virtual object.
In an alternative embodiment, the target site is a body site or tail site of a serpentine virtual object.
In addition, other constituent parts may be determined as the target part according to actual conditions, and this is not particularly limited in the present exemplary embodiment.
After the target site is identified, a plurality of bones may be erected in a target direction.
In an alternative embodiment, two or more bones are erected at a predetermined interval in a direction perpendicular to the central axis of the target site.
Since the model of the body or tail portion of the serpentine-shaped virtual object is a whole segment, it is possible to divide the whole segment of the model into N segments at a preset interval distance and keep the length of each segment uniform.
Also, 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 portion.
For example, when the central axis of the target portion is in the horizontal direction, the direction in which the bone is to be erected may be determined to be the vertical direction; when the central axis of the target site is in the vertical direction, the direction of the bone to be erected can be determined to be the horizontal direction. In addition to this, when the central axis of the target site is in other directions, the direction of the bone to be erected can also be determined in a perpendicular relationship.
After the direction in which the bones are to be erected is determined, the positions in which the bones are to be erected can be determined to erect more than two bones.
In an alternative embodiment, two or more bones start at a center point of the target site, the center point being a point on the central axis.
For example, the center point of the target portion may be determined according to the model highest point and the model lowest point of the target portion, i.e., the center point is the center of the model highest point and the model lowest point.
Therefore, two or more bones can be erected in a predetermined direction as a target portion with the center point as a starting point and the preset spacing distance as the spacing size. And more than two bones are erected, so that the movement of the target part can be flexibly controlled, and the free twisting of the snake-shaped virtual object is met.
In addition, when the head part is the target part, the corresponding skeleton can be erected with the neck as the axis. The direction of the frame may be a forward direction of the center axis of the target portion, or may be another direction, which is not particularly limited in the present exemplary embodiment.
Correspondingly, the skeleton of the tail portion may be erected in the same manner as the skeleton of the body portion, or may be erected around a tail key point of a skeleton chain, and the erection direction may be a backward direction of the central axis of the target portion, which is not particularly limited in this exemplary embodiment.
In step S230, main controllers are respectively erected at key positions in the target site, and a binding relationship between each main controller and a bone of the two or more bones is established.
In an exemplary embodiment of the present disclosure, the master controller may be established first, before the master controller is erected.
In an alternative embodiment, an overall controller is established for the serpentine virtual object, which is used to control all the master controllers. In an alternative embodiment, the overall controller is located at an origin position in the spatial coordinate system, and the overall controller is used for controlling the position of the serpentine virtual object in the spatial coordinate system.
It is worth noting that the overall controller has a marking function. That is, in the process of setting up the controller, the overall controller is regarded as the coordinate origin of the space coordinate, so that the position information of other structures exists in the world coordinate system.
After the master controller is preferentially established, the master controller can be further erected at the key position of the target part.
In an alternative embodiment, the key location is a joint location of the serpentine virtual object.
The joint part of the snake-shaped virtual object is the joint between the head part, the body part and the tail part of the snake-shaped virtual object.
The number of main controllers erected at key positions can be erected according to the length and effect of the snake-shaped virtual object.
Specifically, after the main controller is erected at a key position, the main controller can be continuously added according to an equal division principle.
For example, when the distance between two critical locations is 10 meters, a main controller can be installed at 5 meters. If a more flexible effect is actually desired, the erection can be continued under the condition that the two main controllers are 5 meters.
It is worth mentioning that the overall controller can control the rotation and displacement of the main controller, but the main controller cannot reversely control the overall controller.
After the main controller is erected, the secondary controller can be erected continuously.
In an alternative embodiment, one or more secondary controllers are generated for any primary controller, and a binding relationship is established between each secondary controller and a target bone determined from the bone with which the corresponding primary controller has a binding relationship, the primary controller being configured to control the corresponding one or more secondary controllers.
In an alternative embodiment, fig. 3 shows a flow diagram of a method of generating a secondary controller, as shown in fig. 3, the method comprising at least the steps of: in step S310, a target number of secondary controllers to be established is determined according to a distance between the target master controller and the adjacent master controller.
Since the secondary controllers are used to engage the transitions between the primary controllers, the target number may be determined by equally dividing the distance between the target primary controller and the adjacent primary controller. For example, when the distance between the target master controller and an adjacent master controller is 2 meters, the target number can be obtained by equally dividing 2 meters.
In step S320, a target number of secondary controllers is generated for the target primary controller.
After determining the target number, an equal number of secondary controllers may be generated evenly between the target primary controller and the neighboring primary controllers.
In the present exemplary embodiment, the target number of the secondary controllers may be determined according to the distance between the target primary controller and the adjacent primary controller, and the secondary controllers are erected to achieve accurate erection of the secondary controllers.
After the secondary controller is erected, the binding relationship between the secondary controller and the target skeleton can be correspondingly established.
Since the bone itself has the properties of rotation and displacement, but the properties of rotation and displacement of the bone are assigned to the master controller, the target bone is the bone having a binding relationship with the master controller. In addition, the primary controller may control one or more secondary controllers.
Further, in an alternative embodiment, the control strength of the master controller for each corresponding secondary controller is determined according to the distance between the master controller and each corresponding secondary controller.
Since the primary controller can control the secondary controllers, the constraints of the secondary controllers can be evenly distributed to the corresponding primary controllers.
For example, when one secondary controller is controlled by two primary controllers, either of the two primary controllers may control the 50% spin profile of the secondary controller.
Besides, the control intensity of the main controller to the secondary controller can be embodied as the size of the rotation angle. Specifically, when one main controller controls a plurality of sub controllers, the closer to the main controller, the larger the rotation angle of the sub controller; the further away from the master control the secondary controller is, the smaller the rotation angle.
Furthermore, the binding relationship between the master controller and the skeleton can be further established. That is, the secondary controller is given positional and rotational constraints of the bone, and the secondary controller is given rotational and positional constraints to the primary controller to achieve establishing a binding between the primary controller and the bone.
In addition to this, the position constraints and rotation constraints of the master controller are also bound by the overall controller.
In an alternative embodiment, the control strength of each master controller by the master controller is determined according to the distance between each master controller and the master controller.
Specifically, the main controller close to the main controller is controlled by the strongest control force, so that the main controller has the highest control strength on the main controller; the master controller that is far from the master controller receives the weakest control force, and thus the control strength of the master controller on the master controller is the smallest.
The magnitude of the control intensity can be added by a value of 0-100, and the value decreases in equal proportion from far to near.
In step S240, the motion of the bound bones is controlled according to the master controller, respectively.
In an exemplary embodiment of the present disclosure, after the master controller and the bones are bound, the motion of the bound individual bones may be controlled by the master controller.
Specifically, the master controller can drive the master controller, the secondary controller and the skeleton to move, and the overall movement effect is presented, so that the situation of local displacement or rotation is avoided. The primary controller may move individually and the secondary controller may follow the primary controller to move uniformly. With the addition of a controller, the bone does not move or rotate alone.
The following describes the control method of the snake-shaped virtual object in the embodiment of the present disclosure in detail with reference to an application scenario.
Fig. 4 shows an effect diagram of setting up a main controller under an application scenario, as shown in fig. 4, the main controller 410 is located at a junction of a head and a body part of a serpentine virtual object, the main controller 420 and the main controller 430 are located at a junction of a limb and the body part, and the like.
Fig. 5 shows an effect diagram of further setting up a main controller in an application scenario, as shown in fig. 5, a distance between the main controller 420 and the main controller 430 is large, and the main controller 440 and the main controller 450 may be added continuously according to an equal division principle.
Fig. 6 is a schematic diagram illustrating an effect of generating a secondary controller in an application scenario, and as shown in fig. 6, after the primary controllers of the snake-shaped virtual object are erected, the secondary controller may be generated to further transition the connection between the primary controllers.
Specifically, the manner in which the secondary controllers are generated may be such that the distance between the target primary controller and the neighboring primary controller is equally determined. That is, two secondary controllers, respectively secondary controller 610 and secondary controller 620, may be generated between primary controller 410 and primary controller 420; secondary controller 630 and secondary controller 640 may be generated between primary controller 420 and primary controller 440; a secondary controller 650 may be generated between the primary controller 440 and the primary controller 430; secondary controller 660 may be generated between primary controller 430 and primary controller 450.
Fig. 7 is a schematic diagram illustrating the effect of erecting a bone in an application scene, and as shown in fig. 7, when the head part is the target part, the corresponding bone can be erected with the neck as the axis. The direction of the frame may be a forward direction of the central axis of the target portion.
When the target part is a body part, since the central axis of the body part is in the horizontal direction, it can be determined that the direction of the skeleton to be erected is the vertical direction. More than two bones can be erected for a body part, and the center point of the body part is taken as a starting point. The center point may be determined from the model highest and lowest points of the body part, i.e. the center point is the center of the model highest and lowest points.
Therefore, the body part can be erected with more than two bones in the vertical direction for the body part by taking the central point as a starting point and taking the preset interval distance as the interval size. And more than two bones are erected to flexibly control the movement of the body part, so that the free twisting of the snake-shaped virtual object is met.
When the target site is a tail site, the bone chain may be erected with a key point of the bone chain as a center of a circle, and the direction of erection may be a direction rearward of a central axis of the tail site. That is, a plurality of bones may be erected for the tail portion to form a bone chain.
Fig. 8 is a schematic diagram illustrating the effect of erecting a skeleton at the tail part in an application scene, and as shown in fig. 8, in addition to erecting a skeleton chain at the tail part, a skeleton may be erected at the tail part in the backward direction of the central axis. This approach is suitable for the case where the snake-shaped virtual object is small in size or the snake-shaped virtual object is not focused on by the animation effect.
Fig. 9 is a schematic diagram illustrating an effect of the control method of the serpentine virtual object in the application scene, as shown in fig. 9, 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 elongated from 2 meters to 4 meters, the distance of the middle secondary virtual body also changes correspondingly, and the two secondary controllers 930 and 940 still equally divide the two main controllers 910 and 920.
On one hand, a plurality of bones are erected towards a target direction on a target part, so that the movement of the snake-shaped virtual object is flexibly controlled, and the requirement of flexibly twisting the snake-shaped virtual object is met; on the other hand, a main controller is erected at the key position of the target part, and the controller controls the rotation and displacement of the corresponding skeleton, so that the control difficulty of the snake-shaped virtual object is reduced, and the control effect of the snake-shaped virtual object is optimized.
Further, in an exemplary embodiment of the present disclosure, there is also provided a control apparatus of a serpentine virtual object. Fig. 10 shows a schematic structural diagram of a control device of a serpentine virtual object, and as shown in fig. 10, the control device 1000 of the serpentine virtual object may include: an object segmentation module 1010, a bone erection module 1020, a relationship binding module 1030, and a bone motion module 1040. Wherein:
an object dividing module 1010 configured to divide the serpentine virtual object into a plurality of constituent parts according to a structure of the serpentine virtual object; a bone erecting module 1020 configured to erect two or more bones in a target direction for a target site among the plurality of component sites, the target direction being determined according to a direction in which the target site is to be twisted; a relation binding module 1030 configured to erect master controllers at key positions in the target site, respectively, and establish a binding relation between each master controller and a bone of the two or more bones; a bone motion module 1040 configured to control motion of the bound bones according to the master controller, respectively.
The specific details of the control apparatus 1000 for the serpentine virtual object have been described in detail in the control method for the serpentine virtual object, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the control device 1000 of the serpentine virtual object are mentioned, this division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
An electronic device 1100 according to such an embodiment of the invention is described below with reference to fig. 11. The electronic device 1100 shown in fig. 11 is only an example and should not bring any limitations to the function and the scope of use of the embodiments of the present invention.
As shown in fig. 11, electronic device 1100 is embodied in the form of a general purpose 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 memory unit 1120, a bus 1130 connecting different system components (including the memory unit 1120 and the processing unit 1110), and a display unit 1140.
Wherein the storage unit stores program code that is executable by the processing unit 1110 to cause the processing unit 1110 to perform steps according to various exemplary embodiments of the present invention as described in the above section "exemplary methods" of the present specification.
The storage unit 1120 may include readable media in the form of volatile storage units, 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.
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 thereof, may comprise an implementation of a network environment.
Bus 1130 may be representative of 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.
The electronic device 1100 may also communicate with one or more external devices 1300 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 1100, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 1100 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 1150. Also, the electronic device 1100 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 1160. As shown, the network adapter 1140 communicates with the other modules of the electronic device 1100 via the bus 1130. It should be appreciated that although not shown, 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, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above-mentioned "exemplary methods" section of the present description, when said program product is run on the terminal device.
Referring to fig. 12, a program product 1200 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind 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).
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (14)

1. A method of controlling a serpentine 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;
erecting more than two bones towards a target direction aiming at a target part in the plurality of component parts, wherein the target direction is determined according to the direction to be twisted of the target part;
erecting main controllers at key positions in the target part respectively, and establishing a binding relationship between each main controller and bones of the more than two bones;
and respectively controlling the motion of the bound bones according to the main controller.
2. The control method according to claim 1, characterized in that the method further comprises:
and establishing a master controller for the snake-shaped virtual object, wherein the master controller is used for controlling all the master controllers.
3. The control method according to claim 2, wherein the overall controller is located at an origin position in a spatial coordinate system, and the overall controller is used for controlling the position of the serpentine virtual object in the spatial coordinate system.
4. The control method according to claim 2, characterized in that the method further comprises:
and determining the control intensity of each master controller to each master controller according to the distance between each master controller and the master controller.
5. The control method according to claim 1, wherein the target portion is a body portion or a tail portion of the serpentine virtual object.
6. The control method according to claim 1, characterized in that the method further comprises:
generating one or more secondary controllers for any one of the primary controllers, and establishing a binding relationship between each secondary controller and a target skeleton, wherein the target skeleton is determined according to the skeleton having the binding relationship with the corresponding primary controller, and the primary controller is used for controlling the corresponding one or more secondary controllers.
7. The control method of claim 6, wherein said generating one or more secondary controllers for any of said primary controllers comprises:
determining the target number of the secondary controllers to be established according to the distance between the target main controller and the adjacent main controller;
generating the target number of secondary controllers for the target primary controller.
8. The control method according to claim 6, characterized in that the method further comprises:
and determining the control intensity of the main controller to each corresponding secondary controller according to the distance between the main controller and each corresponding secondary controller.
9. The control method according to claim 1, wherein the erecting two or more bones in a target direction for a target site among the plurality of component sites includes:
at least two bones are erected in a direction perpendicular to a central axis of the target portion at a predetermined interval.
10. The control method according to claim 9, wherein the two or more bones start from a center point of the target site, the center point being a point on the central axis.
11. The control method according to claim 1, wherein the key location is a joint location of the serpentine virtual object.
12. An apparatus for controlling a serpentine virtual object, comprising:
an object dividing module configured to divide a serpentine virtual object into a plurality of component parts according to a structure of the serpentine virtual object;
a bone erecting module configured to erect two or more bones in a target direction for a target site of the plurality of component sites, the target direction being determined according to a direction in which the target site is to be twisted;
a relationship binding module configured to respectively erect main controllers at key positions in the target part and establish a binding relationship between each main controller and a bone of the more than two bones;
a bone motion module configured to control motion of the bound bones according to the master controller, respectively.
13. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method for controlling a serpentine virtual object according to any one of claims 1 to 11.
14. An electronic device, comprising:
a processor;
a memory for storing executable instructions of the processor;
wherein the processor is configured to execute the method of controlling a serpentine virtual object of any of claims 1-11 via execution of the executable instructions.
CN202011088478.6A 2020-10-13 2020-10-13 Control method and device of snake-shaped virtual object, storage medium and electronic equipment Pending CN112169337A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011088478.6A CN112169337A (en) 2020-10-13 2020-10-13 Control method and device of snake-shaped virtual object, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011088478.6A CN112169337A (en) 2020-10-13 2020-10-13 Control method and device of snake-shaped virtual object, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN112169337A true CN112169337A (en) 2021-01-05

Family

ID=73949422

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011088478.6A Pending CN112169337A (en) 2020-10-13 2020-10-13 Control method and device of snake-shaped virtual object, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112169337A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009146103A (en) * 2007-12-13 2009-07-02 Konami Digital Entertainment Co Ltd Image generation device, image generation method and program
CN102542867A (en) * 2010-12-21 2012-07-04 微软公司 Driving simulator control with virtual skeleton
CN105945925A (en) * 2016-04-28 2016-09-21 中国科学院合肥物质科学研究院 Control method of bionic snake-shaped robot
JP2019084665A (en) * 2017-11-02 2019-06-06 国立大学法人電気通信大学 Robot control device, robot, robot system and program
CN110812840A (en) * 2019-10-31 2020-02-21 武汉微派网络科技有限公司 Game object control method and device, readable storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009146103A (en) * 2007-12-13 2009-07-02 Konami Digital Entertainment Co Ltd Image generation device, image generation method and program
CN102542867A (en) * 2010-12-21 2012-07-04 微软公司 Driving simulator control with virtual skeleton
CN105945925A (en) * 2016-04-28 2016-09-21 中国科学院合肥物质科学研究院 Control method of bionic snake-shaped robot
JP2019084665A (en) * 2017-11-02 2019-06-06 国立大学法人電気通信大学 Robot control device, robot, robot system and program
CN110812840A (en) * 2019-10-31 2020-02-21 武汉微派网络科技有限公司 Game object control method and device, readable storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN109848985B (en) Robot graphic programming method and device and intelligent terminal
JP6373425B2 (en) Instruction to shift multiple bits to the left and pull multiple 1s into multiple lower bits
US10977076B2 (en) Method and apparatus for processing a heterogeneous cluster-oriented task
CN111062864B (en) Animation model scaling method and device, electronic equipment and storage medium
TWI550547B (en) A graphics processing unit employing a standard processing unit and a method of constructing a graphics processing unit
CN109550250B (en) Virtual object skeleton data processing method and device, storage medium and electronic equipment
CN110555900A (en) rendering instruction processing method and device, storage medium and electronic equipment
CN112306481A (en) Code display method, system, device and storage medium for graphical programming scene
CN111369647B (en) Information processing method and device, computer storage medium and electronic equipment
WO2023138504A1 (en) Image rendering method and apparatus, electronic device, and storage medium
CN110471654A (en) The cloud development system and computer software program product of communication protocol
CN108279956B (en) Progress indicating method, progress indicating device, storage medium and electronic equipment
CN112169337A (en) Control method and device of snake-shaped virtual object, storage medium and electronic equipment
CN113971048A (en) Application program starting method and device, storage medium and electronic equipment
CN112269571A (en) Modular code development method and device
WO2024007496A1 (en) Image processing method and apparatus, and electronic device and storage medium
CN108734774B (en) Virtual limb construction method and device and human-computer interaction method
CN114937059A (en) Motion control method and device for display object
CN115268447A (en) Robot pose control method and device based on Bezier curve and electronic equipment
CN115221083A (en) PCIe interrupt processing method, device, equipment and medium
JP7265618B2 (en) Method and Apparatus for Optimizing Processor Memory for Deep Learning Training Tasks
CN114028814A (en) Virtual building upgrading method and device, computer storage medium and electronic equipment
CN113134236A (en) Game role control method and device, storage medium and electronic equipment
CN113780554B (en) Processing method and device of deep reinforcement learning model, medium and electronic equipment
CN111768475A (en) Method and device for processing animation skeleton, computer readable medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination