CN115619929A - Model generation method and device and electronic equipment - Google Patents
Model generation method and device and electronic equipment Download PDFInfo
- Publication number
- CN115619929A CN115619929A CN202211222470.3A CN202211222470A CN115619929A CN 115619929 A CN115619929 A CN 115619929A CN 202211222470 A CN202211222470 A CN 202211222470A CN 115619929 A CN115619929 A CN 115619929A
- Authority
- CN
- China
- Prior art keywords
- model
- noise
- preset
- erosion
- map
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
- G06T17/05—Geographic models
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
- G06T17/20—Finite element generation, e.g. wire-frame surface description, tesselation
- G06T17/205—Re-meshing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T19/00—Manipulating 3D models or images for computer graphics
- G06T19/20—Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Graphics (AREA)
- Geometry (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Remote Sensing (AREA)
- Architecture (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention provides a model generation method, a model generation device and electronic equipment, wherein a preset sphere model is subjected to noise processing based on preset noise parameters to obtain a first model; obtaining a spherical surface map of the first model, and carrying out erosion treatment on the spherical surface map to obtain a second model with an erosion effect; wherein, the spherical map is used for indicating: height information of the first model surface; and setting the second model according to the preset attribute control parameters to obtain the final model. In the method, the spherical model is preset through noise processing to obtain the model surface effect, and the spherical mapping of the model surface effect is subjected to erosion processing to obtain the surface erosion effect, so that the method can automatically generate the model with the surface erosion effect; meanwhile, the mode can control the form of the generated model through the attribute parameters, so that models with different effects are obtained, and the freedom degree of model manufacturing is increased.
Description
Technical Field
The present invention relates to the field of model making technologies, and in particular, to a model generation method and apparatus, and an electronic device.
Background
In a virtual scene containing a planet, in order to ensure the reality of the planet simulation, various types of planet surfaces are generally generated, and the planet surfaces have certain erosion details. In the related art, a noise map is usually used to create a star surface, but the noise in the noise map is difficult to control, so that the obtained star surface effect is poor, and meanwhile, the existing surface erosion process cannot be realized on a three-dimensional sphere corresponding to a star, so that the erosion effect on the star surface is difficult to simulate.
Disclosure of Invention
The invention aims to provide a model generation method, a model generation device and electronic equipment, which are used for improving the effect of a planet earth surface and simulating an erosion effect on the earth surface.
In a first aspect, the present invention provides a method for generating a model, the method comprising: based on a preset noise parameter, carrying out noise processing on a preset sphere model to obtain a first model; acquiring a spherical surface map of the first model, and carrying out erosion treatment on the spherical surface map to obtain a second model with an erosion effect; wherein, the spherical map is used for indicating: height information of the first model surface; and setting a second model according to the preset attribute control parameters to obtain a final model.
In a second aspect, the present invention provides a model generation apparatus, comprising: the noise processing module is used for carrying out noise processing on a preset sphere model based on a preset noise parameter to obtain a first model; the erosion processing module is used for acquiring the spherical surface map of the first model and carrying out erosion processing on the spherical surface map to obtain a second model with an erosion effect; wherein the spherical map is used to indicate: height information of the first model surface; and the attribute setting module is used for setting the second model according to the preset attribute control parameters to obtain the final model.
In a third aspect, the present invention provides an electronic device comprising 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 model generation method described above.
In a fourth aspect, the present invention provides a computer-readable storage medium having stored thereon computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the model generation method described above.
The embodiment of the invention has the following beneficial effects:
according to the model generation method, the model generation device and the electronic equipment, firstly, noise processing is carried out on a preset sphere model based on preset noise parameters to obtain a first model; further acquiring a spherical surface map of the first model, and carrying out erosion treatment on the spherical surface map to obtain a second model with an erosion effect; wherein the spherical map is used to indicate: height information of the first model surface; and then setting a second model through preset attribute control parameters to obtain a final model. In the method, the earth surface effect can be obtained by presetting the sphere model through noise processing, and the earth surface erosion effect can be obtained by carrying out erosion processing on the spherical surface map of the earth surface effect, so that the method can automatically generate the model with the earth surface erosion effect; meanwhile, the mode can control the form of the generated model through the attribute parameters, so that models with different effects are obtained, and the freedom degree of model manufacturing is increased.
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 the practice of the invention as set forth above.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a model generation method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another model generation method provided by an embodiment of the invention;
fig. 3 is a diagram of an effect obtained by directly processing a preset sphere model through input noise according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a first model according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a two-dimensional grid according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a square grid according to an embodiment of the present invention;
FIG. 7 is a schematic view of a spherical surface map according to an embodiment of the present invention;
FIG. 8 is a flow chart of another method for generating a model according to an embodiment of the present invention;
FIG. 9 is a diagram illustrating a third model according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a model generation apparatus according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In a virtual scene containing the celestial body, in order to ensure the reality of the celestial body simulation, various types of celestial body surfaces are generally generated, and the celestial body surfaces have certain erosion details. Moreover, the game is a hand game platform, and the performance of the game needs to be paid attention, so a technical scheme capable of generating the planet ground surface needs to be explored.
In the related art, a noise map is usually used for manufacturing a planet ground surface, but the obtained planet ground surface has poor effect due to the fact that the noise in the noise map is difficult to control, and the erosion effect on the planet surface is difficult to simulate due to the fact that the existing ground surface erosion process cannot be realized on a three-dimensional sphere corresponding to a planet.
Based on the above problems, embodiments of the present invention provide a model generation method, an apparatus, and an electronic device, and the technology may be applied in a model making scenario, especially a model making scenario.
In order to facilitate understanding of the embodiment of the present invention, a detailed description is first given of a model generation method disclosed in the embodiment of the present invention, and as shown in fig. 1, the method includes the following specific steps:
and S102, carrying out noise processing on a preset sphere model based on a preset noise parameter to obtain a first model.
The preset sphere model can be any sphere model input by a user, and the sphere model can be drawn by the user through drawing software or can be directly obtained from a preset file. The noise parameters may include parameters such as noise intensity, noise frequency, noise offset, and noise shape and size, and specific parameters included in the noise parameters may be set according to research and development requirements. During specific implementation, the noise of the preset sphere model can be adjusted and processed according to the noise parameters, then the preset sphere model is processed through the adjusted noise, and then the first model with the earth surface effect is obtained, namely the earth surface effect can be formed on the surface of the preset sphere model through the adjusted noise, and the earth surface effect is used for representing the blocks of the land and the sea on the surface of the planet.
Step S104, obtaining a spherical surface map of the first model, and carrying out erosion processing on the spherical surface map to obtain a second model with an erosion effect; wherein, the spherical map is used for indicating: height information of the first model surface.
In specific implementation, according to the height information of the first model surface, a spherical map of the first model surface can be obtained, the spherical map is a two-dimensional image, and the pixel value of each pixel point on the two-dimensional image corresponds to the height value of the corresponding position of the first model surface. The height information includes a height value of each point of the first model surface on a preset terrain.
After the spherical surface map of the first model is determined, the spherical surface map needs to be eroded, and a second model with an erosion effect is obtained. Specifically, the erosion processing may be performed by using an existing erosion flow, or by using an erosion effect to make software processing.
And step S106, setting a second model through the preset attribute control parameters to obtain a final model.
The attribute control parameters can comprise parameters such as the size of a planet, the number of the planet, the material of the surface of the planet and the like, and specific numerical values of the attribute control parameters can be controlled by a user, so that the form of the planet can be freely set according to the requirements of the user, a satisfactory model of the user can be obtained, and the efficiency and the experience of the user for making the model are improved.
According to the model generation method provided by the embodiment of the invention, firstly, a preset sphere model is subjected to noise processing based on a preset noise parameter to obtain a first model; further acquiring a spherical surface map of the first model, and carrying out erosion treatment on the spherical surface map to obtain a second model with an erosion effect; wherein, the spherical map is used for indicating: height information of the first model surface; and then setting a second model through preset attribute control parameters to obtain a final model. In the method, the earth surface effect can be obtained by presetting the sphere model through noise processing, and the earth surface erosion effect can be obtained by carrying out erosion processing on the spherical surface map of the earth surface effect, so that the method can automatically generate the model with the earth surface erosion effect; meanwhile, the mode can control the form of the generated model through the attribute parameters, so that models with different effects are obtained, and the freedom degree of model manufacturing is increased.
The embodiment of the present invention further provides another model generation method, which is implemented on the basis of the above-mentioned embodiment, and the method mainly describes a specific process (specifically, implemented by the following steps S202 to S204) of performing noise processing on a preset sphere model based on a preset noise parameter to obtain a first model, and a specific process (specifically, implemented by the following steps S206 to S208) of obtaining a sphere map of the first model, performing erosion processing on the sphere map to obtain a second model having an erosion effect; as shown in fig. 2, the method comprises the following specific steps:
step S202, input noise is adjusted based on the noise parameter, and final noise is obtained.
The noise parameters comprise one or more of noise intensity, noise frequency, noise offset and noise shape size. The noise may be random noise or noise modulated by a user. Specifically, in a general input noise processing sphere model, the obtained blocks of the earth surface of the model are relatively fine and are very different from natural land and ocean blocks, so that input noise needs to be adjusted through preset noise parameters, fine and broken noise is removed, or the fine and broken noise is normalized to obtain final noise. Fig. 3 shows an effect diagram obtained by directly processing a preset sphere model through input noise according to an embodiment of the present invention, where a circle with a white area and white spots on the top in fig. 3 is also a model obtained by directly processing the preset sphere model through input noise, and the model has more white spot areas, i.e., the blocks in the model are more broken, and have a larger difference from those of natural land and sea.
In a specific implementation, the noise parameters include noise intensity and noise shape size; thus, the input noise having a noise shape size larger than the preset size threshold may be determined as the final noise, that is, the final noise is the noise of the larger block. The preset size threshold may be set according to research and development requirements, for example, the preset size may be set to 2 square centimeters and the like. The following is the code that determines the final noise:
f in the above code represents input noise, start represents a preset size threshold of the shape and size of the noise, c can be understood as a parameter for smooth transition before and after processing, c =0 represents unsmooth, and c =1 represents completely smooth; the meaning of the softclip function body is that the input noise is adjusted according to a preset size threshold value to determine which of the input noise is small noise, and the small noise is removed.
And step S204, processing the preset sphere model through the final noise to obtain a first model.
The earth surface effect of the surface of the preset sphere model can be set through the final noise, and the first model is obtained, namely the first model is the preset sphere model with the earth surface effect. Fig. 4 is a schematic diagram of a first model according to an embodiment of the present invention.
And step S206, obtaining the spherical surface map of the first model based on the height information of the surface of the first model.
The height information comprises a height value of each point of the first model surface on a preset terrain, namely black, white and gray of final noise visualized on the model is height information. In a specific implementation, the step S206 can be implemented by the following steps 10-11:
and step 10, unfolding the surface of the first model into a two-dimensional grid according to a preset rule, and cutting the two-dimensional grid to obtain a square grid.
The preset rule may be set according to research and development requirements, and the preset rule may be a rule for processing texture coordinate information of the sphere model into a square shape. Specifically, the preset rule includes expanding the first model surface into an approximately square shape; further unfolding the first model surface into a two-dimensional grid; wherein the two-dimensional grid comprises square portions and sawtooth portions; and deleting the sawtooth part in the two-dimensional grid to obtain a square grid.
In a specific implementation, the texture coordinate information corresponding to the first model surface may be expanded into a two-dimensional grid including a square portion and a sawtooth portion, as shown in fig. 5, which is a schematic diagram of a two-dimensional grid provided by an embodiment of the present invention, and the sawtooth portion is represented by the upper and lower portions of the square portion in fig. 5. Fig. 6 is a schematic diagram of a square grid provided by an embodiment of the present invention, in which texture coordinates generally have two coordinate axes of U and V, and are therefore referred to as UV coordinates, U represents a distribution in a horizontal coordinate, and V represents a distribution in a vertical coordinate, and in some embodiments, the square grid may also be referred to as a UV grid.
And step 11, mapping the height information of the surface of the first model to a square grid to obtain a spherical mapping.
In a specific implementation, the vex code may be written by a preset cop (for a Composition operator) to map the height information of the first model surface onto the square grid to obtain the spherical map, as shown in fig. 7, which is a schematic diagram of the spherical map provided in the embodiment of the present invention. The cop module is generally used to process 2D (Two-Dimensional) information, and the embodiment may map the height information of the first model surface 3D (three-Dimensional) into 2D, that is, into a square grid in the cop module.
And S208, inputting the spherical map into preset terrain erosion software, and outputting a second model with an erosion effect.
During specific implementation, the spherical surface veneers are led into preset terrain erosion software, and the terrain erosion software can manufacture the terrain erosion effect to obtain a second model with the terrain erosion effect. Specifically, after the spherical surface map is obtained, the spherical surface map may be automatically imported into the terrain erosion software, or the spherical surface map may be manually imported into the terrain erosion model, and the specific importing manner is determined by the terrain erosion software used. In practical applications, the terrain erosion software may be existing software or self-developed software, for example, the terrain erosion software may be Gaea terrain software or WorldMachine software.
Specifically, the erosion effect of the second model earth surface can be modified by setting parameters related to the erosion effect in the terrain erosion software, and the user can manually modify the parameters related to the erosion effect, so that the personalized requirements of the user are improved.
And step S210, setting a second model through preset attribute control parameters to obtain a final model.
Firstly, adjusting input noise based on noise parameters to obtain final noise; processing the preset sphere model through final noise to obtain a first model; then, obtaining a spherical surface map of the first model based on the height information of the surface of the first model; and then inputting the spherical surface map into preset terrain erosion software, outputting a second model with an erosion effect, and setting the second model through preset attribute control parameters to obtain a final model. The method realizes the erosion of the spherical surface effect which cannot be realized by the prior art and a whole set of automatically generated frame, and different star shapes can be obtained by only modifying the attribute control parameters so as to obtain different effects; meanwhile, the method automatically realizes the effect of the earth surface of the planet, and greatly improves the model making efficiency compared with the manual iteration making method.
The embodiment of the present invention further provides another model generation method, which is implemented on the basis of the above embodiment, and the method mainly describes a specific process of setting a second model by using preset attribute control parameters to obtain a final model (specifically, implemented by the following steps S806 to S810); as shown in fig. 8, the method includes the following specific steps:
step S802, based on the preset noise parameters, noise processing is carried out on a preset sphere model to obtain a first model.
Step S804, obtaining the spherical surface map of the first model, and carrying out erosion processing on the spherical surface map to obtain a second model with erosion effect.
For a specific implementation manner of the steps S802 to S804, reference may be made to the above method embodiment, which is not described herein again.
Step 806, according to a preset rule, unfolding the surface of the first model into a two-dimensional grid, and cutting the two-dimensional grid to obtain a square grid.
The preset rule may be set according to research and development requirements, and the preset rule may be a rule for processing texture coordinate information of the sphere model into a square shape. Specifically, the preset rule includes expanding the first model surface into an approximately square shape; further unfolding the first model surface into a two-dimensional grid; wherein the two-dimensional grid comprises square portions and sawtooth portions; and deleting the sawtooth parts in the two-dimensional grid to obtain a square grid, wherein the square grid is shown in fig. 6, and only contains UV coordinate information and no height information.
And step S808, combining the square grids into a third model, and representing the third model by using point cloud to obtain a point cloud model.
Fig. 9 is a schematic diagram of a third model according to an embodiment of the present invention, where the third model is a sphere frame composed of square grids. Specifically, the spatial coordinates of each sampling point on the model surface can be obtained from the third model, and the set of the spatial coordinates of all the sampling points is called a point cloud.
And step S810, obtaining a final model based on the attribute control parameters, the point cloud model and the second model.
The attribute control parameters comprise one or more of the size of the planet, the material of the planet and the number of the planet; the size of the star can control the shape and size of the final model, the material of the star is used for controlling the surface material of the final model, and the number of the star is used for controlling the number of the finally generated models.
In a specific implementation, the step S810 can be implemented by the following steps 20 to 21:
and 20, adjusting the point cloud model through the attribute control parameters to obtain the adjusted point cloud model.
The size, the surface material, the number of models and the like of the point cloud model can be adjusted through the attribute control parameters.
And step 21, setting the corrosion effect of the adjusted point cloud model based on the corrosion effect of the second model, and determining the point cloud model with the corrosion effect as a final model.
And transferring the erosion effect of the earth surface of the second model to the adjusted point cloud model to obtain the erosion effect of the point cloud model, and determining the point cloud model with the erosion effect as a final model.
In a specific implementation, the attribute control parameter is determined by: inputting necessary attribute information by compiling vex codes, wherein the attribute information comprises the size of a planet, a sphere model applied by the planet and the like; corresponding star materials can be compiled through data of the houdini engine automatically corresponding to the materials; the number of generated stars is determined by the wedge count.
In practical application, the invention realizes an automatic function in a PDG (programmable Dependency network) module, firstly, the wedge node sets the number of the planet, then, the mesh and texture automatic module is used for calling a functional node for obtaining a second model, and finally, a top node for scheduling and generating point cloud is used for adjusting the size of the planet, quoting examples, material parameters and other contents, and outputting a final model. The widget node is an iterator capable of transmitting parameters; a top node typically generates work items that will accomplish a particular task and store information in attributes.
In a concrete implementation, the generated final models all have high-mode eroded normal details, but each final model is a low-face number model that the hand game can bear. And then, only the first model is modified, so that various models, such as banana stars, duck stars and the like, can be obtained. The frame that whole automation model generated in this mode also can be expanded, and the planet quantity that generates can be thousands or even tens of thousands in addition, supplies fine arts producers to select to the efficiency of modeling has been promoted greatly.
Firstly, carrying out noise processing on a preset sphere model based on a preset noise parameter to obtain a first model; further acquiring a spherical surface map of the first model, carrying out erosion treatment on the spherical surface map to obtain a second model with an erosion effect, then expanding the surface of the first model into two-dimensional grids according to a preset rule, carrying out cutting treatment on the two-dimensional grids to obtain square grids, combining the square grids into a third model, and representing the third model by adopting point cloud to obtain a point cloud model; and then, obtaining a final model based on the attribute control parameters, the point cloud model and the second model. The mode is an automatic system capable of automatically generating the celestial bodies in batches, and the model in the mode can simulate the celestial bodies, so that the mode can set erosion details of the natural earth surface on the earth surface of the celestial bodies; meanwhile, different model results can be obtained by modifying the attribute control parameters in the method.
Corresponding to the above method embodiment, an embodiment of the present invention further provides a model generating apparatus, as shown in fig. 10, the apparatus includes:
and the noise processing module 90 is configured to perform noise processing on the preset sphere model based on a preset noise parameter to obtain a first model.
The erosion processing module 91 is configured to obtain a spherical surface map of the first model, and perform erosion processing on the spherical surface map to obtain a second model with an erosion effect; wherein, the spherical map is used for indicating: height information of the first model surface.
And the attribute setting module 92 is configured to set the second model according to preset attribute control parameters to obtain a final model.
The model generation device firstly carries out noise processing on a preset sphere model based on a preset noise parameter to obtain a first model; further acquiring a spherical surface map of the first model, and carrying out erosion treatment on the spherical surface map to obtain a second model with an erosion effect; wherein, the spherical map is used for indicating: height information of the first model surface; and then setting a second model through preset attribute control parameters to obtain a final model. In the method, the earth surface effect can be obtained by presetting the sphere model through noise processing, and the earth surface erosion effect can be obtained by carrying out erosion processing on the spherical surface map of the earth surface effect, so that the method can automatically generate the model with the earth surface erosion effect; meanwhile, the mode can control the form of the generated model through the attribute parameters, so that models with different effects are obtained, and the freedom degree of model manufacturing is increased.
Specifically, the noise processing module 90 is configured to: adjusting input noise based on the noise parameters to obtain final noise; wherein the noise parameters comprise one or more of noise intensity, noise frequency, noise offset and noise shape size; and processing the preset sphere model through the final noise to obtain a first model.
In a specific implementation, the noise parameters include noise intensity and noise shape size; the noise processing module 90 is further configured to: and determining the input noise with the noise shape size larger than a preset size threshold value as final noise.
Further, the erosion processing module 91 includes: the map determining unit is used for obtaining a spherical map of the first model based on the height information of the surface of the first model; and the erosion processing unit is used for inputting the spherical surface map into preset terrain erosion software and outputting a second model with an erosion effect.
In a specific implementation, the map determining unit is configured to: according to a preset rule, the surface of the first model is unfolded into a two-dimensional grid, and the two-dimensional grid is cut to obtain a square grid; and mapping the height information of the surface of the first model to a square grid to obtain a spherical mapping.
Specifically, the preset rule includes expanding the first model surface into an approximately square shape; the map determining unit is further configured to: expanding the first model surface into a two-dimensional grid; wherein the two-dimensional grid comprises a square part and a sawtooth part; and deleting the sawtooth part in the two-dimensional grid to obtain a square grid.
Further, the attribute setting module 92 is configured to: according to a preset rule, the surface of the first model is unfolded into a two-dimensional grid, and the two-dimensional grid is cut to obtain a square grid; combining the square grids into a third model, and representing the third model by using point cloud to obtain a point cloud model; and obtaining a final model based on the attribute control parameters, the point cloud model and the second model.
In a specific implementation, the attribute setting module 92 is further configured to: adjusting the point cloud model through the attribute control parameters to obtain an adjusted point cloud model; the attribute control parameters comprise one or more of the size of the planet, the material of the planet and the number of the planet; and setting the corrosion effect of the adjusted point cloud model based on the corrosion effect of the second model, and determining the point cloud model with the corrosion effect as a final model.
The model generating apparatus provided in the embodiment of the present invention has the same implementation principle and technical effect as those of the foregoing method embodiments, and for the sake of brief description, reference may be made to corresponding contents in the foregoing method embodiments for parts that are not mentioned in the apparatus embodiments.
An embodiment of the present invention further provides an electronic device, as shown in fig. 11, where the electronic device includes a processor and a memory, where the memory stores machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to implement the model generating method.
Specifically, the model generation method includes: based on a preset noise parameter, carrying out noise processing on a preset sphere model to obtain a first model; obtaining a spherical surface map of the first model, and carrying out erosion treatment on the spherical surface map to obtain a second model with an erosion effect; wherein, the spherical map is used for indicating: height information of the first model surface; and setting the second model according to the preset attribute control parameters to obtain the final model.
In the model generation mode, the spherical model is preset through noise processing to obtain the earth surface effect, and the spherical mapping of the earth surface effect is subjected to erosion processing to obtain the earth surface erosion effect, so that the mode can automatically generate the model with the earth surface erosion effect; meanwhile, the mode can control the form of the generated model through the attribute parameters, so that models with different effects are obtained, and the freedom degree of model manufacturing is increased.
In an optional embodiment, the step of performing noise processing on the preset sphere model based on the preset noise parameter to obtain the first model includes: adjusting input noise based on the noise parameters to obtain final noise; wherein the noise parameters comprise one or more of noise intensity, noise frequency, noise offset and noise shape size; and processing the preset sphere model through the final noise to obtain a first model.
In an alternative embodiment, the noise parameters include noise intensity and noise shape size; the step of adjusting the input noise based on the noise parameter to obtain the final noise includes: and determining the input noise with the noise shape size larger than a preset size threshold value as final noise.
In an optional embodiment, the step of obtaining the spherical surface map of the first model and performing erosion processing on the spherical surface map to obtain the second model with erosion effect includes: obtaining a spherical surface map of the first model based on the height information of the surface of the first model; and inputting the spherical surface map into preset terrain erosion software, and outputting a second model with an erosion effect.
In an optional embodiment, the step of obtaining the spherical map of the first model based on the height information of the surface of the first model includes: according to a preset rule, the surface of the first model is unfolded into a two-dimensional grid, and the two-dimensional grid is cut to obtain a square grid; and mapping the height information of the surface of the first model to a square grid to obtain a spherical mapping.
In an alternative embodiment, the preset rule includes expanding the first model surface into an approximately square shape; the step of unfolding the surface of the first model into a two-dimensional grid according to a preset rule and cutting the two-dimensional grid to obtain a square grid includes: expanding the first model surface into a two-dimensional grid; wherein the two-dimensional grid comprises a square part and a sawtooth part; and deleting the sawtooth part in the two-dimensional grid to obtain a square grid.
In an optional embodiment, the step of setting the second model according to the preset attribute control parameter to obtain the final model includes: according to a preset rule, the surface of the first model is unfolded into a two-dimensional grid, and the two-dimensional grid is cut to obtain a square grid; combining the square grids into a third model, and representing the third model by using point cloud to obtain a point cloud model; and obtaining a final model based on the attribute control parameters, the point cloud model and the second model.
In an optional embodiment, the step of obtaining a final model based on the attribute control parameter, the point cloud model, and the second model includes: adjusting the point cloud model through the attribute control parameters to obtain an adjusted point cloud model; the attribute control parameters comprise one or more of the size of the planet, the material of the planet and the number of the planet; and setting the corrosion effect of the adjusted point cloud model based on the corrosion effect of the second model, and determining the point cloud model with the corrosion effect as a final model.
Further, the electronic device shown in fig. 11 further includes a bus 102 and a communication interface 103, and the processor 101, the communication interface 103, and the memory 100 are connected through the bus 102.
The memory 100 may include a high-speed Random Access Memory (RAM) and may further include a non-volatile memory (non-volatile memory), such as at least one disk memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used. The bus 102 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 11, but this does not indicate only one bus or one type of bus.
The processor 101 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 101. The processor 101 may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed 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 directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100, and completes the steps of the method of the foregoing embodiment in combination with the hardware thereof.
The embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the model generation method.
Specifically, the model generation method includes: based on a preset noise parameter, carrying out noise processing on a preset sphere model to obtain a first model; obtaining a spherical surface map of the first model, and carrying out erosion treatment on the spherical surface map to obtain a second model with an erosion effect; wherein, the spherical map is used for indicating: height information of the first model surface; and setting the second model according to the preset attribute control parameters to obtain the final model.
In the model generation mode, the spherical model is preset through noise processing to obtain the earth surface effect, and the spherical mapping of the earth surface effect is subjected to erosion processing to obtain the earth surface erosion effect, so that the mode can automatically generate the model with the earth surface erosion effect; meanwhile, the mode can control the form of the generated model through the attribute parameters, so that models with different effects are obtained, and the freedom degree of model manufacturing is increased.
In an optional embodiment, the step of performing noise processing on the preset sphere model based on the preset noise parameter to obtain the first model includes: adjusting input noise based on the noise parameters to obtain final noise; wherein the noise parameters comprise one or more of noise intensity, noise frequency, noise offset and noise shape size; and processing the preset sphere model through the final noise to obtain a first model.
In an alternative embodiment, the noise parameters include noise intensity and noise shape size; the step of adjusting the input noise based on the noise parameter to obtain the final noise includes: and determining the input noise with the noise shape size larger than a preset size threshold value as final noise.
In an optional embodiment, the step of obtaining the spherical surface map of the first model and performing erosion processing on the spherical surface map to obtain the second model with erosion effect includes: obtaining a spherical surface map of the first model based on the height information of the surface of the first model; and inputting the spherical surface map into preset terrain erosion software, and outputting a second model with an erosion effect.
In an optional embodiment, the step of obtaining the spherical map of the first model based on the height information of the surface of the first model includes: according to a preset rule, the surface of the first model is unfolded into a two-dimensional grid, and the two-dimensional grid is cut to obtain a square grid; and mapping the height information of the first model surface to the square grid to obtain the spherical mapping.
In an alternative embodiment, the preset rule includes expanding the first model surface into an approximately square shape; the step of unfolding the surface of the first model into a two-dimensional grid according to a preset rule and cutting the two-dimensional grid to obtain a square grid includes: expanding the first model surface into a two-dimensional grid; wherein the two-dimensional grid comprises a square part and a sawtooth part; and deleting the sawtooth part in the two-dimensional grid to obtain a square grid.
In an optional embodiment, the step of setting the second model according to the preset attribute control parameter to obtain the final model includes: according to a preset rule, the surface of the first model is unfolded into a two-dimensional grid, and the two-dimensional grid is cut to obtain a square grid; combining the square grids into a third model, and representing the third model by using point cloud to obtain a point cloud model; and obtaining a final model based on the attribute control parameters, the point cloud model and the second model.
In an optional embodiment, the step of obtaining the final model based on the attribute control parameter, the point cloud model, and the second model includes: adjusting the point cloud model through the attribute control parameters to obtain an adjusted point cloud model; the attribute control parameters comprise one or more of the size of the planet, the material of the planet and the number of the planet; and setting the corrosion effect of the adjusted point cloud model based on the corrosion effect of the second model, and determining the point cloud model with the corrosion effect as a final model.
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 such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal device, or a network device) to execute 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), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular 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-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (11)
1. A method of model generation, the method comprising:
based on a preset noise parameter, carrying out noise processing on a preset sphere model to obtain a first model;
obtaining a spherical surface map of the first model, and carrying out erosion treatment on the spherical surface map to obtain a second model with an erosion effect; wherein the spherical map is used to indicate: height information of the first model surface;
and setting the second model according to preset attribute control parameters to obtain a final model.
2. The method according to claim 1, wherein the step of performing noise processing on the preset sphere model based on the preset noise parameter to obtain the first model comprises:
adjusting input noise based on the noise parameter to obtain final noise; wherein the noise parameters comprise one or more of noise intensity, noise frequency, noise offset, and noise shape size;
and processing the preset sphere model through the final noise to obtain the first model.
3. The method of claim 2, wherein the noise parameters comprise noise strength, noise shape size;
the step of adjusting the input noise based on the noise parameter to obtain the final noise comprises:
and determining the input noise with the noise shape size larger than a preset size threshold value as the final noise.
4. The method according to claim 1, wherein the step of obtaining the spherical map of the first model and performing erosion processing on the spherical map to obtain the second model with erosion effect comprises:
obtaining a spherical surface map of the first model based on the height information of the surface of the first model;
and inputting the spherical surface map into preset terrain erosion software, and outputting a second model with an erosion effect.
5. The method of claim 4, wherein the step of obtaining the spherical map of the first model based on the height information of the surface of the first model comprises:
according to a preset rule, the surface of the first model is unfolded into a two-dimensional grid, and the two-dimensional grid is cut to obtain a square grid;
and mapping the height information of the first model surface to the square grid to obtain the spherical mapping.
6. The method of claim 5, wherein the preset rules include expanding the first model surface into an approximately square shape;
the step of unfolding the surface of the first model into a two-dimensional grid according to a preset rule, and cutting the two-dimensional grid to obtain a square grid comprises the following steps:
unfolding the first model surface into a two-dimensional grid; wherein the two-dimensional grid comprises square portions and sawtooth portions;
and deleting the sawtooth part in the two-dimensional grid to obtain the square grid.
7. The method of claim 1, wherein the step of setting the second model by preset attribute control parameters to obtain a final model comprises:
according to a preset rule, the surface of the first model is unfolded into a two-dimensional grid, and the two-dimensional grid is cut to obtain a square grid;
combining the square grids into a third model, and representing the third model by adopting point cloud to obtain a point cloud model;
and obtaining the final model based on the attribute control parameters, the point cloud model and the second model.
8. The method of claim 7, wherein the step of deriving the final model based on the property control parameter, the point cloud model, and the second model comprises:
adjusting the point cloud model according to the attribute control parameters to obtain an adjusted point cloud model; the attribute control parameters comprise one or more of the size of the planet, the material of the planet and the number of the planet;
and setting the corrosion effect of the adjusted point cloud model based on the corrosion effect of the second model, and determining the point cloud model with the corrosion effect set as the final model.
9. A model generation apparatus, the apparatus comprising:
the noise processing module is used for carrying out noise processing on a preset sphere model based on a preset noise parameter to obtain a first model;
the erosion processing module is used for acquiring the spherical surface map of the first model and carrying out erosion processing on the spherical surface map to obtain a second model with an erosion effect; wherein the spherical map is used to indicate: height information of the first model surface;
and the attribute setting module is used for setting the second model according to preset attribute control parameters to obtain a final 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 model generation method of any of claims 1 to 8.
11. A computer-readable storage medium having computer-executable instructions stored thereon which, when invoked and executed by a processor, cause the processor to implement the model generation method of any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211222470.3A CN115619929A (en) | 2022-10-08 | 2022-10-08 | Model generation method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211222470.3A CN115619929A (en) | 2022-10-08 | 2022-10-08 | Model generation method and device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115619929A true CN115619929A (en) | 2023-01-17 |
Family
ID=84860180
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211222470.3A Pending CN115619929A (en) | 2022-10-08 | 2022-10-08 | Model generation method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115619929A (en) |
-
2022
- 2022-10-08 CN CN202211222470.3A patent/CN115619929A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103970518B (en) | A kind of the 3D rendering method and device of window logic | |
CN112190935B (en) | Rendering method and device of dynamic volume cloud and electronic equipment | |
CN109683858B (en) | Data processing method and device | |
CN113034688B (en) | Three-dimensional map model generation method and device | |
CN115317916A (en) | Method and device for detecting overlapped objects in virtual scene and electronic equipment | |
CN110136262B (en) | Water body virtual visualization method and device | |
CN113457136B (en) | Game animation generation method and device, storage medium and terminal | |
CN110038302B (en) | Unity 3D-based grid generation method and device | |
CN117152237A (en) | Distance field generation method and device, electronic equipment and storage medium | |
CN115619929A (en) | Model generation method and device and electronic equipment | |
CN111476308A (en) | Remote sensing image classification method and device based on prior geometric constraint and electronic equipment | |
CN112711783B (en) | Jewelry design method and system based on three-dimensional software and illusion engine | |
CN112365576B (en) | Method, device and server for recommending position of fazenda component | |
CN114463477A (en) | Model mapping method and device and electronic equipment | |
CN105894560A (en) | Image processing method, user equipment and system | |
CN113368498B (en) | Model generation method and device and electronic equipment | |
CN117611781B (en) | Flattening method and device for live-action three-dimensional model | |
CN118052948B (en) | Three-dimensional terrain programmed secondary editing optimization method and device and electronic equipment | |
CN114969917A (en) | Method and device for generating 3D vegetation map, electronic equipment and storage medium | |
CN117392333A (en) | Terrain data processing method and device and electronic equipment | |
CN114119925B (en) | Game image modeling method and device and electronic equipment | |
CN118485770A (en) | Model cutting method and device and electronic equipment | |
CN116740282A (en) | Patch structure modeling method, device and equipment of model and storage medium | |
CN116934938A (en) | Three-dimensional model texture processing method, apparatus and storage medium | |
CN115501585A (en) | Vegetation generation method and device in virtual scene 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 |