CN116993871A - Virtual element generation method, device, equipment, medium and program product - Google Patents

Virtual element generation method, device, equipment, medium and program product Download PDF

Info

Publication number
CN116993871A
CN116993871A CN202211241171.4A CN202211241171A CN116993871A CN 116993871 A CN116993871 A CN 116993871A CN 202211241171 A CN202211241171 A CN 202211241171A CN 116993871 A CN116993871 A CN 116993871A
Authority
CN
China
Prior art keywords
curve
eyebrow
virtual
guiding
surface model
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
CN202211241171.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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202211241171.4A priority Critical patent/CN116993871A/en
Publication of CN116993871A publication Critical patent/CN116993871A/en
Pending legal-status Critical Current

Links

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
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2219/00Indexing scheme for manipulating 3D models or images for computer graphics
    • G06T2219/20Indexing scheme for editing of 3D models
    • G06T2219/2021Shape modification

Abstract

The application discloses a virtual element generation method, device, equipment, medium and program product, and relates to the technical field of image processing. The method comprises the following steps: a growth surface model showing hair elements; in response to receiving a curve generation operation on the growth surface model, displaying a control curve on the growth surface model; displaying a guiding curve corresponding to the hair element based on the control curve; in response to receiving a confirmation operation of the guide curve, hair elements on the growth surface model are displayed based on the guide curve. The control curve is used for providing a basic hair element generation template for a producer, the producer can adjust the hair elements on the basis, and the adjustment process is based on parameters or modification of a guiding curve, so that the steps of generating the hair elements are reduced, and the generation efficiency of the hair elements is improved.

Description

Virtual element generation method, device, equipment, medium and program product
Technical Field
The embodiment of the application relates to the technical field of image processing, in particular to a method, a device, equipment, a medium and a program product for generating virtual elements.
Background
When modeling a virtual character, the effect of small-area and short hairs like eyelashes and eyebrows is that the length of the virtual character is short and the area covered by the virtual character is small, so that the growing area needs to be accurately controlled; in addition, the producer needs to perform a finer operation on the bending degree, the length, and the like of the hair.
In the related art, eyelashes, eyebrows, etc. can be manufactured according to a conventional hair manufacturing process by means of a hair tool set in three-dimensional animation software (e.g., autodesk Maya), and then the manufactured hair is rendered into a map and imported into a virtual engine for use.
However, related art hair generation schemes, such as: for eyebrows, the making of different eyebrows requires redrawing and baking of the artwork, and the whole process is manually completed, so that the hair making efficiency is low.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment, a medium and a program product for generating virtual elements, which can improve the generation efficiency of hair elements, and the technical scheme is as follows:
in one aspect, a method for generating a virtual element is provided, the method comprising:
displaying a growth surface model of a hair element, the growth surface model being a three-dimensional model to be subjected to hair generation;
In response to receiving a curve generation operation on the growth surface model, displaying a control curve on the growth surface model, the control curve being used to determine a generation state of the hair element on the growth surface model;
displaying a guide curve corresponding to the hair element based on the control curve, wherein the guide curve is used for adjusting specified display parameters of the three-dimensional form of the hair element;
in response to receiving a confirmation operation of the guide curve, the hair elements on the growth surface model are displayed based on the guide curve.
In another aspect, there is provided a generating apparatus of a virtual element, the apparatus including:
a display module for displaying a growth surface model of hair elements, the growth surface model being a three-dimensional model to be subjected to hair generation;
a curve generation module for displaying a control curve on the growth surface model in response to receiving a curve generation operation on the growth surface model, the control curve being used to determine a generation state of the hair elements on the growth surface model;
the display module is further used for displaying a guide curve corresponding to the hair element based on the control curve, and the guide curve is used for adjusting specified display parameters of the three-dimensional form of the hair element;
A determination module for displaying the hair elements on the growth surface model based on the guide curve in response to receiving a confirmation operation of the guide curve.
In another aspect, a computer device is provided, where the computer device includes a processor and a memory, where the memory stores at least one instruction, at least one program, a set of codes, or a set of instructions, where the at least one instruction, the at least one program, the set of codes, or the set of instructions are loaded and executed by the processor to implement a method for generating a virtual element according to any of the embodiments above.
In another aspect, a computer readable storage medium is provided, in which at least one instruction, at least one program, a set of codes, or a set of instructions is stored, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by a processor to implement a method of generating a virtual element as described in any of the above embodiments.
In another aspect, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the virtual element generating method according to any one of the above embodiments.
The technical scheme provided by the embodiment of the application has the beneficial effects that at least:
upon receiving the curve generating operation on the growth surface model, a control curve is displayed on the growth surface model, and a guide curve corresponding to the hair element is generated from the control curve, thereby displaying the hair element on the growth surface model. The control curve is used for providing a basic hair element generation template for a producer, the producer can adjust the hair elements on the basis, and the adjustment process is based on parameters or modification of a guiding curve, so that the steps of generating the hair elements are reduced, and the generation efficiency of the hair elements is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is an interface schematic diagram of a method for generating virtual elements according to an exemplary embodiment of the present application;
FIG. 2 is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;
FIG. 3 is a flow chart of a method of generating virtual elements provided by an exemplary embodiment of the application;
FIG. 4 is a schematic view of a virtual eyebrow manufacturing interface according to an exemplary embodiment of the present application;
FIG. 5 is a schematic view of an interface for the adjustment process of the virtual eyebrow according to an exemplary embodiment of the present application;
FIG. 6 is a flow chart of a method of generating virtual elements provided by another exemplary embodiment of the application;
FIG. 7 is an interface schematic of a virtual eyebrow control curve provided in accordance with an exemplary embodiment of the present application;
FIG. 8 is a schematic diagram of a display interface of a first control curve provided by an exemplary embodiment of the present application;
FIG. 9 is an interface diagram of the direction of generation of a virtual eyebrow provided by an exemplary embodiment of the application;
FIG. 10 is an interface diagram of the angle of curvature of a virtual eyebrow provided by an exemplary embodiment of the application;
FIG. 11 is an interface diagram of a rendering result of hair elements provided by an exemplary embodiment of the present application;
FIG. 12 is a flowchart of a method of generating virtual elements provided by yet another exemplary embodiment of the present application;
FIG. 13 is an interface diagram of a control curve of a virtual eyelash provided by an exemplary embodiment of the present application;
FIG. 14 is a schematic view of an adjustment panel of attribute values of hair-generation areas provided by an exemplary embodiment of the present application;
FIG. 15 is a rotational schematic view of an eyelash guidance curve provided by an exemplary embodiment of the present application;
FIG. 16 is a schematic view illustrating an adjustment process of an eyelash guide curve according to an exemplary embodiment of the present application;
FIG. 17 is a flow chart of a programmatic generation of a method of generating virtual elements provided by an exemplary embodiment of the present application;
FIG. 18 is a block diagram of a virtual element generation apparatus provided by an exemplary embodiment of the present application;
FIG. 19 is a block diagram of a virtual element generation apparatus according to another exemplary embodiment of the present application;
fig. 20 is a block diagram of a computer device according to an exemplary embodiment of the present application.
Detailed Description
For the purpose of promoting an understanding of the principles and advantages of the application, reference will now be made in detail to the embodiments of the application, some but not all of which are illustrated in the accompanying drawings. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms "first," "second," and the like in this disclosure are used for distinguishing between similar elements or items having substantially the same function and function, and it should be understood that there is no logical or chronological dependency between the terms "first," "second," and no limitation on the amount or order of execution.
In the related art, the production method of the shorter hair element is generally as follows:
the effect of small and short hairs like eyelashes, eyebrows and the like, because of the short length and small covered area, can be directly drawn on a map or expressed by using a patch and a map under the condition of low quality requirement; in the case of high quality requirements, the hair can be produced according to a conventional hair production flow by means of a hair tool set in three-dimensional animation software (e.g., autodesk Maya) and then rendered into a map.
However, the above solution brings about two results, like eyebrows, eyelashes, which are hair effects with small per se visible area and little operating space: 1) The actual effect is too single by adopting a direct drawing mode, and the reality is poor; 2) The cost of making by manually drawing with three-dimensional animation software is high, requiring the producer to be familiar with the workflow of hair styling, for example: for eyebrows, making different eyebrows corresponds to repeating the previous making process, if the eyebrows are presented in a mapping mode, re-drawing and baking (bak) mapping are needed, the whole process is relatively linear, manual completion is needed, and flexibility is poor. In addition, when making the written eyelashes and eyebrows, either way, it presents a great challenge to the producer, for example, due to the small growing area: the precise control of the growing area, the control of the curvature, length, etc. of the eyelashes requires very careful operations, and when a large amount of such effects are required to be produced, the production efficiency is greatly reduced.
The embodiment of the application provides a virtual element generation method, which can improve the manufacturing efficiency of hair elements. Illustratively, taking the implementation of the hair element as a virtual eyebrow as an example, please refer to fig. 1, firstly, inputting a growth surface model of the eyebrow element into a program, and displaying a growth surface model 101 and a control curve 102 in an interface 100 in response to receiving a curve generating operation on the growth surface model; next, an eyebrow guiding curve 111 corresponding to the virtual eyebrow is displayed in the interface 110 based on the control curve 102; finally, in response to receiving a confirmation operation of the eyebrow guiding curve 111, a hair element 121 is rendered in the interface 120 based on the eyebrow guiding curve 111.
Fig. 2 is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application, as shown in fig. 2, where the implementation environment includes a terminal 210 and a server 220, where the terminal 210 and the server 220 are connected through a communication network 230, and in some alternative embodiments, the communication network 230 may be a wired network or a wireless network, and this embodiment is not limited to this.
In some alternative embodiments, terminal 210 is, but is not limited to, a smart phone, tablet, notebook, desktop computer, smart home appliance, smart car terminal, smart speaker, digital camera, etc. The terminal 210 is provided with a target application, which may be a conventional application, a cloud application, an applet or an application module in a host application, or a web platform, which is not limited in this embodiment. The target application is provided with hair element generation functionality. Optionally, the target application is implemented as a separate procedural-based content generation (Procedural Content Generation, PCG) tool; or as a virtual engine containing PCG plugins.
The PCG is a technology based on procedural content generation, and the PCG technology can automatically generate contents such as virtual elements, virtual scenes and the like through preset rules and algorithms. The producer only needs to input parameters and basic materials (such as a growth surface model) and the like, and can generate contents in batch in real time or off-line through a series of preset rules and algorithms.
In some alternative embodiments, server 220 provides background services for a target application installed in the terminal, and illustratively, server 220 uploads a growth surface model of a hair element into terminal 210, and terminal 210 receives the growth surface model of the hair element and displays the growth surface model of the hair element on the interface; when the terminal 210 receives a curve generating operation on the growth surface model, displaying a control curve on the growth surface model and displaying a guide curve corresponding to the hair element based on the control curve; finally, when a confirmation operation of the guide curve is received, the hair element rendering is displayed on the growth surface model based on the guide curve. Optionally, the terminal uploads the rendered map or file of hair elements to the server 220.
In some alternative embodiments, the above-mentioned growth surface model of the hair element is an offline file, that is, the terminal 210 may directly read the locally stored growth surface model of the hair element, thereby obtaining a map or file of the hair element.
It should be noted that the server 220 can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and can also be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), and basic cloud computing services such as big data and artificial intelligence platforms.
Cloud Technology (Cloud Technology) refers to a hosting Technology that unifies serial resources such as hardware, software, network and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data. The cloud technology is based on the general names of network technology, information technology, integration technology, management platform technology, application technology and the like applied by the cloud computing business model, can form a resource pool, and is flexible and convenient as required. Cloud computing technology will become an important support. Background services of technical networking systems require a large amount of computing, storage resources, such as video websites, picture-like websites, and more portals. Along with the high development and application of the internet industry, each article possibly has an own identification mark in the future, the identification mark needs to be transmitted to a background system for logic processing, data with different levels can be processed separately, and various industry data needs strong system rear shield support and can be realized only through cloud computing. Optionally, server 220 may also be implemented as a node in a blockchain system.
It should be noted that, before and during the process of collecting the relevant data of the user, the present application may display a prompt interface, a popup window or output voice prompt information, where the prompt interface, popup window or voice prompt information is used to prompt the user to collect the relevant data currently, so that the present application only starts to execute the relevant step of obtaining the relevant data of the user after obtaining the confirmation operation of the user to the prompt interface or popup window, otherwise (i.e. when the confirmation operation of the user to the prompt interface or popup window is not obtained), the relevant step of obtaining the relevant data of the user is finished, i.e. the relevant data of the user is not obtained. In other words, all user data collected by the present application is collected with the consent and authorization of the user, and the collection, use and processing of relevant user data requires compliance with relevant laws and regulations and standards of the relevant country and region.
Referring to fig. 3, a flowchart of a method for generating a virtual element according to an exemplary embodiment of the present application is shown, and the method is applied to a terminal for explanation, as shown in fig. 3, and includes:
Step 301 shows a growth surface model of hair elements.
Wherein the growth surface model is a three-dimensional model to be subjected to hair generation.
Optionally, the hair element includes at least one of a virtual eyebrow, a virtual eyelash, a virtual beard, a virtual hair, and the like. Illustratively, the hair element may be a virtual eyebrow on a virtual character or a virtual beard on a virtual animal, which is not limited in this embodiment of the application.
Alternatively, the hair to be generated in the growth surface model may comprise only one hair element, for example: only a growth surface model for generating a virtual eyelash is displayed, or only a growth surface model for generating a virtual eyebrow is displayed; the hair to be generated in the growth surface model may also comprise a plurality of hair elements, for example: a growing surface model of the virtual eyelashes and the virtual eyebrows is displayed, or a head model of the complete virtual character is displayed.
Illustratively, the producer may introduce a growth surface model of the hair element into the target application, thereby displaying the growth surface model on the hair element production interface of the target application. Alternatively, the target application may be implemented as a separate PCG tool, and after the hair element is completed, the asset corresponding to the hair element may be output to restore the effect in a virtual Engine (e.g., unreal Engine, unity 3D, etc.); or the target application program can be realized as a virtual engine containing the PCG plug-in, and after the hair element is manufactured, rendering can be performed in real time in the virtual engine so as to show the rendering effect.
Referring to fig. 4, fig. 4 is a schematic diagram illustrating a manufacturing interface of a virtual eyebrow, wherein a three-dimensional grid model 401 is a growth surface model of the virtual eyebrow.
In response to receiving the curve generation operation on the growth surface model, a control curve is displayed on the growth surface model, step 302.
The control curve is used to determine the state of generation of hair elements on the growth surface model.
Optionally, the generating state of the hair element on the growth surface model includes a generating position, a generating direction, a length, a density, a width, a bending direction, an angle, and the like, which is not limited by the embodiment of the present application.
Wherein the control curve includes at least one of the following curves:
1. the control curve comprises a first control curve, and the first control curve corresponds to the closed area.
Optionally, the first control curve may be used to determine a generation position of the hair element, and illustratively, the position of the first control curve projected on the growth surface model is the generation position of the hair element on the growth surface model; the first control curve is also used for determining the generation state of hair elements, and illustratively, the density and the length of the virtual eyebrows are controlled according to the distance from each point in the closed area to the edge, and the closer to the edge, the smaller the density of the virtual eyebrows is, and the shorter the length is.
Optionally, the outline of the closed area is used to represent the generated outline of the hair element on the growth surface model, and referring to fig. 4, schematically, the closed area of the first control curve 402 is the eyebrow shape of the virtual eyebrow. Optionally, the number of the first control curves corresponding to one hair element may be one or more, which is illustrative, for the virtual eyelashes, the first control curves include an upper eyelash control curve and a lower eyelash control curve, and the upper eyelash control curve is used for representing a generated outline of the upper eyelash on the growth surface model; the lower eyelash control curve is used to represent the generated profile of the lower eyelash on the growth surface model.
2. The control curve comprises a second control curve, and tangential lines are correspondingly arranged on each point of the second control curve.
The second control curve is used for determining the generation direction of the hair element, and the direction of the virtual eyebrow generated by the target position point can be illustratively the opposite direction of the tangent line of the point on the second control curve corresponding to the target position point; the second control curve is used for determining a bending state of the hair element, wherein the bending state comprises a bending angle and a bending direction, the bending direction of the virtual eyebrow generated by the target position point is illustratively the point on the second control curve which takes the root of the virtual eyebrow as the origin and points to the corresponding point of the target position point, and the bending angle of the virtual eyebrow generated by the target position point can be determined according to the distance between the target position point and the root.
Referring to fig. 4, the control curves of the virtual eyebrows in fig. 4 include a first control curve 402 and a second control curve 403, where the first control curve 402 is used to control the generating position and generating state of the virtual eyebrows; the second control curve 403 is used to control the direction of generation and the curved state of the virtual eyebrow.
Optionally, the curve generating operation includes at least one of the following operations:
1. curve introduction operation.
Optionally, a control curve corresponding to the growth surface model is displayed on the preparation interface of the hair element of the target application program while the growth surface model of the hair element is imported. Optionally, displaying a corresponding control curve according to the type of the imported growth surface model, and illustratively importing the control curve of the virtual eyebrow if the imported growth surface model of the virtual eyebrow is imported; alternatively, if a model of the growth surface of a female's virtual eyebrow is introduced, the outline of the closed area may be displayed as a control curve corresponding to the elongated eyebrow shape.
Alternatively, after the hair element growth surface model is introduced, a selection interface including at least a hair element selection module and a control curve selection module is displayed on the hair element creation interface of the target application program. The hair element selection module is used for determining the types of hair elements to be generated, and schematically, the hair to be generated in the growth surface model comprises virtual eyebrows and virtual eyelashes, so that a producer can select the virtual eyebrows on the interface, namely, firstly, the virtual eyebrows are produced; the control curve selection module is configured to determine a type of a control curve of a hair element to be generated, and illustratively, when it is determined that the hair to be generated is a virtual eyebrow, the producer may select a type of a control curve of the virtual eyebrow on the interface, for example: when the growth surface model is a female model, the outline of the selectable closed area appears as a control curve corresponding to the elongated eyebrow shape.
2. And (5) curve position adjustment operation.
Optionally, the curve position adjustment operation includes adjusting the position of the control curve to be directly in front of the growth surface model, illustratively, adjusting the control curve of the virtual eyebrow to be directly in front of the eyebrow growth surface model, corresponding to the position of the generation of the eyebrow on the eyebrow growth surface model, please refer to fig. 4, and adjusting the first control curve 402 and the second control curve 403 to be directly in front of the three-dimensional grid model 401.
Optionally, if the hair element making interface includes a plurality of control curves, the curve position adjusting operation further includes an adjusting operation for a relative position of the plurality of control curves. Referring to fig. 4, if the first control curve 402 is fixed, the second control curve 403 may be adjusted up and down to penetrate the first control curve 402.
Optionally, the curve position adjustment operation is implemented as automatic adaptation of the system according to the position of the growth surface model and the position of the control curve; or the curve position adjustment operation is realized in such a way that a producer manually adjusts the position of the control curve in the production interface of the hair element; alternatively, the curve position adjustment operation is realized in such a way that firstly the system automatically adapts according to the position of the growth surface model and the position of the control curve, and secondly the producer fine-adjusts the position of the control curve at the production interface of the hair element.
3. And (5) curve parameter adjustment operation.
The curve parameter adjustment operation comprises adjustment of the shape of a closed area enclosed by the control curve, adjustment of the bending angle of the control curve, and adjustment of the length, width, density, bending angle and the like of hair elements generated in the closed area enclosed by the control curve.
Alternatively, the curve parameter adjustment operation may be implemented as an adjustment operation on the control curve, for example, please refer to fig. 4, click on the first control curve 402, drag any vertex thereof, change the shape of the first control curve 402, and thereby change the shape of the enclosed area enclosed by the first control curve 402; alternatively, clicking on the second control curve 403 drags its bending control point, thereby changing the bending angle of the second control curve 403.
Alternatively, the curve parameter adjustment operation may be implemented as an adjustment operation on a parameter adjustment panel corresponding to the control curve. Illustratively, changing the shape of the first control curve 402, changing the bending angle of the second control curve 403, adjusting the length, width, density, bending angle, etc. of hair elements generated within the control curves at the parameter adjustment panel.
Step 303, displaying a guiding curve corresponding to the hair element based on the control curve.
Wherein the guide curves are visual displays of hair elements on the production interface, i.e. each guide curve may represent each hair element.
Optionally, the controlling of the hair element by the first control curve includes at least one of:
1. position control is generated.
Determining a target area of the hair element in the growth surface model according to the position of a closed area surrounded by the first control curve, wherein the target area is an area of the closed area projected onto the growth surface model; a guide curve is displayed on the target area.
Optionally, the target area is an area where the closed area is projected onto the growth surface model according to a preset direction, and referring to fig. 4, schematically, the closed area enclosed by the first control curve 402 is vertically projected from front to back into the three-dimensional grid model 401, where the projected position is a generation area of the virtual eyebrow in the growth surface model, that is, the target area.
2. Form control is generated.
Determining the curve length of a guide curve displayed on a second position point in the target area according to the distance between the first position point in the closed area and the edge of the closed area, wherein the second position point is the position point of the first position point projected onto the growth surface model; the guide curve is displayed on the target area based on the curve length of the guide curve.
Optionally, the distance between the first location point and the edge of the closed region and the curve length of the guide curve displayed on the second location point are inversely related, that is to say the shorter the hair element generated closer to the edge of the target region.
Or determining the density of a guide curve displayed in a second subarea in the target area according to the distance between each point in the first subarea in the closed area and the edge of the closed area, wherein the second subarea is the area of the first subarea projected onto the growth surface model; the guide curve is displayed on the target area based on the density of the guide curve.
Optionally, the distance between each point in the first sub-area and the edge of the closed area is inversely related to the density of the guiding curve displayed in the second sub-area, i.e. the more sparse the hair elements generated in the area closer to the edge of the target area.
Optionally, if the distance between each point in the third sub-area and the edge of the closed area is smaller than the preset distance, determining the width of the guide curve displayed in the fourth sub-area in the target area as the preset width, where the fourth sub-area is an area of the third sub-area projected onto the growth surface model, and the width of the guide curve displayed in the other target areas except the fourth area is larger than the preset width. That is, hair elements generated in a region near the edge of the target region are thin.
In some alternative embodiments, the hair elements generated within the target area correspond to a start generation point and an end generation point, the width of the hair element at the start generation point being greater than the width of the hair element at the end generation point, that is, the thinner the hair element will be from the start generation point to the end generation point. For example: for the virtual eyebrow, the initial generation point is the root of the eyebrow, the final generation point is the tip of the eyebrow, and the virtual eyebrow becomes thinner from the root of the eyebrow to the tip of the eyebrow.
It should be noted that, the control operation of the hair element based on the first control curve may also be implemented on a parameter panel, optionally, a parameter panel of the target area is displayed, where the parameter panel is used to adjust the curve parameters of the guide curve generated in the target area; in response to receiving a parameter adjustment operation on the parameter panel for the target area, a guide curve is displayed on the target area.
Optionally, the curve parameters of the guiding curve include a shape of a first control curve, and a length, a width, a density, a bending angle, etc. of the hair element generated in the first control curve, which is not limited in the embodiment of the present application.
(II) optionally, the second control curve is used for adjusting the hair element generated based on the first control curve, and then the control situation of the second control curve on the hair element further comprises: displaying an initial guiding curve of the hair element at the target area based on the first control curve; based on the second control curve, the generation direction and the bending state of the initial guiding curve are adjusted, and the adjusted initial guiding curve is used as the guiding curve corresponding to the hair element.
For a schematic, please refer to fig. 5, which shows the adjustment procedure of the virtual eyebrow:
the guiding curve in the interface 500 is an eyebrow guiding curve in an initial state generated according to the first control curve; the guiding curve in the interface 510 is a basic eyebrow guiding curve that performs preliminary adjustment on the eyebrow guiding curve in the initial state according to the second control curve; the guiding curve in the interface 520 is an eyebrow guiding curve obtained by finally adjusting the basic eyebrow guiding curve according to the second control curve.
Optionally, a secondary adjustment process for the guide curve is also included after the guide curve is displayed. That is, the guide curve corresponding to the hair element displayed based on the control curve is a basic guide curve generated according to the control curve, after the basic guide curve is generated, the producer can further adjust the guide curve according to the needs, optionally, the length, width, density and the like of the guide curve can be adjusted on the whole parameter panel, and the detail can be adjusted for a certain guide curve, so that the adjusted guide curve is finally obtained.
The guiding curve is used for adjusting the appointed display parameters of the three-dimensional form of the hair element.
Optionally, the specified display parameters refer to display parameters that the hair element finally renders, including color, transparency, pixel value, and the like.
In response to receiving the confirmation operation of the guide curve, the hair elements on the growth surface model are displayed based on the guide curve, step 304.
Illustratively, when the adjustment operation on the guide curve is finished, the user can click on the preparation panel of the hair element to determine, and then the target application program renders and displays the corresponding hair element on the growth surface model according to the guide curve.
In summary, the method for displaying virtual elements according to the embodiment of the present application receives the operation of generating the curve on the growth surface model, displays the control curve on the growth surface model, and generates the guide curve corresponding to the hair element according to the control curve, thereby displaying the hair element on the growth surface model. The control curve is used for providing a basic hair element generation template for a producer, the producer can adjust the hair elements on the basis, and the adjustment process is based on parameters or modification of a guiding curve, so that the steps of generating the hair elements are reduced, and the generation efficiency of the hair elements is improved.
According to the method provided by the embodiment of the application, the generation position and the generation shape of the hair elements generated on the growth surface model can be controlled through the first control curve, and the guide curve corresponding to the hair elements can be generated through simple adjustment operation of the template curve, so that the step of generating the hair elements is simplified, and the generation efficiency of the hair elements is further improved.
According to the method provided by the embodiment of the application, the length and the density of the hair elements generated on the generation surface model are controlled through the first control curve, namely, the curve length and the density of the guide curve generated on the generation surface model are automatically determined according to the distance between each point and the edge of the closed area enclosed by the first control curve, so that the generation efficiency of the hair elements is improved, and meanwhile, the display naturalness of the hair elements is improved.
According to the method provided by the embodiment of the application, the hair elements generated on the generation surface model are controlled through the parameter adjustment operation on the parameter panel, namely, the detail control is performed on the hair elements based on the parameters, so that the control efficiency of the hair elements in the hair element generation process is improved.
In some alternative embodiments, the hair element includes a virtual eyebrow, please refer to fig. 6, which shows a flowchart of a method for generating a virtual element according to an exemplary embodiment of the present application, and the method is applied to a terminal for illustration, as shown in fig. 6, and includes:
Step 601, a growing surface model of the virtual eyebrow is displayed.
The growth surface model is a three-dimensional model to be generated by virtual eyebrows.
Optionally, the growth surface model is a three-dimensional model corresponding to the right virtual eyebrow, or may be a three-dimensional model corresponding to the left virtual eyebrow, or may be a three-dimensional model corresponding to both virtual eyebrows. Optionally, if the growing surface model only includes one side virtual eyebrow, after the side virtual eyebrow is generated, mirror image processing may be performed on the side virtual eyebrow, so that the generating effect of the other side virtual eyebrow may be obtained.
In response to receiving the curve generation operation on the growth surface model, a control curve is displayed on the growth surface model, step 602.
Optionally, in response to receiving the curve importing operation, displaying an initial control curve corresponding to the virtual eyebrow on the growth surface model; in response to receiving the curve position adjustment operation, adjusting the initial control curve to directly in front of the growth surface model; in response to the reception curve adjustment operation, the initial control curve is adjusted so that the control curve is displayed on the growth surface model.
Optionally, the control curves include a first control curve and a second control curve. The first control curve is used for determining the generation position and the generation form of the virtual eyebrow, and the generation form mainly refers to the length, the sparseness, the thickness, the eyebrow shape and the like of the virtual eyebrow; the second control curve is mainly used for determining the generation direction and the bending state of the virtual eyebrow.
Illustratively, taking the growing surface model as an example and describing the implementation of the growing surface model as a three-dimensional model including two virtual eyebrows corresponding to two sides, please refer to fig. 7, which shows an interface schematic diagram of a control curve of a virtual eyebrow, after the growing surface model corresponding to the virtual eyebrow is imported into a program, the three-dimensional grid model 701 is displayed in the interface 700, after the three-dimensional grid model 701 is imported, a hair element generating tool in the program can be started, a virtual eyebrow generating tool is selected in the hair element generating tools, after a template of a required virtual eyebrow is selected, the control curve matched with the template can be displayed in the interface 700; the control curves include a first control curve 702 for determining the generation position and the generation form of the virtual eyebrows on both sides, and a second control curve 703 for determining the generation direction and the bending state (bending angle and bending direction) of each of the virtual eyebrows on both sides, the first control curve 702.
Optionally, the left and right eyebrows are synchronized for the adjustment operation of the control curve; alternatively, the left and right eyebrows are not synchronized with the adjustment operation of the control curve. That is, when the first control curve 702 of the left eyebrow is modified, the first control curve 702 of the right eyebrow is also modified in synchronization; alternatively, when the first control curve 702 of the left eyebrow is modified, the first control curve 702 of the right eyebrow is not modified.
Step 603, determining an eyebrow guiding curve corresponding to the virtual eyebrow based on the first control curve.
The target area is an area where a closed area surrounded by the first control curve is projected onto the growth surface model.
Optionally, the eyebrow shape, density, length and width corresponding to the virtual eyebrow are determined based on the first control curves, and the following description is given of the control of the growth state by using the first control curves respectively:
1. and determining the eyebrow shape corresponding to the virtual eyebrow.
Schematically, the outline of the closed area surrounded by the first control curve is the outline of the corresponding eyebrow of the virtual eyebrow, that is, the outline of the target area obtained by the first control curve is the eyebrow corresponding to the virtual eyebrow according to the preset projection direction (for example, vertically projecting from front to back) to the growth surface model.
2. And determining the length corresponding to the virtual eyebrow.
Schematically, according to the distance between the first position point in the closed area and the edge of the closed area, determining the curve length of the eyebrow guiding curve displayed on the second position point in the target area, namely the length corresponding to the virtual eyebrow, wherein the second position point is the position point of the first position point projected onto the growth surface model. Alternatively, the distance between the first position point and the edge of the closed region and the curve length of the eyebrow guiding curve displayed on the second position point are in negative correlation, that is, the closer to the edge of the target region, the shorter the virtual eyebrow is generated.
3. And determining the density corresponding to the virtual eyebrows.
Schematically, according to the distance between each point in the first subarea in the closed area and the edge of the closed area, the density of the eyebrow guiding curve displayed in the second subarea in the target area is determined, namely the density corresponding to the virtual eyebrow, and the second subarea is the area of the first subarea projected onto the growth surface model. Optionally, the distance between each point in the first sub-area and the edge of the closed area is inversely related to the density of the eyebrow guiding curve displayed in the second sub-area, i.e. the more sparse the hair elements generated in the area closer to the edge of the target area.
4. And determining the width corresponding to the virtual eyebrow.
Schematically, according to the distance between the third position point in the closed area and the edge of the closed area, determining the curve width of the eyebrow guiding curve displayed on the fourth position point in the target area, namely the width corresponding to the virtual eyebrow, wherein the fourth position point is the position point of the third position point projected onto the growth surface model.
Alternatively, the distance between the third position point and the edge of the closed region and the curve width of the eyebrow guiding curve displayed on the fourth position point are in negative correlation, that is, the virtual eyebrow generated at a position closer to the edge of the target region is thinner.
Or, in response to the distance between each point in the third sub-area and the edge of the closed area being smaller than the preset distance, determining the width of the guide curve displayed in the fourth sub-area in the target area as a first preset width; determining the width of a guide curve displayed in a sixth subarea in the target area as a second preset width in response to the distance between each point in the fifth subarea and the edge of the closed area being greater than or equal to a preset distance; the fourth subarea is a region of the third subarea projected onto the growth surface model, the sixth subarea is a region of the fifth subarea projected onto the growth surface model, and the first preset width is smaller than the second preset width. That is, there are at least two widths of virtual eyebrows in the target area, the virtual eyebrows are thinner at the edges of the target area, and the virtual eyebrows in the target area other than the edges are thicker.
Alternatively, the virtual eyebrow corresponds to an eyebrow root and an eyebrow tip, and the width of the virtual eyebrow at the eyebrow tip is smaller than the width of the virtual eyebrow at the eyebrow root, alternatively, the width of the virtual eyebrow is smaller as approaching the eyebrow tip.
Alternatively, for the distance between each point in the closed area and the edge of the closed area may be represented by a value of a pixel point in the closed area, alternatively, a pixel image corresponding to the closed area is obtained according to the distance between each point and the edge of the closed area, schematically, please refer to fig. 8, where the value of the pixel point in the pixel image 801 of the closed area corresponding to the first control curve is from 0 to 1 (the result after normalization processing), where the value of the pixel point corresponding to the black point is 0, which indicates that the distance to the edge of the closed area is 0, the value of the pixel point corresponding to the white point is 1, which indicates that the distance to the edge of the closed area is farthest in the pixel image 801. Based on the pixel image 801, the length, density, and width of the virtual eyebrow are attenuated according to the change of the pixel value from 1 to 0, so that the eyebrow guiding curve 802 is obtained.
Optionally, the pixel values in the pixel image corresponding to the closed area enclosed by the first control curve may be modified on the manufacturing interface of the virtual eyebrow, so as to adjust the length, width and density of the virtual eyebrow. Illustratively, if the length, width, and density of the virtual eyebrows generated at the designated edge of the target area need to be increased, the value of the pixel point at the corresponding edge of the pixel image is increased.
In some alternative embodiments, the values of the pixel points in the closed area may also be extracted from a preset eyebrow model. Schematically, some eyebrow models which are relatively common or attractive can acquire the length, width and distribution density data of each eyebrow in the eyebrow model, and reversely convert the data into pixel values, so as to generate a pixel image corresponding to the eyebrow model.
Step 604, adjusting the generating direction and the bending state of the eyebrow guiding curve based on the second control curve, taking the adjusted eyebrow guiding curve as the guiding curve corresponding to the virtual eyebrow, and displaying the guiding curve corresponding to the virtual eyebrow.
Illustratively, after the eyebrow guiding curve corresponding to the virtual eyebrow is generated based on the first control curve, the generating direction and the bending state of the eyebrow guiding curve need to be adjusted based on the second control curve, so as to finally generate the guiding curve corresponding to the virtual eyebrow, wherein the bending state includes a bending angle and a bending direction, and optionally, the following determination of the generating direction and the bending state of the virtual eyebrow by the second control curve is described respectively:
1. Determining a point on the second control curve corresponding to the minimum distance in the distances between each point on the second control curve and the eyebrow guiding curve as a target tangent point; and adjusting the generation direction of the eyebrow guiding curve towards the target direction by taking the root of the eyebrow in the eyebrow guiding curve as an origin, wherein the target direction is the opposite direction of the tangential line of the target tangential point on the second control curve.
Referring to fig. 9, firstly, the tangents to all points on the second control curve are calculated to obtain a tangent set 900; secondly, for one eyebrow guiding curve, searching the closest point to the eyebrow guiding curve on the second control curve as a target tangent point, and then the generating direction of the eyebrow guiding curve is the opposite direction of the target tangent point, for example: the direction of the target tangent point of the eyebrow guiding curve 1 is vertically upwards, and the generation direction of the eyebrow guiding curve 1 is vertically downwards, i.e. the eyebrow tip thereof is directed in a vertically downwards direction, which is seen in the interface 910, wherein the direction of the eyebrow tip of the eyebrow guiding curve is opposite to the direction of the tangent line on the second control curve.
2. Determining bending angles of all points on the eyebrow guiding curve based on the distance between all points on the eyebrow guiding curve and the root of the eyebrow; the eyebrow guiding curve is curved in a direction pointing to the target tangent point based on the curved angles of the respective points on the eyebrow guiding curve.
Optionally, the distance between each point on the eyebrow guiding curve and the root of the eyebrow and the bending angle of each point on the eyebrow guiding curve are in positive correlation. That is, the closer to the root of the eyebrow, the smaller the angle at which the eyebrow guiding curve is bent.
Alternatively, for each eyebrow guiding curve there is a random reference bending angle, which may be the bending angle of any point on the eyebrow guiding curve. Illustratively, if the reference bending angle is a bending angle of the root of the eyebrow, the reference bending angle is amplified from the root of the eyebrow to the tip of the eyebrow; if the reference bending angle is the bending angle of the tip of the eyebrow, the reference bending angle is attenuated from the tip of the eyebrow to the root of the eyebrow.
Illustratively, after determining the direction of generation of the eyebrow guide curve, the bending direction and the bending angle of the eyebrow guide curve need to be determined. For an eyebrow guiding curve, the angle of curvature decays from the tip (1) to the root (0) of the eyebrow, the reference angle of curvature of each eyebrow guiding curve being random; and the eyebrow guiding curves are bent in the direction of pointing to the target tangent point, so that each eyebrow guiding curve points to the direction of the target tangent point on the second control curve from the root of each eyebrow guiding curve, namely, the eyebrow guiding curve above the second control curve is bent downwards, and the eyebrow guiding curve below the second control curve is rotated upwards, so that the effect that the eyebrows gather towards the center is generated. Optionally, the control of the second control curve on the eyebrow guiding curve converts the curvature (also referred to as a rotation matrix) into a quaternion and applies the quaternion to the eyebrow guiding curve, so as to obtain the curvature result of the eyebrow guiding curve.
For illustration, referring to fig. 10, the interface 1000 is an eyebrow guiding curve that is not curved, the curved eyebrow guiding curve 1010 is obtained according to a tangent line of the second control curve, and the interface 1020 is a curved effect that is shown after increasing the density of the curved eyebrow guiding curve.
In response to receiving the confirmation operation of the guide curve corresponding to the virtual eyebrow, the virtual eyebrow is displayed on the growth surface model based on the guide curve corresponding to the virtual eyebrow.
Schematically, after the adjustment operation of the guide curve corresponding to the virtual eyebrow is finished, the user can click on the making panel of the hair element to determine, and then the target application program renders and displays the corresponding virtual eyebrow on the growth surface model according to the guide curve corresponding to the virtual eyebrow.
Referring to fig. 11, a display diagram of a rendering result of one hair element is shown, where a virtual eyebrow 1101 is a rendering result of a guiding curve corresponding to the virtual eyebrow on a growth surface model.
In summary, the method for displaying virtual elements according to the embodiment of the present application receives the operation of generating the curve on the growth surface model, displays the control curve on the growth surface model, and generates the guide curve corresponding to the hair element according to the control curve, thereby displaying the hair element on the growth surface model. The control curve is used for providing a basic hair element generation template for a producer, the producer can adjust the hair elements on the basis, and the adjustment process is based on parameters or modification of a guiding curve, so that the steps of generating the hair elements are reduced, and the generation efficiency of the hair elements is improved.
According to the method provided by the embodiment of the application, the generation direction and the bending state of the virtual eyebrows generated on the growth surface model are automatically controlled and adjusted based on the second control curve, so that the generation efficiency of the virtual eyebrows is improved, and meanwhile, the element granularity of the generated virtual eyebrows is improved.
In some alternative embodiments, the hair element includes a virtual eyelash, please refer to fig. 12, which shows a flowchart of a method for generating a virtual element according to an exemplary embodiment of the present application, and the method is applied to a terminal for illustration, as shown in fig. 12, and includes:
step 1201, a growth surface model of the virtual eyelashes is displayed.
The growth surface model is a three-dimensional model to be subjected to virtual eyelash generation.
Alternatively, the growth surface model may be a three-dimensional model corresponding to the right virtual eyelash, a three-dimensional model corresponding to the left virtual eyelash, or a three-dimensional model corresponding to both virtual eyelashes. Alternatively, if the growing surface model only includes one side of the virtual eyelash, after the side of the virtual eyelash is generated, the mirror image processing may be performed on the side of the virtual eyelash, so that the generating effect of the virtual eyelash on the other side may be obtained.
Step 1202, in response to receiving a curve generation operation on a growth surface model, displaying a first control curve on the growth surface model.
The first control curve is used for determining a generation state of the virtual eyelashes on the growth surface model, wherein the generation state comprises a generation position, a generation direction, a length, a density, a width, a rotation direction, an angle and the like, and the embodiment of the application is not limited to the above.
Optionally, the first control curve includes an upper eyelash control curve and a lower eyelash control curve. In response to receiving the curve importing operation, displaying an initial upper eyelash control curve and an initial lower eyelash control curve corresponding to the virtual eyelashes on the growth surface model; in response to receiving the curve position adjustment operation, adjusting the initial upper eyelash control curve and the initial lower eyelash control curve to a specified position directly in front of the growth surface model; optionally, in response to receiving a parameter adjustment operation on the parameter adjustment panel for the initial upper eyelash control curve and the initial lower eyelash control curve, displaying an upper eyelash control curve corresponding to the initial upper eyelash control curve and a lower eyelash control curve corresponding to the initial lower eyelash control curve on the growth surface model.
Referring to fig. 13, schematically, a control curve diagram of a single-sided eyelash is shown, and an initial upper eyelash control curve 1301 and an initial lower eyelash control curve 1302, which are adjusted to the eyelid position of a three-dimensional model of the human eye, are displayed in an interface 1300. Optionally, in response to receiving a curve parameter adjustment operation (e.g., determining a shape of a closed region corresponding to the curve) on the parameter adjustment panel, the initial upper eyelash control curve 1301 and the initial lower eyelash control curve 1302 are projected into a human eye three-dimensional model, so as to obtain a growth region 1311 of the upper eyelash and a growth region 1312 of the lower eyelash (i.e., the target region). It should be noted that, here, the initial upper eyelash control curve 1301 and the initial lower eyelash control curve 1302 actually correspond to a closed region, but the adjustment operation of the closed region is implemented on the parameter adjustment panel, and only two curves are displayed on the interface 1300, but when the two curves are projected onto the three-dimensional model of human eye, the two curves are projected according to the parameters of the closed region set on the parameter adjustment panel, and the projected regions are not lines.
Step 1203, displaying an upper eyelash guiding curve and a lower eyelash guiding curve corresponding to the virtual eyelashes on the target area based on the upper eyelash control curve and the lower eyelash control curve.
The target area is an upper eyelash generating area projected onto the growing surface model by a closed area surrounded by an upper eyelash control curve, and a lower eyelash generating area projected onto the growing surface model by a closed area surrounded by a lower eyelash control curve.
The upper eyelash generating region and the lower eyelash generating region are regions on a three-dimensional model, which is actually a curved surface.
Optionally, before displaying the upper eyelash guiding curve and the lower eyelash guiding curve, attributes such as density, width, length, radian, tangent curve and the like corresponding to the upper eyelash generating region and the lower eyelash generating region may be further set on the parameter adjusting panel. Wherein the density, width, length refer to the density, width, length, curvature, and tangent curves of the upper eyelash guiding curve and the lower eyelash guiding curve generated in the upper and lower eyelash generating regions, and optionally, the curvature and tangent curves may be used to set initial degrees of curvature for the upper and lower eyelash guiding curves.
Referring to fig. 14, a panel for adjusting the attribute values of the hair-generation area is shown, wherein icons 1400, 1410, and 1420 respectively represent the density, width, and length of the eyelash guidance curve in the area, and the color shade in the area in the icon represents the magnitude of the parameter value corresponding to the point. For example: for the icon 1400, the color of the a region is darker (i.e., the pixel value corresponding to the region is lower), and the density of the eyelash guidance curves distributed in the a region is lower (i.e., the region is thinner); the color of the B region is lighter (i.e., the pixel value corresponding to the region is higher), and the density of the eyelash guidance curves distributed in the B region is higher (i.e., denser). For the icon 1410, the color of point a is darker, and the width of the eyelash guidance curve generated by point a is narrower (i.e., thinner); the color of the point b is lighter, and the width of the eyelash guidance curve generated by the point b is wider (i.e., thicker). For icon 1420, the color at point c is darker, and the length of the eyelash guidance curve generated at point c is shorter; the color of the point d is lighter, and the length of the eyelash guiding curve generated by the point d is longer.
Optionally, after the attribute values corresponding to the upper eyelash generating region and the lower eyelash generating region are adjusted on the parameter adjusting panel, the upper eyelash guiding curve and the lower eyelash guiding curve corresponding to the virtual eyelash are displayed in the target region in response to receiving the confirmation operation of the eyelash control curve.
Step 1204, taking the root of the upper eyelash guiding curve as an origin, taking the tangential direction of the root of the upper eyelash guiding curve on the growth surface model as an axis, and rotating the upper eyelash guiding curve upwards according to a first preset angle; taking the root of the lower eyelash guiding curve as an origin, taking the tangential direction of the root of the lower eyelash guiding curve on the growth surface model as an axis, and rotating the lower eyelash guiding curve downwards according to a second preset angle.
Optionally, determining a first preset angle/a second preset angle of each point on the eyelash guide curve based on the distance between each point on the eyelash guide curve and the root of the eyelash; optionally, the distance between each point on the eyelash guide curve and the root of the eyelash and the first/second preset angles of each point on the eyelash guide curve are in a negative correlation.
Alternatively, for each lash guide curve there is a random first reference angle of rotation, which may be the angle of rotation of any point on the lash guide curve. Illustratively, if the first reference rotation angle is a rotation angle of the root portion of the eyelash, the first reference rotation angle is attenuated from the root portion of the eyelash to the tip portion of the eyelash; if the first reference rotation angle is a rotation angle of the tip portion of the eyelash, the first reference rotation angle is amplified from the tip portion of the eyelash to the root portion of the eyelash.
Illustratively, for a lash guide curve, the lash is attenuated by the angle of rotation from root to tip, i.e., the closer to the root the angle of rotation is.
Optionally, after the eyelash guiding curve is rotated up and down, the eyelash guiding curve can be rotated left and right at random angles, optionally, the root of the eyelash of the upper eyelash guiding curve is used as an origin, the cross multiplication result of the root of the upper eyelash guiding curve in the tangential direction and the vertical upward direction on the growth surface model is used as an axis, and the upper eyelash guiding curve is rotated left or right at random according to a third preset angle; taking the root of the lower eyelash guiding curve as an origin, taking the cross multiplication result of the root of the upper eyelash guiding curve in the tangential direction and the vertical upward direction on the growth surface model as an axis, and randomly rotating the lower eyelash guiding curve leftwards or rightwards according to a fourth preset angle.
Optionally, determining a third preset angle/a fourth preset angle of each point on the eyelash guide curve based on the distance between each point on the eyelash guide curve and the root of the eyelash; optionally, the distance between each point on the eyelash guide curve and the root of the eyelash and the third/fourth preset angle of each point on the eyelash guide curve are in a negative correlation.
Alternatively, for each lash guide curve there is a random second reference angle of rotation, which may be the angle of rotation of any point on the lash guide curve. Illustratively, if the second reference rotation angle is a rotation angle of the root portion of the eyelash, the second reference rotation angle is attenuated from the root portion of the eyelash to the tip portion of the eyelash; if the second reference rotation angle is a rotation angle of the tip portion of the eyelash, the second reference rotation angle is amplified from the tip portion of the eyelash to the root portion of the eyelash.
Referring to fig. 15, a rotation diagram of an eyelash guide curve is shown. When the initial bending degree of the eyelash guiding curve corresponding to the eyelash generating area is set on the parameter adjusting panel, generating an initial eyelash guiding curve; the initial eyelash guide curve may also be randomly rotated to adjust the initial degree of curvature to obtain the eyelash guide curve. Optionally, the interface 1500 is an interface schematic of an eyelash guide curve rotated up and down through a random angle; interface 1510 is an interface schematic of the eyelash guidance curve that is then rotated left and right through a random angle.
In step 1205, the rotated upper eyelash guiding curve and lower eyelash guiding curve are used as guiding curves corresponding to the virtual eyelashes, and guiding curves corresponding to the virtual eyelashes are displayed.
In some alternative embodiments, after the curvature of the eyelash guide curves is adjusted, a cluster (Clump) effect may also be randomly added to the eyelash guide curves, i.e., a plurality of eyelash guide curves in a randomly selected area may be clustered together to form a cluster.
In some alternative embodiments, the length of the lash guide curve may also be trimmed randomly after the lash guide curve is adjusted for degree of curvature.
Referring to fig. 16, a schematic diagram of an eyelash guide curve adjustment process is shown. After the curvature of the eyelash guide curve is adjusted, the density of the eyelash guide curve may be increased to obtain the eyelash guide curve in the interface 1600; after the bending degree of the eyelash guiding curve in the interface 1600 is adjusted, the Clump effect is randomly added, so that the eyelash guiding curve in the interface 1610 is obtained; finally, the length of the lash guide curve in interface 1610 is randomly trimmed, resulting in the lash guide curve in interface 1620.
In step 1206, in response to receiving the confirmation operation of the guide curve corresponding to the virtual eyelash, the virtual eyelash is displayed on the growth surface model based on the guide curve corresponding to the virtual eyelash.
Illustratively, after the adjustment operation on the guide curve corresponding to the virtual eyelashes is finished, the user can click on the making panel of the hair element to determine, and then the target application program renders and displays the corresponding virtual eyelashes on the growth surface model according to the guide curve corresponding to the virtual eyelashes.
Referring to fig. 11, a schematic display diagram of a rendering result of a hair element is shown, where a virtual eyelash 1102 is a rendering result of a guide curve corresponding to the virtual eyelash on a growth surface model.
In summary, the method for displaying virtual elements according to the embodiment of the present application receives the operation of generating the curve on the growth surface model, displays the control curve on the growth surface model, and generates the guide curve corresponding to the hair element according to the control curve, thereby displaying the hair element on the growth surface model. The control curve is used for providing a basic hair element generation template for a producer, the producer can adjust the hair elements on the basis, and the adjustment process is based on parameters or modification of a guiding curve, so that the steps of generating the hair elements are reduced, and the generation efficiency of the hair elements is improved.
According to the method provided by the embodiment of the application, the bending degree of the virtual eyelashes generated on the growth surface model is automatically controlled and adjusted based on the first control curve, so that the generation efficiency of the virtual eyelashes is improved, and meanwhile, the element granularity of the generated virtual eyelashes is improved.
Referring to fig. 17, a flowchart of a method for generating virtual elements according to an embodiment of the present application is shown, where the method includes the following steps:
s1701: input hair generation tools.
I.e. the growth surface model is input into the hair-generating tool. Wherein the hair-generating tool is operable to generate a virtual eyebrow and a virtual eyelash.
Alternatively, a model of the growing surface or head on which eyebrows and eyelashes are to be grown is input, and then the curve in the view is moved to the right front of the model.
S1702: editing the hair control curve.
That is, the control curve of the virtual eyebrow is edited in the hair generating tool, and the control curve of the virtual interface is edited.
Optionally, modifying the control curve to a correct position, wherein the control curve is automatically projected to the surface of the model, and illustratively, for the eyebrows, the eyebrows are generated in the area formed by the closed curve in the control curve projected on the surface of the model, and the growth curve in the control curve is modified to control the growth direction of the eyebrows; for eyelashes, eyelashes are generated at the position where the control curve is projected on the model surface, and the control curve can control the growth position of the eyelashes.
For specific steps, reference may be made to steps 601 to 605 and steps 1201 to 1206, which are not described herein.
S1703: parameters are set.
That is, in the hair-generating tool, the parameters corresponding to the control curve of the virtual eyebrow are modified, and the control curve of the virtual eyelash is modified. Illustratively, by control of the parameter panel, the length, width, density, angle of curvature, tuft effect, etc. of the hair can be adjusted.
For specific steps, reference may be made to steps 601 to 605 and steps 1201 to 1206, which are not described herein.
S1704: and outputting the hair map.
That is, the adjusted virtual eyebrows and virtual eyelashes are rendered and displayed, and a map is generated and outputted.
Alternatively, three-dimensional mesh data of the hair may also be output, for example: the fbx suffix file can be directly imported into a virtual engine for editing; the file that can output hair, for example: and (3) an animation model file format of the abc suffix. The virtual element generating method provided by the embodiment of the application can output virtual element rendering effects of various files or mapping formats, is convenient for cross-platform production, and is applicable to both game roles and computer graphics (Computer Graphics, CG) writing roles.
Referring to fig. 18, a block diagram of a virtual element generating apparatus according to an exemplary embodiment of the present application is shown, where the apparatus includes the following modules:
a display module 1800 for displaying a growth surface model of hair elements, the growth surface model being a three-dimensional model to be subjected to hair generation;
a curve generation module 1810 for displaying a control curve on the growth surface model in response to receiving a curve generation operation on the growth surface model, the control curve being used to determine a generation state of the hair element on the growth surface model;
the display module 1800 is further configured to display a guide curve corresponding to the hair element based on the control curve, where the guide curve is used to adjust a specified display parameter for the three-dimensional form of the hair element;
a determination module 1820 for displaying the hair elements on the growth surface model based on the guide curve in response to receiving a confirmation operation of the guide curve.
Referring to fig. 19, in some alternative embodiments, the control curve includes a first control curve, where the first control curve corresponds to a closed region; the display module 1800 is further configured to determine, according to a position of a closed area surrounded by the first control curve, a target area of the hair element in the growth surface model, where the target area is an area where the closed area is projected onto the growth surface model; the display module 1800 is further configured to display the guide curve on the target area.
In some optional embodiments, the display module 1800 is further configured to determine a curve length of the guide curve displayed on a second location point in the target area according to a distance between a first location point in the closed area and an edge of the closed area, where the second location point is a location point where the first location point is projected onto the growth surface model; the display module 1800 is further configured to display the guide curve on the target area based on a curve length of the guide curve.
In some optional embodiments, the display module 1800 is further configured to determine, according to a distance between each point in a first sub-area in the closed area and an edge of the closed area, a density of the guide curve displayed in a second sub-area in the target area, where the second sub-area is an area where the first sub-area is projected onto the growth surface model; the display module 1800 is further configured to display the guide curve on the target area based on a density of the guide curve.
In some optional embodiments, the display module 1800 is further configured to display a parameter panel of the target area, where the parameter panel is configured to adjust a curve parameter of the guide curve generated in the target area; the display module 1800 is further configured to display the guide curve on the target area in response to receiving a parameter adjustment operation on the parameter panel for the target area.
In some alternative embodiments, the hair element comprises a virtual eyebrow, the control curve comprises a second control curve for determining a direction of generation and a curved state of the virtual eyebrow; the display module 1800 is further configured to determine an eyebrow guiding curve corresponding to the virtual eyebrow based on the first control curve; the display module 1800 includes:
an adjusting unit 1801, configured to adjust a generating direction and a bending state of the eyebrow guiding curve based on the second control curve, and take the adjusted eyebrow guiding curve as a guiding curve corresponding to the virtual eyebrow;
the display module 1800 is further configured to display a guiding curve corresponding to the virtual eyebrow.
In some optional embodiments, the adjusting unit 1801 is configured to determine, as a target tangent point, a point on the second control curve corresponding to a minimum distance from among distances of the eyebrow guiding curves from each point on the second control curve; the adjusting unit 1801 is configured to adjust a generating direction of the eyebrow guiding curve in a target direction with an eyebrow root in the eyebrow guiding curve as an origin, where the target direction is a direction opposite to a tangential line of the second control curve with respect to the target tangential point.
In some optional embodiments, the adjusting unit 1801 is configured to determine a bending angle of each point on the eyebrow guiding curve based on a distance between each point on the eyebrow guiding curve and the root of the eyebrow; the adjusting unit 1801 is configured to bend the eyebrow guiding curve in a direction pointing to the target tangent point based on the bending angles of the respective points on the eyebrow guiding curve.
In some alternative embodiments, the hair element comprises a virtual eyelash, and the first control curve comprises an upper eyelash control curve and a lower eyelash control curve; the display module 1800 is further configured to display, on the basis of the upper eyelash control curve and the lower eyelash control curve, an upper eyelash guide curve and a lower eyelash guide curve corresponding to the virtual eyelash in the target area; the adjusting unit 1801 is configured to rotate the upper eyelash guiding curve upwards according to a first preset angle, with the root of the upper eyelash guiding curve as an origin and the root of the upper eyelash guiding curve as an axis in a tangential direction of the growth surface model; the root of the lower eyelash guiding curve is taken as an origin, the tangential direction of the root of the lower eyelash guiding curve on the growing surface model is taken as an axis, and the lower eyelash guiding curve is rotated downwards according to a second preset angle; the adjusting unit 1801 is configured to take the upper eyelash guiding curve and the lower eyelash guiding curve after rotation as guiding curves corresponding to the virtual eyelashes.
In some optional embodiments, the adjusting unit 1801 is configured to rotate the upper eyelash guiding curve randomly to the left or right according to a third preset angle, with a root of the upper eyelash guiding curve as an origin, and a cross product of the root of the upper eyelash guiding curve in a tangential direction and a vertical upward direction on the growth surface model as an axis; the adjusting unit 1801 is configured to randomly rotate the lower eyelash guiding curve to the left or right according to a fourth preset angle, with a result of a cross multiplication of the root of the lower eyelash guiding curve in a tangential direction and a vertical upward direction on the growing surface model being an axis.
In summary, the virtual element generating device provided by the embodiment of the present application displays the control curve on the growth surface model by receiving the curve generating operation on the growth surface model, and generates the guide curve corresponding to the hair element according to the control curve, thereby displaying the hair element on the growth surface model. The control curve is used for providing a basic hair element generation template for a producer, the producer can adjust the hair elements on the basis, and the adjustment process is based on parameters or modification of a guiding curve, so that the steps of generating the hair elements are reduced, and the generation efficiency of the hair elements is improved.
It should be noted that: the virtual element generating device provided in the above embodiment is only exemplified by the division of the above functional modules, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the device and the method for generating the virtual element provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the device and the method embodiment are detailed in the foregoing embodiments, and are not repeated herein.
Fig. 20 shows a block diagram of a computer device 2000 provided by an exemplary embodiment of the present application. The computer device 2000 may be: a smart phone, a tablet computer, a dynamic video expert compression standard audio layer 3 player (Moving Picture Experts Group Audio Layer III, MP 3), a dynamic video expert compression standard audio layer 4 (Moving Picture Experts Group Audio Layer IV, MP 4) player, a notebook computer, or a desktop computer. The computer device 2000 may also be referred to by other names as user device, portable computer device, laptop computer device, desktop computer device, etc.
Generally, the computer device 2000 includes: a processor 2001 and a memory 2002.
Processor 2001 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so forth. The processor 2001 may be implemented in hardware in at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA). Processor 2001 may also include a main processor, which is a processor for processing data in an awake state, also called a central processor (Central Processing Unit, CPU), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 2001 may integrate an image processor (Graphics Processing Unit, GPU) for rendering and rendering of content required to be displayed by the display screen. In some embodiments, the processor 2001 may also include an artificial intelligence (Artificial Intelligence, AI) processor for processing computing operations related to machine learning.
Memory 2002 may include one or more computer-readable storage media, which may be non-transitory. Memory 2002 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 2002 is used to store at least one instruction for execution by processor 2001 to implement the method of generating virtual elements provided by the method embodiments of the present application.
Illustratively, the computer device 2000 also includes other components, and those skilled in the art will appreciate that the structure illustrated in FIG. 20 is not limiting of the computer device 2000, and may include more or fewer components than illustrated, or may combine certain components, or employ a different arrangement of components.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program for instructing related hardware, and the program may be stored in a computer readable storage medium, which may be a computer readable storage medium included in the memory of the above embodiments; or may be a computer-readable storage medium, alone, that is not assembled into a computer device. The computer readable storage medium stores at least one instruction, at least one program, a code set, or an instruction set, where the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the method for generating a virtual element according to any one of the foregoing embodiments.
Alternatively, the computer-readable storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), solid state disk (SSD, solid State Drives), or optical disk, etc. The random access memory may include resistive random access memory (ReRAM, resistance Random Access Memory) and dynamic random access memory (DRAM, dynamic Random Access Memory), among others. The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments of the present application is not intended to limit the application, but rather, the application is to be construed as limited to the appended claims.

Claims (14)

1. A method of generating a virtual element, the method comprising:
Displaying a growth surface model of a hair element, the growth surface model being a three-dimensional model to be subjected to hair generation;
in response to receiving a curve generation operation on the growth surface model, displaying a control curve on the growth surface model, the control curve being used to determine a generation state of the hair element on the growth surface model;
displaying a guide curve corresponding to the hair element based on the control curve, wherein the guide curve is used for adjusting specified display parameters of the three-dimensional form of the hair element;
in response to receiving a confirmation operation of the guide curve, the hair elements on the growth surface model are displayed based on the guide curve.
2. The method of claim 1, wherein the control curve comprises a first control curve, the first control curve corresponding to a closed region;
the displaying the guiding curve corresponding to the hair element based on the control curve comprises the following steps:
determining a target area of the hair element in the growth surface model according to the position of a closed area surrounded by the first control curve, wherein the target area is an area of the closed area projected onto the growth surface model;
Displaying the guide curve on the target area.
3. The method of claim 2, wherein the displaying the guide curve on the target area comprises:
determining the curve length of the guide curve displayed on a second position point in the target area according to the distance between the first position point in the closed area and the edge of the closed area, wherein the second position point is a position point of the first position point projected onto the growth surface model;
the guide curve is displayed on the target area based on a curve length of the guide curve.
4. The method of claim 2, wherein the displaying the guide curve on the target area comprises:
determining the density of the guide curve displayed in a second subarea in the target area according to the distance between each point in the first subarea in the closed area and the edge of the closed area, wherein the second subarea is the area of the first subarea projected onto the growth surface model;
the guide curve is displayed on the target area based on the density of the guide curve.
5. The method of claim 2, wherein the displaying the guide curve on the target area comprises:
a parameter panel for displaying the target area, wherein the parameter panel is used for adjusting curve parameters of the guide curve generated in the target area;
the guide curve is displayed on the target area in response to receiving a parameter adjustment operation on the parameter panel for the target area.
6. The method according to any one of claims 2 to 5, wherein the hair element comprises a virtual eyebrow, and the control curve comprises a second control curve for determining a direction of generation and a curved state of the virtual eyebrow;
the displaying the guiding curve corresponding to the hair element based on the control curve comprises the following steps:
based on the first control curve, determining an eyebrow guiding curve corresponding to the virtual eyebrow;
based on the second control curve, adjusting the generation direction and the bending state of the eyebrow guiding curve, and taking the adjusted eyebrow guiding curve as a guiding curve corresponding to the virtual eyebrow;
and displaying the guide curve corresponding to the virtual eyebrow.
7. The method according to claim 6, wherein adjusting the direction of generation of the eyebrow guide curve based on the second control curve comprises:
determining a point on the second control curve corresponding to the minimum distance in the distances between each point on the second control curve and the eyebrow guiding curve as a target tangent point;
and adjusting the generation direction of the eyebrow guiding curve towards a target direction by taking the root of the eyebrow in the eyebrow guiding curve as an origin, wherein the target direction is the opposite direction of the tangential line of the target tangential point on the second control curve.
8. The method according to claim 6, wherein said adjusting the curvature of the eyebrow guide curve based on the second control curve comprises:
determining bending angles of all points on the eyebrow guiding curve based on the distances between all points on the eyebrow guiding curve and the root of the eyebrow;
and bending the eyebrow guiding curve according to the bending angles of all points on the eyebrow guiding curve and the direction pointing to the target tangent point.
9. The method of any one of claims 2 to 5, wherein the hair element comprises a virtual eyelash and the first control curve comprises an upper eyelash control curve and a lower eyelash control curve;
The displaying the guiding curve corresponding to the hair element based on the control curve comprises the following steps:
displaying an upper eyelash guiding curve and a lower eyelash guiding curve corresponding to the virtual eyelashes in the target area based on the upper eyelash control curve and the lower eyelash control curve;
taking the root of the upper eyelash guiding curve as an origin, and taking the tangential direction of the root of the upper eyelash guiding curve on the growing surface model as an axis, and rotating the upper eyelash guiding curve upwards according to a first preset angle; the root of the lower eyelash guiding curve is taken as an origin, the tangential direction of the root of the lower eyelash guiding curve on the growing surface model is taken as an axis, and the lower eyelash guiding curve is rotated downwards according to a second preset angle;
taking the upper eyelash guiding curve and the lower eyelash guiding curve after rotation as guiding curves corresponding to the virtual eyelashes;
and displaying the guide curve corresponding to the virtual eyelashes.
10. The method according to claim 9, wherein the method further comprises:
taking the root of the upper eyelash guiding curve as an origin, taking the cross multiplication result of the root of the upper eyelash guiding curve in the tangential direction and the vertical upward direction on the growing surface model as an axis, and randomly rotating the upper eyelash guiding curve leftwards or rightwards according to a third preset angle;
Taking the root of the lower eyelash guiding curve as an origin, taking the cross multiplication result of the root of the upper eyelash guiding curve in the tangential direction and the vertical upward direction on the growing surface model as an axis, and randomly rotating the lower eyelash guiding curve leftwards or rightwards according to a fourth preset angle.
11. A virtual element generation apparatus, the apparatus comprising:
a display module for displaying a growth surface model of hair elements, the growth surface model being a three-dimensional model to be subjected to hair generation;
a curve generation module for displaying a control curve on the growth surface model in response to receiving a curve generation operation on the growth surface model, the control curve being used to determine a generation state of the hair elements on the growth surface model;
the display module is further used for displaying a guide curve corresponding to the hair element based on the control curve, and the guide curve is used for adjusting specified display parameters of the three-dimensional form of the hair element;
a determination module for displaying the hair elements on the growth surface model based on the guide curve in response to receiving a confirmation operation of the guide curve.
12. A computer device comprising a processor and a memory, wherein the memory has stored therein at least one program that is loaded and executed by the processor to implement the method of generating a virtual element according to any one of claims 1 to 10.
13. A computer readable storage medium having stored therein at least one program code loaded and executed by a processor to implement a method of generating a virtual element as claimed in any one of claims 1 to 10.
14. A computer program product comprising a computer program which, when executed by a processor, implements a method of generating a virtual element as claimed in any one of claims 1 to 10.
CN202211241171.4A 2022-10-11 2022-10-11 Virtual element generation method, device, equipment, medium and program product Pending CN116993871A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211241171.4A CN116993871A (en) 2022-10-11 2022-10-11 Virtual element generation method, device, equipment, medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211241171.4A CN116993871A (en) 2022-10-11 2022-10-11 Virtual element generation method, device, equipment, medium and program product

Publications (1)

Publication Number Publication Date
CN116993871A true CN116993871A (en) 2023-11-03

Family

ID=88530823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211241171.4A Pending CN116993871A (en) 2022-10-11 2022-10-11 Virtual element generation method, device, equipment, medium and program product

Country Status (1)

Country Link
CN (1) CN116993871A (en)

Similar Documents

Publication Publication Date Title
US11783461B2 (en) Facilitating sketch to painting transformations
US10657652B2 (en) Image matting using deep learning
Ji et al. Easy mesh cutting
US10977844B2 (en) Presenting multiple image segmentations
CN110766776B (en) Method and device for generating expression animation
US20140085293A1 (en) Method of creating avatar from user submitted image
CN107180446A (en) The expression animation generation method and device of character face's model
US11010932B2 (en) Method and apparatus for automatic line drawing coloring and graphical user interface thereof
Ijiri et al. Seamless integration of initial sketching and subsequent detail editing in flower modeling
US10109083B2 (en) Local optimization for curvy brush stroke synthesis
US10964083B1 (en) Facial animation models
JP2023029984A (en) Method, device, electronic apparatus, and readable storage medium for generating virtual image
CN114266695A (en) Image processing method, image processing system and electronic equipment
CN113362263A (en) Method, apparatus, medium, and program product for changing the image of a virtual idol
AU2019200269B2 (en) An interactive user interface and its corresponding engine for improving image completion quality
CN116993871A (en) Virtual element generation method, device, equipment, medium and program product
US20190392653A1 (en) Method and apparatus for sculpting a 3d model
CN113409465B (en) Hair model generation method and device, storage medium and electronic equipment
Liu et al. Interactive modeling of trees using VR devices
CN114549709A (en) User-defined 3D virtual image generation system and method
US10586311B2 (en) Patch validity test
US11816797B1 (en) Rapid generation of three-dimensional characters
US11783516B2 (en) Method for controlling digital feather generations through a user interface in a computer modeling system
Ostrovka et al. A Method for Modifying the Geometry of 3D Surfaces in USDZ Format with Further Implementation in the SceneKit Game Engine.
Jo et al. Generative AI and Building Design: Early Photorealistic Render Visualization of Façades using Local Identity-trained Models

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