CN111714885A - Game role model generation method, game role model generation device, game role adjustment device and game role adjustment medium - Google Patents

Game role model generation method, game role model generation device, game role adjustment device and game role adjustment medium Download PDF

Info

Publication number
CN111714885A
CN111714885A CN202010577249.4A CN202010577249A CN111714885A CN 111714885 A CN111714885 A CN 111714885A CN 202010577249 A CN202010577249 A CN 202010577249A CN 111714885 A CN111714885 A CN 111714885A
Authority
CN
China
Prior art keywords
model
vertex
reference model
target
game role
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010577249.4A
Other languages
Chinese (zh)
Inventor
陈康
张伟东
郭道亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202010577249.4A priority Critical patent/CN111714885A/en
Publication of CN111714885A publication Critical patent/CN111714885A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • G06T13/403D [Three Dimensional] animation of characters, e.g. humans, animals or virtual beings
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation

Landscapes

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

Abstract

The invention provides a method, a device, equipment and a medium for generating a game role model and adjusting roles, and relates to the technical field of games. The method comprises the following steps: determining a vertex mapping relation between the vertex of the reference model and the vertex of the game role mesh model according to the key point of the reference model and the key point of the game role mesh model; determining target skeleton data of the game role mesh model according to the skeleton data of the reference model and the vertex mapping relation; determining target skin data of the game role mesh model according to the reference model skin data, the vertex of at least one reference model corresponding to the vertex of the game role mesh model and the corresponding reference model skin data; the game role model is generated according to the game role grid model, the target skeleton data and the corresponding target skinning data, so that fine manual adjustment is greatly reduced, automatic binding is realized, and the generation efficiency of the game role model is improved.

Description

Game role model generation method, game role model generation device, game role adjustment device and game role adjustment medium
Technical Field
The invention relates to the technical field of games, in particular to a method, a device, equipment and a medium for generating a game role model and adjusting roles.
Background
With the development of games and three-dimensional animation industries, various three-dimensional characters are more and more, facial skeleton binding is performed on a character model, so that the expression of the character is richer and more diverse, the facial expression of the character is more vivid and vivid, and therefore the facial model binding technology of the character is more and more important.
In the related art, an input face model is preprocessed; for the preprocessed face model, manually adjusting a sample line according to the position of facial features to fit the position of facial features; and finally, manually adjusting the position of the skeleton, covering the skeleton, and binding the face of the role.
However, in the related art, before arranging the sample lines and the skin, fine and tedious manual adjustment is required, unnecessary human resources are wasted, and the efficiency of binding the character faces is reduced.
Disclosure of Invention
The present invention aims to provide a method, an apparatus, a device and a medium for generating a game role model and adjusting a role, so as to solve the problems in the related art that, before arranging a sample line and a skin, fine and tedious manual adjustment is required, unnecessary human resources are wasted, and the efficiency of role face binding is reduced.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present invention provides a game character model generation method, including:
determining a vertex mapping relation between a vertex of a reference model and a vertex of a game role mesh model according to the key point of the reference model and the key point of the game role mesh model, wherein the reference model comprises reference model mesh data, reference model skeleton data and corresponding reference model skin data;
determining target skeleton data of the game role mesh model according to the skeleton data of the reference model and the vertex mapping relation;
determining target skinning data of the game role mesh model according to at least one vertex of the reference model corresponding to the vertex of the game role mesh model and the corresponding skinning data of the reference model;
and generating the game role model according to the game role grid model, the target skeleton data and the corresponding target skinning data.
Optionally, the determining a vertex mapping relationship between the vertex of the reference model and the vertex of the game character mesh model according to the key point of the reference model and the key point of the game character mesh model includes:
responding to user operation, and acquiring corresponding relations between a plurality of first key points of the reference model and a plurality of second key points of the game role grid model;
and aligning the reference model and the game role mesh model based on the corresponding relation to obtain a vertex mapping relation between the vertex of the reference model and the vertex of the game role mesh model.
Optionally, aligning the reference model and the game character mesh model based on the correspondence to obtain a vertex mapping relationship between a vertex of the reference model and a vertex of the game character mesh model, including:
and based on the corresponding relation, carrying out rigid body alignment and non-rigid body alignment on the reference model and the game role grid model to obtain a vertex mapping relation between the vertex of the reference model and the vertex of the game role grid model, wherein the rigid body alignment refers to the integral alignment of the model, and the non-rigid body alignment refers to the alignment of the vertices in the model.
Optionally, the performing, based on the correspondence, rigid-body alignment and non-rigid-body alignment on the reference model and the game role mesh model to obtain a vertex mapping relationship between the reference model and the game role mesh model includes:
performing rigid body alignment on the reference model and the game role grid model based on the space coordinates of the reference model and the game role grid model;
and performing non-rigid body alignment on the reference model and the game role mesh model based on the rigid body aligned reference model, the game role mesh model and the corresponding relationship to obtain a vertex mapping relationship between the vertexes of the reference model and the game role mesh model.
Optionally, the determining target bone data of the game character mesh model according to the reference model bone data and the vertex mapping relationship includes:
determining the bone weight of a vertex corresponding to each preset bone in the reference model according to the bone data of the reference model and preset parameters;
and determining target skeleton data of the game role mesh model according to the skeleton weight of the vertex corresponding to each preset skeleton in the reference model and the vertex mapping relation.
Optionally, the determining, according to the bone data of the reference model and preset parameters, a bone weight of a vertex corresponding to each preset bone in the reference model includes:
and calculating to obtain the bone weight of the vertex corresponding to each preset bone in the reference model according to the vertex of the reference model, the bone data of the reference model, the skin data of the reference model and the preset parameters.
Optionally, the determining, according to the bone weight of the vertex corresponding to each preset bone in the reference model and the vertex mapping relationship, target bone data of the game character mesh model includes:
according to the vertex mapping relation, the bone weight of a vertex corresponding to each preset bone in the reference model is used as the bone weight of a vertex corresponding to a target bone at a corresponding position in the game role mesh model;
and determining the target bone data of each target bone according to the bone weight of the corresponding vertex in the target bone and the vertex of the game character mesh model.
Optionally, the determining, by the reference model skinning data including a first skinning weight of each vertex in the reference model, the determining, by the reference model skinning data, target skinning data of the game character mesh model, where at least one vertex of the reference model corresponding to a vertex of the game character mesh model and the corresponding reference model skinning data include:
determining a triangular patch of the reference model corresponding to each vertex of the game role mesh model;
and calculating to obtain a second skinning weight of each vertex in the game role mesh model according to the first skinning weight of at least one target vertex of the triangular patch of the corresponding reference model, wherein the target skinning data comprises the second skinning weight of each vertex in the game role mesh model.
Optionally, the calculating, according to the first skinning weight of at least one target vertex of the triangular patch of the corresponding reference model, to obtain the second skinning weight of each vertex in the game character mesh model includes:
determining a target coefficient of at least one target vertex of the triangular patch of the corresponding reference model;
and calculating the second skinning weight of each vertex in the game role mesh model according to the first skinning weight and the target coefficient corresponding to at least one target vertex of the triangular patch of the corresponding reference model.
Optionally, after the game character model is generated according to the game character mesh model, the target bone data and the corresponding target skinning data, the method further includes:
and smoothing the target skin data of the game role model to obtain a processed game role model.
In a second aspect, an embodiment of the present invention provides a role adjustment method based on a game role model, which is applied to a game role model obtained based on any one of the methods described in the first aspect, and the method further includes:
responding to the adjustment operation of a user for the target game role, and acquiring adjustment action information;
and controlling at least one target skeleton in the game role model to move according to the adjustment action information to obtain the adjusted target game role.
Optionally, the game role model is a facial expression model of a game role;
the controlling at least one target skeleton in the game role model to move according to the adjustment action information to obtain the adjusted target game role comprises the following steps:
and controlling at least one target skeleton in the game role model to move according to the adjustment action information, and acquiring the adjusted expression of the target game role.
Optionally, the obtaining adjustment action information in response to the adjustment operation of the user for the target game character includes:
responding to the adjustment operation of a user for a target game role, and acquiring the amplitude of the adjustment operation;
acquiring the adjustment action information according to the amplitude of the adjustment operation, wherein the adjustment action information comprises: bone adjustment parameters.
In a third aspect, an embodiment of the present invention provides a game character model generation apparatus, including:
the determining module is used for determining a vertex mapping relation between a vertex of a reference model and a vertex of a game role mesh model according to the key point of the reference model and the key point of the game role mesh model, wherein the reference model comprises reference model mesh data, reference model skeleton data and corresponding reference model skin data; determining target skeleton data of the game role mesh model according to the skeleton data of the reference model and the vertex mapping relation; determining target skinning data of the game role mesh model according to at least one vertex of the reference model corresponding to the vertex of the game role mesh model and the corresponding skinning data of the reference model;
and the generating module is used for generating the game role model according to the game role grid model, the target skeleton data and the corresponding target skinning data.
Optionally, the determining module is further configured to, in response to a user operation, obtain correspondence between a plurality of first key points of the reference model and a plurality of second key points of the game character mesh model; and aligning the reference model and the game role mesh model based on the corresponding relation to obtain a vertex mapping relation between the vertex of the reference model and the vertex of the game role mesh model.
Optionally, the determining module is further configured to perform rigid body alignment and non-rigid body alignment on the reference model and the game role mesh model based on the correspondence, so as to obtain a vertex mapping relationship between a vertex of the reference model and a vertex of the game role mesh model, where the rigid body alignment refers to overall alignment of the models, and the non-rigid body alignment refers to vertex alignment in the models.
Optionally, the determining module is further configured to perform rigid body alignment on the reference model and the game role grid model based on the spatial coordinates of the reference model and the game role grid model; and performing non-rigid body alignment on the reference model and the game role mesh model based on the rigid body aligned reference model, the game role mesh model and the corresponding relationship to obtain a vertex mapping relationship between the vertexes of the reference model and the game role mesh model.
Optionally, the determining module is further configured to determine, according to the bone data of the reference model and preset parameters, a bone weight of a vertex corresponding to each preset bone in the reference model; and determining target skeleton data of the game role mesh model according to the skeleton weight of the vertex corresponding to each preset skeleton in the reference model and the vertex mapping relation.
Optionally, the determining module is further configured to calculate, according to the vertex of the reference model, the bone data of the reference model, the skin data of the reference model, and the preset parameters, a bone weight of the vertex corresponding to each preset bone in the reference model.
Optionally, the determining module is further configured to use, according to the vertex mapping relationship, a bone weight of a vertex corresponding to each preset bone in the reference model as a bone weight of a vertex corresponding to a target bone at a corresponding position in the game character mesh model; and determining the target bone data of each target bone according to the bone weight of the corresponding vertex in the target bone and the vertex of the game character mesh model.
Optionally, the reference model skinning data includes a first skinning weight of each vertex in the reference model, and the determining module is further configured to determine a triangular patch of the reference model corresponding to each vertex of the game character mesh model; and calculating to obtain a second skinning weight of each vertex in the game role mesh model according to the first skinning weight of at least one target vertex of the triangular patch of the corresponding reference model, wherein the target skinning data comprises the second skinning weight of each vertex in the game role mesh model.
Optionally, the determining module is further configured to determine a target coefficient of at least one target vertex of a triangular patch of the corresponding reference model; and calculating the second skinning weight of each vertex in the game role mesh model according to the first skinning weight and the target coefficient corresponding to at least one target vertex of the triangular patch of the corresponding reference model.
Optionally, the method further includes:
and the processing module is used for performing smoothing processing on the target skinning data of the game role model to obtain a processed game role model.
In a fourth aspect, an embodiment of the present invention provides a role adjustment apparatus based on a game role model, which is applied to a game role model obtained based on the method described in any one of the above first aspects, and the apparatus further includes:
the acquisition module is used for responding to the adjustment operation of a user aiming at the target game role and acquiring adjustment action information;
and the control module is used for controlling at least one target skeleton in the game role model to move according to the adjustment action information to obtain the adjusted target game role.
Optionally, the game role model is a facial expression model of a game role;
the control module is further configured to control at least one target skeleton in the game character model to move according to the adjustment action information, and obtain an adjusted expression of the target game character.
Optionally, the obtaining module is further configured to respond to an adjustment operation of a user for a target game role, and obtain an amplitude of the adjustment operation; acquiring the adjustment action information according to the amplitude of the adjustment operation, wherein the adjustment action information comprises: bone adjustment parameters.
In a fifth aspect, an embodiment of the present invention provides an electronic device, including: a memory in which a computer program executable by the processor is stored, and a processor that implements the game character model generation method and the game character model-based character adjustment method according to any one of the first and second aspects when the computer program is executed by the processor.
In a sixth aspect, an embodiment of the present invention provides a storage medium, where a computer program is stored, and when the computer program is read and executed, the method for generating a game character model and the method for adjusting a character based on a game character model according to any one of the first and second aspects are implemented.
The invention has the beneficial effects that: the embodiment of the invention provides a game role model generation method, a game role regulation method, a game role model generation device, a game role regulation device and a game role regulation medium, wherein a vertex mapping relation between a vertex of a reference model and a vertex of a game role grid model is determined according to the key point of the reference model and the key point of the game role grid model, wherein the reference model comprises reference model grid data, reference model skeleton data and corresponding reference model skin data; determining target skeleton data of the game role mesh model according to the skeleton data of the reference model and the vertex mapping relation; determining target skin data of the game role mesh model according to the reference model skin data, the vertex of at least one reference model corresponding to the vertex of the game role mesh model and the corresponding reference model skin data; and generating a game role model according to the game role grid model, the target skeleton data and the corresponding target skinning data. The target skeleton data of the game role grid model is determined based on the reference model skeleton data and the vertex mapping relation, and the target skinning data of the game role grid model is determined based on the reference model skinning data, so that the determined target skeleton data and the target skinning data are more accurate, fine manual adjustment is greatly reduced, automatic binding is realized, and the generation efficiency of the game role model is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a schematic flow chart of a method for generating a game character model according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating a method for generating a game character model according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a reference model and a game character mesh model according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart illustrating a method for generating a game character model according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a structure of alignment between a reference model and a mesh model of a game character according to an embodiment of the present invention;
FIG. 6 is a schematic flow chart illustrating a method for generating a game character model according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a predetermined bone position of a reference model according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a target bone position of a game character mesh model according to an embodiment of the present invention;
FIG. 9 is a schematic flow chart illustrating a method for generating a game character model according to an embodiment of the present invention;
FIG. 10 is a flow chart illustrating a method for generating a game character model according to an embodiment of the present invention;
FIG. 11 is a schematic diagram illustrating the skinning result of the left apple machine and the head of the reference model according to the embodiment of the present invention;
FIG. 12 is a schematic diagram illustrating the skinning result of the left apple machine and the head of the game character mesh model according to the embodiment of the present invention;
FIG. 13 is a diagram illustrating a deformation result of a game character model according to an embodiment of the present invention;
FIG. 14 is a schematic flow chart illustrating a method for adjusting a character based on a game character model according to an embodiment of the present invention;
FIG. 15 is a schematic flow chart illustrating a method for adjusting a character based on a game character model according to an embodiment of the present invention;
fig. 16 is a schematic structural diagram of a game character model generating apparatus according to an embodiment of the present invention;
fig. 17 is a schematic structural diagram of a character adjusting apparatus based on a game character model according to an embodiment of the present invention;
fig. 18 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention.
With the improvement of the interactivity of various games and users, some games provide some functions of the user-defined game role, such as "face-pinching", that is, after the user selects a game role, some fine adjustment can be performed on the game role, such as changing the face shape, stature, expression and the like. These operations place higher demands on the model of the game character, and the application provides a method for obtaining a more flexible model so as to facilitate development and user operation.
In the embodiment of the invention, the skeleton system refers to a skeleton set which is constructed by a certain number of skeletons and has an explicit parent-child hierarchical relationship, and each skeleton has the attributes of explicit naming, axial direction and the like. A bone controller: the geometry used to drive the deformation of a set of bone aggregates may be spline lines, mesh polygons, etc. Rigid body alignment: the method is characterized in that the integral translation, rotation and scale deformation are carried out on the grid model, and the integral form of the model is not changed. Non-rigid body alignment: the method is characterized in that each point of the grid model is subjected to different deformations such as translation, rotation, scale and the like, and the overall shape of the model is changed. Bone migration: refers to the migration of the skeletal system of one model onto another model. Skinning weight migration: refers to migrating skinning weights on one model's skeletal system to another model's skeletal system.
Fig. 1 is a schematic flow chart of a game character model generation method according to an embodiment of the present invention, where an execution subject of the method may be a terminal, a computer, a server, or the like, and may be executed at any stage of model development, testing, or revision. As shown in fig. 1, the method includes:
s101, determining a vertex mapping relation between the vertex of the reference model and the vertex of the game role mesh model according to the key point of the reference model and the key point of the game role mesh model.
The reference model comprises reference model grid data, reference model skeleton data and corresponding reference model skin data. The benchmark model is a reference model for completing skeleton binding, and the vertex mapping relation is the mapping relation between the benchmark model and all vertexes in the game role mesh model. The reference model and the game character mesh model may both be face models of game characters.
In some embodiments, the mesh model of the reference model and the game character mesh model may be displayed by the terminal, and a plurality of key points are respectively selected from the reference model, and a plurality of key points are correspondingly selected from the game character mesh model, and then the terminal may determine a correspondence between each vertex in the reference model and each vertex in the game character mesh model according to the selected plurality of key points, that is, a vertex mapping relationship between the reference model and the game character mesh model is obtained.
It should be noted that, a plurality of key points of the selected reference model are in one-to-one correspondence with a plurality of key points in the game character mesh model, and can be actively marked by a developer. For example, when the reference model and the game character mesh model are both face models, the plurality of key points may be key points of the mouth corners, the eye corners, the eyebrows, and the like in the reference model and the game character mesh model.
In addition, the reference model may be CSIs represented by CS=(MS,RS,WS) Wherein M isSRepresenting reference model mesh data, RSRepresenting reference model bone data, WSRepresenting reference model skin data.
The game character model can be used as CTIs represented by CT=(MT),RT,WTWherein M isTRepresenting a game character mesh model, RTRepresenting target bone data, WTRepresenting the target skinning data. Where M isS,RS,WS,MTIs known information, RTInformation to be determined; execution of S102 may determine RTI.e. target bone data; executing S103 may determine WTI.e. the target skin data.
And S102, determining target skeleton data of the game role mesh model according to the skeleton data of the reference model and the vertex mapping relation.
The reference model bone data may also be referred to as a reference model bone system, in which a plurality of bones, each of which may be represented as a weighted linear combination of spatial coordinate locations of the affected keypoints.
In the embodiment of the invention, the vertex mapping relation represents the mapping relation of each vertex between the reference model and the game character mesh model, and the position of each bone in the bone data of the reference model can be represented as the weighting of the relevant parameters of the affected vertex, so that the terminal can determine the target bone data of the game character mesh model according to the bone data of the reference model and the vertex mapping relation.
Of course, the game character mesh model also has a plurality of bones, and the position of each bone can also be expressed as a weighting of the relevant parameters of the affected vertices in the game character mesh model.
S103, determining target skin data of the game role mesh model according to the reference model skin data, the vertexes of at least one reference model corresponding to the vertexes of the game role mesh model and the corresponding reference model skin data.
It should be noted that the terminal may determine, according to the vertex mapping relationship, a vertex of at least one reference model corresponding to each vertex of the game role mesh model, and then determine, according to the vertex of the at least one reference model and the reference model skin data corresponding to the vertex of the at least one reference model, skin data of each vertex in the game role mesh model, to obtain target skin data.
For example, vertex a of the reference model and vertex b of the game character mesh model are corresponding vertices indicated by the vertex mapping relationship, when the number of vertices in the reference model corresponding to vertex b of the game character mesh model is multiple, the multiple vertices in the reference model may form a geometric figure, and vertex a may be one of the multiple vertices in the reference model, or vertex a may be located in the geometric figure.
In addition, when the number of vertices in the reference model corresponding to the vertex b of the game character mesh model is one, the vertex of the reference model may be the vertex a of the reference model, and the skin data of the reference model of the vertex b may be directly used as the skin data of the vertex a.
In addition, the reference model skin data are accurately adjusted, and the target skin data in the game role grid model are determined based on the reference model skin data, so that the determination process of the target skin data does not need manual participation, distortion can be avoided, and the skin effect is improved.
And S104, generating the game role model according to the game role grid model, the target skeleton data and the corresponding target skinning data.
The terminal may adopt a skinning algorithm to bind the game role grid model, the target skeleton data and the corresponding target skinning data to generate the game role model, and of course, the terminal may also bind with other algorithms, which is not specifically limited in the embodiment of the present application.
In the embodiment of the application, the target bone data and the second skinning weight determined based on the mapping relation are accurate, so that the terminal does not need to be manually adjusted again, a preset algorithm can be directly adopted, and the bone model of the game role grid model can be obtained according to the plurality of target bone data and the second skinning weight, so that the bound game role model can be obtained.
In summary, embodiments of the present invention provide a method, an apparatus, a device, and a medium for generating a game character model and adjusting a character, which determine a vertex mapping relationship between vertices of a reference model and vertices of a game character mesh model according to key points of the reference model and key points of the game character mesh model, where the reference model includes reference model mesh data, reference model skeleton data, and corresponding reference model skin data; determining target skeleton data of the game role mesh model according to the skeleton data of the reference model and the vertex mapping relation; determining target skin data of the game role mesh model according to the reference model skin data, the vertexes of at least one reference model corresponding to the vertexes of the game role mesh model and the corresponding reference model skin data; and generating a game role model according to the game role grid model, the target skeleton data and the corresponding target skinning data. The target skeleton data of the game role grid model is determined based on the reference model skeleton data and the vertex mapping relation, and the target skinning data of the game role grid model is determined based on the reference model skinning data, so that the determined target skeleton data and the target skinning data are more accurate, fine manual adjustment is greatly reduced, automatic binding is realized, and the generation efficiency of the game role model is improved.
Optionally, fig. 2 is a schematic flow chart of a game character model generation method according to an embodiment of the present invention, and as shown in fig. 2, the S101 may include:
s201, responding to user operation, and acquiring corresponding relations between a plurality of first key points of the reference model and a plurality of second key points of the game role grid model.
In some embodiments, the terminal may present the reference model and the game character mesh model to the user, and the user may interactively select a plurality of first key points from the reference model mesh data and a plurality of second key points corresponding to the first key points from the game character mesh model, respectively, so that the terminal may obtain a correspondence between the plurality of first key points and the plurality of second key points.
Fig. 3 is a schematic diagram of a reference model and a game character mesh model according to an embodiment of the present invention, as shown in fig. 3, where the left side is the game character mesh model, and the right side is the reference model mesh data. In fig. 3, a plurality of first key points are respectively selected around the eyebrows, the eye circumferences, the nose, the mouth and the chin of the reference model, a plurality of second key points are correspondingly selected around the eyebrows, the eye circumferences, the nose, the mouth and the chin of the game character mesh model, and each first key point and each second key point are in one-to-one correspondence.
In addition, the correspondence between the first key points and the second key points can be expressed as:
Figure BDA0002551397020000121
wherein the content of the first and second substances,
Figure BDA0002551397020000122
being the first keypoint in the reference model,
Figure BDA0002551397020000123
the number of the second key points of the game role grid model is N.
S202, aligning the reference model and the game role mesh model based on the corresponding relation to obtain a vertex mapping relation between the vertex of the reference model and the vertex of the game role mesh model.
It should be noted that, the terminal may align the reference model and the game character mesh model for multiple times based on the correspondence between the multiple first key points and the multiple second key points until the reference model and the game character mesh model are completely aligned, so as to obtain a vertex mapping relationship between a vertex of the reference model and a vertex of the game character mesh model.
In summary, the terminal can determine the vertex mapping relationship between the vertex of the reference model and the vertex of the game character mesh model only by selecting a plurality of key points according to the user, so that the determination of the vertex mapping relationship is simpler and more convenient.
Optionally, the step S202 may further include: and based on the corresponding relation, carrying out rigid body alignment and non-rigid body alignment on the reference model and the game role mesh model to obtain a vertex mapping relation between the vertex of the reference model and the vertex of the game role mesh model.
The rigid body alignment refers to the alignment of the whole model, and the non-rigid body alignment refers to the alignment of the vertexes in the model.
In a possible implementation manner, the terminal may align positions and dimensions of the reference model and the game character mesh model, that is, perform rigid body alignment, and then perform non-rigid body alignment on each vertex of the reference model and the game character mesh model by using a preset algorithm, so as to obtain a vertex mapping relationship between a vertex of the reference model and a vertex of the game character mesh model.
In summary, rigid body alignment and non-rigid body alignment are performed on the reference model and the game role mesh model to obtain the vertex mapping relationship, so that the efficiency of obtaining the vertex mapping relationship is improved, and the obtained vertex mapping relationship is more accurate.
Optionally, fig. 4 is a schematic flow chart of a game character model generation method provided in an embodiment of the present invention, and as shown in fig. 4, the above-mentioned process of performing rigid body alignment and non-rigid body alignment on the reference model and the game character mesh model based on the correspondence to obtain a vertex mapping relationship between the reference model and the game character mesh model may include:
s301, rigid body alignment is carried out on the reference model and the game role grid model based on the space coordinates of the reference model and the game role grid model.
S302, non-rigid body alignment is carried out on the reference model and the game role mesh model based on the rigid body aligned reference model, the game role mesh model and the corresponding relation, and vertex mapping relation between vertexes of the reference model and the game role mesh model is obtained.
In some embodiments, the terminal may calculate a transformation matrix of vertices in the reference model and the game character mesh model based on spatial coordinates of key points in the reference model and the game character mesh model, apply the transformation matrix to the game character mesh model, achieve rigid body alignment of the reference model and the game character mesh model, ensure that alignment in position and dimension is approximately maintained on the spatial coordinates, and then perform non-rigid body alignment according to a corresponding relationship on the result of rigid body alignment, thereby obtaining a vertex mapping relationship between vertices of the reference model and vertices of the game character mesh model.
Wherein, the vertex mapping relationship can be expressed as:
Figure BDA0002551397020000131
wherein the content of the first and second substances,
Figure BDA0002551397020000132
are the vertices of the reference model and are,
Figure BDA0002551397020000133
being vertices of a game character mesh model, NTThe number of vertices of the reference model.
Fig. 5 is a schematic structural diagram of alignment between a reference model and a game character mesh model according to an embodiment of the present invention, where as shown in fig. 5, the diagram on the left side is the reference model, the diagram in the middle is a rigid body alignment result between the reference model and the game character mesh model, and the diagram on the right side is a non-rigid body alignment result between the reference model and the game character mesh model.
It should be noted that the rigid body alignment is a change in position and orientation in space without changing the form of the game character mesh model itself, and therefore the rigid body alignment result is the same as that of the game character mesh model.
In summary, based on the spatial coordinates, rigid body alignment is performed on the reference model and the game role mesh model, and non-rigid body alignment is performed according to the result after rigid body alignment and the corresponding relationship, so that each vertex of the reference model and each vertex of the game role mesh model can be accurately aligned, the vertex mapping relationship is more accurate, and the target bone data and the target skin data determined based on the vertex mapping relationship are more accurate.
Optionally, fig. 6 is a schematic flow chart of a game character model generation method provided in an embodiment of the present invention, and as shown in fig. 6, the process of S102 may include:
s401, determining the bone weight of a vertex corresponding to each preset bone in the reference model according to the bone data of the reference model and the preset parameters.
In a possible implementation manner, the terminal may determine, according to the position of the preset bone in the bone data of the reference model, the set of points affected by each preset bone in the bone data of the reference model, a bone weight of a vertex corresponding to each preset bone in the reference model, so that each preset bone of the reference model may be represented by the set of affected points and the bone weight corresponding to each vertex in the set of points. Wherein the set of points may include a plurality of vertices.
In addition, the terminal may simultaneously determine the bone weight of the vertex corresponding to each preset bone in the reference model, or may determine the bone weight of the vertex corresponding to each preset bone in the reference model in a traversal manner, which is not specifically limited in the embodiment of the present invention.
Fig. 7 is a schematic diagram of preset bone positions of a reference model according to an embodiment of the present invention, as shown in fig. 7, the reference model includes a plurality of preset bones, a left side view is a front view of the reference model, and a right side view is a side view of the reference model.
S402, determining target skeleton data of the game role mesh model according to the skeleton weight and the vertex mapping relation of the vertex corresponding to each preset skeleton in the reference model.
The model can be established in a preset space coordinate system, and accordingly, each vertex has its own space coordinate.
In the embodiment of the invention, the terminal determines a point set influenced by each preset skeleton in the reference model and the skeleton weight of each vertex in the point set, the terminal can correspondingly determine the point set influenced by the target skeleton in the game role mesh model according to the vertex mapping relation, and determine the skeleton weight of the vertex corresponding to the target skeleton according to the skeleton weight of the vertex corresponding to the preset skeleton, and finally, the terminal can determine a plurality of target skeleton positions according to the point set influenced by the target skeleton and the skeleton weight of the vertex corresponding to the target skeleton, namely, the target skeleton data is determined, and the skeleton migration is realized.
Fig. 8 is a schematic diagram of positions of target bones of a game character mesh model according to an embodiment of the present invention, and as shown in fig. 8, the game character mesh model includes a plurality of target bones, a left diagram is a front view of the game character mesh model, and a right diagram is a side view of the game character mesh model.
In summary, the target skeleton data of the game character mesh model is determined according to the skeleton weight and the vertex mapping relationship of the vertex corresponding to each preset skeleton in the reference model, so that the determination of the target skeleton data of the game character mesh model is more accurate and efficient.
Optionally, the process of S401 may include: and calculating to obtain the bone weight of the vertex corresponding to each preset bone in the reference model according to the vertex of the reference model, the bone data of the reference model, the skin data of the reference model and the preset parameters.
The vertex of the reference model, the skeleton data of the reference model, the skin data of the reference model and the preset parameters can be substituted by adopting a preset formula, and the skeleton weight of the vertex corresponding to each preset skeleton in the reference model is calculated.
It should be noted that the reference model skin data may include: the corresponding relation between the vertex in the reference model and the preset skeleton and the first skinning weight of the vertex in the reference model.
Alternatively, the vertices of the reference model may be represented by viSThe reference model bone data can be represented by J for each preset bone positionSThe weight of the skeleton of the vertex corresponding to the preset skeleton in the reference model can be expressed by ciThe first skin weight of a vertex in the reference model may be expressed as wjSThe preset parameter, i.e. the optimization weight coefficient, can be represented by w1、w2And w3Then the preset formula can be expressed as:
Figure BDA0002551397020000151
when the calculation result E (c) of the formula is preset1,...,cm) At the minimum, c is calculatediI.e. the bone weight of the vertex corresponding to each preset bone in the reference model.
Furthermore, it should be noted that for the calculation of different predetermined bones, w1、w2And w3The values of (a) may be the same or different, and may also be set according to actual requirements, which is not specifically limited in the embodiments of the present application.
In addition, each preset bone position may be represented as:
Figure BDA0002551397020000152
wherein, JSFor a predetermined bone position of the reference model, ciBone weight, v, for a predetermined bone-corresponding vertexiSBeing the vertices affected by the predetermined bone.
In this embodiment of the present application, when determining the bone weight of the vertex corresponding to each preset bone, a preset constraint condition should be satisfied, where the preset constraint condition may include: when the bone weight of the vertex corresponding to the preset bone and the affected point set are adopted to represent the preset bone position, the result of linear combination is ensured to be as close to the bone coordinate position as possible; the corresponding bone weight for each vertex is proportional to the first skinning weight for that vertex; for a point set with influenced preset bones, the sum of the weights of the bones corresponding to all top points in the point set is 1, so that the preset bones can be ensured to be in the reference model, and the problem of mold penetration is effectively prevented.
Optionally, in the process of S302, fig. 9 is a schematic flow chart of a game character model generation method according to an embodiment of the present invention, as shown in fig. 9, the method may include:
s501, according to the vertex mapping relation, the bone weight of the vertex corresponding to each preset bone in the reference model is used as the bone weight of the vertex corresponding to the target bone at the corresponding position in the game role mesh model.
S502, determining target bone data of each target bone according to the bone weight of the vertex corresponding to the target bone and the vertex of the game role mesh model.
In some embodiments, the terminal may determine a set of points in the reference model where each preset bone is affected and a bone weight corresponding to each vertex in the set of points, and determine, according to the vertex mapping relationship, the set of points in the game character mesh model where each target bone is affected, and directly use the bone weight of the vertex corresponding to each preset bone as the bone weight of the corresponding vertex in the game character mesh model.
In addition, target bone data of the target bone may be expressed as
Figure BDA0002551397020000161
Wherein, ciThe bone weight, p, of the vertex corresponding to the target boneiTThe number of affected vertices of the target bone is m.
In summary, the bone weight of the vertex corresponding to each preset bone in the reference model is used as the bone weight of the vertex corresponding to the target bone at the corresponding position in the game role mesh model according to the mapping relationship, so as to determine the target bone data of each target bone, and a bone system does not need to be constructed by manually arranging sample lines on the target model, so that the determination of the target bone data is more efficient and accurate.
In the embodiment of the invention, as the non-rigid body alignment cannot ensure that each point of the game role grid model can be accurately aligned to one point on the reference model, the first skin weight value in the reference model cannot be directly mapped to the key point of the game role grid model, and therefore, an interpolation method can be adopted for skin weight migration.
Optionally, fig. 10 is a schematic flow chart of a game character model generation method according to an embodiment of the present invention, as shown in fig. 10, where S103 may include:
s601, determining a triangular patch of a reference model corresponding to each vertex of the game role mesh model.
In this embodiment of the application, the terminal may determine, based on the vertex mapping relationship, a plurality of vertices of the reference model corresponding to each vertex of the game character mesh model, and then determine, according to the plurality of vertices of the reference model, a triangular patch of the reference model. Here, the triangular patch of the reference model may also be referred to as a triangular patch region.
For example, the vertex mapping relation indicates that the vertex m of the game character mesh model and the vertex n of the reference model are corresponding vertices, the terminal can specify the vertices a, b, and c in the reference model corresponding to the vertex m of the game character mesh model, and connect the vertices b, c, and d to form a triangular patch, and the coordinates of the vertices a, b, and c can represent the coordinates of the vertex n of the reference model. In some cases, vertex n may be any of vertices a, b, c, and may also be located in the region of a triangular patch.
S602, calculating to obtain a second skinning weight of each vertex in the game role mesh model according to the first skinning weight of at least one target vertex of the triangular patch of the corresponding reference model, wherein the target skinning data comprises the second skinning weight of each vertex in the game role mesh model.
In some embodiments, when the number of target vertices of the triangular patch of the corresponding reference model is one, the first skinning weight of the target vertex may be used as the second skinning weight of the corresponding vertex in the game character mesh model, and when the number of target vertices of the triangular patch of the corresponding reference model is multiple, the first skinning weights of the multiple target vertices may be calculated to obtain a calculation result, and the processing result may be used as the second skinning weight of the corresponding vertex in the game character mesh model.
For example, the vertex mapping relationship indicates that the vertex m of the game character mesh model and the vertex n of the reference model are corresponding vertices, and the terminal can specify the target vertices a, b, and c in the reference model that can represent the vertex n. If the vertex n is the position of the vertex a, the first skin weight of the vertex a can be directly used as the second skin weight of the vertex m; if the position of the vertex n is not coincident with the vertices a, b and c, and the vertex n is located in a triangular patch formed by the vertices a, b and c, calculating according to the first skin weights of the vertices a, b and c, and taking the calculation result as the second skin weight of the vertex m;
optionally, the process of S602 may include:
determining a target coefficient of at least one target vertex of a triangular patch of the corresponding reference model; and calculating the second skinning weight of each vertex in the game role mesh model according to the first skinning weight and the target coefficient corresponding to at least one target vertex of the triangular patch of the corresponding reference model.
In this embodiment, the vertex mapping relationship indicates that a vertex m of the game character mesh model and a vertex n of the reference model are corresponding vertices, the terminal may determine target vertices a, b, and c in the reference model capable of representing the vertex n, the target vertices a, b, and c form a triangular patch, and the terminal may represent the vertex n in the reference model according to coordinates of the target vertices and coefficients corresponding to the target vertices.
For example, if the vertex n is located at the target vertex b, the target coefficient corresponding to the target vertex b may be 1, and the target coefficients corresponding to the target vertices a and c may be 0, the second skinning weight of the vertex m may be determined according to the target coefficient of the target vertex b and the corresponding first skinning weight.
If the vertex n is located on a straight line connecting the target vertices b and a, the target coefficients corresponding to the target vertices b and a are both greater than 0 and less than 1, and the target coefficient corresponding to the target vertex c is 0, the second skin weight of the vertex m may be determined according to the target coefficients of the target vertices b and a and the corresponding first skin weight.
If the vertex n is located in the triangular patch, and the target coefficients corresponding to the target vertices a, b, and c are all greater than 0 and less than 1, the second skin weight of the vertex m may be determined according to the target coefficients of the target vertices a, b, and c and the corresponding first skin weight.
It should be noted that, a preset formula may be adopted, and the second skinning weight of each vertex in the game role mesh model is calculated according to the first skinning weight and the target coefficient corresponding to the target vertex, that is, migration of the skinning weight is realized.
In some embodiments, the second skinning weight for the vertices in the game character mesh model may be expressed as:
Figure BDA0002551397020000181
wherein a, b and c form the vertex of the triangular patch, i.e. the target vertex βaTarget coefficient for target vertex a, βbTarget coefficient for target vertex a, βcIs a target coefficient of the target vertex c, waS,wbS,wcSThe first skin weight values for vertices a, b, c, respectively.
Fig. 11 is a schematic diagram of skinning results of a left apple machine and a head of a reference model according to an embodiment of the present invention, as shown in fig. 11, the reference model includes a plurality of preset bones, the left side is a schematic diagram of skinning results of the left apple machine, and the right side is a schematic diagram of skinning results of a chin.
Fig. 12 is a schematic diagram of the skinning result of the left apple machine and the head of the game character mesh model according to the embodiment of the present invention, as shown in fig. 12, the game character mesh model includes a plurality of preset bones, the left side diagram is a schematic diagram of the skinning result of the left apple machine, and the right side diagram is a schematic diagram of the skinning result of the chin.
In conclusion, according to the first skin weight and the target coefficient corresponding to at least one target vertex of the triangular patch of the corresponding reference model, the second skin weight of each vertex in the game role mesh model is calculated, the problem of skin effect distortion can be effectively solved without needing to spend more time for adjustment in the later art stage, and the determination of the second skin weight can be more accurate and convenient.
In the embodiment of the application, a tester can change the game role model by adjusting the parameters of the skeleton controller, and when the game role model is the facial expression model of the game role, the facial expression model can be changed, so that the deformation effect of the game role model can be tested.
Fig. 13 is a schematic diagram illustrating a deformation result of a game character model according to an embodiment of the present invention, as shown in fig. 13, an eyebrow of the game character model is in an eyebrow raising state, a mouth of the game character model is in a W shape, and an expression of the game character model changes.
Optionally, after the step S104, the method may further include: and smoothing the target skin data of the game role model to obtain the processed game role model.
It should be noted that, the skin effect of the processed game role model obtained by smoothing the target skin data of the game role model is better.
Fig. 14 is a schematic flow chart of a role adjustment method based on a game role model according to an embodiment of the present invention, and as shown in fig. 14, the method may be based on the game role models obtained in fig. 1 to fig. 13, where the game role models may be applied to specific games, and in a game, a user may adjust a corresponding role based on the game role model, and the method may include:
and S701, responding to the adjustment operation of the user for the target game role, and acquiring adjustment action information.
The user can touch or operate the direct target game role through a mouse, the game interface can comprise function keys and the target game role, and the user can also directly operate the function keys through touching or the mouse so as to realize the operation of the target game role; the user may also directly operate the target game role by touching or by using a mouse, which is not specifically limited in the embodiment of the present application.
S702, controlling at least one target skeleton in the game role model to move according to the adjustment action information, and acquiring the adjusted target game role.
In some embodiments, the terminal may determine at least one first skeleton of the reference model according to the adjustment action information, then determine at least one corresponding target skeleton in the game character model according to the vertex mapping relationship, control the at least one target skeleton to move, and then may obtain the adjusted target game character.
Of course, the terminal may also directly determine at least one target skeleton in the game character model according to the adjustment action information, which is not specifically limited in the embodiment of the present invention.
In summary, in response to the adjustment operation of the user for the target game character, the adjustment action information is obtained, at least one target bone in the game character model is controlled to move according to the adjustment action information, and the adjusted target game character is obtained, so that the user can control the game character model, and the user experience is improved.
Optionally, the game character model is a facial expression model of the game character, and the process of S702 may include: and controlling at least one target skeleton in the game role model to move according to the adjustment action information, and acquiring the adjusted expression of the target game role.
In the embodiment of the invention, the terminal can adjust the expression of the target game role according to the adjustment action, so that the expression of the target game role is richer and more diversified, the interest of the game is increased, and the user experience is improved.
Optionally, fig. 15 is a schematic flowchart of a character adjusting method based on a game character model according to an embodiment of the present invention, and as shown in fig. 15, the process of S701 may further include:
s801, responding to the adjustment operation of the user aiming at the target game role, and acquiring the amplitude of the adjustment operation.
And S802, acquiring adjustment action information according to the amplitude of the adjustment operation.
Wherein the adjusting action information includes: bone adjustment parameters.
In some embodiments, the terminal may determine at least one target bone and an adjustment magnitude for each target bone, i.e., an adjustment parameter for each target bone, in response to an adjustment operation of the user for the target game character, so that adjustment action information may be acquired.
In summary, in response to the adjustment operation of the user for the target game character, the amplitude of the adjustment operation is obtained, and the adjustment action information is obtained according to the amplitude of the adjustment operation. When the adjustment action information is determined, the adjustment amplitude is fully considered, and the user experience is improved.
Fig. 16 is a schematic structural diagram of a game character model generating apparatus according to an embodiment of the present invention, and as shown in fig. 16, the apparatus may include:
a determining module 1601, configured to determine a vertex mapping relationship between a vertex of a reference model and a vertex of a game character mesh model according to a key point of the reference model and a key point of the game character mesh model, where the reference model includes reference model mesh data, reference model skeleton data, and corresponding reference model skin data; determining target skeleton data of the game role mesh model according to the skeleton data of the reference model and the vertex mapping relation; determining target skin data of the game role mesh model according to the vertexes of at least one reference model corresponding to the vertexes of the game role mesh model and the corresponding reference model skin data;
a generating module 1602, configured to generate a game role model according to the game role grid model, the target skeleton data, and the corresponding target skinning data.
Optionally, the determining module 1601 is further configured to, in response to a user operation, obtain a correspondence between a plurality of first key points of the reference model and a plurality of second key points of the game character mesh model; and aligning the reference model and the game role mesh model based on the corresponding relation to obtain a vertex mapping relation between the vertex of the reference model and the vertex of the game role mesh model.
Optionally, the determining module 1601 is further configured to perform rigid body alignment and non-rigid body alignment on the reference model and the game role mesh model based on the correspondence, so as to obtain a vertex mapping relationship between a vertex of the reference model and a vertex of the game role mesh model, where rigid body alignment refers to overall alignment of the model, and non-rigid body alignment refers to alignment of vertices in the model.
Optionally, the determining module 1601 is further configured to perform rigid body alignment on the reference model and the game role grid model based on the spatial coordinates of the reference model and the game role grid model; and performing non-rigid body alignment on the reference model and the game role mesh model based on the reference model and the game role mesh model after rigid body alignment and the corresponding relationship to obtain a vertex mapping relationship between the vertex of the reference model and the vertex of the game role mesh model.
Optionally, the determining module 1601 is further configured to determine, according to the bone data of the reference model and the preset parameters, a bone weight of a vertex corresponding to each preset bone in the reference model; and determining target skeleton data of the game role mesh model according to the skeleton weight of the vertex corresponding to each preset skeleton in the reference model and the vertex mapping relation.
Optionally, the determining module 1601 is further configured to calculate, according to the vertex of the reference model, the bone data of the reference model, the skin data of the reference model, and the preset parameters, a bone weight of the vertex corresponding to each preset bone in the reference model.
Optionally, the determining module 1601 is further configured to use, according to the vertex mapping relationship, the bone weight of the vertex corresponding to each preset bone in the reference model as the bone weight of the vertex corresponding to the target bone at the corresponding position in the game role mesh model; and determining target bone data of each target bone according to the bone weight of the corresponding vertex in the target bone and the vertex of the game character mesh model.
Optionally, the reference model skin data includes a first skin weight of each vertex in the reference model, and the determining module 1601 is further configured to determine a triangular patch of the reference model corresponding to each vertex of the game character mesh model; and calculating to obtain a second skinning weight of each vertex in the game role mesh model according to the first skinning weight of at least one target vertex of the triangular patch of the corresponding reference model, wherein the target skinning data comprises the second skinning weight of each vertex in the game role mesh model.
Optionally, the determining module 1601 is further configured to determine a target coefficient of at least one target vertex of a triangular patch of the corresponding reference model; and calculating the second skinning weight of each vertex in the game role mesh model according to the first skinning weight and the target coefficient corresponding to at least one target vertex of the triangular patch of the corresponding reference model.
Optionally, the method further includes:
and the processing module is used for performing smoothing processing on the target skin data of the game role model to obtain the processed game role model.
Fig. 17 is a schematic structural diagram of a character adjusting apparatus based on a game character model according to an embodiment of the present invention, applied to a game character model obtained by the above method, as shown in fig. 17, the apparatus may include:
an obtaining module 1701 for obtaining adjustment action information in response to an adjustment operation of a user for a target game character;
a control module 1702, configured to control at least one target skeleton in the game character model to move according to the adjustment action information, so as to obtain an adjusted target game character.
Optionally, the game role model is a facial expression model of the game role;
the control module 1702 is further configured to control at least one target bone in the game character model to move according to the adjustment action information, and obtain an expression of the adjusted target game character.
Optionally, the obtaining module 1701 is further configured to, in response to an adjustment operation of the user for the target game character, obtain an amplitude of the adjustment operation; acquiring adjustment action information according to the amplitude of the adjustment operation, wherein the adjustment action information comprises: bone adjustment parameters.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 18 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device may be a computing device with a data processing function.
As shown in fig. 18, the electronic device may include: a processor 1801, a memory 1802.
The memory 1802 is used for storing programs, and the processor 1801 calls the programs stored in the memory 1802 to execute the above-mentioned method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the invention also provides a program product, for example a computer-readable storage medium, comprising a program which, when being executed by a processor, is adapted to carry out the above-mentioned method embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

Claims (17)

1. A method for generating a game character model, comprising:
determining a vertex mapping relation between a vertex of a reference model and a vertex of a game role mesh model according to the key point of the reference model and the key point of the game role mesh model, wherein the reference model comprises reference model mesh data, reference model skeleton data and corresponding reference model skin data;
determining target skeleton data of the game role mesh model according to the skeleton data of the reference model and the vertex mapping relation;
determining target skinning data of the game role mesh model according to at least one vertex of the reference model corresponding to the vertex of the game role mesh model and the corresponding skinning data of the reference model;
and generating the game role model according to the game role grid model, the target skeleton data and the corresponding target skinning data.
2. The method of claim 1, wherein determining vertex mappings between vertices of the reference model and vertices of the game character mesh model based on the key points of the reference model and the key points of the game character mesh model comprises:
responding to user operation, and acquiring corresponding relations between a plurality of first key points of the reference model and a plurality of second key points of the game role grid model;
and aligning the reference model and the game role mesh model based on the corresponding relation to obtain a vertex mapping relation between the vertex of the reference model and the vertex of the game role mesh model.
3. The method of claim 2, wherein said aligning the reference model and the game character mesh model based on the correspondence to obtain a vertex mapping relationship between vertices of the reference model and vertices of the game character mesh model comprises:
and based on the corresponding relation, carrying out rigid body alignment and non-rigid body alignment on the reference model and the game role grid model to obtain a vertex mapping relation between the vertex of the reference model and the vertex of the game role grid model, wherein the rigid body alignment refers to the integral alignment of the model, and the non-rigid body alignment refers to the alignment of the vertices in the model.
4. The method of claim 3, wherein said performing rigid body alignment and non-rigid body alignment on said reference model and said game character mesh model based on said correspondence to obtain a vertex mapping relationship between said reference model and said game character mesh model comprises:
performing rigid body alignment on the reference model and the game role grid model based on the space coordinates of the reference model and the game role grid model;
and performing non-rigid body alignment on the reference model and the game role mesh model based on the rigid body aligned reference model, the game role mesh model and the corresponding relationship to obtain a vertex mapping relationship between the vertexes of the reference model and the game role mesh model.
5. The method of claim 1, wherein said determining target skeletal data for said game character mesh model based on said reference model skeletal data and said vertex mappings comprises:
determining the bone weight of a vertex corresponding to each preset bone in the reference model according to the bone data of the reference model and preset parameters;
and determining target skeleton data of the game role mesh model according to the skeleton weight of the vertex corresponding to each preset skeleton in the reference model and the vertex mapping relation.
6. The method of claim 5, wherein determining the bone weight of the vertex corresponding to each predetermined bone in the reference model based on the bone data of the reference model and predetermined parameters comprises:
and calculating to obtain the bone weight of the vertex corresponding to each preset bone in the reference model according to the vertex of the reference model, the bone data of the reference model, the skin data of the reference model and the preset parameters.
7. The method of claim 6, wherein determining the target bone data of the game character mesh model according to the bone weight of the vertex corresponding to each preset bone in the reference model and the vertex mapping relationship comprises:
according to the vertex mapping relation, the bone weight of a vertex corresponding to each preset bone in the reference model is used as the bone weight of a vertex corresponding to a target bone at a corresponding position in the game role mesh model;
and determining the target bone data of each target bone according to the bone weight of the vertex corresponding to the target bone and the vertex of the game character mesh model.
8. The method of claim 1, wherein the reference model skinning data comprises a first skinning weight for each vertex in the reference model, and wherein determining the target skinning data for the game character mesh model based on the at least one vertex of the reference model corresponding to the vertex of the game character mesh model and the corresponding reference model skinning data comprises:
determining a triangular patch of the reference model corresponding to each vertex of the game role mesh model;
and calculating to obtain a second skinning weight of each vertex in the game role mesh model according to the first skinning weight of at least one target vertex of the triangular patch of the corresponding reference model, wherein the target skinning data comprises the second skinning weight of each vertex in the game role mesh model.
9. The method of claim 8, wherein computing a second skinning weight for each vertex in the game character mesh model based on the first skinning weight for at least one target vertex of the triangular patch of the corresponding reference model comprises:
determining a target coefficient of at least one target vertex of the triangular patch of the corresponding reference model;
and calculating the second skinning weight of each vertex in the game role mesh model according to the first skinning weight and the target coefficient corresponding to at least one target vertex of the triangular patch of the corresponding reference model.
10. The method of any of claims 1-9, wherein after generating the game character model from the game character mesh model, target skeletal data, and corresponding target skinning data, further comprising:
and smoothing the target skin data of the game role model to obtain a processed game role model.
11. A character adjustment method based on a game character model, applied to a game character model obtained based on the method according to any one of claims 1 to 10, the method further comprising:
responding to the adjustment operation of a user for the target game role, and acquiring adjustment action information;
and controlling at least one target skeleton in the game role model to move according to the adjustment action information to obtain the adjusted target game role.
12. The method of claim 11, wherein the game character model is a facial expression model of a game character;
the controlling at least one target skeleton in the game role model to move according to the adjustment action information to obtain the adjusted target game role comprises the following steps:
and controlling at least one target skeleton in the game role model to move according to the adjustment action information, and acquiring the adjusted expression of the target game role.
13. The method of claim 11, wherein the obtaining adjustment action information in response to the user's adjustment operation for the target game character comprises:
responding to the adjustment operation of a user for a target game role, and acquiring the amplitude of the adjustment operation;
acquiring the adjustment action information according to the amplitude of the adjustment operation, wherein the adjustment action information comprises: bone adjustment parameters.
14. A game character model generation apparatus, comprising:
the determining module is used for determining a vertex mapping relation between a vertex of a reference model and a vertex of a game role mesh model according to the key point of the reference model and the key point of the game role mesh model, wherein the reference model comprises reference model mesh data, reference model skeleton data and corresponding reference model skin data; determining target skeleton data of the game role mesh model according to the skeleton data of the reference model and the vertex mapping relation; determining target skinning data of the game role mesh model according to at least one vertex of the reference model corresponding to the vertex of the game role mesh model and the corresponding skinning data of the reference model;
and the generating module is used for generating the game role model according to the game role grid model, the target skeleton data and the corresponding target skinning data.
15. A character adjusting apparatus based on a game character model, applied to a game character model obtained based on the method according to any one of claims 1 to 10, the apparatus comprising:
the acquisition module is used for responding to the adjustment operation of a user aiming at the target game role and acquiring adjustment action information;
and the control module is used for controlling at least one target skeleton in the game role model to move according to the adjustment action information to obtain the adjusted target game role.
16. An electronic device, comprising: a memory storing a computer program executable by the processor, and a processor implementing the game character model generation method according to any one of claims 1 to 13 when the computer program is executed by the processor.
17. A storage medium having stored thereon a computer program which, when read and executed, implements the game character model generation method according to any one of claims 1 to 13.
CN202010577249.4A 2020-06-22 2020-06-22 Game role model generation method, game role model generation device, game role adjustment device and game role adjustment medium Pending CN111714885A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010577249.4A CN111714885A (en) 2020-06-22 2020-06-22 Game role model generation method, game role model generation device, game role adjustment device and game role adjustment medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010577249.4A CN111714885A (en) 2020-06-22 2020-06-22 Game role model generation method, game role model generation device, game role adjustment device and game role adjustment medium

Publications (1)

Publication Number Publication Date
CN111714885A true CN111714885A (en) 2020-09-29

Family

ID=72568260

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010577249.4A Pending CN111714885A (en) 2020-06-22 2020-06-22 Game role model generation method, game role model generation device, game role adjustment device and game role adjustment medium

Country Status (1)

Country Link
CN (1) CN111714885A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112435318A (en) * 2020-11-30 2021-03-02 上海米哈游天命科技有限公司 Anti-threading method and device in game, electronic equipment and storage medium
CN112712578A (en) * 2020-12-31 2021-04-27 魔珐(上海)信息科技有限公司 Virtual character model creating method and device, electronic equipment and storage medium
CN112843701A (en) * 2021-03-09 2021-05-28 腾讯科技(深圳)有限公司 Wearable element replacement method and device, terminal and storage medium
CN112884868A (en) * 2021-04-30 2021-06-01 腾讯科技(深圳)有限公司 Three-dimensional mesh vertex feature determination method, skeleton covering method and related device
CN113058268A (en) * 2021-04-30 2021-07-02 腾讯科技(深圳)有限公司 Skin data generation method, skin data generation device, skin data generation equipment and computer readable storage medium
CN113345059A (en) * 2021-05-31 2021-09-03 网易(杭州)网络有限公司 Animation generation method, animation generation device, storage medium and electronic equipment
CN113797529A (en) * 2021-09-18 2021-12-17 珠海金山网络游戏科技有限公司 Target display method and device
WO2022110791A1 (en) * 2020-11-25 2022-06-02 北京市商汤科技开发有限公司 Method and apparatus for face reconstruction, and computer device, and storage medium
CN116543093A (en) * 2023-07-04 2023-08-04 腾讯科技(深圳)有限公司 Flexible object rendering method, device, computer equipment and storage medium

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110304622A1 (en) * 2006-05-01 2011-12-15 Image Metrics Ltd Development Tools for Animated Character Rigging
CN104021584A (en) * 2014-06-25 2014-09-03 无锡梵天信息技术股份有限公司 Implementation method of skinned skeletal animation
CN106846499A (en) * 2017-02-09 2017-06-13 腾讯科技(深圳)有限公司 The generation method and device of a kind of dummy model
CN106960467A (en) * 2017-03-22 2017-07-18 北京太阳花互动科技有限公司 A kind of face reconstructing method and system with bone information
CN109345615A (en) * 2018-10-25 2019-02-15 网易(杭州)网络有限公司 Covering data creation method and device, electronic equipment and storage medium
CN109993819A (en) * 2019-04-09 2019-07-09 网易(杭州)网络有限公司 Skinning method and device, the electronic equipment of virtual role
CN110111418A (en) * 2019-05-15 2019-08-09 北京市商汤科技开发有限公司 Create the method, apparatus and electronic equipment of facial model
CN110111247A (en) * 2019-05-15 2019-08-09 浙江商汤科技开发有限公司 Facial metamorphosis processing method, device and equipment
CN110214341A (en) * 2016-12-06 2019-09-06 新加坡国立大学 The method for rebuilding skull
CN110490959A (en) * 2019-08-14 2019-11-22 腾讯科技(深圳)有限公司 Three dimensional image processing method and device, virtual image generation method and electronic equipment
CN110675475A (en) * 2019-08-19 2020-01-10 腾讯科技(深圳)有限公司 Face model generation method, device, equipment and storage medium
CN110689604A (en) * 2019-05-10 2020-01-14 腾讯科技(深圳)有限公司 Personalized face model display method, device, equipment and storage medium
CN111292402A (en) * 2020-02-13 2020-06-16 腾讯科技(深圳)有限公司 Data processing method, device, equipment and computer readable storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110304622A1 (en) * 2006-05-01 2011-12-15 Image Metrics Ltd Development Tools for Animated Character Rigging
CN104021584A (en) * 2014-06-25 2014-09-03 无锡梵天信息技术股份有限公司 Implementation method of skinned skeletal animation
CN110214341A (en) * 2016-12-06 2019-09-06 新加坡国立大学 The method for rebuilding skull
CN106846499A (en) * 2017-02-09 2017-06-13 腾讯科技(深圳)有限公司 The generation method and device of a kind of dummy model
CN106960467A (en) * 2017-03-22 2017-07-18 北京太阳花互动科技有限公司 A kind of face reconstructing method and system with bone information
CN109345615A (en) * 2018-10-25 2019-02-15 网易(杭州)网络有限公司 Covering data creation method and device, electronic equipment and storage medium
CN109993819A (en) * 2019-04-09 2019-07-09 网易(杭州)网络有限公司 Skinning method and device, the electronic equipment of virtual role
CN110689604A (en) * 2019-05-10 2020-01-14 腾讯科技(深圳)有限公司 Personalized face model display method, device, equipment and storage medium
CN110111418A (en) * 2019-05-15 2019-08-09 北京市商汤科技开发有限公司 Create the method, apparatus and electronic equipment of facial model
CN110111247A (en) * 2019-05-15 2019-08-09 浙江商汤科技开发有限公司 Facial metamorphosis processing method, device and equipment
CN110490959A (en) * 2019-08-14 2019-11-22 腾讯科技(深圳)有限公司 Three dimensional image processing method and device, virtual image generation method and electronic equipment
CN110675475A (en) * 2019-08-19 2020-01-10 腾讯科技(深圳)有限公司 Face model generation method, device, equipment and storage medium
CN111292402A (en) * 2020-02-13 2020-06-16 腾讯科技(深圳)有限公司 Data processing method, device, equipment and computer readable storage medium

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022110791A1 (en) * 2020-11-25 2022-06-02 北京市商汤科技开发有限公司 Method and apparatus for face reconstruction, and computer device, and storage medium
JP2023507863A (en) * 2020-11-25 2023-02-28 北京市商▲湯▼科技▲開▼▲發▼有限公司 Face reconstruction method, apparatus, computer device, and storage medium
CN112435318A (en) * 2020-11-30 2021-03-02 上海米哈游天命科技有限公司 Anti-threading method and device in game, electronic equipment and storage medium
CN112712578A (en) * 2020-12-31 2021-04-27 魔珐(上海)信息科技有限公司 Virtual character model creating method and device, electronic equipment and storage medium
CN112712578B (en) * 2020-12-31 2022-09-27 魔珐(上海)信息科技有限公司 Virtual character model creating method and device, electronic equipment and storage medium
CN112843701A (en) * 2021-03-09 2021-05-28 腾讯科技(深圳)有限公司 Wearable element replacement method and device, terminal and storage medium
CN113058268A (en) * 2021-04-30 2021-07-02 腾讯科技(深圳)有限公司 Skin data generation method, skin data generation device, skin data generation equipment and computer readable storage medium
CN113058268B (en) * 2021-04-30 2022-07-29 腾讯科技(深圳)有限公司 Skin data generation method, device and equipment and computer readable storage medium
CN112884868B (en) * 2021-04-30 2021-07-13 腾讯科技(深圳)有限公司 Three-dimensional mesh vertex feature determination method, skeleton covering method and related device
CN112884868A (en) * 2021-04-30 2021-06-01 腾讯科技(深圳)有限公司 Three-dimensional mesh vertex feature determination method, skeleton covering method and related device
CN113345059A (en) * 2021-05-31 2021-09-03 网易(杭州)网络有限公司 Animation generation method, animation generation device, storage medium and electronic equipment
CN113345059B (en) * 2021-05-31 2023-08-08 网易(杭州)网络有限公司 Animation generation method and device, storage medium and electronic equipment
CN113797529A (en) * 2021-09-18 2021-12-17 珠海金山网络游戏科技有限公司 Target display method and device
CN113797529B (en) * 2021-09-18 2023-11-21 珠海金山数字网络科技有限公司 Target display method and device, computing equipment and computer readable storage medium
CN116543093A (en) * 2023-07-04 2023-08-04 腾讯科技(深圳)有限公司 Flexible object rendering method, device, computer equipment and storage medium
CN116543093B (en) * 2023-07-04 2024-04-02 腾讯科技(深圳)有限公司 Flexible object rendering method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111714885A (en) Game role model generation method, game role model generation device, game role adjustment device and game role adjustment medium
Lewis et al. Direct manipulation blendshapes
Kavan et al. Elasticity-inspired deformers for character articulation
Li et al. Fitting 3D garment models onto individual human models
Shi et al. Example-based dynamic skinning in real time
JP2022550555A (en) Image processing method, device, electronic device and computer program
US9965574B2 (en) CAD-based initial surface geometry correction
TWI780919B (en) Method and apparatus for processing face image, electronic device and storage medium
von Radziewsky et al. Optimized subspaces for deformation-based modeling and shape interpolation
KR20220083830A (en) Image processing method and image synthesis method, image processing apparatus and image synthesis apparatus, and storage medium
Chen et al. Rigidity controllable as-rigid-as-possible shape deformation
Iwamoto et al. Multi‐layer Lattice Model for Real‐Time Dynamic Character Deformation
Pan et al. Automatic skinning and weight retargeting of articulated characters using extended position-based dynamics
EP1950699A2 (en) Reshaping a camera image
CN116433812B (en) Method and device for generating virtual character by using 2D face picture
US20230079478A1 (en) Face mesh deformation with detailed wrinkles
CN115908664A (en) Man-machine interaction animation generation method and device, computer equipment and storage medium
Yuan et al. Data-driven weight optimization for real-time mesh deformation
US11574444B1 (en) Multi-characteristic remeshing for graphical objects
WO2023169023A1 (en) Expression model generation method and apparatus, device, and medium
US20240104846A1 (en) 3d modeling user interfaces by introducing improved coordinates for triquad cages
Chen et al. Parametric editing of clothed 3D avatars
CN110060779B (en) Soft tissue surface piercing simulation method and device
US20230196678A1 (en) Transforming three-dimensional model by using correlation to template model with template skeleton
CN116977605A (en) Virtual character image model generation method, device and computer equipment

Legal Events

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