CN112529996B - Method and device for generating model and electronic equipment - Google Patents

Method and device for generating model and electronic equipment Download PDF

Info

Publication number
CN112529996B
CN112529996B CN202011491962.3A CN202011491962A CN112529996B CN 112529996 B CN112529996 B CN 112529996B CN 202011491962 A CN202011491962 A CN 202011491962A CN 112529996 B CN112529996 B CN 112529996B
Authority
CN
China
Prior art keywords
model
sub
normal direction
normal
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011491962.3A
Other languages
Chinese (zh)
Other versions
CN112529996A (en
Inventor
刘昱成
唐翌珏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202011491962.3A priority Critical patent/CN112529996B/en
Publication of CN112529996A publication Critical patent/CN112529996A/en
Application granted granted Critical
Publication of CN112529996B publication Critical patent/CN112529996B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/506Illumination models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Processing Or Creating Images (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a method, a device and electronic equipment for generating a model; wherein the method comprises the following steps: obtaining a plurality of sub-models of the target model; a plurality of sub-models form a target model; responding to a normal line adjusting instruction aiming at the sub-model, and adjusting the normal line direction of the sub-model; the normal direction of the sub-model is associated with the normal direction of the model face in the sub-model; and generating a target model based on the adjusted sub-model. In the mode, the target model is divided into a plurality of sub-models to be manufactured respectively, then the normal direction is adjusted by taking the sub-model as a unit, and the normal direction of the model can be flexibly changed by adjusting the normal of the sub-model relative to the mode of integrally resetting the normal, so that the model is more in line with the form of an object in the real world, and the problem of unnatural illumination brightness change is avoided; compared with the mode of adjusting the model surface by model surface, the method for adjusting the normal line of the submodel has lower cost of labor and time, is easy to realize and has controllable adjusting effect due to the limited quantity of the submodels.

Description

Method and device for generating model and electronic equipment
Technical Field
The present invention relates to the field of three-dimensional model technologies, and in particular, to a method and an apparatus for generating a model, and an electronic device.
Background
In a game scene or other three-dimensional scene, the illumination display effect of the model can be affected by the normal direction of the model surface. Especially for plant models, the blades in the plant model are numerous, the angles of the blades are different, and the normal direction should also be different. If the normal direction is unreasonable, the model can generate unnatural and unreasonable illumination brightness change in the scene, and the model has a far difference with the actual plant illumination effect. In the related art, after the model is manufactured, normal lines of all surfaces in the model are disordered, the mode of integrally resetting the normal lines can only adjust the average value of all normal lines of the model, the normal line direction cannot represent the real orientation of the blade, and the problem that illumination brightness change is unnatural is easily generated; in order to improve the display effect, the normal direction of each blade is usually required to be manually adjusted in the related art, which results in high time and labor cost and undesirable final effect of the model.
Disclosure of Invention
In view of the above, the present invention aims to provide a method, an apparatus and an electronic device for generating a model, so as to avoid the problem that the model generates unnatural illumination brightness variation, and reduce the time and labor cost of normal adjustment.
In a first aspect, an embodiment of the present invention provides a method for generating a model, where the method includes: obtaining a plurality of sub-models of the target model; a plurality of sub-models form a target model; responding to a normal line adjusting instruction aiming at the sub-model, and adjusting the normal line direction of the sub-model; the normal direction of the sub-model is associated with the normal direction of the model face in the sub-model; and generating a target model based on the adjusted sub-model.
The step of obtaining a plurality of sub-models of the target model includes: and generating a plurality of sub-models based on the structural attributes of the real object corresponding to the target model.
The object model comprises a plant model; the structural attribute of the real object corresponding to the target model comprises the growth structure of the real plant corresponding to the plant model.
The sub-model includes one or more of the following: trunk model, branch model, leaf model, flower model, and fruit model.
The normal direction of the submodel includes: the mean direction of the normal direction of the mold surface in the sub-model.
The step of adjusting the normal direction of the sub-model in response to the normal direction adjustment instruction for the sub-model includes: responding to a normal direction adjustment instruction aiming at the sub-model, and extracting a direction value of a normal direction from the normal direction adjustment instruction; the normal direction of the sub-model is adjusted to the direction indicated by the direction value.
The step of generating the target model based on the adjusted sub-model includes: in response to a position adjustment operation for the sub-model, placing the sub-model at a position indicated by the position adjustment operation; and combining the multiple sub-models to obtain the target model.
Each model surface in the target model is provided with a mark; the marks of the model surfaces belonging to the same sub-model are divided into the same model surface group; after the step of merging the plurality of sub-models to obtain the target model, the method further comprises the following steps: and updating the normal direction of the sub-model corresponding to the first die surface group in response to a normal direction updating instruction for the first die surface group in the target model.
The step of generating the target model based on the adjusted sub-model includes: and in response to the position adjustment operation for the sub-model, placing the sub-model at the position indicated by the position adjustment operation to obtain the target model.
In a second aspect, an embodiment of the present invention provides an apparatus for generating a model, where the apparatus includes: the model acquisition module is used for acquiring a plurality of sub-models of the target model; a plurality of sub-models form a target model; the direction adjusting module is used for responding to a normal line adjusting instruction aiming at the sub-model and adjusting the normal line direction of the sub-model; wherein the normal direction of the sub-model is associated with the normal direction of the model face in the sub-model; and the model generation module is used for generating a target model based on the adjusted sub model.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, where the memory stores machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the method for generating a model described above.
In a fourth aspect, embodiments of the present invention provide a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the method of generating a model described above.
The embodiment of the invention has the following beneficial effects:
the method, the device and the electronic equipment for generating the model firstly acquire a plurality of sub-models which can form a target model, respond to a normal line adjusting instruction aiming at the sub-models and adjust the normal line direction of the sub-models; and generating a target model based on the adjusted sub-model. In the mode, the target model is divided into a plurality of sub-models to be manufactured respectively, then the normal direction is adjusted by taking the sub-model as a unit, and the normal direction of the model can be flexibly changed by adjusting the normal of the sub-model relative to the mode of integrally resetting the normal, so that the model is more in line with the form of an object in the real world, and the problem of unnatural illumination brightness change is avoided; compared with the mode of adjusting the model surface by model surface, the method for adjusting the normal line of the submodel has lower cost of labor and time, is easy to realize and has controllable adjusting effect due to the limited quantity of the submodels.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are some embodiments of the invention and that other drawings may be obtained from these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for generating a model according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a sub-model of a plant model according to an embodiment of the present invention;
FIG. 3 is a schematic view of a normal line of a sub-model of a plant model according to an embodiment of the present invention;
FIG. 4 is a schematic view of a normal line of a sub-model of another plant model according to an embodiment of the present invention;
FIG. 5 is a schematic view showing the effect of a leaf plant model according to an embodiment of the present invention;
FIG. 6 is a schematic view showing the effect of another leaf plant model according to the embodiment of the present invention;
fig. 7 is a schematic structural diagram of a device for generating a model according to an embodiment of the present invention;
fig. 8 is a schematic diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the related art, in order to adjust the illumination brightness display effect of the model, on one hand, after the model is manufactured, the chaotic normal line can be integrally reset, and because normal line trends of different structures or different parts of the model are generally different, the integral reset mode can influence the artistic effect of the model in the engine, and is also unfavorable for correctly expressing the model material. On the other hand, the normal line of each molding surface of the model can be manually adjusted, and the normal line of each blade can be adjusted by taking a plant model as an example; however, these methods are difficult to obtain a true and reasonable light and shade display effect of the model.
Based on the above problems, the inventors found in the study that, in the model making process in the related art, most of the models are made as a whole, so that the normal line of the model can only be reset as a whole, or the model surface can be adjusted one by one; in order to facilitate the adjustment of the normal, in this embodiment, the model making process may be changed, the models may be made in groups or in regions to obtain a plurality of sub-models, and then an overall model may be obtained based on the sub-models, so that the normal may be adjusted in units of the sub-models, and the normal direction of the model may be flexible and changeable by adjusting the normal of the sub-models with respect to the overall resetting manner, so as to more conform to the shape of the object in the real world; compared with the mode of adjusting the model surface by model surface, the method for adjusting the normal line of the submodel has lower cost of labor and time, is easy to realize and has controllable adjusting effect due to the limited quantity of the submodels.
Based on the above, the method, the device and the electronic equipment for generating the model provided by the embodiment of the invention can be applied to a three-dimensional model making process in a three-dimensional game scene or other scenes, and particularly can be applied to a plant model or other models with complex-oriented model surfaces.
Referring to a method of generating a model shown in fig. 1, the method comprises the steps of:
step S102, a plurality of sub-models of a target model are obtained; wherein the plurality of sub-models form a target model;
each sub-model may be specifically fabricated by three-dimensional modeling software. Before making sub-models, reasonable division is needed for the target model to be generated so as to define the appearance of each sub-model; and all the sub-models can form a target model so that a complete target model can be obtained by combining a plurality of sub-models.
Step S104, responding to a normal line adjusting instruction for the sub-model, and adjusting the normal line direction of the sub-model; wherein the normal direction of the sub-model is associated with the normal direction of the model face in the sub-model;
the above-described normal adjustment instruction may be triggered for each sub-model to which the normal line needs to be adjusted, and may include an adjustment amplitude of the normal line direction, or a direction to which the normal line needs to be adjusted. The normal line adjustment instruction adjusts the normal line direction of the submodel. The normal direction, which is understood to define the vector of the direction in which a face or vertex points, indicates the front or outer curved surface of the face or vertex, and a vector perpendicular to the face in which the point lies.
Typically, the sub-model consists of a plurality of model faces, each model face facing a normal direction; the normal direction of the sub-model is associated with the normal direction of part or all of the mold surfaces within the sub-model; if the normal direction of the sub-model is associated with the normal direction of all mold surfaces within the sub-model, the normal direction of the sub-model may be determined based on the normal direction of all mold surfaces. If the normal direction of the sub-model is associated with the normal direction of the partial mold surface in the sub-model, the partial mold surface can be screened from all mold surfaces in the sub-model, and then the normal direction of the sub-model is determined based on the screened normal direction of the partial mold surface. Specifically, the normal direction of the sub-model can be calculated by the normal direction of part or all of the molding surfaces in the sub-model, for example, the normal direction of the sub-model is the average direction of the normal directions of the molding surfaces in the sub-model; the normal direction of the submodel can be the average direction of the normal directions of all the molding surfaces in the submodel, and can also be the average direction of the normal directions of part of the molding surfaces in the submodel; of course, the normal direction of the mold surface in the submodel may be obtained by performing calculation processing on the normal direction of the mold surface in the submodel in other calculation manners.
Step S106, generating a target model based on the adjusted sub model.
After the normal direction of the sub model is adjusted, a target model can be generated through the sub model. In particular, the relative positions of the sub-models can be adjusted, but the relative independence among the sub-models is maintained, and a target model can be formed relatively completely in a visual sense; in addition, a merging function or an attach function in the model creation software may be adopted to merge a plurality of sub-models into one model, that is, the above-described target model, and the target model at this time is a complete model.
The method for generating the model comprises the steps of firstly, obtaining a plurality of sub-models which can form a target model, responding to a normal line adjusting instruction aiming at the sub-models, and adjusting the normal line direction of the sub-models; and generating a target model based on the adjusted sub-model. In the mode, the target model is divided into a plurality of sub-models to be manufactured respectively, then the normal direction is adjusted by taking the sub-model as a unit, and the normal direction of the model can be flexibly changed by adjusting the normal of the sub-model relative to the mode of integrally resetting the normal, so that the model is more in line with the form of an object in the real world, and the problem of unnatural illumination brightness change is avoided; compared with the mode of adjusting the model surface by model surface, the method for adjusting the normal line of the submodel has lower cost of labor and time, is easy to realize and has controllable adjusting effect due to the limited quantity of the submodels.
The manner in which the plurality of sub-models are obtained is described in detail below. Before an engineer makes a sub-model of a target model, dividing a real object corresponding to the target model; since the normal is adjusted in units of sub-models, regions divided into the same sub-model need to have similar illumination properties in order to make normal adjustment to the normal in the sub-model, while enabling the normal to reflect the orientation of the object as truly as possible.
Based on the above purpose, the structural attribute of the real object corresponding to the target model can be considered when the sub-model is divided; typically, areas of the same structure, the appearance of which has similar illumination properties; therefore, based on the structural attribute of the real object corresponding to the target model, a plurality of sub-models are generated, so that the illumination attribute of the model surfaces in the same sub-model is similar, the trend of the normal direction is similar, the normal direction is convenient to be uniformly adjusted, and the illumination brightness effect is displayed as truly as possible.
Specifically, the structural properties of the real object itself may indicate which parts the real object may be divided into, each part may be used as a sub-model; if the volume or occupied area of a portion is large, the portion may also be divided into a plurality of sub-portions, each sub-portion acting as a sub-model. After the sub-model is divided, each sub-model can be manufactured by model manufacturing software.
Taking a plant model as an example, when the target model includes a plant model, the structural attribute of the real object corresponding to the target model includes a growth structure of the real plant corresponding to the plant model. The growing structure of a real plant generally includes roots, trunks, branches, leaves, flowers, fruits, etc.; for a particular plant, all or part of the above-described growth structures may be included, as well as other growth structures. Thus, for plant models, the sub-models partitioned include one or more of the following: trunk model, branch model, leaf model, flower model, and fruit model. The growth structure based on the plant model divides the sub-model, and in the subsequent adjustment of the normal of the sub-model, the orientation of the region corresponding to the sub-model can be accurately simulated based on the attributes such as the real appearance, the material, the position and the like of the growth structure corresponding to the model, so that the light and shade effects of the region can be accurately displayed, and meanwhile, the correct expression of the appearance materials of different structures is facilitated.
FIG. 2 is an example of a plant model; the plant model is a model of pine tree; the model is divided into three sub-models, namely, a leaf model, a trunk model and a branch model, according to the growth structure of pine, as shown in fig. 2. FIG. 3 is a schematic view of the normal of each sub-model; wherein the model surface of the blade model is the most, so that the normals are more dense; as can be seen from fig. 3, the normal trends belonging to the same sub-model have a certain similarity, while the normal trends of different sub-models have a larger difference. In addition, if the blade model is larger, the blade model may be further divided, as shown in fig. 4, into two or more sub-models to adjust the normal direction of the divided regions of the blade model; similarly, if the trunk model or the branch model is large, the trunk model or the branch model can be divided into a plurality of sub-models, so that the normal direction can be accurately adjusted according to the positions, the forms and the like of different sub-models.
The manner of adjusting the normal direction in units of submodels will be described below taking a plant model as an example. Assuming that a plant model comprises a leaf A, a leaf B, a branch A and a branch B; wherein, the normal direction of the blade A is 45 degrees towards south, the normal direction of the blade B is 60 degrees towards south, the normal direction of the branch A is 20 degrees towards north, and the normal direction of the branch B is 30 degrees towards north; it can be seen that the normal directions of the blade a and the blade B have similar tendencies, while the normal directions of the branch a and the branch B have similar tendencies. If the normal directions of the blade a, the blade B, the branch a, and the branch B are adjusted in an overall reset manner, it is necessary to adjust the average direction of the normal directions of the blade a, the blade B, the branch a, and the branch B, for example, the average direction is 80 degrees toward north; the normal directions of the blade A, the blade B, the branch A and the branch B are adjusted by adjusting the average value direction; however, since the direction trends of the normals of the blade and the branch are different, the normals of the blade and the branch are mutually bound, and the blade and the branch are difficult to adjust to an ideal direction in the mode.
If the sub-model is divided, the blade a and the blade B may be divided into sub-models 1 and the branch a and the branch B may be divided into sub-models 2; by adjusting the normal direction of the submodel 1, the normal directions of the blade A and the blade B can be arbitrarily adjusted without being bound by the normal directions of the branches; meanwhile, as the normal direction trend of the blade A and the normal direction trend of the blade B are similar, the blade can be adjusted to an ideal direction by adjusting the normal direction of the blade A and the normal direction of the blade B together through the submodel 1, and the tedious operation of adjusting the blades one by one is avoided; similarly, by adjusting the normal direction of the sub-model 2, the normal directions of the branch A and the branch B can be adjusted at will without being bound by the normal direction of the blade; meanwhile, as the normal directions of the branches A and the branches B are similar in trend, the branches can be adjusted to an ideal direction by adjusting the normal directions of the branches A and the branches B together through the submodel 2, and the tedious operation of adjusting the branches one by one is avoided.
The target model may also be other models, such as an animal model, a building model, etc.; taking a building model as an example, if the number of model surfaces of the building model is large, the angle and position distribution of the model surfaces are complex, and a plurality of sub-models are needed to be divided in advance; taking a high tower as an example, the tower can be divided into a plurality of sub-models according to the height, the direction or the structure among tower layers of the tower, and after each sub-model is manufactured, the normal direction of the sub-model is adjusted.
After the sub-model is manufactured, the normal direction of the sub-model needs to be adjusted; the normal direction can be adjusted for each sub-model, or only the normal direction of part of the sub-models can be adjusted according to the service requirement. For a sub-model requiring adjustment of the normal direction, an engineer needs to issue a normal direction adjustment instruction for the sub-model, and then respond to the normal direction adjustment instruction for the sub-model to extract a direction value of the normal direction from the normal direction adjustment instruction; the normal direction of the sub-model is adjusted to the direction indicated by the direction value. Specifically, a direction value of the normal direction can be input through a normal adjustment control in model making software, so that a normal direction adjustment instruction is generated. It should be noted that if the sub-model includes a plurality of mold surfaces, the sub-model also includes a plurality of normals; the normal direction adjustment instruction may be used to adjust the average direction of the normal directions of the plurality of normals in the sub-model.
After the normal direction of the sub-model is adjusted, the sub-model can be placed at the position indicated by the position adjustment operation in response to the position adjustment operation for the sub-model; and combining the multiple sub-models to obtain the target model. And merging the plurality of sub-models after adjustment to obtain a target model. Before the merging process, the relative positions among the sub-models can be adjusted, and the relative positions among the sub-models can be adjusted at will according to service requirements, so that the shape of the target model can be more flexible and changeable, and the shape of a real object can be better simulated.
The above-mentioned combining function can be implemented by using an attach or other model bonding function, and typically, after a plurality of sub-models are combined to obtain a target model, the target model becomes a whole, and the sub-models are not divided inside. If the normal of the target model is required to be adjusted later, the target model is generally required to be reset entirely, or the die surfaces are adjusted one by one, and the ideal effect may not be adjusted.
To avoid the above-described problems, after the sub-model is completed, or before the sub-models are combined, the model faces of one sub-model may be divided into a group. In actual implementation, each model surface in the target model is provided with a mark; the marks of the model surfaces belonging to the same sub-model are divided into the same model surface group; thus, the object model is stored with a plurality of mold surface groups. After the merging processing, the normal direction of the model surfaces corresponding to the marks in the model surface group can be commonly adjusted by selecting one model surface group, and the effect of adjusting the normal by taking the submodel as a unit is the same. The marks of the die surfaces are grouped, so that the subsequent normal adjustment of the die surfaces is facilitated, and the operation is more convenient.
Specifically, after the step of merging the plurality of sub-models to obtain the target model, the normal direction of the sub-model corresponding to the first die surface group is updated in response to an instruction for updating the normal direction of the first die surface group in the target model. The first model surface group can be understood as a model surface group selected by an engineer, and after the first model surface group is selected, a direction value of a normal direction can be input through a related control, so that the normal direction of a sub-model corresponding to the first model surface group is adjusted to be the direction indicated by the direction value.
In addition to the above manner of generating the target model by merging the sub-models, in other manners, the sub-models may not be merged, and a relatively independent state of the sub-models may be maintained; in response to the position adjustment operation for each sub-model, the sub-model is placed at the position indicated by the position adjustment operation, resulting in a target model. In this case, the target model is visually a relatively complete model, but the target model is still substantially divided into a plurality of sub-models, and in this manner, if the normal direction needs to be continuously adjusted subsequently, the adjustment can be directly performed on the sub-model to be adjusted.
Especially for the leaf plant model, the display effect is very easily affected by the normal direction, so that an unnatural light and shade change occurs, and referring to fig. 5, an unnatural darkening effect appears at the position indicated by the white arrow, and after the normal is adjusted in the manner in the foregoing embodiment, the natural and real light and shade effect shown in fig. 6 can be obtained.
In general, the embodiment of the method for generating the model can solve the problem that the model is dark when the model is displayed in an engine, save the model manufacturing time and avoid repeated modification; the method can avoid the influence on the artistic effect of the three-dimensional scene caused by the bright and dark display of the model surface, and is especially beneficial to the artistic expression of the plant material effect. In addition, the method firstly makes the sub model, further generates the target model, improves the making flow of the model, and enables the whole making flow to be more standard and higher in efficiency.
Corresponding to the above method embodiment, referring to fig. 7, a schematic structural diagram of an apparatus for generating a model is shown, where the apparatus includes:
a model acquisition module 70 for acquiring a plurality of sub-models of the target model; a plurality of sub-models form a target model;
a direction adjustment module 72 for adjusting the normal direction of the sub-model in response to a normal adjustment instruction for the sub-model; wherein the normal direction of the sub-model is associated with the normal direction of the model face in the sub-model;
the model generating module 74 is configured to generate a target model based on the adjusted sub-model.
The device for generating the model firstly acquires a plurality of sub-models which can form a target model, responds to a normal line adjusting instruction aiming at the sub-models, and adjusts the normal line direction of the sub-models; and generating a target model based on the adjusted sub-model. In the mode, the target model is divided into a plurality of sub-models to be manufactured respectively, then the normal direction is adjusted by taking the sub-model as a unit, and the normal direction of the model can be flexibly changed by adjusting the normal of the sub-model relative to the mode of integrally resetting the normal, so that the model is more in line with the form of an object in the real world, and the problem of unnatural illumination brightness change is avoided; compared with the mode of adjusting the model surface by model surface, the method for adjusting the normal line of the submodel has lower cost of labor and time, is easy to realize and has controllable adjusting effect due to the limited quantity of the submodels.
The above model acquisition module is further configured to: and generating a plurality of sub-models based on the structural attributes of the real object corresponding to the target model.
The object model comprises a plant model; the structural attribute of the real object corresponding to the target model comprises the growth structure of the real plant corresponding to the plant model.
The sub-model includes one or more of the following: trunk model, branch model, leaf model, flower model, and fruit model.
The normal direction of the submodel includes: the mean direction of the normal direction of the mold surface in the sub-model.
The direction adjustment module is further configured to: responding to a normal direction adjustment instruction aiming at the sub-model, and extracting a direction value of a normal direction from the normal direction adjustment instruction; the normal direction of the sub-model is adjusted to the direction indicated by the direction value.
The model generation module is further used for: in response to a position adjustment operation for the sub-model, placing the sub-model at a position indicated by the position adjustment operation; and combining the multiple sub-models to obtain the target model.
Each model surface in the target model is provided with a mark; the marks of the model surfaces belonging to the same sub-model are divided into the same model surface group; the device further comprises a direction updating module for: and updating the normal direction of the sub-model corresponding to the first die surface group in response to a normal direction updating instruction for the first die surface group in the target model.
The model generation module is further used for: and in response to the position adjustment operation for the sub-model, placing the sub-model at the position indicated by the position adjustment operation to obtain the target model.
The present embodiment also provides an electronic device including a processor and a memory, the memory storing machine executable instructions capable of being executed by the processor, the processor executing the machine executable instructions to implement the method of generating a model described above. The electronic device may be a server or a terminal device.
Referring to fig. 8, the electronic device includes a processor 100 and a memory 101, the memory 101 storing machine executable instructions that can be executed by the processor 100, the processor 100 executing the machine executable instructions to implement the method of generating a model described above.
Further, the electronic device shown in fig. 8 further includes a bus 102 and a communication interface 103, and the processor 100, the communication interface 103, and the memory 101 are connected through the bus 102.
The memory 101 may include a high-speed random access memory (RAM, random Access Memory), and may further include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. The communication connection between the system network element and at least one other network element is implemented via at least one communication interface 103 (which may be wired or wireless), and may use the internet, a wide area network, a local network, a metropolitan area network, etc. Bus 102 may be an ISA bus, a PCI bus, an EISA bus, or the like. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 8, but not only one bus or type of bus.
The processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 100 or by instructions in the form of software. The processor 100 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processor, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and, in combination with its hardware, performs the steps of the method of the previous embodiment.
The present embodiments also provide a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the method of generating a model described above.
The method, the apparatus and the computer program product of the electronic device for generating a model provided in the embodiments of the present invention include a computer readable storage medium storing program codes, where the instructions included in the program codes may be used to execute the method described in the foregoing method embodiment, and specific implementation may refer to the method embodiment and will not be repeated herein.
In addition, in the description of embodiments of the present invention, unless explicitly stated and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention will be understood by those skilled in the art in specific cases.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings, are merely for convenience of describing the present invention and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention for illustrating the technical solution of the present invention, but not for limiting the scope of the present invention, and although the present invention has been described in detail with reference to the foregoing examples, it will be understood by those skilled in the art that the present invention is not limited thereto: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (11)

1. A method of generating a model, the method comprising:
dividing regions with similar illumination attributes into the same sub-model based on the structural attributes of the real object corresponding to the target model to obtain a plurality of sub-models forming the target model;
responding to a normal line adjusting instruction aiming at the sub-model, and adjusting the normal line direction of the sub-model; wherein the sub-model comprises a plurality of molding surfaces, and the normal direction of the sub-model is associated with the normal direction of part or all of the molding surfaces in the sub-model; the normal direction of the sub-model is calculated by the normal direction of the related part or all of the molding surfaces;
and generating the target model based on the adjusted sub model.
2. The method of claim 1, wherein the target model comprises a plant model; the structural attribute of the real object corresponding to the target model comprises a growth structure of the real plant corresponding to the plant model.
3. The method of claim 2, wherein the submodel comprises one or more of: trunk model, branch model, leaf model, flower model, and fruit model.
4. The method of claim 1, wherein the normal direction of the submodel comprises: and the average value direction of the normal direction of part or all of the molding surfaces in the sub-model.
5. The method of claim 1, wherein the step of adjusting the normal direction of the sub-model in response to a normal direction adjustment instruction for the sub-model comprises:
responding to a normal direction adjustment instruction aiming at the submodel, and extracting a direction value of a normal direction from the normal direction adjustment instruction;
and adjusting the normal direction of the submodel to the direction indicated by the direction value.
6. The method of claim 1, wherein the step of generating the target model based on the adjusted sub-model comprises:
in response to a position adjustment operation for the sub-model, placing the sub-model at a position indicated by the position adjustment operation;
and combining the multiple sub-models to obtain the target model.
7. The method of claim 6, wherein each model face in the target model is provided with an identifier; the marks of the model surfaces belonging to the same sub-model are divided into the same model surface group;
after the step of merging the plurality of sub-models to obtain the target model, the method further includes:
and responding to a normal direction updating instruction aiming at a first die surface group in the target model, and updating the normal direction of a sub-model corresponding to the first die surface group.
8. The method of claim 1, wherein the step of generating the target model based on the adjusted sub-model comprises:
and responding to the position adjustment operation aiming at the sub-model, and placing the sub-model at the position indicated by the position adjustment operation to obtain the target model.
9. An apparatus for generating a model, the apparatus comprising:
the model acquisition module is used for dividing the region with similar illumination attribute into the same sub-model based on the structural attribute of the real object corresponding to the target model to obtain a plurality of sub-models forming the target model;
the direction adjusting module is used for responding to a normal line adjusting instruction aiming at the sub-model and adjusting the normal line direction of the sub-model; wherein the sub-model comprises a plurality of molding surfaces, and the normal direction of the sub-model is associated with the normal direction of part or all of the molding surfaces in the sub-model; the normal direction of the sub-model is calculated by the normal direction of the related part or all of the molding surfaces;
and the model generation module is used for generating the target model based on the adjusted sub model.
10. An electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the method of generating a model of any of claims 1-8.
11. A machine-readable storage medium storing machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the method of generating a model of any one of claims 1-8.
CN202011491962.3A 2020-12-16 2020-12-16 Method and device for generating model and electronic equipment Active CN112529996B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011491962.3A CN112529996B (en) 2020-12-16 2020-12-16 Method and device for generating model and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011491962.3A CN112529996B (en) 2020-12-16 2020-12-16 Method and device for generating model and electronic equipment

Publications (2)

Publication Number Publication Date
CN112529996A CN112529996A (en) 2021-03-19
CN112529996B true CN112529996B (en) 2024-02-23

Family

ID=75001083

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011491962.3A Active CN112529996B (en) 2020-12-16 2020-12-16 Method and device for generating model and electronic equipment

Country Status (1)

Country Link
CN (1) CN112529996B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113223153A (en) * 2021-05-21 2021-08-06 网易(杭州)网络有限公司 Tree model processing method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6593924B1 (en) * 1999-10-04 2003-07-15 Intel Corporation Rendering a non-photorealistic image
JP2003331312A (en) * 2002-05-13 2003-11-21 Konami Computer Entertainment Studios Inc Three-dimensional image processing program and method, and video game device
JP2005215724A (en) * 2004-01-27 2005-08-11 Sanyo Electric Co Ltd Texture information generation device
FR3000256A1 (en) * 2012-12-26 2014-06-27 Eads Europ Aeronautic Defence Method for controlling three-dimensional structure to perform non-destructive testing of machine elements in e.g. aeronautics field, involves analyzing images to obtain information of corresponding portion of three-dimensional structure
CN106548455A (en) * 2015-09-17 2017-03-29 三星电子株式会社 For adjusting the apparatus and method of the brightness of image
CN108537868A (en) * 2017-03-03 2018-09-14 索尼公司 Information processing equipment and information processing method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9965893B2 (en) * 2013-06-25 2018-05-08 Google Llc. Curvature-driven normal interpolation for shading applications
US10452788B2 (en) * 2015-08-31 2019-10-22 Autodesk, Inc. Modeling a three-dimensional object having multiple materials
JP7179472B2 (en) * 2018-03-22 2022-11-29 キヤノン株式会社 Processing device, processing system, imaging device, processing method, program, and recording medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6593924B1 (en) * 1999-10-04 2003-07-15 Intel Corporation Rendering a non-photorealistic image
JP2003331312A (en) * 2002-05-13 2003-11-21 Konami Computer Entertainment Studios Inc Three-dimensional image processing program and method, and video game device
JP2005215724A (en) * 2004-01-27 2005-08-11 Sanyo Electric Co Ltd Texture information generation device
FR3000256A1 (en) * 2012-12-26 2014-06-27 Eads Europ Aeronautic Defence Method for controlling three-dimensional structure to perform non-destructive testing of machine elements in e.g. aeronautics field, involves analyzing images to obtain information of corresponding portion of three-dimensional structure
CN106548455A (en) * 2015-09-17 2017-03-29 三星电子株式会社 For adjusting the apparatus and method of the brightness of image
CN108537868A (en) * 2017-03-03 2018-09-14 索尼公司 Information processing equipment and information processing method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种结合法线分布特征的三维模型旋转归一化方法;万丽莉;计算机辅助设计与图形学学报(006);全文 *
在游戏中通过法线映射模拟体积渲染效果;刘贇;;电子技术与软件工程(10);全文 *

Also Published As

Publication number Publication date
CN112529996A (en) 2021-03-19

Similar Documents

Publication Publication Date Title
CN110458930B (en) Rendering method and device of three-dimensional map and storage medium
CN112767522B (en) Virtual object wind animation rendering method and device, storage medium and electronic device
CN109559366A (en) Display method, device, storage medium and equipment for growth process of potted plant
CN110124318B (en) Method and device for making virtual vegetation, electronic equipment and storage medium
CN112529996B (en) Method and device for generating model and electronic equipment
CN112221145A (en) Game face model generation method and device, storage medium and electronic equipment
CN104794750A (en) Tree point cloud three-dimensional reconstruction method based on space colonizing algorithm
CN112206534B (en) Vegetation object processing method, device, equipment and storage medium
CN108959707A (en) A kind of BIM model texture and material method for visualizing based on Unity
CN115888087A (en) Processing method and device of virtual plant model
CN113450441A (en) Rendering method and device of three-dimensional virtual model and electronic equipment
TWI801717B (en) A physical image generation method and device, device, non-transitory computer-readable storage medium and computer program product
JP7436464B2 (en) Generate and display 3D objects
KR101295063B1 (en) Realistic and Real-Time Modeling System and Method thereof
CN111667581A (en) 3D model processing method, device, equipment and storage medium
CN111481936A (en) Virtual model generation method and device, storage medium and electronic device
CN114299221A (en) Mountain rendering method and device and electronic equipment
CN116139492A (en) Vine generation method, device, equipment and storage medium
CN117197310A (en) Special effect rendering method and device and electronic equipment
CN109872280A (en) A kind of denoising of three-dimensional plant blade point cloud and simplified method, apparatus and system
CN115908655B (en) Virtual character facial expression processing method and device
CN117893654A (en) Model data migration method, device, electronic equipment and readable storage medium
CN116452710A (en) Model animation generation method and device and electronic equipment
CN117173302A (en) Plant growth animation generation method and device
CN117668965A (en) Landscape greening model creation method and electronic equipment

Legal Events

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