CN108510582B - Rigid body generation method matched with any skeleton model - Google Patents

Rigid body generation method matched with any skeleton model Download PDF

Info

Publication number
CN108510582B
CN108510582B CN201810280588.9A CN201810280588A CN108510582B CN 108510582 B CN108510582 B CN 108510582B CN 201810280588 A CN201810280588 A CN 201810280588A CN 108510582 B CN108510582 B CN 108510582B
Authority
CN
China
Prior art keywords
skeleton
rigid body
region
bone
rigid
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.)
Active
Application number
CN201810280588.9A
Other languages
Chinese (zh)
Other versions
CN108510582A (en
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.)
Suzhou Snail Digital Technology Co Ltd
Original Assignee
Suzhou Snail Digital Technology 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 Suzhou Snail Digital Technology Co Ltd filed Critical Suzhou Snail Digital Technology Co Ltd
Priority to CN201810280588.9A priority Critical patent/CN108510582B/en
Publication of CN108510582A publication Critical patent/CN108510582A/en
Application granted granted Critical
Publication of CN108510582B publication Critical patent/CN108510582B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2219/00Indexing scheme for manipulating 3D models or images for computer graphics
    • G06T2219/20Indexing scheme for editing of 3D models
    • G06T2219/2004Aligning objects, relative positioning of parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2219/00Indexing scheme for manipulating 3D models or images for computer graphics
    • G06T2219/20Indexing scheme for editing of 3D models
    • G06T2219/2016Rotation, translation, scaling

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Graphics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Architecture (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Geometry (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention relates to a rigid body generation method matched with any skeleton model, which generates, edits and stores rigid body and joint data of a doll by directly using API provided by a physX library, and effectively integrates with a Flexi engine, thereby being more in line with the use habit of a Flexi engine user. And the corresponding rigid body and joint are automatically generated according to the skeleton and skin information of the current game role, so that a doll object is generated from nothing to one key, and the simulation effect of the role can be quickly seen. After the rigid body and the joints needed by the cloth doll are generated, the rotation angle needed by the joints can be automatically corrected according to all the bone data in the bone animation model in the current scene, so that the problem that the joint data are difficult to edit and adjust is solved, the working efficiency of a user is improved, and two cloth doll editing modes obtained by data driving and visual experience are combined.

Description

Rigid body generation method matched with any skeleton model
Technical Field
The invention relates to a rigid body generation method matched with any skeleton model, and belongs to the technical field of skeleton models.
Background
When simulating a doll effect using the physX physical engine, it is necessary to use an editor of doll rigid bodies and joints, which is a 3D Max plug-in by the Nvidia corporation. The file generated by the editor contains redundant data, and the format of the joint data between the generated rigid bodies has limitations, is not compatible with the format of a Flexi engine, and is not beneficial to the integration with the Flexi engine and related tools.
Disclosure of Invention
The invention aims to provide a rigid body generation method which is high-efficiency and smoothly suitable for Flexi engine application and matches any skeleton model.
The invention adopts the following technical scheme for solving the technical problems: the invention designs a rigid body generation method matched with any skeleton model, which is characterized by comprising the following steps:
step A, loading each bone area and joint according to a bone joint list in a game role model file based on a physX library integrated in a graphic engine, and entering step B;
b, obtaining the size and the position of a skeleton rigid body corresponding to each skeleton region according to each skeleton region matrix in the game role action file and the relation between different skeleton region matrixes, and then entering the step C;
c, correcting the rotation angle between the adjacent skeleton rigid bodies to obtain a skeleton rigid body structure corresponding to the game role;
the step C comprises the following steps:
step C1-1, obtaining a world matrix of two adjacent skeleton rigid bodies which are in accordance with the requirements of the original role model, and entering step C1-2;
c1-2, obtaining the positions of the two adjacent skeleton rigid bodies in the world matrix, and proceeding to C1-3;
step C1-3, the world matrix of the two rigid bodies which is in accordance with the requirements of the original role model is taken, and the step C1-4 is carried out;
c1-4, taking out the space positions of the two rigid bodies under the world matrix from the world matrix, and entering the step C1-5;
c1-5, selecting the middle position between two rigid body positions, putting the position into one of the rigid body local matrixes obtained according to the physx physical engine API, then transferring the rigid body matrix to the world matrix, and entering the step C1-6;
and C1-6, calculating another rigid matrix according to the same method of solving one rigid matrix.
As a preferred technical scheme of the invention: in the step B, aiming at each skeleton region, according to the skeleton region matrix in the game role action file and the relation between different skeleton region matrixes, executing the following steps to obtain the size and the position of the skeleton rigid body corresponding to the skeleton region so as to obtain the size and the position of each skeleton rigid body;
b1-1, obtaining the position and the volume of a bounding box corresponding to the skin vertex set according to the skin vertex set influenced by the bone region, judging whether the volume of the bounding box is larger than a preset bounding box volume threshold value, if so, generating a bone rigid body corresponding to the bone region, and entering the step B1-2; otherwise, the operation for the bone region is ended;
b1-2, according to the orientation data of the skin vertex positions influenced by the skeleton region, determining an origin of a three-dimensional coordinate system corresponding to the skeleton region, traversing the skin vertices influenced by the skeleton region, obtaining vectors from the origin to the skin vertices, further obtaining an average vector of the vectors, namely the Z axis of the three-dimensional coordinate system corresponding to the skeleton region, and entering the step B1-3;
and B1-3, randomly generating an X axis and a Y axis according to the origin and the Z axis of the three-dimensional coordinate system corresponding to the skeleton region, namely obtaining the orientation vector of the skeleton rigid body, and constructing the collision information of the skeleton rigid body.
As a preferred technical scheme of the invention: in the step B, aiming at each skeleton region, according to the skeleton region matrix in the game role action file and the relation between different skeleton region matrixes, executing the following steps to obtain the size and the position of the skeleton rigid body corresponding to the skeleton region so as to obtain the size and the position of each skeleton rigid body;
b2-1, determining the origin of the three-dimensional coordinate system corresponding to the skeleton region according to the orientation data of the skin vertex positions influenced by the skeleton region; traversing each skin vertex influenced by the skeleton region, obtaining vectors from the origin to each skin vertex, further obtaining an average vector U of each vector, and then entering step B2-2;
step B2-2, obtaining difference (x) between each vector and the average vector U respectively according to the vectors of the skin peaks influenced by the origin to the bone region respectivelyi,yi,zi) And go to step B2-3; wherein i is 0, …, N-1, N represents the number of skin vertices affected by the bone region;
Step B2-3, according to the difference (x) corresponding to each skin vertex influenced by the skeleton areai,yi,zi) Generating a corresponding covariance matrix, and proceeding to step B2-4;
b2-4, obtaining the eigenvector corresponding to the covariance matrix, wherein the eigenvector is the Z axis vector of the skeleton rigid body corresponding to the skeleton region, and then entering the step B2-5;
b2-5, randomly generating an X axis and a Y axis according to the origin and the Z axis of the three-dimensional coordinate system corresponding to the skeleton region, further constructing an orthogonal vector of the skeleton rigid body corresponding to the skeleton region, constructing a skeleton rigid body transformation matrix corresponding to the skeleton region according to the orthogonal vector coordinate system, and then entering the step B2-6;
b2-6, obtaining the position and the volume of the bounding box corresponding to the skin vertex set according to the skin vertex set influenced by the bone region, and entering the step B2-7;
step B2-7, adding the position data of the obtained bounding box into the skeleton rigid body transformation matrix corresponding to the skeleton region, updating the skeleton rigid body transformation matrix corresponding to the skeleton region, and proceeding to step B2-8;
and B2-8, generating a skeleton rigid body with a specified shape type and matched with the original model according to the positions of the bounding boxes corresponding to the skin vertex set influenced by the skeleton region and the skeleton rigid body transformation matrix corresponding to the skeleton region.
As a preferred embodiment of the present invention, the step B2-4 includes the following steps:
step B2-4-1, obtaining a feature vector corresponding to the obtained covariance matrix covarianceMatrix, initializing the current iteration frequency currier to be 0, initializing a Z-axis initial vector vectorZ, obtaining the length of the Z-axis initial vector vectorZ to be vectorZ, and then entering step B2-4-2;
step B2-4-2. according to the following formula:
vectorZ=(covarianceMatrix*vectorZ)/length
updating vectorZ, updating the length of vectorZ, adding 1 to update the value of curIter, and then entering step B2-4-3;
step B2-4-3, judging whether the curriter is greater than or equal to 32, if so, entering step B2-4-4; otherwise, returning to the step B2-4-2;
and step B2-4-4, obtaining vectorZ, namely the Z axis vector of the bone rigid body corresponding to the bone region.
As a preferable embodiment of the present invention, based on the bone rigid structure corresponding to the game character obtained in step C, the method further includes step D of:
and a mouse is adopted to pick up the rigid skeleton structure.
As a preferred technical solution of the present invention, the step D includes the steps of:
d1, when recording the skeleton rigid structure selected by the mouse, calculating the distance between the skeleton rigid structure and the current camera, and entering the step D2;
and D2., when the mouse drags the selected skeleton rigid structure and performs RayTrace calculation, using the distance from the skeleton rigid structure obtained in the previous step to the current camera as the distance from the dragged skeleton rigid structure to the camera, and realizing the picking of the skeleton rigid structure by the mouse.
As a preferred technical scheme of the invention: in the step A, based on a physX library integrated in a Flexi graphic engine, loading each bone area and joint according to a bone joint list in a game role model file.
Compared with the prior art, the application system of the rigid body generation method matched with any skeleton model has the following technical effects by adopting the technical scheme: the rigid body generation method matched with any skeleton model generates, edits and stores rigid body and joint data of the doll by directly using API provided by a physX library, and is effectively integrated with a Flexi engine, thereby being more in line with the use habit of a Flexi engine user. And the corresponding rigid body and joint are automatically generated according to the skeleton and skin information of the current game role, so that a doll object is generated from nothing to one key, and the simulation effect of the role can be quickly seen. After the rigid body and the joints needed by the cloth doll are generated, the rotation angle needed by the joints can be automatically corrected according to all the bone data in the bone animation model in the current scene, so that the problem that the joint data are difficult to edit and adjust is solved, the working efficiency of a user is improved, and two cloth doll editing modes obtained by data driving and visual experience are combined.
Drawings
FIG. 1 is a schematic flow chart of a rigid body generation method of the present invention for matching arbitrary bone models;
FIG. 2 is a schematic diagram of the application of the rigid body generation method of the present invention to match any bone model.
Detailed Description
The following description will explain embodiments of the present invention in further detail with reference to the accompanying drawings.
As shown in fig. 1, the present invention designs a rigid body generation method matching any skeleton model, and in practical application, the method specifically includes the following steps:
because the number of basic skeletons, the skeleton names and the corresponding joints of the game character are fixed, if any character or monster has a head and four limbs, all the skeletons and joints can be configured in advance, and when the character model is loaded, the basic skeletons and joints are automatically generated according to the lists, namely the following step A is executed.
And step A, loading each bone area and joint according to a bone joint list in the game role model file based on a physX library integrated in a Flexi graphic engine, and entering the step B.
A rigid body is an abstraction of a real object, which has most of the physical properties of a real object, such as mass, rolling friction during rolling, sliding friction during sliding, and rebound properties during collision, but unlike the properties of a real object, it does not deform during collision, which does not exist in a real object. A knuckle is a constraint describing the interaction between two rigid bodies that constrains the relative motion of the two rigid bodies with which it is associated, as a hinge between a door and a doorframe allows only rotational motion of the door relative to the hinge.
And step B, obtaining the size and the position of the skeleton rigid body corresponding to each skeleton region according to each skeleton region matrix in the game role action file and the relation between different skeleton region matrixes, and then entering the step C.
For the operation described in the above step B, the present invention specifically designs the following two operation modes.
Firstly, in the step B, according to the skeleton region matrix in the game character action file and the relationship between different skeleton region matrices, the following steps B1-1 to B1-3 are executed to obtain the size and position of the skeleton rigid body corresponding to the skeleton region, and further obtain the size and position of each skeleton rigid body, and then the process goes to the step C;
b1-1, obtaining the position and the volume of a bounding box corresponding to the skin vertex set according to the skin vertex set influenced by the bone region, judging whether the volume of the bounding box is larger than a preset bounding box volume threshold value, if so, generating a bone rigid body corresponding to the bone region, and entering the step B1-2; otherwise, the operation for the bone region is ended;
b1-2, according to the orientation data of the skin vertex positions influenced by the skeleton region, determining an origin of a three-dimensional coordinate system corresponding to the skeleton region, traversing the skin vertices influenced by the skeleton region, obtaining vectors from the origin to the skin vertices, further obtaining an average vector of the vectors, namely the Z axis of the three-dimensional coordinate system corresponding to the skeleton region, and entering the step B1-3;
and B1-3, randomly generating an X axis and a Y axis according to the origin and the Z axis of the three-dimensional coordinate system corresponding to the skeleton region, namely obtaining the orientation vector of the skeleton rigid body, and constructing the collision information of the skeleton rigid body.
Secondly, in the step B, according to the skeleton region matrix in the game character action file and the relationship between different skeleton region matrixes, the following steps B2-1 to B2-8 are executed to obtain the size and position of the skeleton rigid body corresponding to the skeleton region, and further obtain the size and position of each skeleton rigid body, and then the step C is executed;
b2-1, determining the origin of the three-dimensional coordinate system corresponding to the skeleton region according to the orientation data of the skin vertex positions influenced by the skeleton region; traversing each skin vertex influenced by the skeleton region, obtaining vectors from the origin to each skin vertex, further obtaining an average vector U of each vector, and then entering step B2-2;
step B2-2, obtaining difference (x) between each vector and the average vector U respectively according to the vectors of the skin peaks influenced by the origin to the bone region respectivelyi,yi,zi) And go to step B2-3; wherein i is 0, …, N-1, N represents the number of skin vertices affected by the bone region;
step B2-3, according to the difference (x) corresponding to each skin vertex influenced by the skeleton areai,yi,zi) Generating a corresponding covariance matrix as follows, and proceeding to step B2-4;
(∑(xi*xi))/N (∑(xi*yi))/N (∑(xi*zi))/N
(∑(yi*xi))/N (∑(yi*yi))/N (∑(yi*zi))/N
(∑(zi*xi))/N (∑(zi*yi))/N (∑(zi*zi))/N
b2-4, obtaining the eigenvector corresponding to the covariance matrix, wherein the eigenvector is the Z axis vector of the skeleton rigid body corresponding to the skeleton region, and then entering the step B2-5;
the step B2-4 is specifically executed, and includes the following steps B2-4-1 to B2-4-4:
step B2-4-1, obtaining a feature vector corresponding to the obtained covariance matrix covarianceMatrix, initializing the current iteration frequency currier to be 0, initializing a Z-axis initial vector vectorZ, obtaining the length of the Z-axis initial vector vectorZ to be vectorZ, and then entering step B2-4-2;
step B2-4-2. according to the following formula:
vectorZ=(covarianceMatrix*vectorZ)/length
updating vectorZ, updating the length of vectorZ, adding 1 to update the value of curIter, and then entering step B2-4-3;
step B2-4-3, judging whether the curriter is greater than or equal to 32, if so, entering step B2-4-4; otherwise, returning to the step B2-4-2;
and step B2-4-4, obtaining vectorZ, namely the Z axis vector of the bone rigid body corresponding to the bone region.
B2-5, randomly generating an X axis and a Y axis according to the origin and the Z axis of the three-dimensional coordinate system corresponding to the skeleton region, further constructing an orthogonal vector of the skeleton rigid body corresponding to the skeleton region, constructing a skeleton rigid body transformation matrix corresponding to the skeleton region according to the orthogonal vector coordinate system, and then entering the step B2-6;
b2-6, obtaining the position and the volume of the bounding box corresponding to the skin vertex set according to the skin vertex set influenced by the bone region, and entering the step B2-7;
step B2-7, adding the position data of the obtained bounding box into the skeleton rigid body transformation matrix corresponding to the skeleton region, updating the skeleton rigid body transformation matrix corresponding to the skeleton region, and proceeding to step B2-8;
and B2-8, generating a skeleton rigid body with a specified shape type and matched with the original model according to the positions of the bounding boxes corresponding to the skin vertex set influenced by the skeleton region and the skeleton rigid body transformation matrix corresponding to the skeleton region.
The automatic correction function of the joint is realized, and the skeleton data of the character model is determined during art modeling. However, the relative orientation between two rigid bodies connected by the currently edited joint cannot be used in most cases by using data fixed during the original art modeling. Such skeletal data does not correspond to the mutual orientation (or relative rotation) of the two rigid bodies represented by the current joint, and the two rigid bodies have a deviation in relative rotation angle. By calculating such a deviation and recording it in the matrix of rigid bodies, the correction of the rotation angle between the two rigid bodies associated with the joint is achieved, i.e. the following step C is performed.
And C, correcting the rotation angle between the adjacent rigid skeleton bodies to obtain the rigid skeleton structure corresponding to the game character, and specifically comprising the following steps C1-1 to C1-6.
Step C1-1, obtaining a world matrix of two adjacent skeleton rigid bodies which are in accordance with the requirements of the original role model, and entering step C1-2;
c1-2, obtaining the positions of the two adjacent skeleton rigid bodies in the world matrix, and proceeding to C1-3;
step C1-3, the world matrix of the two rigid bodies which is in accordance with the requirements of the original role model is taken, and the step C1-4 is carried out;
c1-4, taking out the space positions of the two rigid bodies under the world matrix from the world matrix, and entering the step C1-5;
c1-5, selecting the middle position between two rigid body positions, putting the position into one of the rigid body local matrixes obtained according to the physx physical engine API, then transferring the rigid body matrix to the world matrix, and entering the step C1-6;
and C1-6, calculating another rigid matrix according to the same method of solving one rigid matrix.
Based on the designed steps A to C, the method for obtaining the skeleton rigid structure corresponding to the game role is completed. That is, people are picked up and thrown into the air, and the process of movement, collision and rebound of the model can be observed to be almost real, and in practical application, as shown in fig. 2, the following is specifically shown:
d1, when recording the skeleton rigid structure selected by the mouse, calculating the distance between the skeleton rigid structure and the current camera, and entering the step D2;
and D2., when the mouse drags the selected skeleton rigid structure and performs RayTrace calculation, using the distance from the skeleton rigid structure obtained in the previous step to the current camera as the distance from the dragged skeleton rigid structure to the camera, and realizing the picking of the skeleton rigid structure by the mouse.
The rigid body generation method matched with any skeleton model designed by the technical scheme generates, edits and stores rigid body and joint data of the doll by directly using API provided by a physX library, and effectively integrates with a Flexi engine, thereby being more in line with the use habit of a Flexi engine user. And the corresponding rigid body and joint are automatically generated according to the skeleton and skin information of the current game role, so that a doll object is generated from nothing to one key, and the simulation effect of the role can be quickly seen. After the rigid body and the joints needed by the cloth doll are generated, the rotation angle needed by the joints can be automatically corrected according to all the bone data in the bone animation model in the current scene, so that the problem that the joint data are difficult to edit and adjust is solved, the working efficiency of a user is improved, and two cloth doll editing modes obtained by data driving and visual experience are combined.
The embodiments of the present invention have been described in detail with reference to the drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention.

Claims (7)

1. A rigid body generation method matched with any skeleton model is characterized by comprising the following steps:
step A, loading each bone area and joint according to a bone joint list in a game role model file based on a physX library integrated in a graphic engine, and entering step B;
b, obtaining the size and the position of a skeleton rigid body corresponding to each skeleton region according to each skeleton region matrix in the game role action file and the relation between different skeleton region matrixes, and then entering the step C;
c, correcting the rotation angle between the adjacent skeleton rigid bodies to obtain a skeleton rigid body structure corresponding to the game role; the step C comprises the following steps:
step C1-1, obtaining a world matrix of two adjacent skeleton rigid bodies which are in accordance with the requirements of the original role model, and entering step C1-2;
c1-2, obtaining the positions of the two adjacent skeleton rigid bodies in the world matrix, and proceeding to C1-3;
step C1-3, the world matrix of the two rigid bodies which is in accordance with the requirements of the original role model is taken, and the step C1-4 is carried out;
c1-4, taking out the space positions of the two rigid bodies under the world matrix from the world matrix, and entering the step C1-5;
c1-5, selecting the middle position between two rigid body positions, putting the position into one of the rigid body local matrixes obtained according to the physx physical engine API, then transferring the rigid body matrix to the world matrix, and entering the step C1-6;
and C1-6, calculating another rigid matrix according to the same method of solving one rigid matrix.
2. A rigid body generation method matching an arbitrary bone model according to claim 1, characterized by: in the step B, aiming at each skeleton region, according to the skeleton region matrix in the game role action file and the relation between different skeleton region matrixes, executing the following steps to obtain the size and the position of the skeleton rigid body corresponding to the skeleton region so as to obtain the size and the position of each skeleton rigid body;
b1-1, obtaining the position and the volume of a bounding box corresponding to the skin vertex set according to the skin vertex set influenced by the bone region, judging whether the volume of the bounding box is larger than a preset bounding box volume threshold value, if so, generating a bone rigid body corresponding to the bone region, and entering the step B1-2; otherwise, the operation for the bone region is ended;
b1-2, according to the orientation data of the skin vertex positions influenced by the skeleton region, determining an origin of a three-dimensional coordinate system corresponding to the skeleton region, traversing the skin vertices influenced by the skeleton region, obtaining vectors from the origin to the skin vertices, further obtaining an average vector of the vectors, namely the Z axis of the three-dimensional coordinate system corresponding to the skeleton region, and entering the step B1-3;
and B1-3, randomly generating an X axis and a Y axis according to the origin and the Z axis of the three-dimensional coordinate system corresponding to the skeleton region, namely obtaining the orientation vector of the skeleton rigid body, and constructing the collision information of the skeleton rigid body.
3. A rigid body generation method matching an arbitrary bone model according to claim 1, characterized by: in the step B, aiming at each skeleton region, according to the skeleton region matrix in the game role action file and the relation between different skeleton region matrixes, executing the following steps to obtain the size and the position of the skeleton rigid body corresponding to the skeleton region so as to obtain the size and the position of each skeleton rigid body;
b2-1, determining the origin of the three-dimensional coordinate system corresponding to the skeleton region according to the orientation data of the skin vertex positions influenced by the skeleton region; traversing each skin vertex influenced by the skeleton region, obtaining vectors from the origin to each skin vertex, further obtaining an average vector U of each vector, and then entering step B2-2;
step B2-2, obtaining difference (x) between each vector and the average vector U respectively according to the vectors of the skin peaks influenced by the origin to the bone region respectivelyi,yi,zi) And go to step B2-3; wherein i is 0, …, N-1, N represents the number of skin vertices affected by the bone region;
step B2-3, according to the difference (x) corresponding to each skin vertex influenced by the skeleton areai,yi,zi) Generating a corresponding covariance matrix and entering step B2-4;
b2-4, obtaining the eigenvector corresponding to the covariance matrix, wherein the eigenvector is the Z axis vector of the skeleton rigid body corresponding to the skeleton region, and then entering the step B2-5;
b2-5, randomly generating an X axis and a Y axis according to the origin and the Z axis of the three-dimensional coordinate system corresponding to the skeleton region, further constructing an orthogonal vector of the skeleton rigid body corresponding to the skeleton region, constructing a skeleton rigid body transformation matrix corresponding to the skeleton region according to the orthogonal vector coordinate system, and then entering the step B2-6;
b2-6, obtaining the position and the volume of the bounding box corresponding to the skin vertex set according to the skin vertex set influenced by the bone region, and entering the step B2-7;
step B2-7, adding the position data of the obtained bounding box into the skeleton rigid body transformation matrix corresponding to the skeleton region, updating the skeleton rigid body transformation matrix corresponding to the skeleton region, and proceeding to step B2-8;
and B2-8, generating a skeleton rigid body with a specified shape type and matched with the original model according to the positions of the bounding boxes corresponding to the skin vertex set influenced by the skeleton region and the skeleton rigid body transformation matrix corresponding to the skeleton region.
4. A rigid body generation method matching an arbitrary bone model according to claim 3, wherein said step B2-4 comprises the steps of:
step B2-4-1, obtaining a feature vector corresponding to the obtained covariance matrix covarianceMatrix, initializing the current iteration frequency currier to be 0, initializing a Z-axis initial vector vectorZ, obtaining the length of the Z-axis initial vector vectorZ to be vectorZ, and then entering step B2-4-2;
step B2-4-2. according to the following formula:
vectorZ=(covarianceMatrix*vectorZ)/length
updating vectorZ, updating the length of vectorZ, adding 1 to update the value of curIter, and then entering step B2-4-3;
step B2-4-3, judging whether the curriter is greater than or equal to 32, if so, entering step B2-4-4; otherwise, returning to the step B2-4-2; and step B2-4-4, obtaining vectorZ, namely the Z axis vector of the bone rigid body corresponding to the bone region.
5. The rigid body generation method according to claim 1, wherein based on the rigid body structure of the bone corresponding to the game character obtained in step C, the method further comprises the following step D:
and a mouse is adopted to pick up the rigid skeleton structure.
6. A rigid body generation method matching an arbitrary bone model according to claim 5, wherein said step D comprises the steps of:
d1, when recording the skeleton rigid structure selected by the mouse, calculating the distance between the skeleton rigid structure and the current camera, and entering the step D2;
and D2., when the mouse drags the selected skeleton rigid structure and performs RayTrace calculation, using the distance from the skeleton rigid structure obtained in the previous step to the current camera as the distance from the dragged skeleton rigid structure to the camera, and realizing the picking of the skeleton rigid structure by the mouse.
7. A rigid body generation method matching any bone model according to any of claims 1 to 6, characterized in that in step A, each bone region and joint is loaded according to the bone joint list in the game character model file based on the physX library integrated in Flexi graphic engine.
CN201810280588.9A 2018-04-02 2018-04-02 Rigid body generation method matched with any skeleton model Active CN108510582B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810280588.9A CN108510582B (en) 2018-04-02 2018-04-02 Rigid body generation method matched with any skeleton model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810280588.9A CN108510582B (en) 2018-04-02 2018-04-02 Rigid body generation method matched with any skeleton model

Publications (2)

Publication Number Publication Date
CN108510582A CN108510582A (en) 2018-09-07
CN108510582B true CN108510582B (en) 2021-12-14

Family

ID=63379506

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810280588.9A Active CN108510582B (en) 2018-04-02 2018-04-02 Rigid body generation method matched with any skeleton model

Country Status (1)

Country Link
CN (1) CN108510582B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112866286B (en) * 2018-10-29 2023-03-14 深圳市瑞立视多媒体科技有限公司 Data transmission method and device, terminal equipment and storage medium
CN109758765A (en) * 2018-12-21 2019-05-17 网易(杭州)网络有限公司 Mobile terminal virtual object control method and equipment
CN109806587A (en) * 2018-12-24 2019-05-28 苏州蜗牛数字科技股份有限公司 A kind of character control method and system
CN110075523B (en) * 2019-04-30 2020-04-17 网易(杭州)网络有限公司 Action generation method and device, electronic equipment and computer readable medium
CN112891954B (en) * 2021-02-02 2024-02-13 网易(杭州)网络有限公司 Simulation method and device for virtual object, storage medium and computer equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101133957A (en) * 2006-09-01 2008-03-05 上海市普陀区中心医院 Method for testing the movement degree variation of the joints between bones
CN103761392A (en) * 2014-01-23 2014-04-30 南京工程学院 Muscle strength model optimizing method for humanoid robot synergic movement

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101246602B (en) * 2008-02-04 2010-09-08 东华大学 Human body posture reconstruction method based on geometry backbone
US20130235043A1 (en) * 2008-08-25 2013-09-12 Adobe Systems Incorporated Systems and Methods for Creating, Displaying, and Using Hierarchical Objects with Rigid Bodies
CN102508986B (en) * 2011-08-31 2015-09-30 微迈森惯性技术开发(北京)有限公司 A kind of cascade rigid motion tracking, gait processes method for tracing and system
CN104021584B (en) * 2014-06-25 2017-06-06 无锡梵天信息技术股份有限公司 A kind of implementation method of Skeletal Skinned Animation
CN106296778B (en) * 2016-07-29 2019-11-15 网易(杭州)网络有限公司 Virtual objects motion control method and device
CN106384115B (en) * 2016-10-26 2019-10-22 武汉工程大学 A kind of joint of mechanical arm angle detecting method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101133957A (en) * 2006-09-01 2008-03-05 上海市普陀区中心医院 Method for testing the movement degree variation of the joints between bones
CN103761392A (en) * 2014-01-23 2014-04-30 南京工程学院 Muscle strength model optimizing method for humanoid robot synergic movement

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于不同刚体模型对老年女性步态的仿真研究";袁晓平 等;《医用生物力学》;20161231;第31卷(第6期);495-500 *

Also Published As

Publication number Publication date
CN108510582A (en) 2018-09-07

Similar Documents

Publication Publication Date Title
CN108510582B (en) Rigid body generation method matched with any skeleton model
Yamane et al. Animating non-humanoid characters with human motion data
JP6227683B2 (en) A way to develop and control a robot to get a movement that matches an animated character.
Rose III et al. Artist‐directed inverse‐kinematics using radial basis function interpolation
US6563503B1 (en) Object modeling for computer simulation and animation
US20040012594A1 (en) Generating animation data
US20090135189A1 (en) Character animation system and method
EP2629265A1 (en) Method and system for driving simulated virtual environments with real data
US9196074B1 (en) Refining facial animation models
GB2555605A (en) Animating a virtual object in a virtual world
Mattingly et al. Robot design using Unity for computer games and robotic simulations
CN103854300A (en) Method for achieving three-dimensional scene cooperation carrying under networking control of client sides
USH2253H1 (en) Multiple personality articulation for animated characters
CN101192308A (en) Roles animations accomplishing method and system
CN116438576A (en) Monocular gesture prediction
Jain et al. Interactive synthesis of human-object interaction
Badler et al. New behavioral paradigms for virtual human models
Skrba et al. Animating quadrupeds: methods and applications
Mahmudi et al. Multi-modal data-driven motion planning and synthesis
Lake Technical animation in video games
JP4358752B2 (en) Statistical mechanical collision methods and equipment
Nurindiyani et al. Motion Modeling of Traditional Javanese Dance: Introduction of Javanese Dancer Gesture with 3D Models
CN114842155B (en) High-precision automatic bone binding method
TWI752629B (en) Method for training virtual animal to move based on control parameter
Han et al. A deep Q network for robotic planning from image

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
GR01 Patent grant
GR01 Patent grant