CN108133505A - Bone beformable body implementation method, device and electronic equipment - Google Patents
Bone beformable body implementation method, device and electronic equipment Download PDFInfo
- Publication number
- CN108133505A CN108133505A CN201711459833.4A CN201711459833A CN108133505A CN 108133505 A CN108133505 A CN 108133505A CN 201711459833 A CN201711459833 A CN 201711459833A CN 108133505 A CN108133505 A CN 108133505A
- Authority
- CN
- China
- Prior art keywords
- bone
- frame position
- father
- next frame
- current frame
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T13/00—Animation
- G06T13/20—3D [Three Dimensional] animation
- G06T13/40—3D [Three Dimensional] animation of characters, e.g. humans, animals or virtual beings
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/55—Controlling game characters or game objects based on the game progress
- A63F13/56—Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T19/00—Manipulating 3D models or images for computer graphics
- G06T19/20—Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F2300/00—Features 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/60—Methods for processing data by generating or executing the game program
- A63F2300/66—Methods for processing data by generating or executing the game program for rendering three dimensional images
- A63F2300/6607—Methods for processing data by generating or executing the game program for rendering three dimensional images for animating game characters, e.g. skeleton kinematics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30004—Biomedical image processing
- G06T2207/30008—Bone
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2219/00—Indexing scheme for manipulating 3D models or images for computer graphics
- G06T2219/20—Indexing scheme for editing of 3D models
- G06T2219/2016—Rotation, translation, scaling
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Human Computer Interaction (AREA)
- Architecture (AREA)
- Computer Graphics (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Processing Or Creating Images (AREA)
Abstract
The embodiment of the present invention provides a kind of bone beformable body implementation method, device and electronic equipment, this method and includes:The corresponding skeletal joint tree of target object is created, skeletal joint tree is made of multiple bones;For each bone with itself father's bone, the current frame position of the bone and next frame position are obtained, and obtains the current frame position of father's bone of the bone and next frame position;Rotation amount of the bone relative to father's bone is calculated according to the current frame position and next frame position of the current frame position of the bone and next frame position and father's bone;The skeletal chain between the bone and father's bone is controlled to be rotated around father's bone so that the bone is moved to next frame position from current frame position according to rotation amount.The movement of bone is converted to the rotation of bone and the skeletal chain before father's bone, avoids a large amount of computing cost caused by opposite vertexes of the prior art calculate one by one, improve the operational efficiency of beformable body by the bone beformable body implementation.
Description
Technical field
The present invention relates to Computer Animated Graph field, in particular to a kind of bone beformable body implementation method, device and
Electronic equipment.
Background technology
The authenticity and expression effect of picture can be promoted using beformable body in 3D game, such as:With the wind the cloth of Dutch roll,
Hair etc..Due to the movement of beformable body be based on true physical computing obtain as a result, its Picture Showing is very true, it is and normal
Skeleton cartoon compare, skeleton cartoon is the effect that the fine arts mix up in advance, and no matter how role, which moves, is finally presented on player
In front will be that one determining as a result, and beformable body then can show different as a result, being with the difference of the movement of role
It is really calculated based on physics, better expression effect can be brought.
In the prior art, the mode for realizing bone beformable body is to calculate its physical location for each vertex of model and do
Collision detection, then original form is also preserved by related algorithm while ensureing the movement of model vertices.This mode is most
The effect obtained eventually is preferable, but its cost is the big CPU calculating of tool.Because each vertex of beformable body model in this fashion
There are participation physical computing, collision detection.If a normal actor model has 5000 vertex, it is necessary to calculate 5000 times, count
It is very big to calculate expense.Although currently providing GPU accelerates the solution calculated, with the visible master of screen in large-scale network game
Angle is very more, after some time it is possible to reach hundreds of people, each leading role can have many beformable body models, and such calculation amount common computer is difficult to hold
It receives.
Invention content
In view of this, the object of the present invention is to provide a kind of bone beformable body implementation method, device and electronic equipments to solve
The certainly above problem.
Present pre-ferred embodiments provide a kind of bone beformable body implementation method, the method includes:
The corresponding skeletal joint tree of target object is created, the skeletal joint tree is made of multiple bones, each bone
Father's bone and/or sub- bone with itself;
For each bone with itself father's bone, the current frame position of the bone and next frame position are obtained, and
Obtain the current frame position of father's bone of the bone and next frame position;
According to the current frame position of the current frame position of the bone and next frame position and father's bone and next
Rotation amount of the bone relative to father's bone is calculated in frame position;
The bone is controlled to be rotated around his father's bone according to the rotation amount so that the bone is from current frame position
It is moved to next frame position.
Further, it is described according to the current of the current frame position of the bone and next frame position and father's bone
The step of rotation amount of the bone relative to father's bone is calculated in frame position and next frame position, including:
According to next frame position of next frame position of the bone and father's bone be calculated the bone with
Primary vector between father's bone;
The bone and institute are calculated according to next frame position of the current location of the bone and father's bone
State the secondary vector between father's bone;
Rotation of the bone relative to father's bone is calculated according to the primary vector and the secondary vector
Amount.
Further, it is described the bone to be controlled to be rotated around his father's bone so that the bone according to the rotation amount
The step of next frame position being moved to from current frame position, including:
Obtain the skeletal chain between the bone and father's bone;
In father's bone after current frame position is moved to next frame position, the bone is made according to the rotation amount
Bone chain is rotated around next frame position of father's bone, so that the bone is moved to next frame position from current frame position.
Further, described to be directed to each bone with itself father's bone, the current frame position for obtaining the bone arrives
Before the step of primary vector of next frame position, the method further includes:
The physical attribute of each bone is set, and the physical attribute includes bone rigidity, gravity and bone in movement
At least one of resistance opposite with moving direction being subject in the process.
Further, it is described the bone to be controlled to be rotated around his father's bone so that the bone according to the rotation amount
Before the step of being moved to next frame position from current frame position, the method further includes:
The rotation amount being calculated is adjusted according to the physical attribute.
Further, the step of current frame position and next frame of the acquisition bone, including:
The current frame position of the bone and the previous frame position of the bone are obtained, the previous frame position is calculated
Put the history vectors of the current frame position;
The bone is calculated from the previous frame position to the interval duration the current frame position;
Next frame position of the bone is obtained according to the history vectors and the interval duration calculation.
Another preferred embodiment of the present invention provides a kind of bone beformable body realization device, and described device includes:
Creation module, for creating the corresponding skeletal joint tree of target object, the skeletal joint tree is by multiple bone groups
Into each bone has the father's bone of itself and/or sub- bone;
Position acquisition module for being directed to each bone with itself father's bone, obtains the current framing bit of the bone
Put with next frame position, and obtain the current frame position of father's bone of the bone and next frame position;
Computing module, for the current of the current frame position according to the bone and next frame position and father's bone
Rotation amount of the bone relative to father's bone is calculated in frame position and next frame position;
Rotary module, for the bone being controlled to be rotated around his father's bone so that the bone according to the rotation amount
Next frame position is moved to from current frame position.
Further, the computing module includes primary vector computing unit, secondary vector computing unit and rotation amount
Computing unit;
The primary vector computing unit is used for according to the next of next frame position of the bone and father's bone
The primary vector between the bone and father's bone is calculated in frame position;
The secondary vector computing unit is used for according to the current location of the bone and the next frame of father's bone
The secondary vector between the bone and father's bone is calculated in position;
The rotation amount computing unit is used to that the bone to be calculated according to the primary vector and the secondary vector
Relative to the rotation amount of father's bone.
Further, the rotary module includes skeletal chain acquiring unit and rotary unit;
The skeletal chain acquiring unit is used to obtain the skeletal chain between the bone and father's bone;
The rotary unit is used in father's bone after current frame position is moved to next frame position, according to institute
Stating rotation amount makes the skeletal chain be rotated around next frame position of father's bone, so that the bone is moved from current frame position
To next frame position.
Another preferred embodiment of the present invention provides a kind of electronic equipment, including:
Memory;
Processor;And
Bone beformable body realization device is stored in the memory including one or more and is performed by the processor
Software function module, the bone beformable body realization device include:
Creation module, for creating the corresponding skeletal joint tree of target object, the skeletal joint tree is by multiple bone groups
Into each bone has the father's bone of itself and/or sub- bone;
Position acquisition module for being directed to each bone with itself father's bone, obtains the current framing bit of the bone
Put with next frame position, and obtain the current frame position of father's bone of the bone and next frame position;
Computing module, for the current of the current frame position according to the bone and next frame position and father's bone
Rotation amount of the bone relative to father's bone is calculated in frame position and next frame position;
Rotary module, for the bone being controlled to be rotated around his father's bone so that the bone according to the rotation amount
Next frame position is moved to from current frame position.
Bone beformable body implementation method provided in an embodiment of the present invention, device and electronic equipment pass through the bone for obtaining and creating
The current frame position and next frame position of each bone in the tree of joint and the current frame position of father's bone of the bone are under
One frame position, so as to which rotation amount of the bone relative to father's bone be calculated.Further according to described in rotation amount control
Bone is rotated around his father's bone so that the bone is moved to next frame position from current frame position.The bone beformable body is realized
Scheme, using next frame position of father's bone and the current frame position of bone and next frame position is calculated, by the movement of bone
The rotation of bone and the skeletal chain before father's bone is converted to, is avoided big caused by opposite vertexes of the prior art calculate one by one
The computing cost of amount improves the operational efficiency of beformable body.
For the above objects, features and advantages of the present invention is enable to be clearer and more comprehensible, preferred embodiment cited below particularly, and coordinate
Appended attached drawing, is described in detail below.
Description of the drawings
It in order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached
Figure is briefly described, it should be understood that the following drawings illustrates only certain embodiments of the present invention, therefore is not construed as pair
The restriction of range, for those of ordinary skill in the art, without creative efforts, can also be according to this
A little attached drawings obtain other relevant attached drawings.
Fig. 1 is the structure diagram of electronic equipment that present pre-ferred embodiments provide.
Fig. 2 is the flow chart of bone beformable body implementation method that present pre-ferred embodiments provide.
Fig. 3 is the schematic diagram of a kind of skeletal joint tree that present pre-ferred embodiments provide.
Fig. 4 is another flow chart of bone beformable body implementation method that present pre-ferred embodiments provide.
Fig. 5 is the flow chart of the sub-step of step S105 in Fig. 2.
Fig. 6 is the flow chart of the sub-step of step S107 in Fig. 2.
Fig. 7 is the functional block diagram of bone beformable body realization device that present pre-ferred embodiments provide.
Fig. 8 is the functional block diagram of computing module that present pre-ferred embodiments provide.
Fig. 9 is the functional block diagram of rotary module that present pre-ferred embodiments provide.
Icon:100- electronic equipments;110- bone beformable body realization devices;111- creation modules;112- position acquisition modules;
113- computing modules;1131- primary vector computing units;1132- secondary vector computing units;1133- rotation amount computing units;
114- rotary modules;1141- skeletal chain acquiring units;1142- rotary units;120- processors;130- memories.
Specific embodiment
Below in conjunction with attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete
Ground describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.Usually exist
The component of the embodiment of the present invention described and illustrated in attached drawing can be configured to arrange and design with a variety of different herein.Cause
This, the detailed description of the embodiment of the present invention to providing in the accompanying drawings is not intended to limit claimed invention below
Range, but it is merely representative of the selected embodiment of the present invention.Based on the embodiment of the present invention, those skilled in the art are not doing
Go out all other embodiments obtained under the premise of creative work, shall fall within the protection scope of the present invention.
It should be noted that:Similar label and letter represents similar terms in following attached drawing, therefore, once a certain Xiang Yi
It is defined in a attached drawing, does not then need to that it is further defined and explained in subsequent attached drawing.Meanwhile the present invention's
In description unless specifically defined or limited otherwise, term " installation ", " setting ", " connection " should be interpreted broadly, for example, can
To be to be fixedly connected or be detachably connected or be integrally connected;Can be mechanical connection or electrical connection;It can
It to be to be connected directly, can also be indirectly connected by intermediary, can be the connection inside two elements.For this field
For those of ordinary skill, the concrete meaning of above-mentioned term in the present invention can be understood with concrete condition.
Referring to Fig. 1, the block diagram for electronic equipment 100 provided in an embodiment of the present invention.In the present embodiment, institute
It states electronic equipment 100 and includes bone beformable body realization device 110, processor 120 and memory 130.Wherein, the memory
It is directly or indirectly electrically connected between 130 and processor 120, to realize the transmission of data or interaction.The bone beformable body is real
Existing device 110 in the form of software or firmware can be stored in the memory 130 or be solidificated in the electricity including at least one
Software function module in the operating system of sub- equipment 100.The processor 120 be used for perform stored in memory 130 can
Execution module, such as the software function module or computer program that the bone beformable body realization device 110 includes, with to target pair
As realizing beformable body operation.
In the present embodiment, the electronic equipment 100 may be, but not limited to, with data processing and image-capable
Terminal device, such as PC, laptop etc..
As shown in Fig. 2, it is that a kind of bone applied to electronic equipment 100 shown in FIG. 1 provided in an embodiment of the present invention is soft
The schematic flow chart of body implementation method.It should be noted that method provided in this embodiment is not with Fig. 2 and as described below suitable
Sequence is limitation.Idiographic flow shown in Fig. 2 will be explained in detail below.
Step S101 creates the corresponding skeletal joint tree of target object, and the skeletal joint tree is made of multiple bones, respectively
The bone has the father's bone of itself and/or sub- bone.
Role generally employs skeleton cartoon technology in 3D game, and the fine arts are using 3dsmax tools the bone of role
It puts up, the movement locus of fine arts adjustment bone exports to animation file, plays and is reappeared by playing corresponding animation file
The skeleton motion effect of the fine arts, model are attached on bone finally by covering technology and move together, are finally formed role
Animation effect.
In the present embodiment for bone physical motion calculated rather than directly computation model vertex.It is because each
The bone quantity of role is compared to being considerably less for model vertices, for example, the normal general bone number of a leading role is on 100 left sides
The right side, and may to reach 5000 even more for model vertices.By calculating the physical motion track of bone in the present embodiment, to control
Corresponding model sport is made to achieve the effect that similar beformable body.Its calculation amount is calculated with vertex and is compared very in this way
Few, more than improved efficiency decades of times, cost performance is very high, and the great promotion that efficiency obtains is very suitable for needing a large amount of beformable body meters
The scene of calculation.
In the present embodiment, corresponding skeletal joint tree is created for target object, wherein, the target object can be more
The animation model of type, such as weapon, its in picture that animation human body, animation face, the hair on human body, personage are held
His object, such as cloud, animal.
When establishing of skeletal joint tree is being carried out, for target object, multiple key points of the target object are being obtained, each
Key point sets corresponding skeleton point, and each bone is attached, obtains the skeletal chain between bone and bone.Wherein, it establishes
The skeletal joint tree include multiple bones, each bone may have the father's bone of itself and sub- bone, it is also possible to
There are some bones that only there is father's bone without sub- bone, it is also possible to there are some bones that only there is sub- bone without father's bone
Bone.Wherein only the bone with sub- bone is known as root bone, and the bone for only having father's bone is known as end bone.In root bone
Each bone between the bone of end is both with the father's bone of itself or with sub- bone.For example, as shown in figure 3, skeleton point 1
For the root bone in the skeletal joint tree, which only has sub- bone, i.e. skeleton point 2 and 3.Skeleton point 4,5,6 is the bone
The end bone of bone joint tree, this kind of bone only have father's bone, wherein father bone of the skeleton point 2 for skeleton point 4, skeleton point 3
Father's bone for skeleton point 5 and 6.Remaining skeleton point 2 and 3 is both with father's bone or with sub- bone, for skeleton point 2, bone
Bone point 1 is his father's bone, and skeleton point 4 is its sub- bone.For skeleton point 3, skeleton point 5 and 6 is its sub- bone, and skeleton point 1 is
His father's bone.
Step S102 for each bone with itself father's bone, obtains the current frame position of the bone and next
Frame position, and obtain the current frame position of father's bone of the bone and next frame position.
In the present embodiment, bone beformable body fortune is carried out generally be directed to each bone (i.e. non-root bone) with father's bone
It calculates, because root bone is generally the intersection of dynamic object and static object, the movement locus of root bone is mainly by static right
As determining, the animation controller in usually being made a reservation for or played in advance by the fine arts determines, therefore bone provided in this embodiment
The realization of bone beformable body can not be directed to root bone.
Optionally, for each bone with father's bone, the current frame position of the bone and next frame position are obtained, and
Obtain the current frame position of father's bone of the bone and next frame position.
Referring to Fig. 4, in the present embodiment, the current frame position of the bone and next can be obtained by following steps
Position:
Step S201 obtains the current frame position of the bone and the previous frame position of the bone, institute is calculated
Previous frame position is stated to the history vectors of the current frame position.
Step S202 calculates the bone from the previous frame position to the interval duration the current frame position.
Step S203 obtains next framing bit of the bone according to the history vectors and the interval duration calculation
It puts.
In the present embodiment, for each skeleton point, according to the current frame position of the bone and previous frame location information
Extrapolate next frame position of the bone.Optionally, it is calculated according to the current frame position of the bone and previous frame position
Previous frame position to current frame position history vectors, wherein, which carries directional information and size information.Root
The movement tendency of the bone can be obtained according to the history vectors, subsequently to extrapolate next frame position of the bone.
Further, the bone is calculated from previous frame position transfer to current frame position the time it takes, it should
It is sampling duration when implementing to be spaced duration.With reference to the history between the previous frame position of the bone and current frame position to
Amount and the duration calculation spent from previous frame position transfer to current frame position go out next frame position of the bone.About
The specific calculating process of next frame position can refer to the prior art to obtain more knowledge, and the present embodiment does not repeat.
Similarly, the calculating process of the current frame position for father's bone of the bone and next frame position is the same as the bone
Calculating process is similar, such as obtains the current frame position of father's bone and the previous frame position of father's bone, calculates
To the previous frame position of father's bone to the vector value between current frame position.And father's bone is calculated from a frame position thereon
To the interval duration between current frame position, father's bone is obtained according to the vector value and interval duration calculation that are calculated
Next frame position.
In the present embodiment, when it is implemented, extraneous factors can realize that process impacts to bone beformable body.Therefore
Before bone site information calculating is carried out, the step of the method further includes the physical attribute for setting each bone.Wherein,
The physical attribute includes bone rigidity, resistance opposite with moving direction that gravity and bone are subject in moving process etc.
Deng.
Step S103, according to the current frame position of the bone and next frame position and the current framing bit of father's bone
It puts and rotation amount of the bone relative to father's bone is calculated with next frame position.
Referring to Fig. 5, in the present embodiment, step S105 can include step S1051, step S1052 and step
Tri- sub-steps of S1053.
Step S1051 is calculated according to next frame position of next frame position of the bone and father's bone
Primary vector between the bone and father's bone.
Step S1052 is calculated according to next frame position of the current frame position of the bone and father's bone
Secondary vector between the bone and father's bone.
The bone is calculated relative to the father according to the primary vector and the secondary vector in step S1053
The rotation amount of bone.
It in the present embodiment, can be according between skeleton point and his father's bone after skeleton point data structure building finishes
Change in location situation rotation amount is calculated.Optionally, it is illustrated by taking the skeletal joint tree shown in Fig. 3 as an example, if bone
The current frame position of bone 4 is P4, and next frame position of the bone 4 is NP4.Father's bone of the bone 4 is bone 2, if bone 2
Current frame position for P2, next frame position of bone 2 is NP2.It can then be calculated as follows to obtain next frame position of bone 4
Primary vector between NP4 and next frame position NP2 of bone 2:
V1=NP4-NP2 (vector of 4 new position of bone to 2 new position of bone)
The secondary vector between the current frame position P4 of bone 4 and next frame position NP2 of bone 2 is calculated again, has
Body is as follows:
V2=P4-NP2 (the old vector to 2 new position of bone of bone 4)
Optionally, bone 4 is calculated relative to bone 2 according to the primary vector V1 and secondary vector V2 that are calculated
Rotation amount, it is specific as follows:
R=RotationFromAxisToAxis (V2, V1)
Wherein, R is the rotation amount being equal between the vectorial axis of V1, V2 two.
In the present embodiment, since extraneous factor may impact result of calculation, lead to error, therefore be calculated
After rotation amount of the bone relative to his father's bone, influence of the extraneous factor to the result being calculated is considered, such as utilize setting
Physical attribute be adjusted to rotation amount is calculated, so as to obtain final accurate rotation amount.
Step S104 controls the skeletal chain between the bone and father's bone around father's bone according to the rotation amount
Bone is rotated so that the bone is moved to next frame position from current frame position.
Referring to Fig. 6, in the present embodiment, step S107 can include two sub-steps of step S1071 and step S1072
Suddenly.
Step S1071 obtains the skeletal chain between the bone and father's bone.
Step S1072, in father's bone after current frame position is moved to next frame position, according to the rotation
Amount make the skeletal chain around father's bone next frame position rotate so that the bone be moved to from current frame position it is next
Frame position.
In the present embodiment, after bone is calculated relative to the rotation amount between his father's bone, from the bone
The skeletal chain between the bone and his father's bone is obtained in the tree of joint.In the specific implementation, when father's bone of the bone is from current
Frame position is moved to after its corresponding next frame position, according to the rotation amount being calculated control the bone and his father's bone it
Between skeletal chain using the position after the movement of father's bone as axis point, to be rotated around the axis point, so as to make in the skeletal chain
The bone of end be moved to next frame position from current frame position.So, it can be achieved that the movement on vertex is converted to bone
The rotation of chain reduces the calculation amount of vertex information.
Referring to Fig. 7, for a kind of functional block diagram of bone beformable body realization device 110 provided in an embodiment of the present invention.
The bone beformable body realization device 110 is applied to above-mentioned electronic equipment 100, and the bone beformable body realization device 110 includes wound
Model block 111, position acquisition module 112, computing module 113 and rotary module 114.
The creation module 111 is for creating the corresponding skeletal joint tree of target object, and the skeletal joint tree is by multiple
Bone forms, and each bone has the father's bone of itself and/or sub- bone.The creation module 111 can be used for performing institute in Fig. 2
The step S101 shown, specific operating method can refer to the detailed description of step S101.
The position acquisition module 112 is used to be directed to each bone with itself father's bone, obtains working as the bone
Preceding frame position and next frame position, and obtain the current frame position of father's bone of the bone and next frame position.The position acquisition
Module 112 can be used for performing step S102 shown in Fig. 2, and specific operating method can refer to the detailed description of step S102.
The computing module 113 is used for according to the current frame position of the bone and next frame position and father's bone
Current frame position and next frame position rotation amount of the bone relative to father's bone is calculated.The computing module
113 can be used for performing step S103 shown in Fig. 2, and specific operating method can refer to the detailed description of step S103.
The rotary module 114 is used to control the skeletal chain between the bone and father's bone according to the rotation amount
It is rotated around father's bone so that the bone is moved to next frame position from current frame position.The rotary module 114 can
For performing step S104 shown in Fig. 2, specific operating method can refer to the detailed description of step S104.
Referring to Fig. 8, in the present embodiment, the computing module 113 include primary vector computing unit 1131, second to
Measure computing unit 1132 and rotation amount computing unit 1133.
The primary vector computing unit 1131 is used for according to next frame position of the bone and father's bone
The primary vector between the bone and father's bone is calculated in next frame position.The primary vector computing unit 1131 can
For performing the step S1051 shown in Fig. 5, specific operating method can refer to the detailed description of step S101.
The secondary vector computing unit 1132 is used for according to the current frame position of the bone and father's bone
The secondary vector between the bone and father's bone is calculated in next frame position.The secondary vector computing unit 1132 can
For performing the step S1052 shown in Fig. 5, specific operating method can refer to the detailed description of step S1052.
The rotation amount computing unit 1133 is used for according to being calculated the primary vector and the secondary vector
Bone relative to father's bone rotation amount.The step of rotation amount computing unit 1133 can be used for performing shown in Fig. 5
S1053, specific operating method can refer to the detailed description of step S1053.
Referring to Fig. 9, in the present embodiment, the rotary module 114 includes skeletal chain acquiring unit 1141 and rotation
Unit 1142.
The skeletal chain acquiring unit 1141 is used to obtain the skeletal chain between the bone and father's bone.The bone
Chain acquiring unit 1141 can be used for performing the step S1071 shown in Fig. 6, and specific operating method can refer to step S1071's
Detailed description.
The rotary unit 1142 is used in father's bone after current frame position is moved to next frame position, root
The skeletal chain is made to be rotated around next frame position of father's bone according to the rotation amount, so that the bone is from current frame position
It is moved to next frame position.The rotary unit 1142 can be used for performing the step S1072 shown in Fig. 6, specific operating method
It can refer to the detailed description of step S1072.
It is apparent to those skilled in the art that for convenience and simplicity of description, each work(of foregoing description
The specific work process of energy module can refer to the corresponding process in preceding method, no longer excessively repeat herein.
In conclusion bone beformable body implementation method provided in an embodiment of the present invention, device and electronic equipment 100, by obtaining
The current frame position and next frame position of each bone in the skeletal joint tree that must be created and father's bone of the bone are worked as
Preceding frame position and next frame position, so as to which rotation amount of the bone relative to father's bone be calculated.Further according to the rotation
Turning amount controls the bone to be rotated around his father's bone so that the bone is moved to next frame position from current frame position.It should
Bone beformable body implementation, using calculating next frame position of father's bone and the current frame position of bone and next frame position,
The movement of bone is converted to the rotation of bone and the skeletal chain before father's bone, avoids opposite vertexes of the prior art one by one
A large amount of computing cost caused by calculating improves the operational efficiency of beformable body.Also, the bone beformable body implementation skeletal chain number
It is simple according to parameter setting, and rotation amount computational methods are succinct, it can be achieved that fast and efficiently bone beformable body moves.
In embodiment provided herein, it should be understood that disclosed device and method, it can also be by other
Mode realize.The apparatus embodiments described above are merely exemplary, for example, the flow chart and block diagram in attached drawing are shown
Architectural framework in the cards, function and the behaviour of devices in accordance with embodiments of the present invention, method and computer program product
Make.In this regard, each box in flow chart or block diagram can represent a part for a module, program segment or code, institute
The part for stating module, program segment or code includes the executable instruction that one or more is used to implement defined logic function.
It should also be noted that at some as in the realization method replaced, the function that is marked in box can also be to be different from attached drawing
The sequence marked occurs.For example, two continuous boxes can essentially perform substantially in parallel, they sometimes can also be by
Opposite sequence performs, this is depended on the functions involved.It is also noted that each box in block diagram and/or flow chart,
And the combination of the box in block diagram and/or flow chart, function as defined in performing or the dedicated of action can be used to be based on hardware
System realize or can be realized with the combination of specialized hardware and computer instruction.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row
His property includes, so that process, method, article or equipment including a series of elements not only include those elements, and
And it further includes other elements that are not explicitly listed or further includes intrinsic for this process, method, article or equipment institute
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including institute
State in process, method, article or the equipment of element that also there are other identical elements.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, that is made any repaiies
Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.It should be noted that:Similar label and letter exists
Similar terms are represented in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, are then not required in subsequent attached drawing
It is further defined and is explained.
The above description is merely a specific embodiment, but protection scope of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can readily occur in change or replacement, should all contain
Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.
Claims (10)
1. a kind of bone beformable body implementation method, which is characterized in that the method includes:
The corresponding skeletal joint tree of target object is created, the skeletal joint tree is made of multiple bones, and each bone has
The father's bone and/or sub- bone of itself;
For each bone with itself father's bone, the current frame position of the bone and next frame position are obtained, and obtain
The current frame position and next frame position of father's bone of the bone;
According to the current frame position and next framing bit of the current frame position of the bone and next frame position and father's bone
It puts and rotation amount of the bone relative to father's bone is calculated;
According to the rotation amount control skeletal chain between the bone and father's bone around father's bone rotated with
The bone is made to be moved to next frame position from current frame position.
2. bone beformable body implementation method according to claim 1, which is characterized in that the present frame according to the bone
The current frame position and next frame position of position and next frame position and father's bone be calculated the bone relative to
The step of rotation amount of father's bone, including:
According to next frame position of next frame position of the bone and father's bone be calculated the bone with it is described
Primary vector between father's bone;
The bone and the father are calculated according to next frame position of the current location of the bone and father's bone
Secondary vector between bone;
Rotation amount of the bone relative to father's bone is calculated according to the primary vector and the secondary vector.
3. bone beformable body implementation method according to claim 1, which is characterized in that described that institute is controlled according to the rotation amount
The skeletal chain stated between bone and father's bone is rotated around father's bone so that the bone is moved from current frame position
The step of moving next frame position, including:
Obtain the skeletal chain between the bone and father's bone;
In father's bone after current frame position is moved to next frame position, the skeletal chain is made according to the rotation amount
Next frame position around father's bone rotates, so that the bone is moved to next frame position from current frame position.
4. bone beformable body implementation method according to claim 1, which is characterized in that described to be directed to itself father's bone
Each bone obtains the current frame position of the bone and next frame position, and obtains the current framing bit of father's bone of the bone
It puts with before the step of next frame position, the method further includes:
The physical attribute of each bone is set, and the physical attribute includes bone rigidity, gravity and bone in moving process
In at least one of the resistance opposite with moving direction that is subject to.
5. bone beformable body implementation method according to claim 4, which is characterized in that described that institute is controlled according to the rotation amount
The skeletal chain stated between bone and father's bone is rotated around father's bone so that the bone is moved from current frame position
Before the step of moving next frame position, the method further includes:
The rotation amount being calculated is adjusted according to the physical attribute.
6. bone beformable body implementation method according to claim 1, which is characterized in that the current framing bit for obtaining the bone
The step of putting with next frame position, including:
The current frame position of the bone and the previous frame position of the bone are obtained, the previous frame position is calculated and arrives
The history vectors of the current frame position;
The bone is calculated from the previous frame position to the interval duration the current frame position;
Next frame position of the bone is obtained according to the history vectors and the interval duration calculation.
7. a kind of bone beformable body realization device, which is characterized in that described device includes:
Creation module, for creating the corresponding skeletal joint tree of target object, the skeletal joint tree is made of multiple bones, respectively
The bone has the father's bone of itself and/or sub- bone;
Position acquisition module, for be directed to have itself father's bone each bone, obtain the bone current frame position and
Next frame position, and obtain the current frame position of father's bone of the bone and next frame position;
Computing module, for the current frame position according to the bone and next frame position and the current framing bit of father's bone
It puts and rotation amount of the bone relative to father's bone is calculated with next frame position;
Rotary module, for controlling the skeletal chain between the bone and father's bone according to the rotation amount around father's bone
Bone is rotated so that the bone is moved to next frame position from current frame position.
8. bone beformable body realization device according to claim 7, which is characterized in that the computing module includes primary vector
Computing unit, secondary vector computing unit and rotation amount computing unit;
The primary vector computing unit is used for according to next frame position of the bone and next framing bit of father's bone
Put the primary vector being calculated between the bone and father's bone;
The secondary vector computing unit is used for according to the current frame position of the bone and next framing bit of father's bone
Put the secondary vector being calculated between the bone and father's bone;
The rotation amount computing unit is opposite for the bone to be calculated according to the primary vector and the secondary vector
In the rotation amount of father's bone.
9. bone beformable body realization device according to claim 7, which is characterized in that the rotary module is obtained including skeletal chain
Take unit and rotary unit;
The skeletal chain acquiring unit is used to obtain the skeletal chain between the bone and father's bone;
The rotary unit is used in father's bone after current frame position is moved to next frame position, according to the rotation
Turning amount makes the skeletal chain be rotated around next frame position of father's bone, so that the bone is moved to down from current frame position
One frame position.
10. a kind of electronic equipment, which is characterized in that including:
Memory;
Processor;And
Bone beformable body realization device, the software for being stored in the memory and being performed by the processor including one or more
Function module, the bone beformable body realization device include:
Creation module, for creating the corresponding skeletal joint tree of target object, the skeletal joint tree is made of multiple bones, respectively
The bone has the father's bone of itself and/or sub- bone;
Position acquisition module, for be directed to have itself father's bone each bone, obtain the bone current frame position and
Next frame position, and obtain the current frame position of father's bone of the bone and next frame position;
Computing module, for the current frame position according to the bone and next frame position and the current framing bit of father's bone
It puts and rotation amount of the bone relative to father's bone is calculated with next frame position;
Rotary module, for the bone being controlled to be rotated around his father's bone according to the rotation amount so that the bone is from working as
Preceding frame position is moved to next frame position.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711459833.4A CN108133505A (en) | 2017-12-28 | 2017-12-28 | Bone beformable body implementation method, device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711459833.4A CN108133505A (en) | 2017-12-28 | 2017-12-28 | Bone beformable body implementation method, device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108133505A true CN108133505A (en) | 2018-06-08 |
Family
ID=62393640
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711459833.4A Pending CN108133505A (en) | 2017-12-28 | 2017-12-28 | Bone beformable body implementation method, device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108133505A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109568952A (en) * | 2018-11-21 | 2019-04-05 | 北京像素软件科技股份有限公司 | 3D game bone processing method and processing device |
CN110136232A (en) * | 2019-05-16 | 2019-08-16 | 北京迈格威科技有限公司 | Processing method, device, electronic equipment and the storage medium of Skeletal Skinned Animation |
CN112076473A (en) * | 2020-09-11 | 2020-12-15 | 腾讯科技(深圳)有限公司 | Control method and device of virtual prop, electronic equipment and storage medium |
CN112634417A (en) * | 2020-12-25 | 2021-04-09 | 上海米哈游天命科技有限公司 | Method, device and equipment for generating role animation and storage medium |
WO2024011792A1 (en) * | 2022-07-15 | 2024-01-18 | 北京字跳网络技术有限公司 | Image processing method and apparatus, electronic device, and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105551072A (en) * | 2015-12-11 | 2016-05-04 | 网易(杭州)网络有限公司 | Method and system for realizing local real-time movement of role model |
CN105976418A (en) * | 2016-06-28 | 2016-09-28 | 珠海金山网络游戏科技有限公司 | Design system and method for human dynamic bone |
US20170018116A1 (en) * | 2015-07-14 | 2017-01-19 | Siemens Medical Solutions Usa, Inc. | 3-d vessel tree surface reconstruction method |
CN107067451A (en) * | 2017-04-07 | 2017-08-18 | 广州爱九游信息技术有限公司 | The implementation method and device of dynamic bone in animation |
-
2017
- 2017-12-28 CN CN201711459833.4A patent/CN108133505A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170018116A1 (en) * | 2015-07-14 | 2017-01-19 | Siemens Medical Solutions Usa, Inc. | 3-d vessel tree surface reconstruction method |
CN105551072A (en) * | 2015-12-11 | 2016-05-04 | 网易(杭州)网络有限公司 | Method and system for realizing local real-time movement of role model |
CN105976418A (en) * | 2016-06-28 | 2016-09-28 | 珠海金山网络游戏科技有限公司 | Design system and method for human dynamic bone |
CN107067451A (en) * | 2017-04-07 | 2017-08-18 | 广州爱九游信息技术有限公司 | The implementation method and device of dynamic bone in animation |
Non-Patent Citations (1)
Title |
---|
曲朝阳等: "运动学在游戏架构中的物理建模及应用", 《计算机应用与软件》 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109568952A (en) * | 2018-11-21 | 2019-04-05 | 北京像素软件科技股份有限公司 | 3D game bone processing method and processing device |
CN110136232A (en) * | 2019-05-16 | 2019-08-16 | 北京迈格威科技有限公司 | Processing method, device, electronic equipment and the storage medium of Skeletal Skinned Animation |
CN110136232B (en) * | 2019-05-16 | 2023-10-03 | 北京迈格威科技有限公司 | Bone skin animation processing method and device, electronic equipment and storage medium |
CN112076473A (en) * | 2020-09-11 | 2020-12-15 | 腾讯科技(深圳)有限公司 | Control method and device of virtual prop, electronic equipment and storage medium |
CN112076473B (en) * | 2020-09-11 | 2022-07-01 | 腾讯科技(深圳)有限公司 | Control method and device of virtual prop, electronic equipment and storage medium |
CN112634417A (en) * | 2020-12-25 | 2021-04-09 | 上海米哈游天命科技有限公司 | Method, device and equipment for generating role animation and storage medium |
CN112634417B (en) * | 2020-12-25 | 2023-01-10 | 上海米哈游天命科技有限公司 | Method, device and equipment for generating role animation and storage medium |
WO2024011792A1 (en) * | 2022-07-15 | 2024-01-18 | 北京字跳网络技术有限公司 | Image processing method and apparatus, electronic device, and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108133505A (en) | Bone beformable body implementation method, device and electronic equipment | |
US20220226728A1 (en) | Route navigation system within a game application environment | |
CN102651180B (en) | OSG-based (open scene graph-based) electric-electronic virtual experiment simulation system | |
CN110415521A (en) | Prediction technique, device and the computer readable storage medium of traffic data | |
CN106056660A (en) | Mobile terminal simulation particle system method | |
CN104112288B (en) | Three-dimensional skeleton model based action transition achieving method | |
CN106600665A (en) | Camera animation path generating method and device | |
CN107665269A (en) | Quick crowd evacuation emulation method and device based on geography information | |
CN105551072A (en) | Method and system for realizing local real-time movement of role model | |
CN112200893A (en) | Animation generation method, device and equipment for virtual article and storage medium | |
CN115797517A (en) | Data processing method, device, equipment and medium of virtual model | |
CN112102454A (en) | Method, device and equipment for driving facial expressions and storage medium | |
US10410393B2 (en) | Animating a virtual object in a virtual world | |
CN109167989A (en) | A kind of VR method for processing video frequency and system | |
CN107730134A (en) | Interactive Auto-Evaluation System based on VR technologies | |
Ma et al. | Towards robust direction invariance in character animation | |
CN116415933A (en) | Method and device for maintaining computing power network equipment, electronic equipment and storage medium | |
CN103578127B (en) | A kind of object turns round operation realizing method and device | |
CN110858328A (en) | Data acquisition method and device for simulating learning and storage medium | |
CN108460236A (en) | The construction method and device of educational robot model | |
Behzadan et al. | Enabling smooth and scalable dynamic 3D visualization of discrete-event construction simulations in outdoor augmented reality | |
CN108803378B (en) | Data processing method, device, flight simulator and storage medium | |
Meng | Analysis and Evaluation on the Harmfulness of Sports Dance Based on Intelligent Computing | |
Gu et al. | Constraint solving order in position based dynamics | |
CN112052738A (en) | Indoor obstacle testing method, system, equipment and readable storage medium |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180608 |
|
RJ01 | Rejection of invention patent application after publication |