Map generation method and device, electronic equipment and storage medium

CN115731318BActive Publication Date: 2026-08-21XINGZHEN TECH (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211503648.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-28
Publication Date
2026-08-21
Estimated Expiration
2042-11-28

AI Technical Summary

Technical Problem

[0004]然而,上述方法中,整个游戏世界的地图完全由游戏制作者手动生成,在游戏世界的规模较大的情况下,地图的生成需要耗费高昂的人力成本和时间成本,消耗的美术资源和存储资源也将十分庞大

Benefits of technology

[0061]根据本申请实施例的第五方面,提供一种计算机程序产品,包括一条或多条指令,该一条或多条指令由电子设备的一个或多个处理器执行,使得该电子设备能够执行上述地图的生成方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115731318B_ABST
    Figure CN115731318B_ABST
Patent Text Reader

Abstract

The application relates to a map generation method and device, electronic equipment and a storage medium, and belongs to the computer technical field. The method comprises the following steps: importing a terrain height map and a plurality of terrain modules of a to-be-generated map; based on the terrain type corresponding to each region of the terrain height map, superimposing the height value of each region and the height value of the corresponding terrain module to obtain a first height value of each region; obtaining a first map based on the first height value of each region; and performing mapping on the first map to obtain a map. Through the above method, the terrain modules are superimposed on the terrain height map, and the height value of the terrain module is added to the height value of the terrain height map. Since the same terrain module can superimpose different height values at different positions of the terrain height map, a rich terrain effect can be generated by using fewer terrain modules, thereby saving the labor cost and time cost required for generating a large-scale map, and saving artistic resources and storage resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device and storage medium for generating maps. Background Technology

[0002] With the development of computer technology, game technology has also evolved, and diverse games have enriched people's daily lives. Game maps, including terrain, vegetation, and buildings, play a vital role in enriching game content and enhancing the gaming experience.

[0003] In related technologies, game developers use various art tools to generate the entire map and then store the generated map in blocks.

[0004] However, in the above method, the entire game world map is generated manually by the game developers. When the game world is large, the map generation requires high manpower and time costs, and the art and storage resources consumed will also be enormous. Summary of the Invention

[0005] This application provides a map generation method, apparatus, electronic device, and storage medium, which can save the manpower and time required for map generation, as well as art and storage resources. The technical solution of this application is as follows.

[0006] According to a first aspect of the embodiments of this application, a map generation method is provided, the method comprising:

[0007] In response to the import operation of the terrain height map, the terrain height map of the map to be generated is obtained. The terrain height map indicates the height value of the map and includes multiple regions, each corresponding to a terrain type.

[0008] In response to the import operation of the terrain module, multiple terrain modules are obtained. These terrain modules are used to generate local detailed terrain, and each terrain module corresponds to a terrain type.

[0009] In response to the terrain overlay function being triggered, based on the terrain type corresponding to each region in the terrain height map, the height value of each region is overlaid with the height value of the corresponding terrain module to obtain the first height value of each region, and the first map is obtained based on the first height value of each region.

[0010] Apply textures to the first map to obtain the final map.

[0011] In the above method, terrain modules are superimposed on the terrain elevation map, and the height value of the terrain module is added to the height value of the terrain elevation map. Since the same terrain module can produce different height values ​​when superimposed at different positions on the terrain elevation map, a rich terrain effect can be generated using fewer terrain modules, thereby saving the manpower and time costs required to generate large-scale maps, as well as art resources and storage resources.

[0012] In one possible implementation, in response to the terrain overlay function being triggered, based on the terrain type corresponding to each region of the terrain height map, the height value of each region is overlaid with the height value of the corresponding terrain module to obtain a first height value for each region, including:

[0013] In response to the marking operation of the target area in the terrain height map, the terrain type corresponding to the target area in the terrain height map is determined. Based on the terrain type corresponding to the target area, the target terrain module corresponding to the target area is determined. The target area is any area in the terrain height map, and the target terrain module corresponds to the same terrain type as the target area.

[0014] The height value of the target terrain module is superimposed with the height value of the target area to obtain the first height value of the target area.

[0015] In the above method, the terminal automatically determines the terrain module that matches the target area based on the terrain type, and randomly overlays the determined terrain module onto the target area. This can reduce user operations, save the time spent generating maps, and improve the efficiency of map generation. In addition, the random overlay of terrain modules on the target area can produce a variety of terrain module combinations, thereby generating rich terrain effects.

[0016] In one possible implementation, in response to the terrain overlay function being triggered, based on the terrain type corresponding to each region of the terrain height map, the height value of each region is added to the height value of the corresponding terrain module to obtain a first height value for each region, including:

[0017] In response to a drag operation on the target terrain module, the height value of the area where the end point of the drag operation is located is superimposed with the height value of the target terrain module to obtain the first height value of the area where the end point of the drag operation is located.

[0018] In the above method, the terrain module can be dragged and dropped to any position on the terrain height map, which is convenient and flexible.

[0019] In one possible implementation, the method further includes:

[0020] In the case where the first terrain module and the second terrain module overlap, a second height value of the overlapping area is determined based on the height value of the first terrain module in the overlapping area and the height value of the second terrain module in the overlapping area. The second height value is the maximum value between the height value of the first terrain module in the overlapping area and the height value of the second terrain module in the overlapping area.

[0021] The second elevation value of the overlapping area is superimposed with the elevation value of the overlapping area on the terrain elevation map to obtain the third elevation value. Based on the third elevation value, a map of the overlapping area is obtained.

[0022] In the above method, the second height value of the overlapping area is the maximum value of the height values ​​of the first terrain module and the second terrain module in the overlapping area, which ensures that the terrain undulations inside the overlapping area are obvious and reduces the possibility that the overlapping area after superposition becomes flat land.

[0023] In one possible implementation, at least one of the first and second terrain modules has a model resource indicating land cover on the terrain module; the method further includes:

[0024] Display the model resource on a map of the overlapping area.

[0025] The above method can automatically adjust the position of model resources on the surface of the terrain module, reducing manual operations and improving map generation efficiency.

[0026] In one possible implementation, the method further includes:

[0027] In response to a rotation operation on the terrain module, rotate the terrain module on the terrain height map.

[0028] In the above method, the terrain module can be rotated, thereby producing a variety of terrain effects from the same terrain module.

[0029] In one possible implementation, the terrain module includes multiple sub-modules, and the method further includes:

[0030] In response to a drag operation on the first submodule of the terrain module, if the endpoint of the drag operation is located at the position of the second submodule of the terrain module, swap the positions of the first and second submodules.

[0031] In the above method, the positions of the sub-modules of the terrain module can be swapped, thereby producing a variety of terrain effects from the same terrain module.

[0032] In one possible implementation, the method further includes:

[0033] The terrain height map is obtained by enlarging the thumbnail of the terrain height map to the target size, where the target size indicates the size of the map to be generated.

[0034] The above method, which obtains a terrain elevation map by enlarging the thumbnail, can reduce the manpower and time costs required to create terrain elevation maps and save art resources.

[0035] According to a second aspect of the embodiments of this application, a map generation apparatus is provided, the apparatus comprising:

[0036] The first import unit is configured to perform an import operation in response to the terrain height map to obtain the terrain height map of the map to be generated. The terrain height map indicates the height value of the map and includes multiple regions, each region corresponding to a terrain type.

[0037] The second import unit is configured to perform an import operation on a terrain module to obtain multiple terrain modules, which are used to generate local detailed terrain, and each terrain module corresponds to a terrain type.

[0038] The terrain overlay unit is configured to respond to the terrain overlay function being triggered by overlaying the height values ​​of each region based on the terrain type of each region in the terrain height map, overlaying the height values ​​of each region with the height values ​​of the corresponding terrain modules to obtain the first height value of each region, and obtaining the first map based on the first height values ​​of each region.

[0039] The texturing unit is configured to perform texturing on the first map to obtain the map.

[0040] In one possible implementation, the terrain overlay unit is configured to perform:

[0041] In response to the marking operation of the target area in the terrain height map, the terrain type corresponding to the target area in the terrain height map is determined. Based on the terrain type corresponding to the target area, the target terrain module corresponding to the target area is determined. The target area is any area in the terrain height map, and the target terrain module corresponds to the same terrain type as the target area.

[0042] The height value of the target terrain module is superimposed with the height value of the target area to obtain the first height value of the target area.

[0043] In one possible implementation, the terrain overlay unit is configured to perform:

[0044] In response to a drag operation on the target terrain module, the height value of the area where the end point of the drag operation is located is superimposed with the height value of the target terrain module to obtain the first height value of the area where the end point of the drag operation is located.

[0045] In one possible implementation, the terrain overlay unit is also configured to perform:

[0046] In the case where the first terrain module and the second terrain module overlap, a second height value of the overlapping area is determined based on the height value of the first terrain module in the overlapping area and the height value of the second terrain module in the overlapping area. The second height value is the maximum value between the height value of the first terrain module in the overlapping area and the height value of the second terrain module in the overlapping area.

[0047] The second elevation value of the overlapping area is superimposed with the elevation value of the overlapping area on the terrain elevation map to obtain the third elevation value. Based on the third elevation value, a map of the overlapping area is obtained.

[0048] In one possible implementation, at least one of the first and second terrain modules has a model resource indicating land cover on the terrain module, and the terrain overlay unit is further configured to perform:

[0049] Display the model resource on a map of the overlapping area.

[0050] In one possible implementation, the device further includes:

[0051] The rotation unit is configured to perform a rotation operation on the terrain module on the terrain height map in response to the terrain module rotation operation.

[0052] In one possible implementation, the terrain module includes multiple sub-modules, and the device further includes:

[0053] The swap unit is configured to perform a drag operation in response to the first submodule of the terrain module, and swap the positions of the first and second submodules if the endpoint of the drag operation is located at the position of the second submodule of the terrain module.

[0054] In one possible implementation, the transpose further includes:

[0055] The zoom unit is configured to zoom in on a thumbnail of the terrain height map to a target size to obtain a terrain height map, the target size indicating the size of the map to be generated.

[0056] According to a third aspect of the embodiments of this application, an electronic device is provided, the electronic device comprising:

[0057] One or more processors;

[0058] Memory used to store the executable program code of the processor;

[0059] The processor is configured to execute the program code to implement the map generation method described above.

[0060] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided, the computer-readable storage medium comprising: when program code in the computer-readable storage medium is executed by a processor of an electronic device, enabling the electronic device to perform the above-described map generation method.

[0061] According to a fifth aspect of the embodiments of this application, a computer program product is provided, including one or more instructions, which are executed by one or more processors of an electronic device, enabling the electronic device to perform the map generation method described above.

[0062] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0063] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application, and do not constitute an undue limitation of this application.

[0064] Figure 1 This is a schematic diagram illustrating the implementation environment of a map generation method provided in an embodiment of this application;

[0065] Figure 2 This is a flowchart of a map generation method provided in an embodiment of this application;

[0066] Figure 3 This is a flowchart of a map generation method provided in an embodiment of this application;

[0067] Figure 4 This is a schematic diagram of a miniature topographic map provided in an embodiment of this application;

[0068] Figure 5 This is a schematic diagram of a local height map provided in an embodiment of this application;

[0069] Figure 6 This is a schematic diagram illustrating the correspondence between a terrain module and a local height map provided in an embodiment of this application;

[0070] Figure 7 This is a schematic diagram of a sub-module of a terrain module provided in an embodiment of this application;

[0071] Figure 8 This is a two-dimensional schematic diagram of a sub-module of a terrain module provided in an embodiment of this application;

[0072] Figure 9 This is a three-dimensional schematic diagram of a sub-module of a terrain module provided in an embodiment of this application;

[0073] Figure 10This is a schematic diagram of overlaying a terrain module on a terrain elevation map according to an embodiment of this application;

[0074] Figure 11 This is a schematic diagram illustrating a method for determining a second height value of an overlapping region, as provided in an embodiment of this application.

[0075] Figure 12 This is a schematic diagram of terrain module fusion provided in an embodiment of this application;

[0076] Figure 13 This is a schematic diagram illustrating how the location of a model resource adapts to module fusion, as provided in an embodiment of this application.

[0077] Figure 14 This is a schematic diagram of rotating a terrain module on a terrain elevation map provided in this application.

[0078] Figure 15 This is a schematic diagram illustrating the texturing of a first map according to an embodiment of this application;

[0079] Figure 16 This is a schematic diagram of a map provided in an embodiment of this application;

[0080] Figure 17 This is a schematic diagram of the structure of a map generation device provided in an embodiment of this application;

[0081] Figure 18 This is a structural block diagram of a terminal provided in an embodiment of this application. Detailed Implementation

[0082] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0083] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of methods and systems consistent with some aspects of this application as detailed in the appended claims.

[0084] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items that have essentially the same function. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor does it limit the quantity or execution order. It should also be understood that although the following description uses the terms "first," "second," etc., to describe various elements, these elements should not be limited by the terms.

[0085] These terms are simply used to distinguish one element from another. For example, without departing from the scope of various examples, a first terrain module can be referred to as a second terrain module, and similarly, a second terrain module can be referred to as a first terrain module.

[0086] Here, "at least one" means one or more. For example, at least one terrain module can be one terrain module, two terrain modules, three terrain modules, or any integer number of terrain modules greater than or equal to one. "Multiple" means two or more. For example, multiple terrain modules can be two terrain modules, three terrain modules, or any integer number of terrain modules greater than or equal to two.

[0087] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the maps involved in this application were obtained with full authorization.

[0088] The implementation environment of the embodiments of this application is described below.

[0089] Figure 1 This is a schematic diagram illustrating the implementation environment of a map generation method provided in this application embodiment, such as... Figure 1 As shown, the implementation environment includes a terminal 101 and a server 102. The terminal 101 can connect to the server 102 via a wireless network or a wired network.

[0090] Terminal 101 can be at least one of the following devices: smartphone, smartwatch, desktop computer, laptop, virtual reality terminal, augmented reality terminal, wireless terminal, and laptop computer. Terminal 101 has communication functions and can access the Internet. Terminal 101 can refer to one of multiple terminals; this embodiment only uses terminal 101 as an example. Those skilled in the art will understand that the number of terminals can be more or less. Indicatively, terminal 101 can run an application program that provides a toolchain for generating maps, such as terrain brushes for generating terrain, model resource brushes for adding model resources to terrain, and surface material brushes for applying textures to the terrain surface, etc., to realize the terrain creation, model resource addition, and texturing work required for map generation, thereby realizing a map generation workflow. For example, in response to a sliding operation based on a terrain brush, the application generates terrain of the corresponding height in the area slid across the terrain based on the height value corresponding to the terrain brush; in response to a click operation based on a model resource brush, it displays the surface cover corresponding to the model resource brush at the target location of the terrain, etc. This application can be a map editing application, a game engine application, an interactive real-time graphics application, a 3D animation rendering and production application, etc., without limitation.

[0091] Server 102 can be a standalone physical server, a server cluster consisting of multiple physical servers, or a distributed file system. It can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Server 102 provides background services for the applications running on terminal 101. For example, it stores the map generated by terminal 101 in chunks. During game operation, it loads the corresponding map chunks according to the player's field of view to generate a map corresponding to that field of view. Terminal 101 calls this map through an interface and displays it.

[0092] In some embodiments, the wired or wireless network uses standard communication technologies and / or protocols. The network is typically the Internet, but can be any network, including but not limited to LAN (Local Area Network), MAN (Metropolitan Area Network), WAN (Wide Area Network), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats including HTML (Hypertext Markup Language), XML (Extensible Markup Language), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as SSL (Secure Socket Layer), TLS (Transport Layer Security), VPN (Virtual Private Network), and IPsec (Internet Protocol Security) can be used to encrypt all or some links. In other embodiments, custom and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.

[0093] The implementation environment of the embodiments of this application has been described above. The following describes a map generation method provided by the embodiments of this application. Figure 2 This is a flowchart of a map generation method provided in an embodiment of this application, such as... Figure 2 As shown, the method is executed by the aforementioned terminal, and the method includes the following steps 201 to 204.

[0094] In step 201, in response to the import operation of the terrain height map, the terminal obtains the terrain height map of the map to be generated. The terrain height map indicates the height value of the map and includes multiple regions, each region corresponding to a terrain type.

[0095] The application running on the terminal provides a terrain height map import function. In response to the triggering of this import function, the terminal displays a terrain height map selection interface, which shows importable terrain height maps. Upon selecting any terrain height map from the selection interface, the terminal retrieves the selected terrain height map.

[0096] This terrain elevation map represents the map's outline and basic terrain features, used to determine the global topography of the map to be generated. Elevation values ​​indicate the terrain's altitude, and the size of the terrain elevation map is equal to the size of the map to be generated. The size of the map to be generated is determined based on specific needs; for example, the map size for an SLG (Simulation Game) is typically hundreds of kilometers by hundreds of kilometers.

[0097] Terrain types include plateaus, mountains, hills, plains, and basins. Terrain types indicate altitude and the shape of the surface undulations. For example, the plateau terrain type indicates terrain with an altitude of over 1,000 meters, little surface undulation, and steep edges; the mountain terrain type indicates terrain with an altitude of over 500 meters, steep slopes, deep valleys, and continuous terrain.

[0098] In step 202, in response to the import operation of the terrain module, the terminal obtains multiple terrain modules, which are used to generate local detailed terrain, and each terrain module corresponds to a terrain type.

[0099] The application running on the terminal provides a terrain module import function. In response to the terrain module import function being triggered, the terminal displays a terrain module selection interface, which shows the importable terrain modules. In response to selecting multiple terrain modules in the terrain module selection interface, the terminal retrieves the selected terrain modules.

[0100] The terrain modules vary in size and shape. Each terrain module includes at least one sub-module, which is the smallest unit that makes up the terrain module. The sub-modules of each terrain module have the same specifications.

[0101] In step 203, in response to the terrain overlay function being triggered, the terminal overlays the height value of each region with the height value of the corresponding terrain module based on the terrain type of each region in the terrain height map to obtain the first height value of each region, and obtains the first map based on the first height value of each region.

[0102] Among them, the first map, compared with the terrain elevation map, can represent more detailed terrain information.

[0103] In step 204, the terminal applies textures to the first map to obtain the map.

[0104] Here, texture refers to the surface material. By applying textures to the first map, various terrain features such as snow, grassland, and desert can be displayed on the first map, thus creating the map.

[0105] In summary, by overlaying terrain modules onto a terrain elevation map and adding the elevation values ​​of the terrain modules to the elevation values ​​of the terrain elevation map, different elevation values ​​can be generated by overlaying the same terrain module at different positions on the terrain elevation map. This allows for the generation of rich terrain effects using fewer terrain modules, thereby saving the manpower and time costs required to generate large-scale maps, as well as saving art and storage resources.

[0106] The above Figure 2 The diagram shown is only the basic process of this application. The solution provided in this application will be further elaborated below. Figure 3 This is a flowchart of a map generation method provided in an embodiment of this application, such as... Figure 3 As shown, the method is executed by the aforementioned terminal and includes the following steps 301 to 307.

[0107] In step 301, in response to the import operation of the terrain height map, the terminal obtains the terrain height map of the map to be generated. The terrain height map indicates the height value of the map and includes multiple regions, each region corresponding to a type of terrain.

[0108] The terrain height map is a grayscale image. The grayscale value of each pixel in the grayscale image is also the height value. The height value of each pixel ranges from 0 to 255. A height value of 0 indicates the lowest point of the map, and a height value of 255 indicates the highest point of the map.

[0109] The above-mentioned terrain elevation map can be obtained based on any of the following generation processes.

[0110] In one generation process, the user manually draws a three-dimensional global terrain map using a brush tool. This global terrain map is used to represent the map's outline and basic terrain features. The global terrain map is then converted into a grayscale image to obtain a terrain height map.

[0111] In another generation process, the user manually draws a miniature topographic map of the global topographic map using a brush tool, converts this miniature topographic map to grayscale, obtains a miniature topographic height map, and then enlarges this miniature to the size of the map to be generated, thus obtaining the topographic height map. The above method is one implementation of enlarging a miniature topographic height map to the target size to obtain the topographic height map. In some embodiments, this step is also performed in other ways, which are not limited in this application embodiment. Figure 4 As shown, Figure 4 This is a schematic diagram of a miniature topographic map provided in an embodiment of this application. In the above embodiment, by enlarging the miniature map to obtain a topographic elevation map, the labor and time costs required to create the topographic elevation map can be reduced, and art resources can be saved.

[0112] In another generation process, the height values ​​corresponding to each pixel in the grayscale image of the global terrain map are discretized to obtain a terrain height map. Based on a preset number of elevation difference steps, the terminal maps the height values ​​corresponding to each pixel in the grayscale image to each elevation difference step. An elevation difference step refers to a range of height values. For example, if there are 16 elevation difference steps from 0 to 15, and each step has a span of 1, then the height values ​​corresponding to each pixel can be mapped to 0 to 15, height values ​​from 0 to 10 can be mapped to 0, height values ​​from 10 to 20 can be mapped to 1, and so on.

[0113] The regions in a terrain height map can be divided during map generation or after the map is imported into the terminal. The method of dividing each region is determined based on actual needs. The terrain type corresponding to each region can be determined by marking each region. This application does not limit the timing of dividing each region in the terrain height map, the method of dividing each region, or the method of marking terrain types.

[0114] In step 302, in response to the import operation of the terrain module, the terminal obtains multiple terrain modules, which are used to generate local detailed terrain, and each terrain module corresponds to a type of terrain.

[0115] The terrain modules can be manually drawn using the brush tool, combined from multiple terrain components provided by the application, or based on a local heightmap that indicates the height value of the terrain module. Each terrain module carries an identifier indicating the terrain type it corresponds to.

[0116] In some embodiments, the terrain module is generated based on a local height map; that is, the terminal transforms the local height map into the corresponding terrain module through vertex transformation in the application's vertex shader. The following uses... Figures 5 to 9 Let's take an example to illustrate this process.

[0117] like Figure 5 As shown, Figure 5 This is a schematic diagram of a local height map provided in an embodiment of this application. Figure 5 In this example, the local heightmap is 5 pixels x 5 pixels, with each pixel corresponding to a height value. For example... Figure 6 As shown, Figure 6This is a schematic diagram illustrating the correspondence between terrain modules and local height maps provided in an embodiment of this application. Each sub-module consists of four pixels, and the vertex of each sub-module corresponds to a height value on the local height map. The height difference within each sub-module does not exceed 1. The entire local height map can generate a 4×4 terrain module. That is, a terrain module can be generated by transforming the vertices of a 4×4 grid based on this local height map. The relatively low position of a vertex in each sub-module is recorded as 0, and the relatively high position of a vertex is recorded as 1. A total of 2^4 = 16 sub-module shapes can be generated. Since four sub-modules with all positions set to 1 can be considered as four sub-modules with all positions set to 0 superimposed on a position with a height of 1, 15 sub-module shapes are obtained.

[0118] like Figure 7 As shown, Figure 7 This is a schematic diagram of a sub-module of a terrain module provided in an embodiment of this application. Figure 7 The sub-module shown in the middle left figure can be regarded as Figure 7 The sub-modules shown in the middle right image are stacked at a height of 3. (Example) Figure 8 As shown, Figure 8 This is a two-dimensional schematic diagram of a sub-module of a terrain module provided in an embodiment of this application. Figure 8 A two-dimensional schematic diagram of 16 sub-modules is shown, where vertices represented by solid circles indicate that the vertex is located at a relatively low position, and vertices represented by hollow circles indicate that the vertex is located at a relatively high position. Figure 9 As shown, Figure 9 This is a three-dimensional schematic diagram of a sub-module of a terrain module provided in an embodiment of this application. Figure 9 It shows the relationship with Figure 8 The two-dimensional schematic diagram of the neutron submodule corresponds to the three-dimensional schematic diagram of the 16 submodule forms. In the above method, based on the local height map, the vertex transformation of the mesh in the vertex shader generates the terrain module. The density of the mesh can be adjusted according to the needs, which facilitates the presentation of the LOD (Levels of Detail) of the terrain module. In addition, the edges of the terrain modules generated by the above method are flat, that is, the edges of the terrain modules do not coincide with the edges of the local height map, but are half a pixel away from the edges of the local height map. The edges of the terrain modules have no undulations, so that when different terrain modules are stitched together, the edges can fit perfectly without gaps.

[0119] By stitching together terrain modules, some special terrains can be generated. For example, if the size of the terrain elevation map is 512×512, and you need to generate Mount Everest on this terrain elevation map, you can import 9 3×3 terrain modules, which means it supports importing across multiple plots. Then, you can stitch these 9 terrain modules together to get the terrain corresponding to Mount Everest.

[0120] In some embodiments, the surface of the terrain module also contains model resources, that is, the surface of the terrain module contains surface cover, such as vegetation and buildings. The terminal can respond to a click operation based on a model resource brush on the surface of the terrain module, adding model resources at the corresponding location on the surface of the terrain module. The terminal can also respond to the addition operation of model resources by adding model resources of a corresponding density to the surface of the terrain module based on a preset model resource density.

[0121] In step 303, in response to the terrain overlay function being triggered, the terminal overlays the height value of the target terrain module with the height value of the area covered by the target terrain module, in the absence of overlap between the target terrain module and other terrain modules, to obtain a first height value of the area covered by the target terrain module, and obtains a map of the area covered by the target terrain module based on the first height value.

[0122] The terrain overlay function can be triggered in two ways: the first is to mark the terrain type corresponding to any area in the terrain height map, and the second is to drag any terrain module to any position on the terrain height map.

[0123] Based on the two triggering methods described above, the terminal overlays multiple imported terrain modules onto the corresponding areas of the terrain height map. The application's terrain overlay function supports overlapping of different terrain modules. When overlaying terrain modules, some modules may not overlap with other modules, while others may overlap. The following describes the process of overlaying terrain modules that do not overlap with other modules onto the terrain height map using the two triggering methods described above.

[0124] The superposition process based on the first triggering method is executed by the aforementioned terminal, including the following steps 1 to 2.

[0125] In step 1, in response to the marking operation of the target area in the terrain height map, the terrain type corresponding to the target area in the terrain height map is determined. Based on the terrain type corresponding to the target area, the target terrain module corresponding to the target area is determined. The target area is any area in the terrain height map, and the target terrain module corresponds to the same terrain type as the target area.

[0126] The application provides the function of filling any area on the terrain height map with color. This marking operation refers to the coloring operation of the target area on the terrain height map. Based on the color filled in the target area, the terminal determines the terrain type corresponding to the target area. For example, green corresponds to plains, and red corresponds to plateaus. If area A is filled with green, then the terrain type corresponding to area A is a plain; if area B is filled with red, then the terrain type corresponding to area B is a plateau. It should be noted that the above embodiment is only an exemplary illustration of the marking operation. The marking operation can be customized according to actual needs, and this application embodiment does not limit it in this way.

[0127] The process by which the terminal determines the target terrain module corresponding to the target area includes: determining the identifier of the terrain type corresponding to the target area based on the color filled in the target area; and determining at least one terrain module carrying the identifier from among the imported terrain modules. For example, if area A is filled with green, the terrain type corresponding to area A is plain, and the identifier of plain is p, then the terrain module carrying the identifier p is the target terrain module corresponding to the target area.

[0128] In step 2, if the target terrain module does not overlap with other terrain modules, the height value of the target terrain module is superimposed with the height value of the area covered by the target terrain module in the target region to obtain the first height value of the area covered by the target terrain module.

[0129] The terminal adds the height value corresponding to each pixel of the target terrain module to the height value corresponding to each pixel in the target area on the terrain height map to obtain the first height value of the target area.

[0130] In some embodiments, the application provides a map accuracy selection function. The terminal determines a first height value of the area covered by the target terrain module based on the accuracy of the map to be generated. This process includes: in response to the accuracy selection function being triggered, determining the accuracy level of the map to be generated; when the accuracy level of the map to be generated is the first accuracy level, superimposing the height values ​​of each pixel of the target terrain module with the height values ​​of each pixel in the area covered by the target terrain module on the terrain height map to obtain the first height value of the area covered by the target terrain module; when the accuracy level of the map to be generated is the second accuracy level, superimposing the target height values ​​of each pixel region of the target terrain module with the height values ​​of the area covered by the target terrain module to obtain the first height value of the area covered by the target terrain module, wherein the target height value of a pixel region is the maximum value of the height values ​​of each pixel in that pixel region; wherein the accuracy of the map to be generated indicated by the first accuracy level is higher than the accuracy of the map to be generated indicated by the second accuracy level.

[0131] In the above embodiments, depending on the accuracy of the map to be generated, it is determined whether the height value of the superimposed map is determined based on the height value of the pixel or the height value of the pixel region. Superimposing based on the height value of the pixel results in a map with higher accuracy, while superimposing based on the height value of the pixel region results in a map with lower accuracy. This can meet the generation requirements of maps with different accuracies.

[0132] In the overlay process based on the first triggering method, the terminal automatically determines the terrain module that matches the target area based on the terrain type, and randomly overlays the determined terrain module onto the target area. This can reduce user operations, save time spent generating maps, and improve the efficiency of map generation. In addition, the random overlay of terrain modules in the target area can produce a variety of terrain module combinations, thereby generating rich terrain effects.

[0133] Steps 1 and 2 above are an implementation method that responds to the marking operation of the target area in the terrain height map, determines the terrain type corresponding to the target area in the terrain height map, determines the target terrain module corresponding to the target area based on the terrain type corresponding to the target area, and superimposes the height value of the target terrain module with the height value of the target area to obtain the first height value of the target area. In some embodiments, this step is also performed in other ways, which are not limited in this application embodiment.

[0134] The overlay process based on the second triggering method includes: in response to a drag operation on the target terrain module, if the target terrain module does not overlap with other terrain modules, the height value of the area covered by the target terrain module corresponding to the endpoint of the drag operation is overlaid with the height value of the target terrain module to obtain a first height value of the area covered by the target terrain module. Specifically, the terminal adds the height values ​​of each position of the target terrain module to the height values ​​of each position of the area covered by the target terrain module on the terrain height map to obtain the first height value of the area covered by the target terrain module.

[0135] In the overlay process based on the second triggering method, the terrain module can be dragged and dropped to any position on the terrain height map. The operation is convenient and the terrain module overlay is highly flexible.

[0136] The above-described overlay process based on the second triggering method is an implementation that responds to a drag operation on the target terrain module by overlaying the height value of the area where the end point of the drag operation is located with the height value of the target terrain module to obtain a first height value of the area where the end point of the drag operation is located. In some embodiments, this step is also performed based on other methods, which are not limited in this application embodiment.

[0137] In some embodiments, the application only supports terrain overlay functionality based on one of the above methods. In other embodiments, the application supports terrain overlay functionality based on both of the above methods. For example, it first automatically matches terrain modules corresponding to each region, randomly overlays the terrain modules onto the corresponding regions on the terrain height map, and then fine-tunes the position of the terrain modules overlaid on the terrain height map by dragging. This application does not limit this approach. Figure 10 As shown, Figure 10 This is a schematic diagram illustrating the overlay of a terrain module onto a terrain elevation map, as provided in an embodiment of this application. Figure 10 In the process, the terrain elevation map is divided into multiple regions. In response to the marking operation of the target region in the terrain elevation map, the terminal randomly overlays the corresponding terrain module on the target region.

[0138] In step 303 above, the terrain module is overlaid on the terrain height map based on the terrain overlay function. When the target terrain module does not overlap with other terrain modules, the height values ​​of the corresponding positions are added together. Since the height values ​​of different positions on the terrain height map may be different, the same terrain module overlaid on different positions on the terrain height map can also generate different terrain effects, thereby achieving the goal of generating rich terrain using fewer terrain modules.

[0139] Step 303 above describes the process by which the terminal superimposes the height value of a terrain module with the height value of the corresponding area for terrain modules that do not overlap with other terrain modules. The following describes the process by which the terminal merges the overlapping parts between terrain modules for terrain modules that overlap with other terrain modules. This process includes steps 304 to 305 below.

[0140] In step 304, when the first terrain module and the second terrain module overlap, the terminal determines a second height value of the overlapping area based on the height value of the first terrain module in the overlapping area and the height value of the second terrain module in the overlapping area. The second height value is the maximum value between the height values ​​of the first terrain module and the second terrain module in the overlapping area.

[0141] In the above method, the second height value of the overlapping area is the maximum value of the height values ​​of the first terrain module and the second terrain module in the overlapping area. This ensures that the terrain undulations inside the overlapping area are obvious and reduces the possibility that the overlapping area after superposition will become flat land.

[0142] In some embodiments, the application provides a blending effect setting function, which allows users to set the blending effect attributes of the terrain module. For example, the blending effect attribute can be set to at least one of obvious undulations and natural transitions. This application embodiment does not limit this. The terminal blends the terrain module based on the preset blending effect attributes in the following four cases.

[0143] In the first scenario: if the terminal detects that the pre-set blending effect attribute is "natural transition", the terminal will determine the average height value of the overlapping area of ​​the first terrain module and the second terrain module as the second height value of the overlapping area.

[0144] In the second scenario: if the terminal detects that the pre-set fusion effect attribute is obvious undulation and the size of the overlapping area is smaller than the preset size, the terminal will determine the maximum value of the height of the overlapping area between the first terrain module and the second terrain module as the second height value of the overlapping area.

[0145] The third scenario: If the terminal detects that the pre-set fusion effect attribute is natural transition and obvious fluctuations, the terminal will determine the maximum height value of the first terrain module and the second terrain module in the overlapping area as the second height value inside the overlapping area, and determine the average height value of the first terrain module and the second terrain module in the overlapping area as the second height value at the edge of the overlapping area.

[0146] The fourth scenario: The terminal detects that the preset blending effect attribute is "significant undulation," and the size of the overlapping area is a target multiple of the preset size. The terminal determines the target pixels of the first terrain module and the second terrain module in the overlapping area, and the number of these target pixels is equal to the target multiple. Based on the height values ​​of the target pixels of the first and second terrain modules, the terminal determines the target height value of each target pixel. The target height values ​​of two adjacent target pixels are the maximum and minimum height values ​​of the target pixels of the first and second terrain modules, respectively. For example, if the preset blending effect attribute is "significant undulation," and the width of the overlapping area is 5 times the preset width, the terminal selects 5 pixels in the overlapping area of ​​the first and second terrain modules. The height values ​​of the 5 pixels in the first terrain module are 10, 20, 30, 30, and 50, and the height values ​​of the 5 pixels in the second terrain module are 5, 10, 20, 10, and 40. The target height value of the first pixel is the maximum value between the height values ​​of the first terrain module and the second terrain module, that is, the maximum value of 10 between 10 and 5. The target height value of the second pixel is the minimum value between the height values ​​of the first terrain module and the second terrain module, that is, the minimum value of 10 between 20 and 10. The process of determining the target height value of other pixels is the same and will not be repeated.

[0147] In the above method, the method of determining the superposition of the height values ​​of the overlapping area of ​​the first terrain module and the second terrain module based on the fusion effect can make the fusion method of terrain modules more flexible and meet different terrain fusion requirements.

[0148] In step 305, the terminal superimposes the second height value of the overlapping area with the height value of the overlapping area on the terrain height map to obtain a third height value, and obtains a map of the overlapping area based on the third height value.

[0149] The terminal converts the third elevation value into a 3D map to represent the terrain undulations of the overlapping area after the first and second terrain modules are merged. When different modules are merged, the process for determining the map of the non-overlapping area of ​​the first and second terrain modules is the same as in step 303 and will not be repeated here.

[0150] The following is based on Figure 11 and Figure 12 The fusion process of the two terrain modules mentioned above is illustrated with an example. Figure 11 As shown, Figure 11 This is a schematic diagram illustrating a method for determining a second height value of an overlapping region, as provided in an embodiment of this application. Figure 11 In the diagram, the left image shows the first terrain module, the right image shows the second terrain module, and the middle image is a schematic diagram of the fusion of the first and second terrain modules. Figure 11 As shown, the area between the two vertical dashed lines represents the overlapping region of two terrain modules. The height value of this overlapping region on the terrain height map is 0. Taking point 'a' in the overlapping region as an example, the height value of the first terrain module corresponding to point 'a' is h2, and the height value of the second terrain module corresponding to point 'a' is h1. Since h2 is greater than h1, the second height value of the overlapping region at point 'a' is h2. The process of determining the second height value at other locations in the overlapping region is similar and will not be repeated. The height value of the overlapping region on the terrain height map is 0. The second height value of each point in the overlapping region is also the third height value. The solid lines in the overlapping region correspond to the third height value of the overlapping region. Based on the third height value of the overlapping region, a map of the overlapping region is obtained. Figure 12 As shown, Figure 12 This is a schematic diagram of terrain module fusion provided in an embodiment of this application. Figure 12 The top image shows a schematic diagram of the continuous mountain range effect obtained after merging three terrain modules. The circled position 1201 is a map of the overlapping area between the left and middle terrain modules, and the circled position 1202 is a map of the overlapping area between the right and middle terrain modules. The bottom image is a schematic diagram of the overlapping area between the left and middle terrain modules obtained by zooming in on position 1201.

[0151] It should be noted that the above embodiments describe the fusion process of two terrain modules. The fusion process of three or more terrain modules is similar and will not be repeated here.

[0152] In some embodiments, when the first terrain module and the second terrain module overlap, the terminal determines the height value of either the first or second terrain module in the overlapping area as the second height value of the overlapping area. This second height value is then superimposed with the height value of the overlapping area on the terrain height map to obtain a third height value. Based on this third height value, a map of the overlapping area is generated. In other words, in the overlapping area, the first terrain module covers the second terrain module, or vice versa. In this method, directly covering one terrain module with another in the overlapping area reduces the comparison and calculation of height values, thereby saving time required for terrain module fusion and improving the efficiency of map generation.

[0153] In steps 303 to 305 above, the method for determining whether a terrain module overlaps with other terrain modules to overlay the terrain module onto the terrain height map is described. In some embodiments, regardless of whether there is overlap between terrain modules, the height value of the terrain module is directly overlaid with the height value of the covered area, which can save computing resources, improve the efficiency of overlaying terrain modules, and thus improve the efficiency of map generation. This application does not limit this aspect.

[0154] Steps 303 to 305 described above are implemented in response to the terrain overlay function being triggered. Based on the terrain type corresponding to each region of the terrain height map, the height value of each region is added to the height value of the corresponding terrain module to obtain a first height value for each region. Based on the first height value, a first map is obtained. In some embodiments, this step is also performed in other ways, which are not limited in this application embodiment.

[0155] It should be noted that the embodiments of this application are described by taking the execution of step 303 first and then steps 304 and 305 as an example. In some embodiments, the terminal responds to the terrain overlay function being triggered by executing steps 304 and 305 first, and then executes the step of overlaying the terrain module in step 303. In other embodiments, the terminal responds to the terrain overlay function being triggered by executing the step of overlaying the terrain module in step 303 and step 304 simultaneously. The embodiments of this application do not limit this.

[0156] Steps 304 and 305 above describe how to determine the height value of the overlapping area when merging two terrain modules. In some cases, there are model resources on the terrain module. When merging the overlapping areas of the terrain modules, the position of the model resources on the terrain module will be adaptively adjusted according to the module merging process. This process includes the following step 306.

[0157] In step 306, at least one of the first and second terrain modules has a model resource indicating the land cover on the terrain module, and the terminal displays the model resource on the map of the overlapping area.

[0158] The model resources include tree model resources, flower and grass model resources, and building model resources, each corresponding to a type of terrain cover. For example, tree model resources correspond to trees on the terrain, flower and grass model resources correspond to flowers and grass on the terrain, and building model resources correspond to buildings on the terrain. When the first terrain module and the second terrain module are merged, the position of the model resources in the overlapping area changes from the original surface of the first or second terrain module to the surface of the merged overlapping area.

[0159] The following is based on Figure 13 For example, let's illustrate step 306 above. Figure 13 As shown, Figure 13 This is a schematic diagram illustrating how the location of the model resources provided in this application embodiment is adaptively determined based on the module. Figure 13 The map consists of two terrain modules. The circled area is the overlapping area of ​​the two terrain modules. In this overlapping area, the trees that were originally located on the surface of the two terrain modules are now located on the surface of the overlapping area after the terrain modules are merged, which means they are displayed on the map of the overlapping area.

[0160] In step 306 above, the position of the model resources on the surface of the terrain module can be automatically adjusted, reducing manual operation by the user and improving the efficiency of map generation.

[0161] It should be noted that step 306 above is an optional step, and whether to perform this step can be determined according to actual needs. This application embodiment does not limit this.

[0162] Steps 301 to 305 above describe the process of overlaying terrain modules onto a terrain height map. In this embodiment, the terminal can also transform the shape of the terrain modules overlaid on the terrain height map, including rotating the terrain modules and swapping the positions of the sub-modules within the terrain modules. These two methods of transforming the shape of terrain modules are described below.

[0163] In method one, the terminal responds to the rotation operation of the terrain module by rotating the terrain module on the terrain height map.

[0164] The rotation operation includes clockwise and counterclockwise rotation around the center of the terrain module.

[0165] Taking clockwise rotation as an example, such as Figure 14 As shown, Figure 14This is a schematic diagram of rotating a terrain module on a terrain elevation map provided in this application. Figure 14 In the diagram, the top left image shows the imported terrain module 1401, the top right image shows terrain module 1402 obtained by rotating terrain module 1401 90 degrees clockwise, the bottom left image shows terrain module 1403 obtained by rotating terrain module 1401 180 degrees clockwise, and the bottom right image shows terrain module 1404 obtained by rotating terrain module 1401 270 degrees clockwise. In this first method, terrain modules can be rotated to produce various terrain effects from the same module.

[0166] Method 2: The terminal responds to the drag operation of the first sub-module of the terrain module. If the endpoint of the drag operation is located at the position of the second sub-module of the terrain module, the positions of the first sub-module and the second sub-module are swapped.

[0167] It should be noted that both of the above methods involve transforming the shape of the terrain module after it has been overlaid on the terrain height map. After the shape of the terrain module is transformed, the height values ​​at each location of the terrain module also change. If the terrain module does not overlap with other terrain modules, the terminal needs to re-overlay the height values ​​at each location of the transformed terrain module with the corresponding height values ​​on the terrain height map. The height value overlay process is the same as in step 303 and will not be repeated here. If the terrain module overlaps with other terrain modules, the terminal needs to re-merge the terrain modules. The module merging process is the same as in steps 304 and 305 and will not be repeated here. In the above methods, the positions of the sub-modules of the terrain module can be swapped, thus producing various terrain effects from the same terrain module.

[0168] It should be noted that the above two terrain module morphology transformation methods are optional steps, and whether to execute them can be determined according to actual needs. This application embodiment does not limit this.

[0169] In step 307, the terminal applies textures to the obtained map to obtain a new map.

[0170] The obtained map includes maps of areas where terrain modules overlap and maps of areas where terrain modules do not overlap. The maps of areas where terrain modules do not overlap include maps of areas covered by terrain modules that do not overlap with other terrain modules, and maps of non-overlapping areas of terrain modules that overlap with other terrain modules.

[0171] Texture mapping methods include color mapping, bump mapping, reflection mapping, and structure mapping, among others. Color mapping adds texture and color to the acquired map; bump mapping creates a visual effect of uneven textures; reflection mapping adds reflections of the surrounding environment to the acquired map; and structure mapping adds lighting effects. Different texture mapping methods, or combinations of multiple methods, can be used depending on the actual needs. The surface material used for the texture can be obtained from a surface material resource library or created using image processing applications. This application does not limit the texture mapping method or the surface material used.

[0172] like Figure 15 As shown, Figure 15 This is a schematic diagram illustrating the texturing of an obtained map according to an embodiment of this application. By adding a grassland-like surface material to any area of ​​the obtained map, that area presents a grassland terrain. Figure 16 As shown, Figure 16 This is a schematic diagram of a map provided in an embodiment of this application.

[0173] It should be noted that in steps 303 to 307 above, the terrain overlay function provided by the application supports the overlapping of different terrain modules. In other embodiments, the terrain overlay function provided by the application does not support the overlapping of different terrain modules, that is, the terrain modules will not overlap with other terrain modules. The process of overlaying terrain modules is the same as in step 303. This application embodiment does not limit this aspect.

[0174] In summary, pre-made terrain modules of different shapes and sizes are superimposed on the terrain height map. The superposition method of the terrain modules is determined according to whether the terrain modules overlap with other terrain modules. Since different overlapping terrain modules can be merged, rich terrain effects can be generated using fewer terrain modules. This saves the manpower and time costs required to generate large-scale maps, as well as art resources and storage resources.

[0175] Figure 17 This is a schematic diagram of the structure of a map generation device provided in an embodiment of this application, as shown below. Figure 17 As shown, the device includes a first import unit 1701, a second import unit 1702, a terrain overlay unit 1703, and a texture unit 1704.

[0176] The first import unit 1701 is configured to perform an import operation in response to the terrain height map to obtain the terrain height map of the map to be generated. The terrain height map indicates the height value of the map and includes multiple regions, each region corresponding to a terrain type.

[0177] The second import unit 1702 is configured to perform an import operation on a terrain module to obtain multiple terrain modules, which are used to generate local detailed terrain, and each terrain module corresponds to a terrain type.

[0178] The terrain overlay unit 1703 is configured to perform, in response to the terrain overlay function being triggered, overlay the height value of each region with the height value of the corresponding terrain module based on the terrain type of each region in the terrain height map, to obtain the first height value of each region, and to obtain the first map based on the first height value of each region.

[0179] Texture unit 1704 is configured to perform texture mapping on the first map to obtain the map.

[0180] In one possible implementation, the terrain overlay unit 1703 is configured to perform:

[0181] In response to the marking operation of the target area in the terrain height map, the terrain type corresponding to the target area in the terrain height map is determined. Based on the terrain type corresponding to the target area, the target terrain module corresponding to the target area is determined. The target area is any area in the terrain height map, and the target terrain module corresponds to the same terrain type as the target area.

[0182] The height value of the target terrain module is superimposed with the height value of the target area to obtain the first height value of the target area.

[0183] In one possible implementation, the terrain overlay unit 1703 is configured to perform:

[0184] In response to a drag operation on the target terrain module, the height value of the area where the end point of the drag operation is located is superimposed with the height value of the target terrain module to obtain the first height value of the area where the end point of the drag operation is located.

[0185] In one possible implementation, the terrain overlay unit 1703 is also configured to perform:

[0186] In the case where the first terrain module and the second terrain module overlap, a second height value of the overlapping area is determined based on the height value of the first terrain module in the overlapping area and the height value of the second terrain module in the overlapping area. The second height value is the maximum value between the height value of the first terrain module in the overlapping area and the height value of the second terrain module in the overlapping area.

[0187] The second elevation value of the overlapping area is superimposed with the elevation value of the overlapping area on the terrain elevation map to obtain the third elevation value. Based on the third elevation value, a map of the overlapping area is obtained.

[0188] In one possible implementation, at least one of the first and second terrain modules has a model resource indicating land cover on the terrain module, and the terrain overlay unit 1703 is further configured to perform:

[0189] Display the model resource on a map of the overlapping area.

[0190] In one possible implementation, the device further includes:

[0191] The rotation unit is configured to perform a rotation operation on the terrain module on the terrain height map in response to the terrain module rotation operation.

[0192] In one possible implementation, the terrain module includes multiple sub-modules, and the device further includes:

[0193] The swap unit is configured to perform a drag operation in response to the first submodule of the terrain module, and swap the positions of the first and second submodules if the endpoint of the drag operation is located at the position of the second submodule of the terrain module.

[0194] In one possible implementation, the transpose further includes:

[0195] The zoom unit is configured to zoom in on a thumbnail of the terrain height map to a target size to obtain a terrain height map, the target size indicating the size of the map to be generated.

[0196] In summary, pre-made terrain modules of different shapes and sizes are superimposed on the terrain height map. The superposition method of the terrain modules is determined according to whether the terrain modules overlap with other terrain modules. Since different overlapping terrain modules can be merged, rich terrain effects can be generated using fewer terrain modules. This saves the manpower and time costs required to generate large-scale maps, as well as art resources and storage resources.

[0197] It should be noted that the map generation apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when performing the corresponding steps. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the map generation apparatus and map generation method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0198] In this embodiment of the disclosure, an electronic device is also provided, which includes a processor and a memory. The memory is used to store at least one computer program, which is loaded and executed by the processor to implement the map generation method described above.

[0199] Taking electronic devices as terminals as an example, Figure 18 This is a structural block diagram of a terminal provided in an embodiment of this application. See also... Figure 18 Terminal 1800 can be: a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. Terminal 1800 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.

[0200] Typically, terminal 1800 includes a processor 1801 and a memory 1802.

[0201] Processor 1801 may include one or more processing cores, such as a quad-core processor or an 18-core processor. Processor 1801 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1801 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1801 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1801 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0202] The memory 1802 may include one or more computer-readable storage media, which may be non-transitory. The memory 1802 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1802 are used to store at least one program code, which is executed by the processor 1801 to implement the terminal execution process in the map generation method provided in the method embodiments of this disclosure.

[0203] In some embodiments, the terminal 1800 may also optionally include a peripheral device interface 1803 and at least one peripheral device. The processor 1801, memory 1802, and peripheral device interface 1803 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1803 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 1804, a display screen 1805, a camera assembly 1806, an audio circuit 1807, and a power supply 1808.

[0204] Peripheral device interface 1803 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1801 and memory 1802. In some embodiments, processor 1801, memory 1802 and peripheral device interface 1803 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1801, memory 1802 and peripheral device interface 1803 can be implemented on separate chips or circuit boards, which is not limited in this disclosure.

[0205] The radio frequency (RF) circuit 1804 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1804 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1804 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. In some embodiments, the RF circuit 1804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 1804 can communicate with other terminals via at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: metropolitan area networks (MANs), various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks (WLANs), and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1804 may also include circuitry related to NFC (Near Field Communication), which is not limited herein.

[0206] Display screen 1805 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1805 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1801 for processing. In this case, display screen 1805 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1805, disposed on the front panel of terminal 1800; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal 1800 or in a folded design; in still other embodiments, display screen 1805 may be a flexible display screen, disposed on a curved or folded surface of terminal 1800. Furthermore, display screen 1805 may be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 1805 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light Emitting Diode).

[0207] The camera assembly 1806 is used to acquire images or videos. In some embodiments, the camera assembly 1806 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 1806 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.

[0208] Audio circuit 1807 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and environment, converting them into electrical signals that are input to processor 1801 for processing, or to radio frequency circuit 1804 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each positioned at a different location on terminal 1800. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from processor 1801 or radio frequency circuit 1804 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, audio circuit 18018 may also include a headphone jack.

[0209] The power supply 1808 is used to power the various components in the terminal 1800. The power supply 1808 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When the power supply 1808 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0210] In some embodiments, the terminal 1800 further includes one or more sensors 1809. The one or more sensors 1809 include, but are not limited to: an acceleration sensor 1810, a gyroscope sensor 1811, a pressure sensor 1812, an optical sensor 1813, and a proximity sensor 1814.

[0211] Accelerometer 1810 can detect the magnitude of acceleration along the three axes of a coordinate system established by terminal 1800. For example, accelerometer 1810 can be used to detect the components of gravitational acceleration along the three axes. Processor 1801 can control display screen 1805 to display the user page in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 1810. Accelerometer 1810 can also be used for collecting motion data from games or users.

[0212] The gyroscope sensor 1811 can detect the orientation and rotation angle of the terminal 1800. The gyroscope sensor 1811 can work in conjunction with the accelerometer sensor 1810 to acquire the user's 3D movements on the terminal 1800. Based on the data acquired by the gyroscope sensor 1811, the processor 1801 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.

[0213] The pressure sensor 1812 can be disposed on the side bezel of the terminal 1800 and / or on the lower layer of the display screen 1805. When the pressure sensor 1812 is disposed on the side bezel of the terminal 1800, it can detect the user's grip signal on the terminal 1800, and the processor 1801 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 1812. When the pressure sensor 1812 is disposed on the lower layer of the display screen 1805, the processor 1801 can control the operable controls on the UI page based on the user's pressure operation on the display screen 1805. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0214] An optical sensor 1813 is used to collect ambient light intensity. In one embodiment, the processor 1801 can control the display brightness of the display screen 1805 based on the ambient light intensity collected by the optical sensor 1813. Specifically, when the ambient light intensity is high, the display brightness of the display screen 1805 is increased; when the ambient light intensity is low, the display brightness of the display screen 1805 is decreased. In another embodiment, the processor 1801 can also dynamically adjust the shooting parameters of the camera assembly 1806 based on the ambient light intensity collected by the optical sensor 1813.

[0215] The proximity sensor 1814, also known as a distance sensor, is typically located on the front panel of the terminal 1800. The proximity sensor 1814 is used to detect the distance between the user and the front of the terminal 1800. In one embodiment, when the proximity sensor 1814 detects that the distance between the user and the front of the terminal 1800 is gradually decreasing, the processor 1801 controls the display screen 1805 to switch from a screen-on state to a screen-off state; when the proximity sensor 1814 detects that the distance between the user and the front of the terminal 1800 is gradually increasing, the processor 1801 controls the display screen 1805 to switch from a screen-off state to a screen-on state.

[0216] Those skilled in the art will understand that Figure 18 The structure shown does not constitute a limitation on terminal 1800 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0217] In this embodiment of the application, a computer-readable storage medium including program code is also provided, such as a memory 1802 including program code. The program code can be executed by the processor 1801 of the terminal 1800 to complete the map generation method. Optionally, the computer-readable storage medium may be ROM (Read-Only Memory), RAM (Random Access Memory), CD-ROM (Compact-Disc Read-Only Memory), magnetic tape, floppy disk, and optical data storage device, etc.

[0218] In this application embodiment, a computer program product is also provided, including one or more instructions, which are executed by one or more processors of an electronic device, enabling the electronic device to perform the map generation method described above.

[0219] In some embodiments, the computer program involved in the present application embodiments may be deployed and executed on a computer device, or executed on multiple computer devices located in one location, or executed on multiple computer devices distributed in multiple locations and interconnected through a communication network. Multiple computer devices distributed in multiple locations and interconnected through a communication network may constitute a blockchain system.

[0220] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0221] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for generating a map, characterized in that, The method includes: In response to the import operation of the terrain height map, the terrain height map of the map to be generated is obtained. The terrain height map indicates the height value of the map and includes multiple regions, each region corresponding to a terrain type. In response to the import operation of the terrain module, multiple terrain modules are obtained. The terrain modules are used to generate local detailed terrain, and each terrain module corresponds to a terrain type. In response to the terrain overlay function being triggered, if the target terrain module does not overlap with other terrain modules, the height value of the target terrain module is overlaid with the height value of the area covered by the target terrain module to obtain a first height value of the area covered by the target terrain module, and a map of the area covered by the target terrain module is obtained based on the first height value. When the first terrain module and the second terrain module overlap, a second height value of the overlapping area is determined based on the fusion effect attribute of the terrain modules, the height value of the first terrain module in the overlapping area, and the height value of the second terrain module in the overlapping area; the second height value of the overlapping area is superimposed with the height value of the overlapping area on the terrain height map to obtain a third height value; and a map of the overlapping area is obtained based on the third height value. The obtained map is obtained by applying textures to the maps of non-overlapping terrain modules and the maps of overlapping terrain modules.

2. The map generation method according to claim 1, characterized in that, The method further includes: In response to the marking operation of the target area in the terrain height map, the terrain type corresponding to the target area in the terrain height map is determined, and based on the terrain type corresponding to the target area, a target terrain module corresponding to the target area is determined. The target area is any area in the terrain height map, and the target terrain module corresponds to the same terrain type as the target area. The height value of the target terrain module is superimposed with the height value of the target area to obtain the first height value of the target area.

3. The map generation method according to claim 1, characterized in that, The method further includes: In response to a drag operation on a target terrain module, the height value of the area where the end point of the drag operation is located is superimposed with the height value of the target terrain module to obtain a first height value of the area where the end point of the drag operation is located.

4. The map generation method according to claim 1, characterized in that, The second height value is the maximum value between the height value of the first terrain module in the overlapping area and the height value of the second terrain module in the overlapping area.

5. The map generation method according to claim 4, characterized in that, At least one of the first and second terrain modules has a model resource, the model resource indicating the land cover on the terrain module, and the method further includes: The model resources are displayed on a map of the overlapping area.

6. The map generation method according to claim 1, characterized in that, The method further includes: In response to a rotation operation on the terrain module, the terrain module is rotated on the terrain height map.

7. The map generation method according to claim 1, characterized in that, The terrain module includes multiple sub-modules, and the method further includes: In response to a drag operation on the first sub-module of the terrain module, if the endpoint of the drag operation is located at the position of the second sub-module of the terrain module, the positions of the first sub-module and the second sub-module are swapped.

8. The map generation method according to claim 1, characterized in that, The method further includes: The terrain height map is obtained by enlarging the thumbnail of the terrain height map to the target size, where the target size indicates the size of the map to be generated.

9. A map generation apparatus, characterized in that, The device includes: The first import unit is configured to perform an import operation in response to a terrain height map, obtain the terrain height map of the map to be generated, the terrain height map indicating the height value of the map, the terrain height map including multiple regions, each region corresponding to a terrain type; The second import unit is configured to perform an import operation on the terrain module to obtain a plurality of the terrain modules, which are used to generate local detailed terrain, and each terrain module corresponds to a terrain type. The terrain overlay unit is configured to, in response to the triggering of the terrain overlay function, overlay the height value of the target terrain module with the height value of the area covered by the target terrain module to obtain a first height value of the area covered by the target terrain module, provided that the target terrain module does not overlap with other terrain modules, and obtain a map of the area covered by the target terrain module based on the first height value. The terrain overlay unit is further configured to, when the first terrain module and the second terrain module overlap, determine a second height value of the overlapping area based on the fusion effect attribute of the terrain module, the height value of the first terrain module in the overlapping area, and the height value of the second terrain module in the overlapping area; overlay the second height value of the overlapping area with the height value of the overlapping area on the terrain height map to obtain a third height value; and obtain a map of the overlapping area based on the third height value. The mapping unit is configured to perform mapping on the maps of the non-overlapping areas of the obtained terrain modules and the maps of the overlapping areas of the terrain modules to obtain the map.

10. A computer device, characterized in that, The computer device includes a processor and a memory, the memory being used to store at least one computer program, the at least one computer program being loaded and executed by the processor to implement the map generation method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to implement the map generation method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Planet surface safe landing terrain simulation and generation method based on random fractal

    CN105931293A

  • Virtual ground surface processing method and device and electronic device

    CN112530012A