Mountain model generation method and device and electronic equipment

By using an automated method to generate mountain models, the distribution area and placement parameters of mountains are determined based on the height information and characteristics of the terrain model, thus solving the problem of low efficiency in generating mountain models and improving the efficiency of game scene production.

CN115814408BActive Publication Date: 2026-05-01NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2022-10-21
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing technologies, the generation efficiency of mountain models in open-world games is low, requiring manual editing, which leads to high labor costs and low scene production efficiency.

Method used

Based on the height information of the preset terrain model, the initial distribution area of ​​the mountain is automatically determined, and the final distribution area is obtained by specifying terrain features. The size and orientation of the mountain model are adjusted and mapped to the final distribution area to generate the mountain.

Benefits of technology

It improved the efficiency of generating mountain models, reduced manual editing operations, and enhanced the efficiency of scene production in open-world games.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115814408B_ABST
    Figure CN115814408B_ABST
Patent Text Reader

Abstract

The present application provides a mountain model generation method and device and electronic equipment, based on the height information of the terrain model, determine the initial distribution area of the mountain on the terrain model; obtain the final distribution area with the specified terrain feature from the initial distribution area, determine the mountain placement parameter indicating the mountain size and / or the mountain orientation based on the final distribution area; adjust the preset mountain model according to the mountain placement parameter, and map the adjusted mountain model on the final distribution area to generate the mountain on the terrain model. This way can determine the mountain distribution area and the mountain placement parameter according to the terrain feature and the height information of the terrain model, and then adjust the obtained mountain model based on the mountain placement parameter, so that the mountain model can be placed on the terrain model according to the mountain trend rule in the terrain; this way can automatically generate the mountain on the terrain model, thereby improving the generation efficiency of the mountain model and the scene production efficiency of the big world game.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of model making technology, and in particular to a method, apparatus and electronic device for generating mountain models. Background Technology

[0002] In open-world games, numerous mountains are typically featured in the game's environments. These mountains are usually model resources, each with its own designated location within the game levels. In existing technologies, users typically need to manually select the placement of mountains within a terrain model, then place the pre-selected mountain model at the chosen location, and adjust the size and orientation of the placed mountain model. However, manually editing mountain models is inefficient, and given the typically large scale of open-world games, it requires significant manpower and results in low scene creation efficiency. Summary of the Invention

[0003] The purpose of this invention is to provide a method, apparatus, and electronic device for generating mountain models, so as to automatically generate mountain models on terrain models, improve the efficiency of mountain model generation, and thus improve the efficiency of scene production.

[0004] In a first aspect, the present invention provides a method for generating a mountain model, the method comprising: determining an initial distribution area of ​​the mountain on the preset terrain model based on the height information of the preset terrain model; obtaining a final distribution area with specified terrain features from the initial distribution area; and determining mountain placement parameters based on the final distribution area; wherein the mountain placement parameters are used to indicate the mountain size and / or mountain orientation of the mountain model; and adjusting the preset mountain model according to the mountain placement parameters, and mapping the adjusted mountain model onto the final distribution area to generate a mountain on the preset terrain model.

[0005] Secondly, the present invention provides a mountain model generation device, the device comprising: a region determination module, used to determine an initial distribution area of ​​mountains on a preset terrain model based on the height information of the preset terrain model; a parameter determination module, used to obtain a final distribution area with specified terrain features from the initial distribution area, and determine mountain placement parameters based on the final distribution area; wherein the mountain placement parameters are used to indicate the mountain size and / or mountain orientation of the mountain model; and a model generation module, used to adjust the preset mountain model according to the mountain placement parameters, and map the adjusted mountain model onto the final distribution area to generate mountains on the preset terrain model.

[0006] Thirdly, the present invention provides an electronic device including a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the above-described mountain model generation method.

[0007] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the above-described mountain model generation method.

[0008] The embodiments of the present invention bring the following beneficial effects:

[0009] This invention provides a method, apparatus, and electronic device for generating mountain models. First, based on the height information of a preset terrain model, an initial distribution area of ​​mountains on the preset terrain model is determined. Then, a final distribution area with specified terrain features is obtained from the initial distribution area. Based on the final distribution area, mountain placement parameters are determined, indicating the mountain model's size and / or orientation. Next, according to the mountain placement parameters, the preset mountain model is adjusted, and the adjusted mountain model is mapped onto the final distribution area to generate mountains on the preset terrain model. This method can determine the mountain distribution area and mountain placement parameters based on the terrain features and height information of the terrain model, and then adjust the obtained mountain model based on the mountain placement parameters. This allows the mountain model to place mountains on the terrain model according to the mountain's natural contours. Furthermore, this method can automatically generate mountains from the terrain model, thereby improving the efficiency of mountain model generation and the scene creation efficiency of large-scale games.

[0010] Other features and advantages of the invention will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.

[0011] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0012] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0013] Figure 1 A flowchart of a method for generating a mountain model provided in an embodiment of the present invention;

[0014] Figure 2 A flowchart of another method for generating a mountain model provided in an embodiment of the present invention;

[0015] Figure 3 This is a schematic diagram of the initial distribution area of ​​a mountain provided in an embodiment of the present invention;

[0016] Figure 4 A schematic diagram of a mountain model in a mountain model resource library provided in an embodiment of the present invention;

[0017] Figure 5 This is a schematic diagram of a vegetation distribution area provided in an embodiment of the present invention;

[0018] Figure 6 A schematic diagram of a mountain model including mountain vegetation provided in an embodiment of the present invention;

[0019] Figure 7 A flowchart of another method for generating a mountain model provided in an embodiment of the present invention;

[0020] Figure 8 A schematic diagram of a road area and a river area provided in an embodiment of the present invention;

[0021] Figure 9 A schematic diagram of the second region provided in an embodiment of the present invention;

[0022] Figure 10 This is a schematic diagram of the convex hull geometry of the second region provided in an embodiment of the present invention;

[0023] Figure 11 A schematic diagram of the final geometry provided in an embodiment of the present invention;

[0024] Figure 12 A schematic diagram of the minimum circumscribed cuboid of the final geometry provided in the embodiments of the present invention;

[0025] Figure 13 A schematic diagram of a road model and a river model provided in an embodiment of the present invention;

[0026] Figure 14 A schematic diagram of a road model, a river model, and a minimum circumscribed cuboid provided in an embodiment of the present invention;

[0027] Figure 15 This is a schematic diagram of a mountain model generation device provided in an embodiment of the present invention;

[0028] Figure 16 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0030] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0031] In open-world games, numerous mountains are typically featured in the game's environments. These mountains are usually model resources, each with its own designated location within the game levels. In existing technologies, users usually need to manually select the placement of mountains within a terrain model, then place the pre-selected mountain model at the chosen location, and adjust the size and orientation of the placed mountain model. However, manually editing mountain models is inefficient. Furthermore, since open-world games are typically very large, spanning thousands or even tens of thousands of square kilometers, and each modification to the mountain model involves iterating over previous manual edits, manual mountain model editing requires significant manpower and results in low scene creation efficiency.

[0032] To address the aforementioned problems, embodiments of the present invention provide a method, apparatus, and electronic device for generating mountain models, which can be applied to mountain creation scenarios in various game scenes. To facilitate understanding of the present invention, a method for generating mountain models provided by the present invention will first be described in detail; for example... Figure 1 As shown, the method includes the following specific steps:

[0033] Step S102: Based on the height information of the preset terrain model, determine the initial distribution area of ​​the mountain on the preset terrain model.

[0034] The aforementioned preset terrain model can be a terrain model pre-drawn by the user using modeling software. The height information of this preset terrain model includes the height value of each location within the model. Based on the height information of the preset terrain model, high ground can be identified, and this high ground can be designated as the area where mountains may be placed within the model. This area is also the initial distribution area of ​​mountains on the preset terrain model.

[0035] Step S104: Obtain the final distribution area with specified terrain features from the initial distribution area, and determine the mountain placement parameters based on the final distribution area; wherein, the mountain placement parameters are used to indicate the mountain size and / or mountain orientation of the mountain model.

[0036] The aforementioned final distribution area with specified terrain features can be a terrain area in the initial distribution area whose height is greater than a preset threshold, a terrain area in the initial distribution area after removing river and road areas, or a terrain area in the initial distribution area with other specific terrain features, etc., without specific limitations here.

[0037] The aforementioned mountain placement parameters can include only the mountain model's dimensions, or only its orientation; or they can include both. In practical implementation, the final distribution area can contain at least one sub-region. The size of the mountain model to be placed in each sub-region can be determined based on its size, and the orientation of the mountain model to be placed in each sub-region can be determined based on its shape and trend.

[0038] Step S106: Adjust the preset mountain model according to the mountain placement parameters, and map the adjusted mountain model onto the final distribution area to generate mountains on the preset terrain model.

[0039] The aforementioned preset mountain models are typically obtained from a pre-set mountain model resource library. This library can contain multiple mountain models of different shapes and heights; and the mountain models in this resource library are pre-defined. In practice, a mountain model can be randomly selected from the resource library as the preset mountain model to be placed, or a specific mountain model from the resource library can be designated as the preset mountain model. Alternatively, a preset mountain model can be selected from the resource library based on the mountain placement parameters.

[0040] In practice, after determining the preset mountain model, it is necessary to adjust the size and orientation of the preset mountain model according to the mountain placement parameters, and then place the adjusted mountain model in the final distribution area on the preset terrain model to generate the mountain on the preset terrain model.

[0041] This invention provides a method for generating mountain models. First, based on the height information of a preset terrain model, an initial distribution area of ​​mountains on the preset terrain model is determined. Then, a final distribution area with specified terrain features is obtained from the initial distribution area. Based on the final distribution area, mountain placement parameters are determined, indicating the mountain size and / or orientation of the mountain model. Next, according to the mountain placement parameters, the preset mountain model is adjusted, and the adjusted mountain model is mapped onto the final distribution area to generate mountains on the preset terrain model. This method can determine the mountain distribution area and mountain placement parameters based on the terrain features and height information of the terrain model, and then adjust the obtained mountain model based on the mountain placement parameters. This allows the mountain model to place mountains on the terrain model according to the mountain trend patterns within the terrain. Furthermore, this method can automatically generate mountains on the terrain model, thereby improving the efficiency of mountain model generation and the scene production efficiency of large-scale games.

[0042] This invention also provides another method for generating mountain models, which is implemented based on the above embodiments. This method focuses on describing the specific process of determining the initial distribution area of ​​mountains on a preset terrain model based on the height information of the preset terrain model (specifically implemented through the following steps S202-S204); such as Figure 2 As shown, the method includes the following specific steps:

[0043] Step S202: Based on the height information of the preset terrain model, determine the first region in the preset terrain model whose height is greater than the preset height threshold.

[0044] The aforementioned preset height threshold can be determined based on research and development needs and the height of mountains in real-world scenarios. For example, the preset height threshold can be set to 50 meters or 60 meters.

[0045] Step S204: The first region is determined as the initial distribution area of ​​the mountain on the preset terrain model.

[0046] In practical implementation, the aforementioned first area is the area in the preset terrain model where mountains may need to be placed; that is, the initial distribution area of ​​mountains on the preset terrain model. This initial distribution area will be marked in the preset terrain model with a color different from other areas. This color can be red or yellow, etc., and the specific color can be set according to the development needs. Figure 3 The diagram shown is a schematic representation of the initial distribution area of ​​a mountain according to an embodiment of the present invention. Figure 3 The square-like model in the model is called the preset terrain model. The dark area in the preset terrain model represents the initial distribution area of ​​the mountains. That is, the dark area is the possible placement area of ​​the mountains, and the area outside the dark area is the area where mountains will definitely not be placed.

[0047] Step S206: Obtain the final distribution area with specified terrain features from the initial distribution area, and determine the mountain placement parameters based on the final distribution area.

[0048] Step S208: Obtain a preset mountain model from the preset mountain model resource library.

[0049] The aforementioned mountain model resource library contains multiple mountain models of different shapes, which are pre-set. The orientation of these mountain models in the resource library is typically aligned with the Z-axis of the coordinate system, meaning the longest axis of the mountain model (which corresponds to the longest possible direction in terms of its shape) is aligned with the model's longest axis. This facilitates subsequent adjustment and placement of the mountain models within the terrain model. For example... Figure 4 The image shown is a schematic diagram of a mountain model in a mountain model resource library provided by an embodiment of the present invention. Figure 4 It contains four mountain models, each with a different shape and size, and each mountain model represents a length trend.

[0050] In practical implementation, this invention can be implemented using Houdini software. In this case, a mountain model resource library needs to be prepared in advance and imported into Houdini software in FBX (FilmBoX, a file format).

[0051] In practical applications, preset mountain model resources can be obtained from the mountain model resource library according to the preset model reference path. The random parameters for model selection are set, and the corresponding model reference path can be changed by modifying the random parameters, thereby achieving the purpose of randomly selecting mountain models.

[0052] Step S210: Adjust the preset mountain model according to the mountain placement parameters, and map the adjusted mountain model onto the final distribution area to generate mountains on the preset terrain model.

[0053] Step S212: Obtain the vegetation distribution area from the adjusted mountain model.

[0054] To set vegetation on the mountain, the adjusted mountain model needs to be placed in the final distribution area, and the vegetation distribution area is obtained from the adjusted mountain model. Usually, the area in the adjusted mountain model with a slope less than a preset slope threshold is determined as the vegetation distribution area.

[0055] The specific value of the aforementioned preset slope threshold can be determined based on research and development needs or in conjunction with the growth patterns of vegetation displayed. For example, the preset slope threshold can be set to 45 degrees, meaning that areas with a slope less than 45 degrees in the adjusted mountain model are designated as the vegetation distribution areas where mountain vegetation needs to be distributed. Figure 5 The diagram shown is a schematic representation of a vegetation distribution area according to an embodiment of the present invention. Figure 5 The protruding part on the right is a mountain set on the terrain model, and the dark area on the mountain is the vegetation distribution area.

[0056] Step S214: Generate mountain vegetation in the vegetation distribution area to obtain a mountain model containing mountain vegetation.

[0057] By distributing mountain vegetation according to preset rules within a vegetation distribution area, a mountain model containing mountain vegetation can be generated on a preset terrain model. These preset rules can be set according to development needs; for example, they could generate mountain vegetation according to a certain vegetation density or a specified vegetation generation pattern, etc., without specific limitations here. Figure 6 The image shown is a schematic diagram of a mountain model containing mountain vegetation provided in an embodiment of the present invention. Figure 6 The prominent area in the image is the mountain model, and the dark objects on the mountain model represent the mountain vegetation.

[0058] The above-described method for generating mountain models first identifies a first region in the preset terrain model whose height exceeds a preset height threshold, based on the height information of the preset terrain model. This first region is then designated as the initial distribution area for mountains on the preset terrain model. Next, a final distribution area with specified terrain features is obtained from the initial distribution area, and mountain placement parameters are determined based on this final distribution area. A preset mountain model is then retrieved from a preset mountain model resource library. Following the mountain placement parameters, the preset mountain model is adjusted and mapped onto the final distribution area to generate mountains on the preset terrain model. Finally, a vegetation distribution area is obtained from the adjusted mountain model, and mountain vegetation is generated within this area, resulting in a mountain model containing vegetation. This method automatically selects mountain models based on the mountain's contour patterns in the terrain model and correctly scales and rotates them according to the placement parameters, placing them on the correct terrain and covering them with vegetation. This automated generation method reduces manual editing of mountain models, thereby improving generation efficiency.

[0059] This invention also provides another method for generating mountain models, which is implemented based on the above embodiments. This method focuses on describing the specific process of obtaining a final distribution area with specified terrain features from an initial distribution area, and determining the mountain placement parameters based on the final distribution area (specifically implemented through steps S704-S712 below); such as Figure 7 As shown, the method includes the following specific steps:

[0060] Step S702: Based on the height information of the preset terrain model, determine the initial distribution area of ​​the mountain on the preset terrain model.

[0061] Step S704: Divide the initial distribution area into at least one sub-region according to the terrain features of the preset terrain model.

[0062] In a practical implementation, step S704 above can be achieved through the following steps 10-11:

[0063] Step 10: Based on the terrain features of the preset terrain model, determine the road area and river area in the preset terrain model.

[0064] Based on the distribution information of roads and rivers in the preset terrain model, the road areas and river areas in the preset terrain model can be obtained, such as... Figure 8 The diagram shown is a schematic representation of a road area and a river area according to an embodiment of the present invention. Figure 8 In the diagram on the left, the dark areas in the preset terrain model represent road areas. Figure 8 In the diagram on the right, the dark area in the preset terrain model represents the river model.

[0065] Step 11: Remove the road and river areas from the initial distribution area to obtain at least one sub-region.

[0066] In practical implementation, the area obtained after deleting the road and river areas from the initial distribution area is determined as at least one sub-region. Specifically, the road and river areas may divide the initial distribution area into at least one sub-region, or the road and river areas may not pass through the initial distribution area, and the initial distribution area itself may contain multiple independent sub-regions.

[0067] Step S706: Based on at least one sub-region, obtain the final distribution area.

[0068] In a practical implementation, step S706 above can be achieved through the following steps 20-22:

[0069] Step 20: Delete sub-regions whose size is smaller than the first size threshold from at least one sub-region to obtain the second region.

[0070] In practical implementation, sub-regions smaller than the first size threshold are typically areas where mountains will not be generated, and therefore need to be deleted from at least one sub-region. Here, the deletion involves relatively small areas within at least one sub-region. The aforementioned first size threshold can be set according to research and development needs; for example, it can be set to 1 square meter or 0.5 square meters, etc. Figure 9 The diagram shown is a schematic representation of the second region provided in an embodiment of the present invention. Figure 9It contains three second regions, that is Figure 9 The three gray blocks in the image.

[0071] Step 21: For each second region, perform convex hull operation on the current second region to obtain the convex hull geometry of the current second region.

[0072] The convex hull operation described above can be understood as setting up a geometric shape that perfectly encloses each independent second region. The convex hull operation is a classic and commonly used algorithm in computational geometry. It addresses the problem of calculating a convex polygon (equivalent to a convex hull geometry) containing all discrete points in a given space. In this embodiment of the invention, the existing Graham scan method and Andrew's algorithm can be used to perform the convex hull operation. Figure 10 The diagram shown is a schematic representation of the convex hull geometry of the second region provided in an embodiment of the present invention. Figure 10 The convex hull set in the middle is a collection of convex hulls. Figure 9 The convex hull is obtained by performing convex hull operations on the three second regions in the image.

[0073] Step 22: Determine the final distribution area based on the convex hull geometry of the second region.

[0074] In practice, step 22 above can be achieved through the following steps 30-32:

[0075] Step 30: Delete the convex hull geometry of the second region whose size is smaller than the second size threshold to obtain the final geometry.

[0076] In practical implementation, convex hull geometries with dimensions smaller than the second size threshold are typically not used to generate convex hull geometries for the regions corresponding to the mountain, and therefore need to be deleted. The aforementioned second size threshold can be set according to development needs; for example, it can be set to 3 square meters or 5 square meters, etc. Figure 11 The figure shown is a schematic diagram of the final geometry provided in an embodiment of the present invention. Figure 11 It contains only one final geometry. Figure 11 It is Figure 10 The result after deleting the two smaller convex hull geometries.

[0077] Step 31: Determine the minimum bounding cube for each final geometry. For example... Figure 12 The diagram shown is a schematic of the minimum circumscribed cuboid of the final geometry.

[0078] Step 32: Process the minimum circumscribed cuboid based on the road and river areas in the preset terrain model to obtain the final distribution area.

[0079] Specifically, the road and river regions in the preset terrain model are extruded to obtain road and river models with volume. The final distribution area is determined by subtracting the road and river models from the minimum bounding cube in the preset terrain model. In implementation, the road and river regions are extruded to form a base, resulting in road and river models with a certain volume. This extrusion process can be achieved using an extrude editor, which can add thickness to splines, stretching two-dimensional shapes into three-dimensional forms. Figure 13 The diagram shown is a schematic representation of the road and river models provided in an embodiment of the present invention. Figure 13 The gray model in the figure Figure 8 It was obtained by compressing the road and river areas within the area. Figure 13 The gray model in the image is a schematic diagram of the road and river models.

[0080] The purpose of subtracting the road and river models from the minimum bounding box is to ensure that the minimum bounding box does not intersect with roads and rivers in the terrain model. Figure 14 This is a schematic diagram of a road model, a river model, and a minimum circumscribed cuboid provided in an embodiment of the present invention. Figure 14 The minimum bounding cube and the river and road models displayed in wireframe are special cases, that is, the minimum bounding cube does not intersect with the road and river models. Of course, there are cases where they do intersect, but they will not be listed here.

[0081] Step S708: Determine the longest axis line based on the smallest circumscribed cuboid corresponding to the final distribution area.

[0082] In practical implementation, we can determine the two faces with the smallest area in the smallest circumscribed cuboid corresponding to the final distribution area; connect the center points of the two faces to obtain the longest axis line.

[0083] Step S710: Determine the length of the longest axis line as the size of the mountain model.

[0084] For example, if the length of the longest axis line is 10 meters, then the size of the mountain model to be set in the final distribution area is also 10 meters.

[0085] Step S712: Determine the direction of the longest axis connection as the orientation of the mountain model.

[0086] Specifically, a vector can be obtained from the two endpoints of the longest axis line. This vector will serve as the rotation value of the mountain, which will be used to indicate the orientation of the mountain model. The two endpoints of the longest axis line can form two vectors in two directions, either of which can be used to indicate the orientation of the mountain model.

[0087] Step S714: Determine the midpoint of the longest axis line as the axis center of the mountain.

[0088] In practice, if there are multiple final distribution areas, steps S710-S714 need to be executed for each final distribution area to obtain the mountain size, orientation and center point of the mountain model corresponding to each final distribution area, so that the corresponding mountain model can be placed on each final distribution area later.

[0089] Step S716: Save the mountain placement parameters to the mountain's center point and set the corresponding preset mountain model for the center point; wherein, the mountain placement parameters include the mountain size and the mountain orientation.

[0090] In the specific implementation, a preset mountain model is set for each axis point. This preset mountain model corresponds to the model reference path in the game engine, and the random parameters for model selection are set. By modifying the random parameters, the model reference path of the corresponding mountain model can be changed, thereby achieving the purpose of randomly selecting a mountain model from the mountain resource model.

[0091] In practical applications, the dihedral() function can be used to convert the rotation value corresponding to the orientation of the mountain into a quaternion, thereby storing all the information needed by the mountain model at the axis point.

[0092] Step S718: Adjust the preset mountain model according to the mountain placement parameters, and map the adjusted mountain model onto the final distribution area to generate mountains on the preset terrain model.

[0093] After generating mountains on the preset terrain model, you can also generate mountain vegetation on the mountain. Then, render the mountain vegetation and mountain model in the game engine to get the final game scene.

[0094] The above-mentioned method for generating mountain models can automatically place mountain models on the terrain model, saving a lot of manpower costs in model editing. At the same time, the automated mountains generated in this method will automatically avoid areas such as rivers and roads, and will further spread vegetation after the mountains are generated, completing multiple tasks.

[0095] Corresponding to the above method embodiments, this invention also provides a mountain model generation device, such as... Figure 15As shown, the device includes:

[0096] The region determination module 90 is used to determine the initial distribution area of ​​the mountain on the preset terrain model based on the height information of the preset terrain model.

[0097] The parameter determination module 91 is used to obtain a final distribution area with specified terrain features from the initial distribution area, and determine the mountain placement parameters based on the final distribution area; wherein, the mountain placement parameters are used to indicate the mountain size and / or mountain orientation of the mountain model.

[0098] The model generation module 92 is used to adjust the preset mountain model according to the mountain placement parameters, and map the adjusted mountain model onto the final distribution area to generate mountains on the preset terrain model.

[0099] The aforementioned mountain model generation device first determines the initial distribution area of ​​mountains on a preset terrain model based on the height information of the preset terrain model. Then, it obtains a final distribution area with specified terrain features from the initial distribution area. Based on the final distribution area, it determines mountain placement parameters, which indicate the size and / or orientation of the mountain model. Next, it adjusts the preset mountain model according to the mountain placement parameters and maps the adjusted model onto the final distribution area to generate mountains on the preset terrain model. This method can determine the mountain distribution area and mountain placement parameters based on the terrain features and height information of the terrain model, and then adjust the obtained mountain model based on the mountain placement parameters. This allows the mountain model to place mountains on the terrain model according to the mountain's natural contours. Furthermore, this method can automatically generate mountains from the terrain model, thereby improving the efficiency of mountain model generation and the scene creation efficiency of large-scale games.

[0100] Furthermore, the above-mentioned device also includes a vegetation generation module, used for: after adjusting the preset mountain model according to the mountain placement parameters, mapping the adjusted mountain model onto the final distribution area to generate a mountain on the preset terrain model, obtaining the vegetation distribution area from the adjusted mountain model; generating mountain vegetation in the vegetation distribution area to obtain a mountain model containing mountain vegetation.

[0101] Specifically, the aforementioned vegetation generation module is also used to: identify areas in the adjusted mountain model with slopes less than a preset slope threshold as vegetation distribution areas.

[0102] Furthermore, the aforementioned region determination module 90 is also used to: determine a first region in the preset terrain model whose height is greater than a preset height threshold based on the height information of the preset terrain model; and determine the first region as the initial distribution area of ​​the mountain on the preset terrain model.

[0103] In a specific implementation, the parameter determination module 91 includes: a region division unit, used to divide the initial distribution area into at least one sub-region according to the terrain features of the preset terrain model; and a region determination unit, used to obtain the final distribution area based on at least one sub-region.

[0104] Furthermore, the aforementioned region division module is also used to: determine the road region and river region in the preset terrain model based on the terrain features of the preset terrain model; remove the road region and river region in the initial distribution area to obtain at least one sub-region.

[0105] Furthermore, the aforementioned region determination unit is used to: delete sub-regions with sizes smaller than a first size threshold from at least one sub-region to obtain a second region; perform convex hull operation on the current second region for each second region to obtain the convex hull geometry of the current second region; and determine the final distribution region based on the convex hull geometry of the second region.

[0106] In a specific implementation, the aforementioned region determination unit is also used to: delete convex hull geometries with dimensions smaller than the second size threshold from the convex hull geometry of the second region to obtain the final geometry; determine the minimum bounding cuboid of each final geometry; and process the minimum bounding cuboid based on the road region and river region in the preset terrain model to obtain the final distribution region.

[0107] In practical implementation, the aforementioned region determination unit is also used to: compress the road and river regions in the preset terrain model to obtain road and river models with volume; and determine the final distribution area by subtracting the road and river models from the minimum circumscribed cuboid in the preset terrain model.

[0108] Furthermore, the above-mentioned mountain placement parameters include mountain size and mountain orientation; the above-mentioned parameter determination module 91 is also used to: determine the longest axis connection line according to the minimum circumscribed cuboid corresponding to the final distribution area; determine the size of the longest axis connection line as the mountain size of the mountain model; and determine the direction of the longest axis connection line as the mountain orientation of the mountain model.

[0109] In practical applications, the parameter determination module 91 is also used to: determine the two faces with the smallest area in the smallest circumscribed cuboid corresponding to the final distribution area; and connect the center points of the two faces to obtain the longest axis line.

[0110] Furthermore, the above-mentioned device also includes a parameter saving module, used to: determine the midpoint of the longest axis line as the axis point of the mountain; save the mountain placement parameters to the axis point of the mountain, and set a corresponding preset mountain model for the axis point.

[0111] In a specific implementation, the above-mentioned device also includes a model acquisition module, which is used to: adjust the preset mountain model according to the mountain placement parameters, and map the adjusted mountain model onto the final distribution area so as to obtain the preset mountain model from the preset mountain model resource library before generating the mountain on the preset terrain model; wherein, the mountain model resource library contains multiple mountain models of different shapes.

[0112] The mountain model generation device provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned mountain model generation method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0113] This invention also provides an electronic device, such as... Figure 16 As shown, the electronic device includes a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, which executes the machine-executable instructions to implement the above-described mountain model generation method.

[0114] Furthermore, Figure 16 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 101, the communication interface 103 and the memory 100 connected via the bus 102.

[0115] The memory 100 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 16 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0116] Processor 101 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 101 or by instructions in software form. The processor 101 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it 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, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 100, and processor 101 reads information from memory 100 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0117] This invention also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the above-described mountain model generation method. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0118] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal device, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0119] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0120] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for generating a mountain model, characterized in that, The method includes: Based on the height information of the preset terrain model, the initial distribution area of ​​the mountain on the preset terrain model is determined; A final distribution area with specified terrain features is obtained from the initial distribution area, and mountain placement parameters are determined based on the final distribution area; wherein, the mountain placement parameters are used to indicate the mountain size and / or mountain orientation of the mountain model; the final distribution area with specified terrain features includes: terrain areas in the initial distribution area with a height greater than a preset threshold, or terrain areas in the initial distribution area after removing river areas and road areas; Based on the mountain placement parameters, the preset mountain model is adjusted, and the adjusted mountain model is mapped to the final distribution area to generate mountains on the preset terrain model; The step of determining the initial distribution area of ​​mountains on the preset terrain model based on the height information of the preset terrain model includes: determining a first area in the preset terrain model whose height is greater than a preset height threshold according to the height information of the preset terrain model; and determining the first area as the initial distribution area of ​​mountains on the preset terrain model.

2. The method according to claim 1, characterized in that, After the step of adjusting the preset mountain model according to the mountain placement parameters and mapping the adjusted mountain model to the final distribution area to generate mountains on the preset terrain model, the method further includes: The vegetation distribution area is obtained from the adjusted mountain model; Mountain vegetation is generated in the vegetation distribution area to obtain a mountain model containing the mountain vegetation.

3. The method according to claim 2, characterized in that, The step of obtaining the vegetation distribution area from the adjusted mountain model includes: The areas in the adjusted mountain model with slopes less than a preset slope threshold are identified as the vegetation distribution areas.

4. The method according to claim 1, characterized in that, The step of obtaining a final distribution area with specified terrain features from the initial distribution area includes: Based on the terrain features of the preset terrain model, the initial distribution area is divided into at least one sub-region; The final distribution area is obtained based on the at least one sub-region.

5. The method according to claim 4, characterized in that, The step of dividing the initial distribution area into at least one sub-region based on the terrain features of the preset terrain model includes: Based on the terrain features of the preset terrain model, the road area and river area in the preset terrain model are determined; The road area and the river area in the initial distribution area are removed to obtain the at least one sub-region.

6. The method according to claim 4, characterized in that, The step of obtaining the final distribution area based on the at least one sub-region includes: A second region is obtained by deleting a sub-region with a size smaller than a first size threshold from the at least one sub-region; For each of the second regions, perform a convex hull operation on the current second region to obtain the convex hull geometry of the current second region; The final distribution region is determined based on the convex hull geometry of the second region.

7. The method according to claim 6, characterized in that, The step of determining the final distribution region based on the convex hull geometry of the second region includes: In the convex hull geometry of the second region, delete the convex hull geometry whose size is smaller than the second size threshold to obtain the final geometry; Determine the minimum bounding cube for each of the final geometries; The minimum circumscribed cuboid is processed based on the road and river regions in the preset terrain model to obtain the final distribution area.

8. The method according to claim 7, characterized in that, The step of processing the minimum circumscribed cuboid based on the road and river regions in the preset terrain model to obtain the final distribution area includes: The road and river areas in the preset terrain model are compressed to obtain road and river models with volume. In the preset terrain model, the final distribution area is determined by subtracting the road model and the river model from the minimum circumscribed cuboid.

9. The method according to claim 1, characterized in that, The mountain placement parameters include the mountain dimensions and the mountain orientation; The step of determining the hill placement parameters based on the final distribution area includes: The longest axis line is determined based on the smallest circumscribed cuboid corresponding to the final distribution area; The dimension of the line connecting the longest axes is determined as the mountain dimension of the mountain model; The direction of the line connecting the longest axes is determined as the orientation of the mountain model.

10. The method according to claim 9, characterized in that, The step of determining the longest axis line based on the smallest circumscribed cuboid corresponding to the final distribution region includes: Determine the two faces with the smallest area in the smallest circumscribed cuboid corresponding to the final distribution region; Connecting the center points of the two faces yields the longest axis line.

11. The method according to claim 10, characterized in that, The method further includes: The midpoint of the longest axis line is determined as the axis center of the mountain. Save the mountain placement parameters to the mountain's center point, and set a corresponding preset mountain model for the center point.

12. The method according to claim 1, characterized in that, Before the step of adjusting the preset mountain model according to the mountain placement parameters and mapping the adjusted mountain model to the final distribution area to generate mountains on the preset terrain model, the method further includes: The preset mountain model is obtained from the preset mountain model resource library; wherein the mountain model resource library contains multiple mountain models of different shapes.

13. A mountain model generation device, characterized in that, The device includes: The region determination module is used to determine the initial distribution area of ​​mountains on the preset terrain model based on the height information of the preset terrain model; The parameter determination module is used to obtain a final distribution area with specified terrain features from the initial distribution area, and determine the mountain placement parameters based on the final distribution area; wherein, the mountain placement parameters are used to indicate the mountain size and / or mountain orientation of the mountain model; the final distribution area with specified terrain features includes: terrain areas in the initial distribution area with a height greater than a preset threshold, or terrain areas in the initial distribution area after removing river areas and road areas; The model generation module is used to adjust the preset mountain model according to the mountain placement parameters, and map the adjusted mountain model to the final distribution area to generate mountains on the preset terrain model; The region determination module is further configured to: determine a first region in the preset terrain model whose height is greater than a preset height threshold based on the height information of the preset terrain model; and determine the first region as the initial distribution area of ​​the mountain on the preset terrain model.

14. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the mountain model generation method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the mountain model generation method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Method and device for generating mountain in sand table map, storage medium and processor

    CN110288690A

  • Virtual ground surface processing method and device and electronic device

    CN112530012A