CN115588065A - Method and device for generating hair model, computer equipment and storage medium - Google Patents

Method and device for generating hair model, computer equipment and storage medium Download PDF

Info

Publication number
CN115588065A
CN115588065A CN202211358247.1A CN202211358247A CN115588065A CN 115588065 A CN115588065 A CN 115588065A CN 202211358247 A CN202211358247 A CN 202211358247A CN 115588065 A CN115588065 A CN 115588065A
Authority
CN
China
Prior art keywords
hair
model
spline curve
setting part
patch
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
CN202211358247.1A
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.)
Guangzhou Boguan Information Technology Co Ltd
Original Assignee
Guangzhou Boguan Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Boguan Information Technology Co Ltd filed Critical Guangzhou Boguan Information Technology Co Ltd
Priority to CN202211358247.1A priority Critical patent/CN115588065A/en
Publication of CN115588065A publication Critical patent/CN115588065A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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

Landscapes

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

Abstract

The embodiment of the application discloses a method and a device for generating a hair model, computer equipment and a storage medium. The scheme includes acquiring a preset object model of a target object, wherein the preset object model comprises a hair setting part model of the target object and a basic hair model corresponding to the hair setting part model, then creating a hair spline curve corresponding to the basic hair model according to a model contour of the basic hair model, adsorbing the hair spline curve to the hair setting part model of the target object, further performing hair region mapping processing on the hair setting part model with the hair spline curve attached, acquiring hair spline curve information from the hair setting part model after mapping processing, and generating a hair patch model required by the hair setting part model according to the hair spline curve information. Thus, the generation efficiency of the hair model can be improved.

Description

Method and device for generating hair model, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a hair model, a computer device, and a storage medium.
Background
With the development of computer technology and the like, three-dimensional virtual objects become an important part in the fields of game production, animation production and the like, and are widely popular with the public because of rich and vivid visual effects. Among them, the hair model is a very important component in some three-dimensional virtual objects such as characters, animals and other virtual objects. For example, it may include the hair of a character, the hair of an animal, the pile of a pile material article, and the like.
In the related art, the shape of the hair is formed by stacking a large number of hair pieces. In the process, a modeler is required to place and adjust the shape of each hair patch according to requirements. However, the number of the hair pieces determines the quality of the hair model, so that a great deal of time and effort is required to produce a high-quality hair model, thereby affecting the production efficiency of the hair model.
Disclosure of Invention
The embodiment of the application provides a hair model generation method, a hair model generation device, a computer device and a storage medium, and can improve the hair model generation efficiency.
The embodiment of the application provides a hair model generation method, which comprises the following steps:
acquiring a preset object model of a target object, wherein the preset object model comprises a hair setting part model of the target object and a basic hair model corresponding to the hair setting part model;
creating a hair spline curve corresponding to the basic hair model based on the model contour of the basic hair model;
adsorbing the hair spline curve to a hair setting site model of the target object;
carrying out hair region mapping treatment on the hair setting part model attached with the hair spline curve to obtain a hair setting part model after mapping treatment;
acquiring hair spline curve information based on the hair setting part model after the chartlet processing;
and generating a hair patch model required by the hair setting part model according to the hair spline curve information.
Correspondingly, the embodiment of the present application further provides a device for generating a hair model, including:
a first obtaining unit, configured to obtain a preset object model of a target object, where the preset object model includes a hair setting portion model of the target object and a basic hair model corresponding to the hair setting portion model;
a creating unit, configured to create a hair spline curve corresponding to the base hair model based on the model contour of the base hair model;
an adsorption unit for adsorbing the hair spline curve to a hair setting part model of the target object;
a processing unit for performing hair region mapping processing on the hair setting part model to which the hair spline curve is attached to obtain a mapped hair setting part model;
a second obtaining unit, configured to obtain hair spline curve information based on the chartlet-processed hair setting part model;
and the generating unit is used for generating a hair patch model required by the hair setting part model according to the hair spline curve information.
In some embodiments, the creating unit comprises:
a first determining subunit, configured to determine a hair tendency of the base hair model from the model contour;
and the creating subunit is used for creating a spline curve on the basic hair model according to the hair trend correspondence to obtain the hair spline curve.
In some embodiments, the adsorption unit comprises:
a second determining subunit for determining a model surface of the hair setting region model which is in contact with the basic hair model;
an adsorption subunit for adsorbing the vertex of the hair spline curve to the mold surface.
In some embodiments, the processing unit comprises:
a conversion subunit for converting the hair spline curve into a guide line in a hair system;
and a processing subunit, configured to perform mapping processing on the hair region on the guide line to obtain a hair setting region model after the mapping processing.
In some embodiments, the processing unit further comprises:
the first adjusting subunit is used for adjusting the number and/or the shape of the guide lines to obtain the adjusted guide lines.
In some embodiments, the processing subunit is specifically configured to:
and performing hair region mapping treatment on the adjusted guide line.
In some embodiments, the apparatus further comprises:
and the adding unit is used for adding a hair bundle effect device to the chartlet-processed hair setting part model so as to enable the chartlet-processed hair setting part model to present a hair bundle effect.
In some embodiments, the apparatus further comprises:
and the adjusting unit is used for adjusting the hair density of the hair spline curve in the hair setting part model after the mapping treatment.
In some embodiments, the second acquisition unit comprises:
and the acquiring subunit is used for acquiring the number of the hair spline curves based on the hair setting part model after the mapping treatment after the hair density is adjusted, so as to obtain the hair spline curve information.
In some embodiments, the apparatus further comprises:
the modification unit is used for modifying the number of hair spline curves in the hair setting part model after the mapping treatment after the hair density is adjusted to obtain the hair spline curves of the target number;
and the grouping unit is used for carrying out grouping processing on the hair spline curves of the target number to obtain the grouping information of the hair spline curves.
In some embodiments, the second acquisition unit comprises:
a third determining subunit, configured to obtain the hair spline curve information based on the target number of hair splines and the grouping information of the hair splines.
In some embodiments, the generating unit comprises:
a generating subunit, configured to generate corresponding patch models based on each of the hair spline curves of the target number;
and the matching subunit is used for matching a preset hair effect map for the patch model to obtain the hair patch model.
In some embodiments, the matching subunit is specifically configured to:
determining hair spline curves in the same group according to the group information;
and matching the same preset hair effect maps for the patch models corresponding to the hair spline curves in the same group.
In some embodiments, the generating unit further comprises:
and the second adjusting subunit is used for adjusting the patch attributes of the patch model to obtain an adjusted patch model.
In some embodiments, the matching subunit is specifically configured to:
and matching a preset hair effect mapping for the adjusted rear patch model to obtain the hair patch model.
Accordingly, embodiments of the present application further provide a computer device, including a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the method for generating a hair model provided in any of the embodiments of the present application.
Accordingly, embodiments of the present application further provide a computer-readable storage medium, which stores a plurality of instructions, where the instructions are suitable for being loaded by a processor to perform the method for generating a hair model as above.
The scheme includes that a preset object model of a target object is obtained, the preset object model comprises a hair setting part model of the target object and a basic hair model corresponding to the hair setting part model, then a hair spline curve corresponding to the basic hair model is created according to the model outline of the basic hair model, the hair spline curve is adsorbed to the hair setting part model of the target object, further, hair area mapping processing is carried out on the hair setting part model with the hair spline curve, hair spline curve information is obtained from the hair setting part model after mapping processing, and a hair patch model required by the hair setting part model is generated according to the hair spline curve information. Thus, the efficiency of generating the hair model can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for generating a hair model according to an embodiment of the present application.
Fig. 2 is an application scenario diagram of a method for generating a hair model according to an embodiment of the present application.
Fig. 3 is a schematic application scenario diagram of another hair model generation method provided in an embodiment of the present application.
Fig. 4 is a schematic application scenario diagram of another hair model generation method according to an embodiment of the present application.
Fig. 5 is a schematic application scenario diagram of another hair model generation method according to an embodiment of the present application.
Fig. 6 is a schematic flowchart of another method for generating a hair model according to an embodiment of the present application.
Fig. 7 is a schematic application scenario diagram of another hair model generation method according to an embodiment of the present application.
Fig. 8 is a schematic application scenario diagram of another hair model generation method according to an embodiment of the present application.
Fig. 9 is a schematic application scenario diagram of another hair model generation method according to an embodiment of the present application.
Fig. 10 is a schematic application scenario diagram of another hair model generation method provided in an embodiment of the present application.
Fig. 11 is a block diagram of a hair model generation apparatus according to an embodiment of the present application.
Fig. 12 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a hair model generation method, a hair model generation device, a storage medium and computer equipment. Specifically, the method for generating a hair model according to the embodiment of the present application may be executed by a computer device, where the computer device may be a terminal or a server or the like. The terminal can be a terminal device such as a smart phone, a tablet Computer, a notebook Computer, a touch screen, a Personal Computer (PC), a Personal Digital Assistant (PDA), and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and a big data and artificial intelligence platform.
For example, the computer device may be a terminal, and the terminal may obtain a preset object model of the target object, where the preset object model includes a hair setting location model of the target object and a basic hair model corresponding to the hair setting location model; creating a hair spline curve corresponding to the basic hair model based on the model outline of the basic hair model; adsorbing the hair spline curve to a hair setting part model of the target object; carrying out hair region mapping treatment on the hair setting part model attached with the hair spline curve to obtain a hair setting part model after mapping treatment; acquiring hair spline curve information based on the hair setting part model after the chartlet processing; and generating a hair patch model required by the hair setting part model according to the hair spline curve information.
In view of the above problems, embodiments of the present application provide a method, an apparatus, a computer device, and a storage medium for generating a first hair model, which can improve the generation efficiency of the hair model.
The following are detailed descriptions. It should be noted that the following description of the embodiments is not intended to limit the preferred order of the embodiments.
The embodiments of the present application provide a method for generating a hair model, which may be executed by a terminal or a server, and are described in the context of the method for generating a hair model being executed by a terminal as an example.
Referring to fig. 1, fig. 1 is a schematic flow chart of a method for generating a hair model according to an embodiment of the present disclosure. The specific procedure of the hair model generation method may be as follows:
101. and acquiring a preset object model of the target object.
In the embodiment of the present application, the target object refers to a living being having hair, and for example, the target object may be a person including hair, or an animal including hair, or the like.
The preset object model may be an object model of a target object generated by three-dimensional drawing. In the embodiment of the present application, the preset object model of the target object may be made by next generation software, which refers to modeling software, for example, the next generation software may include: maya, 3Dmax, etc. The modeler may draw a preset object model in next generation software according to the image of the target object.
Specifically, the preset object model includes a hair setting portion model of the target object and a basic hair model corresponding to the hair setting portion model. The hair setting site model is a site model where a hair grows in a target object, and the basic hair model is a basic hair shape model of the target object.
For example, the target object may be a character a, the preset object may be a character model drawn according to the character a, the hair setting part model may be a head model, and the basic hair shape model may be a hair model.
Referring to fig. 2, fig. 2 is a schematic view of an application scenario of a method for generating a hair model according to an embodiment of the present application. The preset object model shown in fig. 2 is an object model drawn according to a character, and includes a head model and a hair model.
102. And creating a hair spline curve corresponding to the basic hair model based on the model contour of the basic hair model.
Wherein, the hair spline curve refers to a generated spline curve for representing the hair.
In some embodiments, in order to ensure the effect of generating hair, the step "creating a hair spline curve corresponding to the base hair model based on the model contour of the base hair model" may include some operations:
determining the hair trend of the basic hair model according to the model outline;
and creating a spline curve on the basic hair model according to the hair tendency correspondence to obtain a hair spline curve.
Wherein, the model contour of the basic hair model refers to the hair contour of the basic hair model, i.e. the hair shape, and the hair tendency refers to the growth direction of the hair.
Specifically, a spline curve is drawn on the basic hair model according to the hair growth tendency, so that a hair spline curve corresponding to the basic hair model is obtained.
For example, referring to fig. 3, fig. 3 is a schematic view of an application scenario of another hair model generation method according to an embodiment of the present application. In the preset object model shown in fig. 3, a basic hair model, that is, a hair model, in the preset object model is selected first, spline curves are created on the basic hair model in an adsorption manner according to the hair style trend of the basic hair model, and an appropriate number of spline curves, that is, black curves in fig. 3, are created around the shape contour of the basic hair model.
Wherein, the adsorption means that the drawn new sample strip curve is adsorbed on the basic hair model for manufacturing, so as to obtain the hair sample strip curve which is completely fit with the appearance of the basic hair model.
103. The hair spline curve is adsorbed to the hair setting site model of the target object.
In some embodiments, in order to make the hair model, the step "adsorbing the hair spline curve to the hair setting part model of the target object" may include the following operations:
determining a model surface in the hair arrangement part model, which is contacted with the basic hair model;
the apex of the hair spline curve is adsorbed to the model surface.
Wherein the contact surface refers to a surface for growing hair in the hair setting model portion. For example, the hair setting portion model may be a head model, the base hair model may be a hair model, and the contact surface may refer to a scalp surface for growing hair in the head model.
Further, the apex of each hair spline was attached to the model surface. Specifically, the extracted model surface is used as an adsorption object, and the adsorption can be completed by moving the vertex of the hair spline curve to the model surface. The hair spline curve can be adsorbed to the hair setting part model, and the hair setting part model with the hair spline curve adsorbed can be obtained.
104. And carrying out hair region mapping treatment on the hair setting part model with the hair spline curve to obtain the hair setting part model after mapping treatment.
Wherein, the region map refers to the weight of the hair region parameter in the hair system, and the hair region parameter may include the parameters of hair thickness, number, etc. The region map may be used to generate a hair region.
In some embodiments, the step of "performing a hair region mapping process on the hair setting site model with the hair spline curve attached to it to obtain a mapped hair setting site model" may include the following operations:
converting the hair spline curve to a guideline in the hair system;
the guide line is subjected to hair region mapping treatment to obtain a mapped hair setting part model.
In embodiments of the present application, the hair system may provide a convenient hair simulation effect. In the hair system, if it is necessary to generate a hair using a model, a hair setting site model to which a hair spline curve is attached may be used for generation, and the hair spline curve in the hair setting site model may be converted into a guide line in the hair system.
Wherein, the guide line in the hair system is a making auxiliary line for guiding the hair growth direction and controlling the hair volume sparsity in the hair system.
Specifically, when performing the region mapping on the guide lines, the region mapping may be performed on each guide line according to the actual hair shape effect, so as to obtain the hair region parameter of each guide line.
In some embodiments, to ensure that the generated hair model fits the actual hair shape effect, before the step "hair region mapping treatment on the guide line", the following operations may be further included:
adjusting the number and/or shape of the guide lines to obtain adjusted guide lines;
specifically, the number of guide lines in the hair setting portion model is adjusted in accordance with the actual hair shape requirement, and the shape of the guide lines is adjusted, thereby obtaining adjusted guide lines that conform to the actual hair shape requirement.
In some embodiments, the step "hair region mapping treatment on guide lines" may then comprise the following operations:
and performing hair region mapping treatment on the adjusted guide line.
In some embodiments, in order to further ensure that the generated hair model fits the actual hair shape effect, after the step of "performing hair region mapping treatment on the hair setting site model with the hair spline curve attached to obtain the mapped hair setting site model", the method may further include the steps of:
and adding a hair bundle effect device to the hair setting part model after the mapping treatment so that the hair setting part model after the mapping treatment presents a hair bundle effect.
The hair bundle effect device is a hair system effect device which can divide hair into bundles.
Specifically, a hair bundle effector is added to the guide line in the hair setting portion model after the mapping treatment, so that the guide line in the hair setting portion model after the mapping treatment exhibits a hair bundle effect and is more closely attached to the hair model.
105. And acquiring hair spline curve information based on the hair setting part model after the mapping treatment.
In some embodiments, in order to meet the hair density requirements of different hair model effects, before the step of "obtaining hair spline curve information based on the chartled hair setting site model", the method may further comprise the steps of:
and adjusting the hair density of the hair spline curve in the hair setting part model after the chartlet treatment.
The hair density can represent the number of hair spline curves, and the greater the number of hair spline curves, the greater the hair density; the smaller the number of hair spline curves, the lower the hair density.
For example, referring to fig. 4, fig. 4 is a schematic view of an application scenario of another hair model generation method according to an embodiment of the present application. Fig. 4 shows the effect of different hairline densities of the hair spline curves in the hair setting part model of the preset object model. The left side represents the hair setting part model of the preset object model with the small hair density of the hair spline curve, and the right side represents the hair setting part model of the preset object model with the large hair density of the hair spline curve.
In some embodiments, the step of "obtaining hair spline curve information based on the chartled hair setting site model" may include the following operations:
and acquiring the number of hair spline curves based on the hair setting part model after the mapping treatment after the hair density is adjusted, so as to obtain hair spline curve information.
After the transmission density of the hair setting part model after the mapping treatment is adjusted, the hair spline curves in the hair setting part model after the mapping treatment are changed, the number of the changed hair spline curves is obtained, and the hair spline information is obtained.
In some embodiments, after the step of "adjusting the hair line density of the hair spline curve in the chartlet-treated hair setting site model", the following steps may be further included:
modifying the number of hair spline curves in the hair setting part model after the mapping treatment after the hair density is adjusted to obtain the hair spline curves with the target number;
and carrying out grouping processing on the hair spline curves of the target number to obtain grouping information of the hair spline curves.
In the embodiment of the present application, in order to generate a hair patch from the hair setting region model after the mapping process, the hair setting region model may be derived as mel (Maya Embedded Language File) after adjusting the hair line density of the hair spline curve in the hair setting region model after the mapping process.
In some embodiments, in order to meet the requirement of the hair density at different positions of the hair setting part model, the hair spline curves in the hair setting part model can be set to have different hair densities, and the hair spline curves are exported to be different mel files in multiple groups, so that the mel files corresponding to multiple hair setting part models with different hair densities are obtained.
Further, the derived mel file is imported into three-dimensional software, and the hair spline curves in the hair setting portion model are deleted and grouped. Specifically, the number of the hair spline curves can be adjusted according to the number of patches required by each part of the hair setting part model.
The grouping processing of the hair splines may be performed by grouping the hair splines according to different positions of the hair setting portion model.
For example, referring to fig. 5, fig. 5 is a schematic view of an application scenario of another hair model generation method according to an embodiment of the present application. In the head model shown in fig. 5, to which the hair spline is attached, first, a first region and a second region are divided from the head model. The hair spline curves in the first area are divided into one group, the hair spline curves in the second area are divided into a second group, and grouping of the plurality of hair spline curves divided based on different positions of the head model is obtained.
In some embodiments, the step of "obtaining hair spline curve information based on the chartled hair setting site model" may include the following operations:
and obtaining hair spline curve information based on the hair spline curves of the target number and the grouping information of the hair spline curves.
Specifically, the hair spline curve information is obtained based on the number information of the hair spline curves of the hair setting portion model and the grouping information of the hair spline curves.
For example, the total number of hair spline curves in the hair setting site model may be: 1000, grouping information of the hair spline curve comprises: a first grouping, a second grouping, wherein the number of hair splines included in the first grouping may be: 200, the number of hair splines included in the second grouping may be: 800. thus, the hair spline curve information of the hair setting part model is obtained.
106. And generating a hair patch model required by the hair setting part model according to the hair spline curve information.
In some embodiments, in order to improve the efficiency of hair modeling, the step of "generating a hair patch model required by the hair setting part model according to the hair spline curve information" may include the following operations:
respectively generating corresponding patch models based on all the hair spline curves in the hair spline curves of the target number;
and matching a preset hair effect map for the patch model to obtain a hair patch model.
Specifically, a corresponding patch, that is, a patch model, is generated from each hair spline curve in the hair setting part model obtained in the previous step.
Further, a model UV of the generated patch model is obtained, a patch model is matched with a model chartlet based on the model UV, and the hair patch model is obtained according to the generated patch hair.
The model UV, namely UV texture mapping coordinates, defines the information of the position of each point on a picture, the 'UV' in three-dimensional modeling can be understood as the 'skin' of a three-dimensional model, and the 'skin' is unfolded and then drawn on a two-dimensional plane and is endowed to an object.
The model map is also a preset hair effect map, that is, a map simulating the hair effect of real hair.
In some embodiments, when grouping information of the hair spline is newly included in the hair spline, the step "matching a preset hair effect map for the patch model" may include the following operations:
determining hair spline curves in the same group according to the grouping information;
and matching the same preset hair effect maps for the patch models corresponding to the hair spline curves in the same group.
In the embodiment of the present application, different preset hair effect maps are set for different groups of hair spline curves.
For example, the preset hair effect map may include: a first effect map, a second effect map, etc., different preset hair effect maps corresponding to different hair effects. Acquiring grouping information in the hair spline curve information may include: the grouping information includes: a first grouping, a second grouping, wherein the number of hair splines included in the first grouping may be: 200, the number of hair splines included in the second grouping may be: 800. then, patch models generated for 200 hair spline curves in the first grouping are matched with the first effect maps, patch models generated for 800 hair spline curves in the second grouping are matched with the second effect maps, and therefore different hair effects can be set at different positions of the hair setting part model.
In some embodiments, in order to improve the performance of the hair model, before the step of "matching the patch model with the preset hair effect map to obtain the hair patch model", the following steps may be further included:
adjusting the surface patch attribute of the surface patch model to obtain an adjusted surface patch model;
after the corresponding patch model is generated according to the hair spline curve, patch attribute modification can be carried out on the patch model according to the actual hair model expression effect, and the adjusted patch model is obtained.
Wherein the patch attributes may include: the number of the surface patches, the thickness of the surface patches, the rotating effect, the tilting effect, the scaling adjustment of the tail ends of the surface patches and the like.
In some embodiments, the step of "matching the patch model with the preset hair effect map to obtain the hair patch model" may include the following operations:
and presetting a hair effect mapping for adjusting the rear patch model matching to obtain a hair patch model.
In some embodiments, for the generated hair patch model, if adjustment is needed, the hair patch model may be adjusted by adjusting the hair spline curve. In addition, in the scheme of the application, the hair spline curves in the hair setting part model can be uniformly controlled to be modified, so that when the hair patch model is adjusted, each hair patch model does not need to be adjusted independently, and the adjustment efficiency of the hair patch model can be improved.
The embodiment of the application discloses a method for generating a hair model, which comprises the following steps: acquiring a preset object model of a target object, wherein the preset object model comprises a hair setting part model of the target object and a basic hair model corresponding to the hair setting part model; creating a hair spline curve corresponding to the basic hair model based on the model outline of the basic hair model; adsorbing the hair spline curve to a hair setting part model of the target object; carrying out hair region mapping treatment on the hair setting part model attached with the hair spline curve to obtain a hair setting part model after mapping treatment; acquiring hair spline curve information based on the hair setting part model after the chartlet processing; and generating a hair patch model required by the hair setting part model according to the hair spline curve information. Thus, the generation efficiency of the hair model can be improved.
In light of the above description, the method for generating the hair model of the present application will be further described below by way of example. Referring to fig. 6, fig. 6 is a schematic flowchart of another method for generating a hair model according to an embodiment of the present application, and taking the method for generating a hair model applied to a terminal as an example, a specific process may be as follows:
201. and the terminal draws the head model and the hair model of the target object according to the drawing instruction.
In this embodiment of the application, the drawing instruction may be triggered by the model drawing software for a user, and an object model of the target object is drawn in the model drawing software according to a drawing operation of the user, where the object model at least includes a head model and a hair model of the target object.
The head model and the hair model can be three-dimensional models, and the outline of the hair model can be made by utilizing polygons when the hair model is created.
202. And the terminal creates a spline curve according to the contour information of the hair model.
Specifically, spline curves are created on the hair model according to the hairstyle trend in the contour information of the hair model, and an appropriate number of spline curves can be created around the shape of the hair model.
203. And the terminal extracts the designated model surface in the head model and adsorbs the spline curve to the designated model surface.
Wherein the designated model face refers to a face for growing hair, such as a scalp surface in a head model. Then, the extracted specified model surface is used as an adsorption object, and the vertex of the spline curve created in the previous step is moved to the specified model surface, so that the spline curve can be adsorbed to the head model.
For example, please refer to fig. 7, fig. 7 is a schematic view of an application scenario of another hair model generation method according to an embodiment of the present application. As shown in fig. 7, the scalp surface on which the hair is produced is determined from the head model, and then the apex of the created spline curve is attached to the scalp surface.
204. The terminal transforms the spline curve of the designated model surface into a guide line in the hair system.
This step is used to perform a hair system addition to the head model with the spline curve attached.
Since the hair system needs to be generated by using a model, the embodiment of the application uses the extracted head model to generate, and converts the created spline curve into a guide line in the hair system, wherein the guide line in the hair system is a production auxiliary line for guiding the hair growth direction and controlling the hair volume sparseness in the hair system.
In some embodiments, the addition of the guide lines and the adjustment of the shape can be performed according to the actual hairstyle requirement, and specifically, the guide lines can be adjusted by moving the brush with the guide lines in the hair system, so that the adjustment efficiency is improved.
For example, referring to fig. 8, fig. 8 is a schematic application scenario diagram of another hair model generation method according to an embodiment of the present application. Fig. 8 shows the effect of the performance after the adjustment of the guideline of the head model.
205. The terminal maps the hair region on the guide line on the designated model surface to obtain the head model with the initial hair preview effect.
The area mapping is the weight for controlling hair area parameters in the hair system, the area mapping can be drawn and modified according to the actual hair generation effect, and then a hair bundle effector is added to the head model subjected to the area mapping treatment, so that the head model with the initial hair preview effect is obtained.
For example, please refer to fig. 9, fig. 9 is a schematic application scenario diagram of another hair model generation method according to an embodiment of the present application. Fig. 9 shows a hair preview effect of the head model obtained after the region mapping process is performed on the head model.
206. And adjusting the hairline density of the head model by the terminal to obtain the adjusted head model.
Specifically, the hairline density of the head model is adjusted to a proper density value according to the actual issuing effect requirement, and the head model with the hairline density adjusted is exported to be a mel file. The different hairline densities can be derived in multiple groups, and the requirements of the head model on the hairline densities at different positions are met.
207. And the terminal generates a facet model based on the spline curve in the adjusted head model.
Furthermore, the mel file obtained in the step is imported into the three-dimensional software, and the spline curves in the head model are deleted and grouped. Specifically, the number of the spline curves is adjusted according to the number of the facings required by each part of the head model.
And generating a patch model (two-dimensional model) from the adjusted spline curve, and modifying the patch attributes of each patch model according to the actual hairstyle effect to obtain an initial model of the patch hair model.
208. And matching the hair effect chartlet for the patch model by the terminal to obtain a hair patch model of the head model.
Specifically, according to the UV maps of the patch models, appropriate hair effect maps are matched for the patch models, the hair effect maps may be preset hair texture maps to obtain hair patch models corresponding to each patch model, and based on the hair patch models corresponding to all patch models, the hair patch model of the head model is obtained.
Because the spline curves are converted into the patches and then the UV tiles are overlapped, the patches can be matched with hair texture maps conveniently, and the hair effect of the patches can be previewed quickly.
In the embodiment of the application, because the spline curve is generated according to the actual hair model in time, the surface patch model is generated by adjusting the spline curve, so that the adjustment of the surface patch model in the later stage can be reduced, and the hair model manufacturing efficiency is improved.
For example, referring to fig. 10, fig. 10 is a schematic view of an application scenario of another hair model generation method according to an embodiment of the present application. The upper side of fig. 10 shows various hair effect maps, and any hair effect map can be selected and matched on the patch model, so that the hair patch model with the hair effect on the lower side is obtained.
The embodiment of the application discloses a method for generating a hair model, which comprises the following steps: the terminal draws a head model of a target object according to a drawing instruction and creates a spline curve according to the hair model and outline information of the hair model, extracts a designated model surface in the head model, adsorbs the spline curve to the designated model surface, converts the spline curve on the designated model surface into a guide line in a hair system, carries out hair region mapping on the guide line on the designated model surface to obtain the head model with an initial hair preview effect, adjusts the hair density of the head model to obtain an adjusted head model, generates a patch model based on the spline curve in the adjusted head model, matches the patch model with the hair effect mapping to obtain a hair patch model of the head model. Thus, the efficiency of generating a hair model and the expression effect can be improved.
In order to better implement the method for generating a hair model provided in the embodiments of the present application, the embodiments of the present application also provide a device for generating a hair model based on the method for generating a hair model described above. Wherein the terms have the same meanings as in the above-mentioned hair model generation method, and the details of the implementation can be referred to the descriptions in the method examples.
Referring to fig. 11, fig. 11 is a block diagram of a device for generating a hair model according to an embodiment of the present application, the device including:
a first obtaining unit 301, configured to obtain a preset object model of a target object, where the preset object model includes a hair setting location model of the target object and a basic hair model corresponding to the hair setting location model;
a creating unit 302, configured to create a hair spline curve corresponding to the base hair model based on the model contour of the base hair model;
an adsorption unit 303 for adsorbing the hair spline curve to a hair setting part model of the target object;
a processing unit 304, configured to perform hair region mapping processing on the hair setting part model to which the hair spline curve is attached, to obtain a mapped hair setting part model;
a second obtaining unit 305 for obtaining hair spline curve information based on the chartlet-processed hair setting site model;
a generating unit 306, configured to generate a hair patch model required by the hair setting part model according to the hair spline curve information.
In some embodiments, the creating unit 302 may include:
a first determining subunit, configured to determine a hair tendency of the base hair model from the model contour;
and the creating subunit is used for creating a spline curve on the basic hair model according to the hair trend correspondence to obtain the hair spline curve.
In some embodiments, the adsorption unit 303 may include:
a second determining subunit for determining a model surface of the hair setting region model which is in contact with the basic hair model;
an adsorption subunit for adsorbing the vertex of the hair spline curve to the mold surface.
In some embodiments, the processing unit 304 may include:
a conversion subunit for converting the hair spline curve into a guide line in a hair system;
and a processing subunit, configured to perform mapping processing on the hair region on the guide line to obtain a hair setting region model after the mapping processing.
In some embodiments, the processing unit 304 may also:
the first adjusting subunit is used for adjusting the number and/or the shape of the guide lines to obtain the adjusted guide lines.
In some embodiments, the processing subunit may be specifically configured to:
and performing hair region mapping treatment on the adjusted guide line.
In some embodiments, the apparatus may further comprise:
and the adding unit is used for adding a hair bundle effect device to the chartled hair setting part model so as to enable the chartled hair setting part model to present a hair bundle effect.
In some embodiments, the apparatus may further comprise:
and the adjusting unit is used for adjusting the hair density of the hair spline curve in the hair setting part model after the mapping treatment.
In some embodiments, the second obtaining unit 305 may include:
and the acquiring subunit is used for acquiring the number of the hair spline curves based on the hair setting part model after the mapping treatment after the hair density is adjusted, so as to obtain the hair spline curve information.
In some embodiments, the apparatus may further comprise:
a modification unit for modifying the number of hair spline curves in the hair setting part model after the mapping treatment after the adjustment of the hair density to obtain the hair spline curves of a target number;
and the grouping unit is used for grouping the hair spline curves of the target number to obtain the grouping information of the hair spline curves.
In some embodiments, the second obtaining unit 305 may include:
a third determining subunit, configured to obtain the hair spline curve information based on the target number of hair spline curves and grouping information of the hair spline curves.
In some embodiments, the generating unit 306 may include:
a generating subunit, configured to generate corresponding patch models based on each of the hair spline curves of the target number;
and the matching subunit is used for matching a preset hair effect map for the patch model to obtain the hair patch model.
In some embodiments, the matching subunit may be specifically configured to:
determining hair spline curves in the same group according to the grouping information;
and matching the same preset hair effect maps for the patch models corresponding to the hair spline curves in the same group.
In some embodiments, the generating unit 306 may further include:
and the second adjusting subunit is used for adjusting the patch attributes of the patch model to obtain an adjusted patch model.
In some embodiments, the matching subunit may be specifically configured to:
and matching a preset hair effect mapping for the adjusted back patch model to obtain the hair patch model.
The embodiment of the application discloses a hair model generation device, a first acquisition unit 301 acquires a preset object model of a target object, the preset object model comprises a hair setting part model of the target object and a basic hair model corresponding to the hair setting part model, a creation unit 302 creates a hair spline curve corresponding to the basic hair model based on a model contour of the basic hair model, an adsorption unit 303 adsorbs the hair spline curve to the hair setting part model of the target object, a processing unit 304 performs hair region mapping processing on the hair setting part model to which the hair spline curve is adsorbed to obtain a mapped hair setting part model, a second acquisition unit 305 acquires hair spline curve information based on the mapped hair setting part model, and a generation unit 306 generates a hair patch model required by the hair setting part model according to the hair spline curve information. Thus, the efficiency of generating the hair model can be improved.
Correspondingly, the embodiment of the application also provides a computer device, and the computer device can be a terminal. As shown in fig. 12, fig. 12 is a schematic structural diagram of a computer device according to an embodiment of the present application. The computer apparatus 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored on the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. Those skilled in the art will appreciate that the computer device configurations illustrated in the figures are not meant to be limiting of computer devices and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The processor 501 is a control center of the computer device 500, connects various parts of the entire computer device 500 using various interfaces and lines, performs various functions of the computer device 500 and processes data by running or loading software programs and/or modules stored in the memory 502, and calling data stored in the memory 502, thereby monitoring the computer device 500 as a whole.
In this embodiment, the processor 501 in the computer device 500 loads instructions corresponding to processes of one or more applications into the memory 502, and the processor 501 executes the applications stored in the memory 502 according to the following steps, so as to implement various functions:
acquiring a preset object model of a target object, wherein the preset object model comprises a hair setting part model of the target object and a basic hair model corresponding to the hair setting part model;
creating a hair spline curve corresponding to the basic hair model based on the model outline of the basic hair model;
adsorbing the hair spline curve to a hair setting part model of the target object;
carrying out hair region mapping treatment on the hair setting part model attached with the hair spline curve to obtain a hair setting part model after mapping treatment;
acquiring hair spline curve information based on the hair setting part model after the chartlet processing;
and generating a hair patch model required by the hair setting part model according to the hair spline curve information.
In some embodiments, creating a hair spline curve corresponding to the base hair model based on the model contour of the base hair model comprises:
determining the hair trend of the basic hair model according to the model outline;
and creating a spline curve on the basic hair model according to the hair trend correspondence to obtain a hair spline curve.
In some embodiments, adsorbing the hair spline curve to the hair setting site model of the target object comprises:
determining a model surface in the hair arrangement part model, which is contacted with the basic hair model;
the apex of the hair spline curve is adsorbed to the model surface.
In some embodiments, performing a hair region mapping process on the hair setting site model with the hair spline curve attached thereto to obtain a mapped hair setting site model, includes:
converting the hair spline curve to a guideline in the hair system;
the guide line is subjected to hair region mapping treatment to obtain a mapped hair setting part model.
In some embodiments, before the hair region mapping treatment of the guideline, further comprising:
adjusting the number and/or shape of the guide lines to obtain adjusted guide lines;
in some embodiments, the hair region mapping treatment is performed on the guideline, comprising:
and performing hair region mapping treatment on the adjusted guide line.
In some embodiments, after the hair region mapping process is performed on the hair setting part model to which the hair spline curve is attached, and the mapped hair setting part model is obtained, the method further comprises:
and adding a hair bundle effect device to the hair setting part model after the mapping treatment so as to enable the hair setting part model after the mapping treatment to show the hair bundle effect.
In some embodiments, before obtaining the hair spline curve information based on the mapped hair setting site model, the method further comprises:
adjusting the hair density of the hair spline curve in the hair setting part model after the chartlet treatment;
in some embodiments, obtaining hair spline curve information based on the chartlet-processed hair setup site model comprises:
and acquiring the number of hair spline curves based on the hair setting part model after the mapping treatment after the hair density is adjusted, and obtaining hair spline curve information.
In some embodiments, after adjusting the hair line density of the hair spline curve in the chartlet-treated hair setting site model, the method further comprises:
modifying the number of hair spline curves in the hair setting part model after the mapping treatment after the hair density is adjusted to obtain the hair spline curves with the target number;
grouping the hair spline curves of the target number to obtain grouping information of the hair spline curves;
in some embodiments, obtaining hair spline curve information based on the chartlet-processed hair setup site model comprises:
based on the target number of hair spline curves and the grouping information of the hair spline curves, hair spline curve information is obtained.
In some embodiments, generating a hair patch model required for the hair set point model from the hair spline curve information includes:
respectively generating corresponding patch models based on all the hair spline curves in the hair spline curves of the target number;
and matching and presetting a hair effect mapping for the patch model to obtain a hair patch model.
In some embodiments, matching the patch model with the preset hair effect map comprises:
determining hair spline curves in the same group according to the grouping information;
and matching the same preset hair effect maps for the patch models corresponding to the hair spline curves in the same group.
In some embodiments, before matching the patch model with the preset hair effect map to obtain the hair patch model, the method further includes:
adjusting the surface patch attribute of the surface patch model to obtain an adjusted surface patch model;
presetting a hair effect mapping for patch model matching to obtain a hair patch model, comprising:
in some embodiments, the hair patch model is obtained by matching the preset hair effect map for adjusting the back patch model.
The scheme includes that a preset object model of a target object is obtained, the preset object model comprises a hair setting part model of the target object and a basic hair model corresponding to the hair setting part model, then a hair spline curve corresponding to the basic hair model is created according to the model outline of the basic hair model, the hair spline curve is adsorbed to the hair setting part model of the target object, further, hair area mapping processing is carried out on the hair setting part model with the hair spline curve, hair spline curve information is obtained from the hair setting part model after mapping processing, and a hair patch model required by the hair setting part model is generated according to the hair spline curve information. Thus, the generation efficiency of the hair model can be improved.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Optionally, as shown in fig. 12, the computer device 500 further includes: touch display screen 503, radio frequency circuit 504, audio circuit 505, input unit 506 and power supply 507. The processor 501 is electrically connected to the touch display screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507, respectively. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 12 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The touch display screen 503 can be used for displaying a graphical user interface and receiving an operation instruction generated by a user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. The display panel may be used, among other things, to display information entered by or provided to a user and various graphical user interfaces of the computer device, which may be composed of graphics, guide information, icons, video, and any combination thereof. Alternatively, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations of a user on or near the touch panel (for example, operations of the user on or near the touch panel using any suitable object or accessory such as a finger, a stylus pen, and the like), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 501, and can receive and execute commands sent by the processor 501. The touch panel may overlay the display panel, and when the touch panel detects a touch operation thereon or nearby, the touch panel transmits the touch operation to the processor 501 to determine the type of the touch event, and then the processor 501 provides a corresponding visual output on the display panel according to the type of the touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 503 to implement input and output functions. However, in some embodiments, the touch panel and the display panel may be implemented as two separate components to perform the input and output functions. That is, the touch display screen 503 can also be used as a part of the input unit 506 to implement an input function.
The rf circuit 504 may be used for transceiving rf signals to establish wireless communication with a network device or other computer device via wireless communication, and for transceiving signals with the network device or other computer device.
Audio circuitry 505 may be used to provide an audio interface between a user and a computer device through speakers, microphones. The audio circuit 505 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and converted into audio data, which is then processed by the audio data output processor 501, and then transmitted to, for example, another computer device via the rf circuit 504, or output to the memory 502 for further processing. Audio circuitry 505 may also include an earbud jack to provide communication of peripheral headphones with the computer device.
The input unit 506 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and generate a keyboard, mouse, joystick, optical, or trackball signal input related to user settings and function control.
The power supply 507 is used to power the various components of the computer device 500. Optionally, the power supply 507 may be logically connected to the processor 501 through a power management system, so as to implement functions of managing charging, discharging, power consumption management, and the like through the power management system. The power supply 507 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown in fig. 12, the computer device 500 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which will not be described in detail herein.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to the related descriptions of other embodiments.
As can be seen from the above, the computer device provided in this embodiment may obtain a preset object model of the target object, where the preset object model includes a hair setting portion model of the target object and a basic hair model corresponding to the hair setting portion model; creating a hair spline curve corresponding to the basic hair model based on the model outline of the basic hair model; adsorbing the hair spline curve to a hair setting part model of the target object; carrying out hair region mapping treatment on the hair setting part model attached with the hair spline curve to obtain a hair setting part model after mapping treatment; acquiring hair spline curve information based on the hair setting part model after the chartlet processing; and generating a hair patch model required by the hair setting part model according to the hair spline curve information.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, the present application provides a computer readable storage medium, in which a plurality of computer programs are stored, and the computer programs can be loaded by a processor to execute the steps in any one of the hair model generation methods provided by the embodiments of the present application. For example, the computer program may perform the steps of:
acquiring a preset object model of a target object, wherein the preset object model comprises a hair setting part model of the target object and a basic hair model corresponding to the hair setting part model;
creating a hair spline curve corresponding to the basic hair model based on the model outline of the basic hair model;
adsorbing the hair spline curve to a hair setting part model of the target object;
carrying out hair region mapping treatment on the hair setting part model attached with the hair spline curve to obtain a hair setting part model after mapping treatment;
acquiring hair spline curve information based on the hair setting part model after the chartlet processing;
and generating a hair patch model required by the hair setting part model according to the hair spline curve information.
In some embodiments, creating a hair spline curve corresponding to the base hair model based on the model contour of the base hair model comprises:
determining the hair trend of the basic hair model according to the model outline;
and creating a spline curve on the basic hair model according to the hair trend correspondence to obtain a hair spline curve.
In some embodiments, adsorbing the hair spline curve to the hair setting site model of the target object comprises:
determining a model surface in the hair arrangement part model, which is contacted with the basic hair model;
the apex of the hair spline curve is adsorbed to the model surface.
In some embodiments, performing a hair region mapping process on the hair setting site model with the hair spline curve attached thereto to obtain a mapped hair setting site model, includes:
converting the hair spline curve to a guideline in the hair system;
the guide line is subjected to hair region mapping treatment to obtain a mapped hair setting part model.
In some embodiments, before the hair region mapping treatment of the guideline, further comprising:
adjusting the number and/or shape of the guide lines to obtain adjusted guide lines;
in some embodiments, the hair region mapping treatment is performed on the guideline, comprising:
and performing hair region mapping treatment on the adjusted guide line.
In some embodiments, after performing a hair region mapping process on the hair setting site model with the hair spline curve attached to it, resulting in a mapped hair setting site model, the method further comprises:
and adding a hair bundle effect device to the hair setting part model after the mapping treatment so as to enable the hair setting part model after the mapping treatment to show the hair bundle effect.
In some embodiments, prior to obtaining the hair spline curve information based on the chartled hair set-up site model, the method further comprises:
adjusting the hair density of the hair spline curve in the hair setting part model after the chartlet treatment;
in some embodiments, obtaining hair spline curve information based on the chartlet-processed hair setup site model comprises:
and acquiring the number of hair spline curves based on the hair setting part model after the mapping treatment after the hair density is adjusted, so as to obtain hair spline curve information.
In some embodiments, after adjusting the hair line density of the hair spline curve in the chartlet-treated hair setting site model, the method further comprises:
modifying the number of hair spline curves in the hair setting part model after the mapping treatment after the hair density is adjusted to obtain the hair spline curves with the target number;
grouping the hair spline curves of the target number to obtain grouping information of the hair spline curves;
in some embodiments, obtaining hair spline curve information based on the chartlet-processed hair setup site model comprises:
and obtaining hair spline curve information based on the hair spline curves of the target number and the grouping information of the hair spline curves.
In some embodiments, generating a hair patch model required for the hair set point model from the hair spline curve information includes:
respectively generating corresponding patch models based on all the hair spline curves in the hair spline curves of the target number;
and matching and presetting a hair effect mapping for the patch model to obtain a hair patch model.
In some embodiments, matching the patch model with the preset hair effect map comprises:
determining hair spline curves in the same group according to the grouping information;
and matching the same preset hair effect maps for the patch models corresponding to the hair spline curves in the same group.
In some embodiments, before matching the patch model with the preset hair effect map to obtain the hair patch model, the method further includes:
adjusting the surface patch attribute of the surface patch model to obtain an adjusted surface patch model;
presetting a hair effect mapping for patch model matching to obtain a hair patch model, comprising:
in some embodiments, matching the pre-set hair effect map for adjusting the back patch model results in a hair patch model.
The scheme includes that a preset object model of a target object is obtained, the preset object model comprises a hair setting part model of the target object and a basic hair model corresponding to the hair setting part model, then a hair spline curve corresponding to the basic hair model is created according to the model outline of the basic hair model, the hair spline curve is adsorbed to the hair setting part model of the target object, further, hair area mapping processing is carried out on the hair setting part model with the hair spline curve, hair spline curve information is obtained from the hair setting part model after mapping processing, and a hair patch model required by the hair setting part model is generated according to the hair spline curve information. Thus, the efficiency of generating the hair model can be improved.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the computer-readable storage medium may include: read Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, and the like.
Since the computer program stored in the computer readable storage medium can execute the steps of any method for generating a hair model provided in the embodiments of the present application, the beneficial effects that can be achieved by any method for generating a hair model provided in the embodiments of the present application can be achieved, and detailed descriptions thereof are omitted for the foregoing embodiments.
The method, the apparatus, the storage medium, and the computer device for generating a hair model provided in the embodiments of the present application are described in detail above, and a specific example is applied in the present application to explain the principles and embodiments of the present application, and the description of the above embodiments is only used to help understand the method and the core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (14)

1. A method of generating a hair model, the method comprising:
acquiring a preset object model of a target object, wherein the preset object model comprises a hair setting part model of the target object and a basic hair model corresponding to the hair setting part model;
creating a hair spline curve corresponding to the basic hair model based on the model contour of the basic hair model;
adsorbing the hair spline curve to a hair setting part model of the target object;
carrying out hair region mapping treatment on the hair setting part model attached with the hair spline curve to obtain a hair setting part model after mapping treatment;
acquiring hair spline curve information based on the hair setting part model after the chartlet processing;
and generating a hair patch model required by the hair setting part model according to the hair spline curve information.
2. The method of claim 1, wherein said creating a hair spline curve corresponding to said base hair model based on said model contour of said base hair model comprises:
determining the hair tendency of the basic hair model according to the model outline;
and creating a spline curve on the basic hair model according to the hair trend correspondence to obtain the hair spline curve.
3. The method of claim 1, wherein said adsorbing said hair spline curve to said target subject's hair placement site model comprises:
determining a model surface in the hair setting location model that is in contact with the base hair model;
adsorbing the apex of the hair spline curve to the mold surface.
4. The method according to claim 1, wherein said performing a hair region mapping process on the hair setting site model to which the hair spline curve is attached to obtain a mapped hair setting site model, comprises:
converting the hair spline curve to a guideline in the hair system;
and performing hair region mapping treatment on the guide line to obtain a hair setting part model after the mapping treatment.
5. The method according to claim 4, further comprising, before said hair region mapping treatment of the guide wire:
adjusting the number and/or shape of the guide lines to obtain adjusted guide lines;
the hair region mapping process for the guide line includes:
and performing hair region mapping treatment on the adjusted guide line.
6. The method according to claim 1, wherein after said hair region mapping process is performed on the hair setting site model to which the hair spline curve is attached to obtain a mapped hair setting site model, the method further comprises:
and adding a hair bundle effect device to the chartled hair setting part model so as to enable the chartled hair setting part model to show a hair bundle effect.
7. The method according to claim 1, wherein prior to said obtaining hair spline curve information based on said mapped hair placement site model, the method further comprises:
adjusting the hairline density of a hair spline curve in the hair setting part model after the chartlet treatment;
the acquiring of the hair spline curve information based on the hair setting part model after the chartlet processing comprises:
and acquiring the number of hair spline curves based on the hair setting part model after the chartlet treatment after the hair density is adjusted, and obtaining the hair spline curve information.
8. The method according to claim 7, further comprising, after said adjusting the hair line density of hair splines in said mapped hair setting site model:
modifying the number of hair spline curves in the hair setting part model after the chartlet treatment after the hair density is adjusted to obtain the hair spline curves with the target number;
grouping the hair spline curves of the target number to obtain grouping information of the hair spline curves;
the acquiring of the hair spline curve information based on the hair setting part model after the chartlet processing comprises:
obtaining the hair spline curve information based on the target number of hair spline curves and grouping information of the hair spline curves.
9. The method of claim 8, wherein said generating a hair patch model required for said hair placement site model from said hair spline curve information comprises:
respectively generating corresponding patch models based on each hair spline curve in the hair spline curves of the target number;
and matching a preset hair effect chartlet for the patch model to obtain the hair patch model.
10. The method of claim 9, wherein matching the patch model with a preset hair effect map comprises:
determining hair spline curves in the same group according to the group information;
and matching the same preset hair effect mapping for the patch models corresponding to the hair spline curves in the same group.
11. The method of claim 9, wherein before said matching a preset hair effect map to said patch model to obtain said hair patch model, further comprising:
adjusting the patch attributes of the patch model to obtain an adjusted patch model;
the matching of the patch model with the preset hair effect map to obtain the hair patch model comprises the following steps:
and matching a preset hair effect mapping for the adjusted rear patch model to obtain the hair patch model.
12. An apparatus for generating a hair model, the apparatus comprising:
a first obtaining unit, configured to obtain a preset object model of a target object, where the preset object model includes a hair setting location model of the target object and a basic hair model corresponding to the hair setting location model;
a creating unit, configured to create a hair spline curve corresponding to the base hair model based on the model contour of the base hair model;
an adsorption unit for adsorbing the hair spline curve to a hair setting part model of the target object;
a processing unit for performing hair region mapping processing on the hair setting part model to which the hair spline curve is attached to obtain a mapped hair setting part model;
a second obtaining unit, configured to obtain hair spline curve information based on the hair setting part model after the mapping processing;
and the generating unit is used for generating a hair patch model required by the hair setting part model according to the hair spline curve information.
13. A computer device comprising a memory, a processor and a computer program stored on the memory and run on the processor, wherein the processor when executing the program implements the method of generating a hair model according to any of claims 1 to 11.
14. A computer-readable storage medium storing instructions adapted to be loaded by a processor to perform a method of generating a hair model according to any of claims 1 to 11.
CN202211358247.1A 2022-11-01 2022-11-01 Method and device for generating hair model, computer equipment and storage medium Pending CN115588065A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211358247.1A CN115588065A (en) 2022-11-01 2022-11-01 Method and device for generating hair model, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211358247.1A CN115588065A (en) 2022-11-01 2022-11-01 Method and device for generating hair model, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115588065A true CN115588065A (en) 2023-01-10

Family

ID=84782018

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211358247.1A Pending CN115588065A (en) 2022-11-01 2022-11-01 Method and device for generating hair model, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115588065A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116894916A (en) * 2023-06-19 2023-10-17 北京百度网讯科技有限公司 Hairline model generation method, device and equipment for virtual image and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116894916A (en) * 2023-06-19 2023-10-17 北京百度网讯科技有限公司 Hairline model generation method, device and equipment for virtual image and storage medium

Similar Documents

Publication Publication Date Title
CN113516742A (en) Model special effect manufacturing method and device, storage medium and electronic equipment
CN110136236B (en) Personalized face display method, device and equipment for three-dimensional character and storage medium
CN109324688A (en) Exchange method and system based on visual human's behavioral standard
CN112465945B (en) Model generation method and device, storage medium and computer equipment
CN113546411B (en) Game model rendering method, device, terminal and storage medium
WO2023213037A1 (en) Hair virtual model rendering method and apparatus, computer device, and storage medium
CN115588065A (en) Method and device for generating hair model, computer equipment and storage medium
CN114742926A (en) Animation redirection method and device, computer equipment and storage medium
CN112891954B (en) Simulation method and device for virtual object, storage medium and computer equipment
CN113426129B (en) Method, device, terminal and storage medium for adjusting appearance of custom roles
CN113362435B (en) Virtual component change method, device, equipment and medium of virtual object model
CN116228982A (en) Virtual model processing method and device, computer equipment and storage medium
CN105516785A (en) Communication system, communication method and server for transmitting human-shaped doll image or video
CN115645921A (en) Game indicator generating method and device, computer equipment and storage medium
CN113350792A (en) Contour processing method and device for virtual model, computer equipment and storage medium
CN113706685A (en) Face model reconstruction method, apparatus, device and storage medium
CN112907715B (en) Hair model making method, device, storage medium and computer equipment
CN115994986A (en) Hair model manufacturing method and device, computer equipment and storage medium
CN116870473A (en) Model creation method, device and computer readable storage medium
CN112837403B (en) Mapping method, mapping device, computer equipment and storage medium
CN117953150A (en) Three-dimensional human body reconstruction method, three-dimensional human body reconstruction device, electronic equipment and storage medium
CN117078815A (en) Bone binding method, device, computer equipment and computer readable storage medium
CN115272432A (en) Model information processing method, device, storage medium and computer equipment
CN116503519A (en) Hair treatment method, device, apparatus and readable storage medium
CN116993898A (en) Model-based virtual hair generation method, device, equipment and storage medium

Legal Events

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