Terrain grid surface reduction method and device, electronic equipment and storage medium

By dividing terrain blocks and filling triangles with non-proximal zones, the performance loss problem caused by the generation of a large number of triangles in the hexagonal lattice terrain is solved, and the operationability on low-end devices is achieved.

CN119127458APending Publication Date: 2024-12-13NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310700606.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-13
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The terrain of the hexagonal lattice generates a large number of extra triangles in SLG games, resulting in high performance losses, limited to running on PC or host side, making it difficult to run on low-end devices.

Method used

By obtaining the original terrain data, dividing it into terrain blocks, determining non-proximal areas and using two triangles to fill the central area, reducing the number of triangles in the target terrain block and reducing terrain complexity.

Benefits of technology

It effectively reduces terrain complexity, reduces operating pressure and performance consumption, and enables the reduced terrain to run on PC, host or mobile devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127458A_ABST
    Figure CN119127458A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a terrain grid surface reduction method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining the original terrain data of a to-be-reduced surface, dividing the original terrain data into a plurality of terrain blocks, and when a target terrain block in the original terrain data meets a preset surface reduction condition, carrying out the surface reduction of the target terrain block; determining a non-adjacent region included in a target terrain block according to the adjacent condition of the target terrain block and other terrain blocks in the original terrain data, further determining a central region formed by a largest quadrangle in the non-adjacent region, and filling the central region with two first triangles, the first number of triangles contained in the target terrain block is smaller than the second number of triangles contained in the target terrain block after surface reduction. According to the embodiment of the invention, the method achieves the reduction of the surface number of a complex terrain, and reduces the operation pressure and performance consumption of assets after the surface reduction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of terrain data processing, and in particular to a method, device, electronic device and storage medium for reducing terrain mesh surface. Background Art

[0002] For SLG (Simulation Game, strategy game) type games, hexagonal grid-based maps can often provide richer and more variable gameplay, so hexagonal grid maps are not only beneficial for SLG type games, but may also be necessary at certain times.

[0003] With ordinary Figure 1 Similarly, the terrain of the hexagonal grid map is also expressed by Mesh. The hexagonal grid terrain also has some limitations. For example, the hexagonal grid terrain will generate a lot of extra triangles, causing a very large performance loss; and the generated hexagonal grid terrain is relatively complex, so it can generally only be run on a PC (Personal Computer) or host. Summary of the invention

[0004] In view of the above problems, a method, device, electronic device and storage medium for reducing terrain meshes are proposed to overcome the above problems or at least partially solve the above problems, including:

[0005] In a first aspect, the present application provides a method for reducing terrain meshes, the method comprising:

[0006] Acquire original terrain data of the surface to be reduced, and divide the original terrain data into a plurality of terrain blocks; wherein the terrain blocks include one or more hexagonal grids connected by grids;

[0007] When the target terrain block in the original terrain data meets the preset surface reduction condition, determining the non-adjacent area included in the target terrain block according to the adjacency between the target terrain block and other terrain blocks in the original terrain data;

[0008] A central area formed by the largest quadrilateral in the non-adjacent area is determined, and the central area is filled with two first triangles so that a first number of triangles included in the target terrain block before surface reduction is less than a second number of triangles included in the target terrain block after surface reduction.

[0009] A second aspect of the present application provides a device for reducing terrain meshes, the device comprising:

[0010] A terrain block division module is used to obtain original terrain data of the surface to be reduced, and divide the original terrain data into a plurality of terrain blocks; wherein the terrain block includes one or more hexagonal grids connected by a grid;

[0011] an adjacent partitioning module, configured to determine a non-adjacent area included in the target terrain block according to the adjacent conditions between the target terrain block and other terrain blocks in the original terrain data when the target terrain block in the original terrain data meets a preset surface reduction condition;

[0012] The central area filling module is used to determine the central area formed by the largest quadrilateral in the non-adjacent area, and use two first triangles to fill the central area so that the first number of triangles contained in the target terrain block before surface reduction is less than the second number of triangles contained in the target terrain block after surface reduction.

[0013] A third aspect of the present application provides an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the terrain mesh reduction method as described above when executed by the processor.

[0014] A fourth aspect of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for reducing terrain mesh surface as described in any of the above items is implemented.

[0015] The embodiments of the present application have the following advantages:

[0016] In the embodiment of the present application, the original terrain data of the to-be-reduced surface can be obtained, and the original terrain data can be divided into a plurality of terrain blocks. When the target terrain block in the original terrain data meets the preset surface reduction condition, the non-adjacent area contained in the target terrain block is determined according to the adjacency between the target terrain block and other terrain blocks in the original terrain data, and then the central area formed by the largest quadrilateral in the non-adjacent area can be determined, and the central area is filled with two first triangles, so that the first number of triangles contained in the target terrain block is less than the second number of triangles contained in the target terrain block after surface reduction. Thus, the number of faces of complex terrain is reduced, and the operating pressure and performance consumption of assets after surface reduction are reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0018] Figure 1 It is a flowchart of the steps of a method for reducing terrain mesh surface provided by an embodiment of the present application;

[0019] Figure 2 is a flowchart of another method for reducing terrain meshes provided by an embodiment of the present application;

[0020] Figure 3 is a flowchart of another method for reducing terrain meshes provided by an embodiment of the present application;

[0021] Figure 4a is a schematic diagram of a terrain block provided by an embodiment of the present application;

[0022] Figure 4b This is a schematic diagram of reducing the area of ​​a non-adjacent area of ​​a terrain block provided by an embodiment of the present application;

[0023] Figure 4c It is a schematic diagram of reducing the adjacent area of ​​a terrain block provided by an embodiment of the present application;

[0024] Figure 5 It is a structural schematic diagram of a terrain grid reduction device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0026] Reference Figure 1 , shows a flowchart of a method for reducing terrain meshes provided in an embodiment of the present application, which may specifically include the following steps:

[0027] Step 101, obtaining original terrain data of the surface to be reduced, and dividing the original terrain data into a plurality of terrain blocks; wherein the terrain block includes one or more hexagonal grids connected by grids;

[0028] The original terrain data may be terrain data of a game map in a virtual game, or terrain data constructed based on a real scene, and the terrain data is terrain data of a hexagonal grid. Face reduction is a method of reducing the number of faces of a complex terrain.

[0029] In practical applications, the original terrain data of the surface to be reduced can be obtained first, and the original terrain data can be divided into multiple terrain blocks (Chunks). Each Chunk can contain multiple hexagonal grids. For example, a 10*10 Chunk can be set, and there are a total of 100 hexagonal grids in this Chunk.

[0030] In one example, a hexagonal grid may be formed by a plurality of triangles, so that the terrain block is essentially formed by triangles.

[0031] Since the original terrain data in virtual games is often huge, dividing the original terrain data into chunks can achieve on-demand division of the terrain data. When terrain reduction is needed, only the currently needed chunks are loaded, which greatly improves loading efficiency and reduces memory consumption.

[0032] Step 102, when the target terrain block in the original terrain data meets the preset surface reduction condition, the non-adjacent area included in the target terrain block is determined according to the adjacency between the target terrain block and other terrain blocks in the original terrain data;

[0033] After the original terrain data is divided into multiple terrain blocks, a target terrain block that can be subjected to surface reduction processing can be determined from the multiple terrain blocks. Specifically, it can be determined whether the target terrain block meets a preset surface reduction condition, which is a condition used to determine whether the target terrain block can perform surface reduction.

[0034] When it is determined that the target terrain block meets the preset surface reduction condition, the adjacency between the target terrain block and other terrain blocks in the original terrain block can be determined, and then the non-adjacent area contained in the target terrain block can be determined according to the adjacency. Among them, the non-critical area is the area in the target terrain block that is not adjacent to any other terrain block in the original terrain block.

[0035] The process of map grid reduction is actually a process of grid reconstruction. By dividing adjacent areas and non-adjacent areas, it is easier to reduce the terrain grid.

[0036] In one embodiment of the present application, the target terrain block in the original terrain data satisfies a preset surface reduction condition, including: when the landform type and height of each hexagonal grid contained in the target terrain block in the original terrain data are the same, it is determined that the target terrain block satisfies the preset surface reduction condition.

[0037] In practical applications, whether a terrain block can be reduced depends on the landform type and the terrain height, so a preset reduction condition can be set according to the landform type and the terrain height. Specifically, the preset reduction condition is that the landform type and the terrain height of the hexagonal grid in the terrain block are the same.

[0038] Step 103, determine the central area formed by the largest quadrilateral in the non-adjacent area, and use two first triangles to fill the central area so that the first number of triangles contained in the target terrain block before surface reduction is less than the second number of triangles contained in the target terrain block after surface reduction.

[0039] After the non-adjacent areas are divided, a largest quadrilateral can be determined in the non-adjacent areas. The quadrilateral can be any one of a rectangle, a square, and a rhombus.

[0040] After the quadrilateral is determined, two first triangles can be used to fill the central area, and the central area is simplified into two triangles, thereby realizing the reduction of the terrain mesh. It can be understood that before the target terrain block is reduced, the target terrain block can be composed of multiple triangles. When the surface is reduced, a largest quadrilateral is divided as much as possible in the non-critical area in the target terrain block. The central area where the quadrilateral is located is composed of multiple triangles before the surface is reduced in the target terrain block. After the surface reduction process, the quadrilateral can be composed of two triangles, that is, no matter how many triangles the central area originally contains, they are eventually replaced by two triangles. Therefore, after the surface reduction process, the number of triangles contained in the target terrain block is less than the number of triangles contained in the target terrain block before the reduction. Specifically, when the number of triangles contained in the target terrain block before the reduction is the first number and the number of triangles contained in the target terrain block after the surface reduction is the second number, the first number is greater than the second number.

[0041] In practical applications, triangles can be pieced together to form any other polygon. When constructing a three-dimensional model, it can be constructed based on triangles, and each triangle independently represents a face. In an embodiment of the present application, the number of triangles in the target terrain block is reduced through terrain reconstruction, thereby achieving terrain surface reduction.

[0042] In an embodiment of the present application, the terrain mesh reduction method may further include: mesh simplification of non-adjacent areas and adjacent areas outside the central area.

[0043] In practical applications, after the surface reduction operation is performed on the central area, the mesh of other areas outside the central area can also be simplified.

[0044] In one example, the target terrain block after face reduction can be run not only on a PC (Personal Computer) or a host, but also on a low-end mobile device.

[0045] In the embodiment of the present application, the original terrain data of the to-be-reduced surface can be obtained, and the original terrain data can be divided into a plurality of terrain blocks. When the target terrain block in the original terrain data meets the preset surface reduction condition, the non-adjacent area contained in the target terrain block is determined according to the adjacency between the target terrain block and other terrain blocks in the original terrain data, and then the central area formed by the largest quadrilateral in the non-adjacent area can be determined, and two first triangles are used to fill the central area, so that the first number of triangles contained in the target terrain block is less than the second number of triangles contained in the target terrain block after surface reduction. Thus, the number of faces of complex terrain is reduced, and the operating pressure and performance consumption of assets after surface reduction are reduced.

[0046] Reference Figure 2 , shows a flowchart of a method for reducing terrain meshes provided in an embodiment of the present application, which may specifically include the following steps:

[0047] Step 201, obtaining original terrain data of the surface to be reduced, and dividing the original terrain data into a plurality of terrain blocks; wherein the terrain block includes one or more hexagonal grids connected by grids;

[0048] The original terrain data may be terrain data of a game map in a virtual game, or terrain data constructed based on a real scene, and the terrain data is terrain data of a hexagonal grid. Face reduction is a method of reducing the number of faces of a complex terrain.

[0049] In practical applications, the original terrain data of the surface to be reduced can be obtained first, and the original terrain data can be divided to obtain multiple terrain blocks (Chunks), each of which contains multiple hexagonal grids. For example, a 10*10 Chunk can be set, and there are a total of 100 hexagonal grids in this Chunk.

[0050] Since the original terrain data in virtual games is often huge, dividing the original terrain data into chunks can achieve on-demand division of the terrain data. When terrain reduction is needed, only the currently needed chunks are loaded, which greatly improves loading efficiency and reduces memory consumption.

[0051] Step 202, when the target terrain block in the original terrain data meets the preset surface reduction condition, the non-adjacent area included in the target terrain block is determined according to the adjacency between the target terrain block and other terrain blocks in the original terrain data;

[0052] After the original terrain data is divided into a plurality of terrain blocks, a target terrain block that can be subjected to surface reduction processing can be determined from the plurality of terrain blocks. Specifically, the preset surface reduction condition is a condition for determining whether the target terrain block can be subjected to surface reduction processing.

[0053] When it is determined that the target terrain block meets the preset surface reduction condition, the adjacency between the target terrain block and other terrain blocks in the original terrain block can be determined, and then the non-adjacent area contained in the target terrain block can be determined according to the adjacency. Among them, the non-critical area is the area in the target terrain block that is not adjacent to any other terrain block in the original terrain block.

[0054] The process of map grid reduction is actually a process of grid reconstruction. By dividing adjacent areas and non-adjacent areas, it is easier to reduce the terrain grid.

[0055] In one embodiment of the present application, the target terrain block in the original terrain data satisfies a preset surface reduction condition, including: when the landform type and height of each hexagonal grid contained in the target terrain block in the original terrain data are the same, it is determined that the target terrain block satisfies the preset surface reduction condition.

[0056] In practical applications, whether a terrain block can be reduced depends on the landform type and the terrain height, so a preset reduction condition can be set according to the landform type and the terrain height. Specifically, the preset reduction condition is that the landform type and the terrain height of the hexagonal grid in the terrain block are the same.

[0057] Step 203, determine the central area formed by the largest quadrilateral in the non-adjacent area, and use two first triangles to fill the central area so that the first number of triangles included in the target terrain block before surface reduction is less than the second number of triangles included in the target terrain block after surface reduction.

[0058] After the non-adjacent areas are divided, a largest quadrilateral can be determined in the non-adjacent areas. The quadrilateral can be any one of a rectangle, a square, and a rhombus.

[0059] After the quadrilateral is determined, two first triangles may be used to fill the central area, and the central area is simplified into two triangles, thereby achieving terrain mesh reduction.

[0060] Step 204: determine the adjacent areas included in the target terrain block, and perform mesh simplification on the adjacent areas and non-adjacent areas outside the central area.

[0061] In practical applications, the adjacent area included in the target terrain block can be determined while the non-adjacent area is determined, wherein the non-adjacent area and the adjacent area together constitute the target terrain block.

[0062] After the surface reduction operation is performed on the central area, mesh simplification can be performed on other non-adjacent areas outside the central area, so that mesh simplification can be achieved in the entire non-adjacent area.

[0063] In addition, mesh simplification may be performed on the adjacent area. In one example, during mesh simplification on the adjacent area, the outer contour of the target terrain block is ensured not to change as much as possible.

[0064] In the embodiment of the present application, the original terrain data of the to-be-reduced surface can be obtained, and the original terrain data can be divided into a plurality of terrain blocks. When the target terrain block in the original terrain data meets the preset surface reduction condition, the non-adjacent area contained in the target terrain block can be determined according to the adjacency between the target terrain block and other terrain blocks in the original terrain data, and then the central area formed by the largest quadrilateral in the non-adjacent area can be determined, and two first triangles are used to fill the central area, so that the first number of triangles contained in the target terrain block is less than the second number of triangles contained in the target terrain block after the surface reduction, and the adjacent area contained in the target terrain block is determined, and the adjacent area and the non-adjacent area outside the central area are mesh simplified. Thus, the number of faces of complex terrain can be reduced, and the operating pressure and performance consumption of assets after the surface reduction can be reduced.

[0065] Reference Figure 3 , shows a flowchart of another method for reducing terrain meshes provided by an embodiment of the present application, which may specifically include the following steps:

[0066] Step 301, obtaining original terrain data of the surface to be reduced, and dividing the original terrain data into a plurality of terrain blocks; wherein the terrain block includes one or more hexagonal grids connected by grids;

[0067] Step 302, when the target terrain block in the original terrain data meets the preset surface reduction condition, the non-adjacent area included in the target terrain block is determined according to the adjacency between the target terrain block and other terrain blocks in the original terrain data;

[0068] Step 303, determine the central area formed by the largest quadrilateral in the non-adjacent area, and use two first triangles to fill the central area so that the first number of triangles contained in the target terrain block before surface reduction is less than the second number of triangles contained in the target terrain block after surface reduction.

[0069] After the central area is reduced, the non-adjacent area outside the central area can be reduced by executing steps 304 and 305. Meanwhile, the adjacent area can be reduced by executing steps 306 and 307.

[0070] Step 304, dividing the non-adjacent area outside the central area into a first part consisting of a first preset triangle in the hexagonal grid, a second part consisting of the hexagonal grid and the connected grid, and a third part consisting of the connected grid;

[0071] The non-adjacent area outside the central area can be divided into three parts, wherein the first part is composed of the first preset triangle in the hexagonal grid in the non-adjacent area outside the central area. Specifically, it can be subdivided into the first preset triangle obtained by dividing the hexagonal grid by the outer grid of the central area, and the undivided hexagonal grid in the non-adjacent area outside the central area can be divided according to the divided hexagonal grid to obtain the first preset triangle.

[0072] The second part is composed of hexagonal grids and connected grids. Specifically, it is composed of the undivided hexagonal grids in the non-adjacent area outside the central area after segmentation, and the part outside the first preset triangle and the connected grid, which can be specifically in the form of a rectangle.

[0073] The third part is the quadrilateral obtained by connecting the meshes.

[0074] Step 305 , fill the first part, the second part, and the third part with triangles respectively according to a first preset filling method.

[0075] After the non-adjacent area outside the central area is divided into parts, each part can be filled in a different manner to achieve mesh simplification, wherein the first preset filling manner can be set according to the actual scene, and the first preset filling manner may include parameters such as the shape and size of the filling. In the embodiment of the present application, triangles are used to fill each part.

[0076] In one embodiment of the present application, step 305 may specifically include: filling the first part with a second triangle matching the first preset triangle; filling each rectangular area in the second part with two third triangles; and filling each target quadrilateral area in the third part with a combination of a fourth triangle and a fifth triangle.

[0077] In practical applications, the first part is composed of a plurality of first preset triangles, so that each first preset triangle can be filled with a second triangle that matches the first preset triangle, that is, one second triangle is filled with one first preset triangle.

[0078] The second part is composed of a plurality of rectangles, and each rectangle can be filled by combining two third triangles.

[0079] The third part is composed of a plurality of target quadrilaterals, and each quadrilateral can be filled by combining the fourth triangle and the fifth triangle.

[0080] Step 306: Divide the adjacent area into a fourth part consisting of a plurality of second preset triangles and a fifth part consisting of a plurality of rectangles according to the grid connection lines between the hexagonal grids;

[0081] In the adjacent area, the grid connection lines between the hexagonal grids can divide the adjacent area. Specifically, the adjacent area can be divided into a fourth part consisting of a plurality of second preset triangles and a fifth part consisting of a plurality of rectangles.

[0082] Step 307: fill the fourth portion and the fifth portion with triangles according to the second preset filling method.

[0083] After the adjacent area is divided into parts, each part can be filled in a different manner to achieve mesh simplification, wherein the second preset filling manner can be set according to the actual scene, and the second preset filling manner can include parameters such as the shape and size of the filling. In the embodiment of the present application, triangles are used to fill each part.

[0084] In an embodiment of the present application, step 307 may specifically be: filling the fourth portion with a sixth triangle that matches the second preset triangle; and filling each rectangle in the fifth portion with two seventh triangles.

[0085] The fourth part is composed of multiple second preset triangles, so that the sixth triangle matching the second preset triangle can fill each second preset triangle, that is, one second preset triangle is filled with one corresponding sixth triangle.

[0086] For each rectangle in the fifth part, two seventh triangles can be combined to fill it.

[0087] It should be noted that the above step 304 and step 306 may be parallel steps.

[0088] In the embodiment of the present application, by splitting other areas outside the central area and performing different fillings on different parts, the overall surface reduction of the target terrain block is completed, thereby reducing the operating pressure and performance consumption of the assets after the surface reduction.

[0089] The following combination Figures 4a to 4c The above-mentioned surface reduction process of this application is exemplified as follows:

[0090] Simplifying the mesh actually means reconstructing the topological structure of the mesh and ensuring the following conditions:

[0091] 1. The number of faces should be as small as possible.

[0092] 2. Applicable to chunks of different sizes.

[0093] 3. Does not affect the outer contour of the Chunk.

[0094] After omitting the transition, that is, the mesh at the connection, the topological structure of a Chunk is as follows Figure 4a As shown. Figure 4aIt can be seen that this Chunk is adjacent to the Chunks above and below it. It can be seen that for a Chunk, there are two cases depending on whether there are other Chunks on its edge: the first case is that the Chunk edge is not adjacent to other Chunks, that is, the Chunk edge corresponds to the inner dotted line in the figure. The second case is that the Chunk edge is adjacent to other Chunks, that is, the Chunk edge corresponds to the outer dotted line in the figure.

[0095] For the case of no contiguous area (i.e., the non-contiguous area of ​​the target terrain block), use Figure 4b The method shown reconstructs the topology of the grid. It can be seen that the Chunk grid is redivided into the following parts.

[0096] 1.Inner Left / Right Connection–Above, such a mesh can be expressed by 2 triangles.

[0097] 2.Inner Left / Right Connection–Below, such a mesh can be expressed by 2 triangles.

[0098] 3.Left / Right Single Hexagon-Center Quad, such a mesh is a Quad, which can also be expressed by 2 triangles.

[0099] 4.Left / Right Single Hexagon–Top Triangle, which is the top triangle of the edge hexagon.

[0100] 5.Left / Right Single Hexagon–Bottom Triangle, which is the bottom triangle of the edge hexagon.

[0101] 6.Above / Below Triangles, which are the triangles that protrude from the upper and lower edges of the Chunk.

[0102] 7. Center Quad, which is the central quad. This is the key to face reduction. It can be seen that no matter how big the Chunk is, the hexagonal grid in the middle will degenerate to the center quad after face reduction. The center quad can be expressed by 2 triangles.

[0103] For the case of adjacency (i.e. the adjacency area of ​​the target terrain block), Figure 4c As shown, the Chunk grid can be divided into two parts. The first part corresponds to the transition part between Chunks, and it can be seen that it includes the following parts:

[0104] 1.Outer Top Connections. You can see that the mesh of this part can be expressed by 3 triangles.

[0105] 2. Outer Bottom Connections. You can see that the mesh of this part can be expressed by 3 triangles.

[0106] 3.Outer Left Connection Above, you can see that the mesh of this part can be expressed by 4 triangles.

[0107] 4.Outer Left Connection Below, you can see that the mesh of this part can be expressed by 4 triangles.

[0108] 5.Outer Left Connection. You can see that the mesh of this part can be expressed by 2 triangles.

[0109] The second part corresponds to the remaining meshes except the transition part of the Chunk. It can be seen that this part of the mesh can be degenerated into a non-adjacent situation, so the remaining part can be processed according to the non-adjacent situation.

[0110] It should be noted that, for the method embodiment, for the sake of simplicity, it is expressed as a series of action combinations, but those skilled in the art should know that the embodiments of the present application are not limited by the described action sequence, because according to the embodiments of the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

[0111] Reference Figure 5 , shows a schematic diagram of the structure of a device for reducing terrain mesh surface provided by an embodiment of the present application, which may specifically include the following modules:

[0112] The terrain block division module 501 is used to obtain the original terrain data of the surface to be reduced, and divide the original terrain data into a plurality of terrain blocks; wherein the terrain block includes one or more hexagonal grids connected by a grid;

[0113] The adjacent division module 502 is used to determine the non-adjacent area included in the target terrain block according to the adjacent conditions between the target terrain block and other terrain blocks in the original terrain data when the target terrain block in the original terrain data meets the preset surface reduction condition;

[0114] The central area filling module 503 is used to determine the central area formed by the largest quadrilateral in the non-adjacent area, and use two first triangles to fill the central area so that the first number of triangles contained in the target terrain block before surface reduction is less than the second number of triangles contained in the target terrain block after surface reduction.

[0115] In one embodiment of the present application, the device further includes:

[0116] The other area simplification module is used to determine the adjacent area included in the target terrain block, and perform mesh simplification on the adjacent area and the non-adjacent area outside the central area.

[0117] In one embodiment of the present application, other area simplification modules may include:

[0118] A first area division submodule, used for dividing the non-adjacent area outside the central area into a first part consisting of a first preset triangle in the hexagonal grid, a second part consisting of the hexagonal grid and the connection grid, and a third part consisting of the connection grid;

[0119] The first filling submodule is used to perform triangle filling on the first part, the second part and the third part respectively according to a first preset filling method.

[0120] In an embodiment of the present application, the first filling submodule may include:

[0121] A first portion filling unit, configured to fill the first portion with a second triangle matching the first preset triangle;

[0122] A second part filling unit, used to fill each rectangular area in the second part with two third triangles;

[0123] The third part filling unit is used to fill each target quadrilateral area in the third part with a combination of a fourth triangle and a fifth triangle.

[0124] In an embodiment of the present application, other area simplification modules may also include:

[0125] A second area division submodule, used for dividing the adjacent area into a fourth part consisting of a plurality of second preset triangles and a fifth part consisting of a plurality of rectangles according to grid connection lines between the hexagonal grids;

[0126] The second filling submodule is used to perform triangle filling on the fourth part and the fifth part according to a second preset filling method.

[0127] In an embodiment of the present application, the second filling submodule may include:

[0128] a fourth portion filling unit, configured to fill the fourth portion with a sixth triangle matched with the second preset triangle;

[0129] The fifth part filling unit is used to fill each rectangle in the fifth part with two seventh triangles.

[0130] In an embodiment of the present application, the adjacent division module 502 may include:

[0131] The preset surface reduction condition satisfaction submodule is used to determine that the target terrain block satisfies the preset surface reduction condition when the landform type and height of each hexagonal grid contained in the target terrain block are the same.

[0132] In the embodiment of the present application, the original terrain data to be reduced can be obtained, and the original terrain data can be divided into multiple terrain blocks. When the target terrain block in the original terrain data meets the preset surface reduction conditions, the non-adjacent area contained in the target terrain block is determined according to the adjacency between the target terrain block and other terrain blocks in the original terrain data, and then the central area formed by the largest quadrilateral in the non-adjacent area can be determined, and two first triangles are used to fill the central area, so that the first number of triangles contained in the target terrain block is less than the second number of triangles contained in the target terrain block after surface reduction. In this way, the number of faces of complex terrain is reduced, so that the assets after surface reduction can run on low-end mobile devices.

[0133] An embodiment of the present application also provides an electronic device, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the above terrain mesh reduction method is implemented.

[0134] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above terrain mesh reduction method is implemented.

[0135] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0136] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0137] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0138] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0139] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0140] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0141] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0142] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0143] The above is a detailed introduction to a method, device, electronic device and storage medium for reducing terrain mesh surface. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for reducing terrain mesh surface, characterized in that: The method comprises: Acquire original terrain data of the surface to be reduced, and divide the original terrain data into a plurality of terrain blocks; wherein the terrain blocks include one or more hexagonal grids connected by grids; When the target terrain block in the original terrain data meets the preset surface reduction condition, determining the non-adjacent area included in the target terrain block according to the adjacency between the target terrain block and other terrain blocks in the original terrain data; A central area formed by the largest quadrilateral in the non-adjacent area is determined, and the central area is filled with two first triangles so that a first number of triangles included in the target terrain block before surface reduction is less than a second number of triangles included in the target terrain block after surface reduction.

2. The method according to claim 1, characterized in that Also includes: The adjacent area included in the target terrain block is determined, and mesh simplification is performed on the adjacent area and the non-adjacent area outside the central area.

3. The method according to claim 2, characterized in that The mesh simplification of the non-adjacent area outside the central area includes: Dividing the non-adjacent area outside the central area into a first part consisting of a first preset triangle in the hexagonal grid, a second part consisting of the hexagonal grid and the connected grid, and a third part consisting of the connected grid; The first part, the second part and the third part are respectively filled with triangles according to a first preset filling method.

4. The method according to claim 3, characterized in that The performing triangle filling on the first part, the second part, and the third part respectively according to a first preset filling method includes: Filling the first portion with a second triangle matching the first preset triangle; filling each rectangular area in the second portion with two third triangles; Each target quadrilateral region in the third portion is filled with a combination of a fourth triangle and a fifth triangle.

5. The method according to claim 2, characterized in that: The step of performing mesh simplification on the adjacent area includes: Dividing the adjacent area into a fourth part consisting of a plurality of second preset triangles and a fifth part consisting of a plurality of rectangles according to grid connection lines between the hexagonal grids; The fourth portion and the fifth portion are triangularly filled according to a second preset filling method.

6. The method according to claim 5, characterized in that The performing triangle filling on the fourth part and the fifth part according to the second preset filling method comprises: filling the fourth portion with a sixth triangle matched with the second preset triangle; Each rectangle in the fifth portion is filled with two seventh triangles.

7. The method according to any one of claims 1 to 6, characterized in that The target terrain block in the original terrain data satisfies a preset surface reduction condition, including: When the landform type and height of each hexagonal grid contained in the target terrain block in the original terrain data are the same, it is determined that the target terrain block meets the preset surface reduction condition.

8. A device for reducing terrain mesh surface, characterized in that: The device comprises: A terrain block division module is used to obtain original terrain data of the surface to be reduced, and divide the original terrain data into a plurality of terrain blocks; wherein the terrain block includes one or more hexagonal grids connected by a grid; an adjacent partitioning module, configured to determine a non-adjacent area included in the target terrain block according to the adjacent conditions between the target terrain block and other terrain blocks in the original terrain data when the target terrain block in the original terrain data meets a preset surface reduction condition; The central area filling module is used to determine the central area formed by the largest quadrilateral in the non-adjacent area, and use two first triangles to fill the central area so that the first number of triangles contained in the target terrain block before surface reduction is less than the second number of triangles contained in the target terrain block after surface reduction.

9. An electronic device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the method for reducing terrain mesh surface as claimed in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for reducing terrain mesh surface as claimed in any one of claims 1 to 7 is implemented.