A method and device for generating a two-dimensional and three-dimensional integrated war chess hexagonal grid
By adopting the two- and three-dimensional integrated generation method in the warga hexagonal grid generation method, the problems of distortion and poor compatibility of two-dimensional and three-dimensional in high-latitude areas are solved, and efficient warga hexagonal grid visualization is achieved.
Patent Information
- Application Number
- CN201910960409.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-10-10
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2039-10-10
AI Technical Summary
The traditional two-dimensional plane warga hexagonal grid generation algorithm is severely distorted when displayed in high-latitude areas and is difficult to perfectly compatible between two-dimensional and three-dimensional scenes.
A two-three-dimensional integrated warga hexagonal grid generation method is proposed. By selecting polygon drawing areas in the target map, a collection of vertices is generated, and points are converted to a specified coordinate system according to the coordinates of the geometric center position, and the vertices of the equilateral hexagon are calculated. The intersection is judged and stored in the output set, and finally draw an equilateral hexagon in the two-dimensional and three-dimensional views.
The two- and three-dimensional integrated visualization effect of the war chess hexagon grid is realized, avoiding the distortion problem in high-latitude areas, and achieving perfect compatibility between two-dimensional and three-dimensional scenes.
Smart Images

Figure CN112652034B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of geographic image technology, and more specifically, to a method and device for generating a two-dimensional and three-dimensional integrated war chess hexagonal grid. Background Art
[0002] War games are an important tool for logical deduction, research and evaluation of combat processes, and are an important method and means of modern combat simulation. The three major elements of war games include chessboards, chess pieces and rules. The classic style of chessboards is hexagonal war chessboards, and hexagonal war chessboards are also often used in computer war games to describe battlefield terrain environments.
[0003] Traditional wargame hexagonal grid generation algorithms are mostly based on two-dimensional planes. However, with the development of three-dimensional geographic information display platforms, wargame simulation has also become a direction of its military application, and traditional two-dimensional plane wargame hexagonal grid generation algorithms are no longer applicable.
[0004] In order to realize the three-dimensional hexagonal grid war chess board drawing, some three-dimensional war chess hexagonal grid generation algorithms have been proposed, but these algorithms generally have some problems: they can only be displayed normally near the equator, and the closer to the high latitude area, the greater the distortion of the drawn hexagonal grid; they are only applicable to three-dimensional scenes, and it is difficult to convert them into two-dimensional scenes for perfect compatibility. Summary of the invention
[0005] In view of this, the purpose of this application is to propose a method for generating a two-dimensional and three-dimensional integrated war chess hexagonal grid to solve the above-mentioned technical problems existing in the prior art.
[0006] Based on the above purpose, in the first aspect of the present application, a method for generating a two-dimensional and three-dimensional integrated war chess hexagonal grid is provided. The method comprises:
[0007] Selecting a polygonal drawing area in the target map, and generating a first vertex set according to the vertices of the polygonal drawing area;
[0008] Determine the geometric center position coordinates of the polygon drawing area according to the first vertex set;
[0009] According to the coordinates of the geometric center position, the points in the first vertex set are converted into points in a specified coordinate system to generate a second vertex set;
[0010] An equilateral hexagon is obtained by calculation according to the coordinates of the geometric center position and the preset side length, and a third vertex set is generated according to the six vertices of the equilateral hexagon;
[0011] Determine whether the second vertex set has an intersection with the third vertex set, if yes, store the equilateral hexagon in an output set, if no, stop drawing;
[0012] Based on the generated equilateral hexagon, continue to generate equilateral hexagons toward the outside of the geometric center, and store the equilateral hexagons whose vertices intersect with the second vertex set into the output set;
[0013] Equilateral hexagons are drawn in the two-dimensional view and the three-dimensional view respectively according to the output set to generate a hexagonal grid of the chess game.
[0014] Furthermore, the method further includes: selecting a polygonal drawing area in the target map, and generating a first vertex set according to vertices of the polygonal drawing area.
[0015] Initialize and construct the MapView views used to carry 3D map drawing and 2D view drawing respectively.
[0016] Furthermore, the coordinates of the points in the first vertex set are geographic coordinates.
[0017] Furthermore, the designated coordinate system is a northeast celestial coordinate system.
[0018] Furthermore, converting the points in the first vertex set into points in a specified coordinate system according to the coordinates of the geometric center position to generate the second vertex set includes:
[0019] The coordinates of the points in the first vertex set and the coordinates of the geometric center position are converted into geocentric coordinate system coordinates, and the geocentric coordinate system coordinates are converted into geographic coordinate system coordinates. Taking the position of the geometric center point as the origin, the vertices in the first vertex set are converted into points in the northeast celestial coordinate system to generate a second vertex set.
[0020] Further, the calculating of an equilateral hexagon according to the geometric center position coordinates and a preset side length includes:
[0021] The equilateral hexagon is calculated in the direction of the preset central axis according to the geometric center position coordinates and the preset side length.
[0022] Further, the step of continuing to generate equilateral hexagons outward from the geometric center based on the generated equilateral hexagon, and storing the equilateral hexagons whose vertices intersect with the second vertex set into the output set includes:
[0023] According to the center point position and the central axis direction of the generated equilateral hexagon, the center point position and vertex position of the six adjacent equilateral hexagons are calculated to form a set of six equilateral hexagons;
[0024] Compare the calculated 6 equilateral hexagons with the equilateral hexagons in the output set, and select the equilateral hexagons outside the output set;
[0025] It is determined whether the vertex set of the equilateral hexagon outside the output set has an intersection with the third vertex set. If so, the selected equilateral hexagon is stored in the output set.
[0026] Furthermore, the step of continuing to generate equilateral hexagons outward from the geometric center based on the generated equilateral hexagons and storing the equilateral hexagons whose vertices intersect with the second vertex set into the output set further includes:
[0027] This step is repeated until there is no equilateral hexagon outside the output set or the vertex set of the equilateral hexagon outside the output set does not intersect with the third vertex set.
[0028] Based on the above purpose, in a second aspect of the present application, a device is proposed, comprising:
[0029] one or more processors;
[0030] A storage device for storing one or more programs;
[0031] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating a two-dimensional and three-dimensional integrated war chess hexagonal grid as described in any one of the first aspects.
[0032] Based on the above purpose, in the third aspect of the present application, a computer-readable storage medium is proposed, on which a computer program is stored, and when the program is executed by a processor, the method for generating a two-dimensional and three-dimensional integrated war chess hexagonal grid as described in any one of the first aspects is implemented.
[0033] The method for generating a two-dimensional and three-dimensional integrated polygonal graphic provided in an embodiment of the present application generates a first vertex set by drawing vertices of a polygonal area; determines the coordinates of the center point of the polygonal area according to the first vertex set; converts the points in the first vertex set into points in a specified coordinate system according to the coordinates of the center point to generate a second vertex set; calculates an equilateral hexagon according to the coordinates of the geometric center position and a preset side length, and generates a third vertex set according to the six vertices of the equilateral hexagon; determines whether the second vertex set and the third vertex set have an intersection, if so, stores the equilateral hexagon in an output set, if not, stops drawing; continues to generate equilateral hexagons toward the outside of the geometric center based on the generated equilateral hexagon, and stores the equilateral hexagons whose vertices intersect with the second vertex set in the output set; draws equilateral hexagons in a two-dimensional view and a three-dimensional view according to the output set to generate a hexagonal grid of a chess game, thereby achieving a two-dimensional and three-dimensional integrated visualization effect of the hexagonal grid of the chess game and avoiding distortion in high-latitude areas.
[0034] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0036] Figure 1 It is a flow chart of a method for generating a two-dimensional and three-dimensional integrated war chess hexagonal grid according to the first embodiment of the present application;
[0037] Figure 2 It is a flow chart of a method for generating a two-dimensional and three-dimensional integrated war chess hexagonal grid according to the second embodiment of the present application;
[0038] Figure 3 is a schematic diagram of the structure of a computer system of a terminal device or server used to implement an embodiment of the present application;
[0039] Figure 4 A polygonal diagram of a common area selected on a two-dimensional map and a three-dimensional map;
[0040] Figure 5 Schematic diagram of polygons of the equatorial region selected on the two-dimensional and three-dimensional images;
[0041] Figure 6 A schematic diagram of a polygon across the North Pole selected on a three-dimensional map. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0043] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0044] As an embodiment of the present application, Figure 1, which is a flow chart of a method for generating a two-dimensional and three-dimensional integrated chess hexagonal grid according to the first embodiment of the present application. Figure 1 It can be seen that the method for generating a two-dimensional and three-dimensional integrated war chess hexagonal grid of this embodiment includes the following steps:
[0045] S101: Selecting a polygonal drawing area in a target map, and generating a first vertex set according to vertices of the polygonal drawing area;
[0046] The method of this embodiment can be applied to a three-dimensional scene in a geographic information system to display map information in two-dimensional and three-dimensional integration. Specifically, when drawing a target map in two-dimensional and three-dimensional integration, first, select a polygonal area in the target map including a two-dimensional map and / or a three-dimensional map. The polygonal area here can usually be a simple polygon. The simple polygon here refers to a polygon in which two adjacent sides intersect at a vertex of a polygon, and there is no intersection between any two non-adjacent sides. The simple polygon can be a concave polygon or a convex polygon. Specifically, as Figure 4 , which are polygonal schematic diagrams of common areas selected on two-dimensional and three-dimensional graphs; Figure 5 Schematic diagram of polygons of the equatorial region selected on the two-dimensional and three-dimensional images; Figure 6 This is a schematic diagram of the polygon of the cross-North Pole area selected on the three-dimensional map. It can be seen from the figure that the selected simple polygon is not limited by the latitude of the earth, and can be selected arbitrarily from low-latitude areas such as the equator to high-latitude areas such as the North and South Poles; it is also not limited by land type, and the drawing area can be selected in land or ocean areas; it is also not limited by terrain, and the drawing area can be selected in mountainous areas, forests and other areas.
[0047] After selecting a polygonal area, the vertices of the polygonal area are arranged in a counterclockwise order to form a first vertex set. The counterclockwise order here may also be a clockwise order, or other orders, such as an order of one vertex in a counterclockwise order.
[0048] S102: Determine the geometric center position coordinates of the polygon drawing area according to the first vertex set;
[0049] Based on the acquired coordinates of each vertex in the first vertex set, the coordinates of the geometric center position of the polygon drawing area are calculated.
[0050] S103: According to the coordinates of the geometric center position, convert the points in the first vertex set into points in a specified coordinate system to generate a second vertex set;
[0051] After the first vertex set is generated, the vertices in the first vertex set are converted to a coordinate system, and a second vertex set is generated based on the converted vertices and the obtained geometric center position coordinates. Specifically, since the polygonal area is directly selected in the target map, the vertices of the selected polygonal area and the obtained geometric center position coordinates are usually points in the geographic coordinate system. In order to achieve two- and three-dimensional integration of polygons and avoid distortion in high-latitude areas, it is necessary to convert the points in the geographic coordinate system into points in the northeast celestial coordinate system to determine the longitude and latitude of the vertices of the polygonal area.
[0052] In this embodiment, the first vertex set can be recorded as set. Traverse all points in the vertex set set (L i , B i , H i ), convert each point to geocentric coordinates, and get (X i , Y i , Z i ); Traverse(X i , Y i , Z i ), calculate the average value (X avr , Y avr , Z avr ),X avr =∑ i X i / n,Y avr =∑ i Y i / n,Z avr =∑ i Z i / n; (X avr , Y avr , Z avr ) is converted to the geographic coordinate system and refCentre(L c , B c , H c );with refCentre(L c , B c , H c ) is the origin of the ENU (northeast sky) coordinate system, that is, taking the coordinates of the geometric center position as the origin, traverse all the vertices in set respectively, convert each vertex to the ENU coordinate system, and obtain the set set′, where set′={(N i , E i ), i≥1&&i≤N1}. The set set′ is a second vertex set.
[0053] S104: Calculating an equilateral hexagon according to the geometric center position coordinates and a preset side length, and generating a third vertex set according to six vertices of the equilateral hexagon;
[0054] Based on the obtained geometric center position coordinates and the preset side length, the coordinates of the six vertices of the equilateral hexagon are calculated in the preset central axis direction, and the six vertex coordinates of the equilateral hexagon are stored in a set, namely the third vertex set. Specifically, the preset central axis direction can be determined arbitrarily, and the direction parallel to the latitude line is generally taken as the central axis direction of the equilateral hexagon.
[0055] Furthermore, in the ENU coordinate system, with (0.0) as the center point of the first hexagon and a preset radius of r, an equilateral hexagon consisting of 6 vertices can be calculated, and the position coordinates of the 6 vertices of the equilateral hexagon constitute the third vertex set.
[0056] S105: Determine whether the second vertex set has an intersection with the third vertex set, if yes, store the equilateral hexagon into an output set, if no, stop drawing;
[0057] Calculate the intersection of the second vertex set and the third vertex set. If the intersection exists, retain the third vertex set and store it in the output set, and proceed to the next step; if the intersection does not exist, stop the operation.
[0058] S106: Continue to generate equilateral hexagons outward from the geometric center based on the generated equilateral hexagon, and store the equilateral hexagons whose vertices intersect with the second vertex set into the output set;
[0059] Based on the generated center point position coordinates and central axis direction of the equilateral hexagon, the center point position coordinates and vertex position coordinates of the six adjacent equilateral hexagons are calculated to form a set of six equilateral hexagons; the calculated set of six equilateral hexagons is compared with the equilateral hexagons in the output set, and the equilateral hexagons not in the set are selected; it is determined whether the vertex set of the equilateral hexagon not in the output set has an intersection with the third vertex set, and if there is an intersection, the selected equilateral hexagon is stored in the output set.
[0060] Further, the execution step is repeated until there is no equilateral hexagon outside the output set or the vertex set of the equilateral hexagon outside the output set does not intersect with the third vertex set.
[0061] S107: Draw equilateral hexagons in the two-dimensional view and the three-dimensional view respectively according to the output set to generate a chess hexagonal grid.
[0062] The method for generating a two- and three-dimensional integrated war chess hexagonal grid in the embodiment of the present application can not only achieve a two- and three-dimensional integrated visualization effect of the war chess hexagonal grid, but also avoid the influence of distortion in high-latitude areas.
[0063] like Figure 2 , which is a flow chart of a method for generating a two-dimensional and three-dimensional integrated chess hexagonal grid according to Embodiment 2 of the present application. This embodiment is an embodiment expanded on the basis of Embodiment 1. Specifically, before Step S101 in Embodiment 1, the following steps are also included:
[0064] S201: Initialize and construct MapView views for carrying 3D map drawing and 2D view drawing respectively.
[0065] That is, two MapView views are initialized and constructed in advance, one MapView3D is used to carry 3D map drawing, and one MapView2D is used to carry 2D view drawing.
[0066] In step S101 , two nodes are drawn according to the first vertex set, and the two nodes are loaded into two corresponding views respectively.
[0067] The method of this embodiment can achieve similar technical effects as those of the first embodiment, and will not be repeated here.
[0068] The present application also provides a device, including:
[0069] one or more processors;
[0070] A storage device for storing one or more programs;
[0071] When the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method for generating a two-dimensional and three-dimensional integrated polygonal graphic.
[0072] In addition, an embodiment of the present application also proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned method for generating a two-dimensional and three-dimensional integrated polygonal graphic is implemented.
[0073] Reference below Figure 3 , which shows a schematic diagram of the structure of a computer system of a terminal device or server suitable for implementing an embodiment of the present application. Figure 3 The terminal device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0074] like Figure 3As shown, the computer system includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes based on a program stored in a read-only memory (ROM) 302 or a program loaded from a storage part 308 into a random access memory (RAM) 303. In RAM 303, various programs and data required for system operation are also stored. CPU 301, ROM 302 and RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0075] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.
[0076] In particular, based on the embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 309, and / or installed from a removable medium 311. When the computer program is executed by a central processing unit (CPU) 301, the above-mentioned functions defined in the method of the present application are executed.
[0077] It should be noted that the computer-readable medium described in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0078] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a unit, a program segment or a part of a code, and the unit, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0079] The units involved in the embodiments described in the present application may be implemented by software or by hardware. The units described may also be provided in a processor, for example, may be described as: a processor including an information measurement unit, a driving trajectory determination unit, a mapping relationship determination unit, and a driving strategy generation unit. The names of these units do not, in some cases, constitute limitations on the units themselves, for example, the information measurement unit may also be described as a "unit for measuring the state information of the vehicle and the surrounding scene information".
[0080] As another aspect, the present application also provides a non-volatile computer storage medium, which can be the non-volatile computer storage medium included in the device described in the above embodiment; or it can be a non-volatile computer storage medium that exists independently and is not installed in the terminal. The above non-volatile computer storage medium stores one or more programs, and when the one or more programs are executed by a device, the device: selects a first polygonal area and a second polygonal area in a target map, transforms the coordinate system of the vertices of the first polygonal area and the second polygonal area, sets the value of the first direction of the transformed vertex to zero, and generates a first plane polygon and a second plane polygon; performs Boolean operations on the first plane polygon and the second plane polygon to generate a polygon or a polygon set; determines the longitude and latitude of the vertex coordinates in the generated polygon or polygon set and the corresponding altitude; according to the longitude and latitude of the vertex coordinates in the polygon or polygon set and the corresponding altitude, draws the first polygonal area and the second polygonal area of the target map in a two-dimensional view and a three-dimensional view.
[0081] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
Claims
1. A method for generating a two-dimensional and three-dimensional integrated war chess hexagonal grid, characterized in that: include: Initialize and construct the MapView views used to carry 3D map drawing and 2D view drawing respectively; Selecting a polygonal drawing area in the target map, and generating a first vertex set according to the vertices of the polygonal drawing area; Determining the coordinates of the geometric center position of the polygonal drawing area according to the first vertex set, wherein the coordinates of the points in the first vertex set are geographic coordinates; According to the coordinates of the geometric center position, the points in the first vertex set are converted into points in a specified coordinate system to generate a second vertex set, wherein the specified coordinate system is a northeast celestial coordinate system; including: converting the coordinates of the points in the first vertex set and the coordinates of the geometric center position into coordinates of a geocentric coordinate system, and converting the coordinates of the geocentric coordinate system into coordinates of a geographic coordinate system, taking the position of the geometric center point as the origin, converting the vertices in the first vertex set into points in the northeast celestial coordinate system to generate a second vertex set; An equilateral hexagon is obtained by calculation according to the coordinates of the geometric center position and the preset side length, and a third vertex set is generated according to the six vertices of the equilateral hexagon; Determine whether the second vertex set has an intersection with the third vertex set, if yes, store the equilateral hexagon in an output set, if no, stop drawing; Based on the generated equilateral hexagon, continue to generate equilateral hexagons outward from the geometric center, and store the equilateral hexagons whose vertices intersect with the second vertex set into the output set; including: based on the center point position coordinates and the central axis direction of the generated equilateral hexagon, calculate the center point position coordinates and vertex position coordinates of the six adjacent equilateral hexagons to form a set of six equilateral hexagons; compare the calculated set of six equilateral hexagons with the equilateral hexagons in the output set, and select the equilateral hexagons that are not in the set; determine whether the vertex set of the equilateral hexagon that is not in the output set has an intersection with the third vertex set, and if there is an intersection, store the selected equilateral hexagon in the output set; Equilateral hexagons are drawn in the two-dimensional view and the three-dimensional view respectively according to the output set to generate a hexagonal grid of the chess game.
2. The method according to claim 1, characterized in that The calculating of an equilateral hexagon according to the geometric center position coordinates and the preset side length comprises: The equilateral hexagon is calculated in the direction of the preset central axis according to the geometric center position coordinates and the preset side length.
3. The method according to claim 2, characterized in that The step of continuing to generate equilateral hexagons outward from the geometric center based on the generated equilateral hexagons, and storing the equilateral hexagons whose vertices intersect with the second vertex set into the output set comprises: According to the center point position and the central axis direction of the generated equilateral hexagon, the center point position and vertex position of the six adjacent equilateral hexagons are calculated to form a set of six equilateral hexagons; Compare the calculated 6 equilateral hexagons with the equilateral hexagons in the output set, and select the equilateral hexagons outside the output set; It is determined whether the vertex set of the equilateral hexagon outside the output set has an intersection with the third vertex set. If so, the selected equilateral hexagon is stored in the output set.
4. The method according to claim 3, characterized in that The step of continuing to generate equilateral hexagons outward from the geometric center based on the generated equilateral hexagons, and storing the equilateral hexagons whose vertices intersect with the second vertex set into the output set further comprises: Repeat the following steps until there are no equilateral hexagons outside the output set or the vertex set of the equilateral hexagons outside the output set does not intersect with the third vertex set: continue to generate equilateral hexagons outward from the geometric center based on the generated equilateral hexagons, and store the equilateral hexagons whose vertices intersect with the second vertex set in the output set.
5. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating a two-dimensional and three-dimensional integrated war chess hexagonal grid as described in any one of claims 1-4.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the method for generating a two-dimensional and three-dimensional integrated war chess hexagonal grid as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method for modeling terrain property of Wargame map by grid matrix
CN105045976A
A-star-algorithm-based war game hexagonal-grid map path planning method
CN107506513A