Map generation method and device
By identifying and splicing the object information of adjacent grids in TileMap technology, and determining the appropriate plot type to fill the grid, the problem of being unable to generate a three-dimensional map in the existing technology is solved, and a high-quality three-dimensional map effect is achieved.
Patent Information
- Application Number
- CN202410712011.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-08-30
AI Technical Summary
Existing TileMap technology is mainly used for the creation of two-dimensional maps and lacks effective methods to generate three-dimensional maps.
By selecting the target parcel model from the target map library, determining its location information in the pre-segmented map, identifying the object information of adjacent grids, and based on this information, using seamless splicing as constraints, determine and select the appropriate The plot type is used to populate the target grid to generate a 3D map.
Seamless 3D map generation is achieved, ensuring continuity between adjacent plot models and high-quality 3D map effects.
Smart Images

Figure CN118557968A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a map generation method and device. Background Art
[0002] Ti leMap is a common technology in game development. It is a collection of tiles composed of many small tiles. These small tiles can be common elements in games such as characters, walls, ground, trees, etc.
[0003] TileMap is one of the most commonly used technical methods for creating two-dimensional maps. It divides the world into a grid of a fixed size and fills each grid with a small tile. Each small tile is usually an independent image that can be created and edited using various software tools to generate a two-dimensional map. However, there is currently no solution for creating a three-dimensional map using TileMap. Therefore, there is an urgent need for a map generation method for creating a three-dimensional map using TileMap. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a map generation method. One or more embodiments of the present application also relate to a map generation device, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects existing in the prior art.
[0005] According to a first aspect of an embodiment of the present application, a map generation method is provided, comprising:
[0006] In response to a selection instruction for a target plot model from a target map library, determining position information of a target grid where the target plot model is to be placed, wherein the target map library includes pre-created three-dimensional plot models, and the target grid is obtained by pre-segmenting a map;
[0007] According to the position information, identifying object information of adjacent grids of the target grid;
[0008] Based on the object information of the adjacent grids, the land parcel type of the target land parcel model is determined with the constraint that the adjacent land parcel models are seamlessly spliced;
[0009] The target plot model that matches the plot type is selected and filled into the target grid to generate a target map.
[0010] According to a second aspect of an embodiment of the present application, a map generating device is provided, including:
[0011] A response module is configured to determine, in response to a selection instruction for a target plot model from a target map library, position information of a target grid where the target plot model is to be placed, wherein the target map library includes pre-created three-dimensional plot models, and the target grid is obtained by pre-segmenting a map;
[0012] an identification module, configured to identify object information of adjacent grids of the target grid according to the position information;
[0013] A determination module is configured to determine the plot type of the target plot model based on the object information of the adjacent grids and with the constraint that the adjacent plot models are seamlessly spliced;
[0014] The generation module is configured to select the target plot model that meets the plot type and fill it into the target grid to generate a target map.
[0015] According to a third aspect of an embodiment of the present application, a computing device is provided, including:
[0016] Memory and processor;
[0017] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above-mentioned map generation method are implemented.
[0018] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program / instruction, and when the instruction is executed by a processor, the steps of the above-mentioned map generation method are implemented.
[0019] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising a computer program / instruction, which, when executed by a processor, implements the steps of executing the above-mentioned map generation method.
[0020] In response to a selection instruction for a target plot model from a target map library, an embodiment of the present application determines the location information of a target grid to be placed with a target plot model, wherein the target map library includes a pre-created three-dimensional plot model, and the target grid is obtained by pre-segmenting the map; according to the location information, the object information of the adjacent grids of the target grid is identified; based on the object information of the adjacent grids, the plot type of the target plot model is determined with the constraint that the adjacent plot models are seamlessly spliced; the target plot model that meets the plot type is selected and filled into the target grid to generate a target map. The location information of the target grid to be placed with a target plot model is determined by selecting an instruction, and based on the location information, the object information of the adjacent grids of the target grid is identified to determine the plot type at which the target plot model is placed, with the constraint that the adjacent plot models are seamlessly spliced, and based on the plot type, a target plot model that meets the type condition is selected to fill the target grid, and a target map is generated, so that there is no gap between adjacent plot models in the generated target map, thereby ensuring the effect of the generated three-dimensional target map. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flow chart of a map generation method provided by an embodiment of the present application;
[0022] Figure 2a is a process flow chart of a map generation method provided by an embodiment of the present application;
[0023] Figure 2b A schematic diagram of generating and displaying image information in a map generation method provided by an embodiment of the present application;
[0024] Figure 3 is a structural schematic diagram of a map generating device provided by an embodiment of the present application;
[0025] Figure 4 It is a structural block diagram of a computing device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0026] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0027] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0028] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0029] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0030] First, the terms involved in one or more embodiments of the present application are explained.
[0031] Application Programming Interface (API): is a set of predefined rules and specifications that allow software applications to interact and communicate with each other. API can be seen as a bridge between different software components, allowing them to "understand" each other and exchange information.
[0032] Editor Tools: An application used to write and modify code, text, images, or other types of data during programming or content creation. The types and functions of editor tools vary depending on their design goals.
[0033] Bitwise operation: It is a common algorithm in computer programming that directly operates on the binary bits of integers in memory. Bitwise operation has applications in many fields, including image processing, hardware device control, error detection and correction codes, etc.
[0034] TileMap is a common technology used in game development. It is a two-dimensional tile set composed of many small tiles. These small tiles can be common elements in games such as characters, walls, ground, trees, etc. TileMap is one of the most commonly used technical ways to create maps in two-dimensional games. It divides the game world into a grid of a fixed size and fills each grid with a small tile. Each small tile is usually an independent image that can be created and edited using various software tools.
[0035] However, there is currently no solution for creating a three-dimensional map using Ti leMap. Therefore, there is an urgent need for a map generation method for creating a three-dimensional map using Ti leMap.
[0036] In the present application, a map generation method is provided. The present application also relates to a map generation device, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.
[0037] Currently, when a map editor is used to edit and generate a map, usually only two-dimensional maps can be edited and generated. When there is a need to generate a three-dimensional map, the source code of the map editor needs to be modified and expanded so that the map editor can support the generation of three-dimensional maps after modification and expansion. Among them, expansion is to expand the application program interface of the map editor. The map editor is an editor tool.
[0038] See also Figure 1 , Figure 1 A flowchart of a map generation method provided by an embodiment of the present application is shown, which specifically includes the following steps.
[0039] Step 102: In response to a selection instruction for a target plot model from a target map library, determine the location information of a target grid where the target plot model is to be placed, wherein the target map library includes pre-created three-dimensional plot models, and the target grid is obtained by pre-segmenting a map.
[0040] Specifically, the target texture library refers to the textures for storing various objects used when generating the target map. For example, the target texture library includes textures of various objects such as three-dimensional land models, three-dimensional assets, props, and characters. For example, three-dimensional assets can be three-dimensional houses, three-dimensional walls, three-dimensional roads, etc., and props can be weapons, equipment, etc. The target plot model refers to the three-dimensional plot model to be filled into the target grid. The three-dimensional plot model can be divided into four-sided seamless, four-sided chamfered, three-sided chamfered, single-sided chamfered, double-sided chamfered, inner corner chamfered, etc. based on the different edge types. Among them, four-sided seamless means that the edges of the four sides are right angles. The chamfers in four-sided chamfered, three-sided chamfered, single-sided chamfered, double-sided chamfered, and inner corner chamfered refer to a slope formed by cutting off the sharp part of the corner edge. Four-sided, three-sided, single-sided, double-sided, and inner corner refer to the position of the chamfer in the three-dimensional plot model. The type of the three-dimensional plot model filled in the target grid is different based on the different objects filled in the grids adjacent to the target grid. Among them, the filled objects can be three-dimensional plot models or non-three-dimensional plot models. Non-three-dimensional plot models can be three-dimensional assets, props, characters, etc. The selection instruction refers to the selection instruction of the target plot model generated based on the dragging or parameter input of the front end, and can specifically be the selection instruction of the texture of the target plot model. Based on the selection instruction, the corresponding relationship between the target plot model and the target grid can be determined. The location information is used to characterize the location of the target grid in the map. The location information can be represented by the coordinates of the target grid in the map, or can also be represented by a grid number. The embodiment of this specification uses TileMap to generate a three-dimensional map, so before generating the map, the map is pre-grid-divided to obtain multiple grids.
[0041] An implementation method for determining the position information of a target grid on which the target plot model is to be placed in response to an instruction to select a target plot model from a target texture library may be to determine a correspondence between the position information of the target plot model and the target grid in response to an instruction to select a target plot model from a target texture library, and determine the position information of the target grid on which the target plot model is to be placed based on the correspondence.
[0042] Exemplarily, the user drags the model texture of the target plot model to the target grid through the front end, and generates a selection instruction based on the dragging operation.
[0043] Step 104: Identify object information of adjacent grids of the target grid according to the position information.
[0044] Specifically, an adjacent grid refers to a grid whose distance from the target grid in the map is less than a preset threshold. For example, the grids in the map are arranged in 3*4, and the numbers are 1-12 from left to right and from top to bottom. The target grid is grid 3, and the adjacent grids of grid 3 are grid 2, grid 4 and grid 7. The distances between grid 3 and grid 2, grid 4 and grid 7 are all less than the preset threshold. Object information is used to characterize the uniqueness of an object. Object information can be attribute information of an object. Attribute information can include object name, shape, size and other information.
[0045] The object information of the adjacent grids of the target grid may be identified according to the position information by acquiring drawing image information, wherein the drawing image information includes a plurality of grids and object information of each grid, identifying the adjacent grids adjacent to the target grid according to the position information, and reading the object information of the adjacent grids from the drawing information.
[0046] Optionally, the drawing image information is generated based on a selection operation for a sticker in the target sticker library. For example, a user drags a selected sticker to a specified grid through the front end. Based on the dragging of the front end, the sticker is dragged to the specified grid. The map composed of the grids carrying the stickers is called the drawing image information. The drawing image information records the object information of the grids and the objects to be placed on each grid, wherein the objects are three-dimensional objects, such as 3D assets, roads, enemies, plot models, etc.
[0047] Step 106: Based on the object information of the adjacent grids, the land parcel type of the target land parcel model is determined with the constraint that the adjacent land parcel models are seamlessly spliced.
[0048] Specifically, seamless splicing is used to indicate that adjacent plot models achieve a continuous and uninterrupted effect after being spliced together, for example, the spliced faces or edges are seamless, so that adjacent three-dimensional plot models are spliced together seamlessly. Constraints refer to the conditions that constrain the splicing of objects in each grid in the map. Plot type refers to the type of plot filled in the terrain. The plot type includes at least the edge type. For example, the plot type can be seamless on all sides, chamfered on all sides, chamfered on three sides, chamfered on one side, chamfered on both sides, chamfered on the inner corner, etc. The plot type can also include the terrain type. For example, the terrain type is a bulge in the middle, a depression in the middle, a bulge in the four corners, a depression in the four corners, etc., wherein the edge type and the terrain type can be used in combination. For example, the plot type of a certain plot model is seamless on all sides and has a bulge in the middle.
[0049] There are many ways to determine the plot type of the target plot model based on the object information of adjacent grids and with the constraint that adjacent plot models are seamlessly spliced. The specific method is determined based on actual conditions and is not limited in this application.
[0050] In an optional embodiment of the present application, the plot type of the target plot model is determined based on object information of adjacent grids, with the constraint that adjacent plot models are seamlessly spliced. The splicing type when the target plot model is spliced with objects of adjacent grids can be determined based on object information of adjacent grids, with the constraint that adjacent plot models are seamlessly spliced. The splicing type when the target plot model is spliced with objects of adjacent grids can be integrated to determine the plot type of the target plot model.
[0051] Exemplarily, the splicing types when the target plot model is spliced with objects of each adjacent grid are seamless splicing, seamless splicing, chamfered splicing, and chamfered splicing. Each splicing method is integrated to determine that the plot type of the target plot model is double-sided chamfering.
[0052] In another possible implementation of the present application, the plot type of the target plot model is determined based on the object information of adjacent grids, with the constraint that adjacent plot models are seamlessly spliced together. Alternatively, the object information of the adjacent grids may be input into a plot type determination model to obtain the plot type of the target plot model output by the plot type determination model, wherein the plot type determination model is based on information with the constraint that adjacent plot models are seamlessly spliced together, and is trained using the object information of sample adjacent grids and label plot types.
[0053] Exemplarily, the object information of each adjacent grid corresponding to the target grid is a plot model, a non-plot model, a non-plot model, and a non-plot model. The plot model, the non-plot model, the non-plot model, and the non-plot model are input into a plot type determination model, and the plot type of the target plot model output by the plot type determination model is single-sided seamless.
[0054] Optionally, the constraint condition may be satisfied by splicing adjacent block models using right-angle edges so that the block models are completely filled in the target grid.
[0055] Step 108: Select a target plot model that matches the plot type and fill it into the target grid to generate a target map.
[0056] After determining the plot type of the target plot model, a target plot model that matches the plot type is selected, and the target plot model is filled into the mapping position of the target grid in the three-dimensional space coordinates to generate a target map.
[0057] There is a mapping relationship between the map and the three-dimensional space coordinates. Based on the mapping relationship, the corresponding relationship between the target plot model and the target grid, the mapping grid corresponding to the target grid in the three-dimensional space coordinates is determined, and the target plot model is filled into the mapping grid to generate the target map.
[0058] Optionally, in actual applications, the objects filled in each grid in the three-dimensional space coordinates will be mounted on the mounting container, and the behavioral logic information of the corresponding object can be written on the mounting container. For example, the behavioral logic information can be a response to user input, trigger, specific animation, etc.
[0059] For example, if the object is a road, and the user controls the game character to step on the road hard, an animation of a dent will appear on the road. This animation is the behavioral logic information corresponding to the object "road"; if the object is an enemy, and the user controls the game character to hit the enemy, the enemy will appear to be knocked away, bent over, etc. This animation is the behavioral logic information corresponding to the object "enemy".
[0060] Optionally, the implementation method of selecting the target plot model that conforms to the plot type may be to select a benchmark plot model whose benchmark plot type is the same as the plot type of the target plot model from the benchmark plot models, and determine it as the target plot model that conforms to the plot type, wherein the benchmark plot model is a pre-generated three-dimensional plot model of various types.
[0061] Optionally, the benchmark plot model includes multiple benchmark plot types, such as seamless on all sides, chamfered on all sides, chamfered on three sides, chamfered on one side, chamfered on both sides, chamfered on the inner corner, etc. The benchmark plot model may be stored in memory. When there is a need to select a target plot model that meets the plot type and fill it into the target grid, the benchmark plot type of each benchmark plot model will be obtained from the memory, and the benchmark plot type will be matched with the plot type of the target plot model, so as to select the benchmark plot model with the same plot type as the target plot model from the benchmark plot model and fill it, specifically, fill it into the target grid.
[0062] Among them, the implementation method of selecting a benchmark plot model with the same benchmark plot type as the plot type from the benchmark plot model can be to match the type characteristics of the benchmark plot model with the type characteristics of the plot type, and determine the benchmark plot model with the same plot type based on the matching result.
[0063] Optionally, the matching may be implemented by calculating cosine similarity, Euclidean distance, neural network, bitwise AND operation, etc., wherein the bitwise AND operation refers to performing a bitwise operation first and then performing an AND operation, and determining the matching result based on the result of the AND operation.
[0064] In an optional embodiment of the present application, the above step of identifying object information of adjacent grids of the target grid according to the position information includes the following steps:
[0065] Acquire drawing image information, wherein the drawing image information includes a plurality of grids and object information of each grid;
[0066] According to the position information, identifying adjacent grids adjacent to the target grid;
[0067] Read the object information of the adjacent mesh from the drawn image information.
[0068] Specifically, the drawn image information includes information of the map image structure, the drawn image information includes object information of multiple grids, the drawn image information is generated based on the completed Ti leMap, the object of each grid in the completed Ti leMap is a texture in the target texture library, the drawn image information can be a two-dimensional array structure, and each element in the drawn image information is the object information of the object to be filled in each grid. For example, the drawn image information is a two-dimensional array structure of three rows and three columns, the first row is [object information of three-dimensional plot model, object information of three-dimensional plot model, object information of three-dimensional wall], the second row is [object information of three-dimensional plot model, object information of three-dimensional plot model, object information of three-dimensional wall], and the third row is [object information of three-dimensional wall, object information of three-dimensional wall, object information of three-dimensional wall].
[0069] There are many ways to generate drawing image information based on the completed TileMap, and the specific method is selected according to the actual situation, which is not limited in this application.
[0070] In a possible implementation of the present application, the drawing image information is generated based on the completed Ti leMap, which can be performed by extracting the position information and object information of each grid in the completed Ti leMap, constructing a first two-dimensional array template based on the position information of each grid, and filling the object information into the first two-dimensional array template based on the correspondence between each object information and each grid, so as to generate the drawing image information.
[0071] For example, the first row of the first two-dimensional array template is [(1,1), (1,2), (1,3)], the second row is [(2.1), (2,2), (2,3)], and the third row is [(3,1), (3,2), (3,3)], where the index corresponding to each element in the first two-dimensional array template is the location information of each grid.
[0072] In another possible implementation of the present application, the drawing image information is generated based on the completed Ti leMap, and the grid identifier and the object information of each grid in the completed Ti leMap can be extracted, and a second two-dimensional array template is constructed based on the grid identifier of each grid. Based on the correspondence between each object information and each grid, the object information is filled into the second two-dimensional array template to generate the drawing image information.
[0073] For example, a row of the second two-dimensional array template includes [A, B, C, D, E, F, G, H, I], where the index corresponding to each element in the second two-dimensional array template is the grid identifier of each grid, and the grid identifier is associated with the position of the grid in Ti leMap. For example, the position information of the grid with grid identifier D in Ti leMap is (2, 1).
[0074] In another possible implementation of the present application, the drawing image information is generated based on the drawn TileMap, and the drawn TileMap may be determined as the drawing image information.
[0075] When generating a target map, developers will design the target map in advance and display the design results in the drawing image information. Therefore, when generating a three-dimensional target map, the target grids on the three-dimensional target map are filled with objects based on the object information of each grid in the drawing image information. The implementation method for designing the target map can be based on the user's dragging on the front end or the front end inputting parameter instructions for design.
[0076] The implementation method of filling the target grid on the three-dimensional target map with objects based on the object information of each grid in the drawn image information can be to determine the target object to be filled on the target grid in the three-dimensional target map based on the object information of each grid in the drawn image information, obtain the three-dimensional entity of the target object, and fill the three-dimensional entity of the target object into the corresponding target grid.
[0077] The generation of drawing image information is an important condition for generating a target map. The drawing image information includes the basis for filling the grid. The drawing image information is image information generated based on the design of the map. The drawing image information can be in the form of a two-dimensional array structure.
[0078] After generating the drawing image information, the drawing image information is stored in the information repository and obtained from the information repository when generating the target map. Alternatively, when there is a need for map generation, the drawing image information is generated and stored in the editor, and it can be directly called from the editor when generating the target map.
[0079] The implementation method of identifying the adjacent grids adjacent to the target grid according to the position information can be to identify the adjacent position information according to the position information and determine the adjacent grids at the adjacent position information; or it can be to input the position information and the drawn image information into an adjacent grid determination model and determine the adjacent grids adjacent to the target grid output by the adjacent grid determination model, wherein the adjacent grid determination model is pre-trained based on sample position information, sample drawn image information and labeled adjacent grids.
[0080] The implementation method of reading the object information of the adjacent grid from the drawn image information can be to read the object information of the adjacent grid in the drawn image information based on the grid identifier of the adjacent grid; or to read the object information of the adjacent grid in the drawn image information based on the position information of the adjacent grid.
[0081] By acquiring the drawn image information, the adjacent grids adjacent to the target grid are identified according to the position information, and the object information of the adjacent grids is read from the drawn image information, so that the object information of the adjacent grids is determined based on the drawn image information, thereby ensuring the accuracy of the object information of the determined adjacent grids, and further ensuring the accuracy and completeness of the generated target map.
[0082] In an optional embodiment of the present application, the drawn image information is a two-dimensional array structure; the above step of reading the object information of the adjacent grid from the drawn image information includes the following steps:
[0083] Based on the two-dimensional array index of the adjacent grid, the object information of the adjacent grid is read from the drawing image information.
[0084] Specifically, the two-dimensional array structure is usually organized in the form of a table, and each element can be accessed through a two-dimensional array index. Each element in the drawn image information is the object information corresponding to each grid. The two-dimensional array index is an index identifier for indexing elements in the two-dimensional array structure. For example, the two-dimensional array index of adjacent grids can be the grid identifier of the adjacent grid, or the position information of the adjacent grid.
[0085] Exemplarily, the two-dimensional array index is position information, the first line of the drawn image information is [object information of the three-dimensional plot model, object information of the three-dimensional plot model, object information of the three-dimensional wall], the second line is [object information of the three-dimensional plot model, object information of the three-dimensional plot model, object information of the three-dimensional wall], and the third line is [object information of the three-dimensional wall, object information of the three-dimensional wall, object information of the three-dimensional wall], wherein the indexes corresponding to the elements in the first row, the second row and the third row are [(1,1), (1,2), (1,3)], [(2.1), (2,2), (2,3)], [(3,1), (3,2), (3,3)], respectively.
[0086] Exemplarily, the two-dimensional array index is the grid identifier, and the drawn image information is [object information of the three-dimensional plot model, object information of the three-dimensional plot model, object information of the three-dimensional wall, object information of the three-dimensional plot model, object information of the three-dimensional plot model, object information of the three-dimensional wall, object information of the three-dimensional wall, object information of the three-dimensional wall, object information of the three-dimensional wall], where the indexes corresponding to each element are [A, B, C, D, E, F, G, H, I], and the grid identifier is associated with the position of the grid in the Ti leMap. For example, the position information of the grid with grid identifier D in the Ti leMap is (2, 1).
[0087] The object information of the adjacent grids may be read from the drawn image information based on the two-dimensional array index of the adjacent grids by reading the object information corresponding to the two-dimensional array index of the adjacent grids from the drawn image information of the two-dimensional data structure.
[0088] The object information of the adjacent grids is read from the drawn image information through the two-dimensional array index of the adjacent grids, so that the acquired object information is read from the drawn image information, thereby ensuring the accuracy of the read object information of the adjacent grids.
[0089] In an optional embodiment of the present application, the above step selects a target plot model that meets the plot type and fills it into the target grid to generate a target map, including the following steps:
[0090] Obtaining the mapping relationship between the drawn image information and the three-dimensional space coordinates;
[0091] A target plot model that matches the plot type is selected, and based on the mapping relationship, the target plot model is filled into the mapping position of the target grid in the three-dimensional space coordinates to generate a target map.
[0092] The drawn image information includes multiple grids and object information of each grid. The object information of the objects that need to be filled in each grid can be determined through the drawn image information. The drawn image information is information of a two-dimensional array structure generated based on the design and conception of the target map. By establishing a mapping relationship between the drawn image information and the three-dimensional space coordinates, the drawn image information can be used as the basis for map generation when generating the target map.
[0093] The drawing image information is information of a two-dimensional array structure generated based on the design and conception of the target map. Exemplarily, a TileMap to be drawn is generated, and the conception is performed in the TileMap based on the tiles in the target tile library. Specifically, the tiles in the target tile library are dragged and placed on each grid in the TileMap to obtain a drawn TileMap, wherein the drawn TileMap is the result of the conception of the target map; structural data is extracted based on the drawn TileMap to obtain drawing image information of the two-dimensional array structure.
[0094] The mapping relationship between the drawn image information and the three-dimensional space coordinates can be generated by the editor based on the correspondence between the grids, or can be determined based on the received coordinate information selection instruction, and the mapping relationship is established based on the coordinate selection information.
[0095] The coordinate selection information may include a coordinate origin, and may also include a coordinate horizontal axis, a coordinate vertical axis, etc., wherein the selection of the coordinate horizontal axis and the coordinate vertical axis includes length, and the length of the coordinate horizontal axis and the coordinate vertical axis corresponds to the length and width of the target map.
[0096] The method for obtaining the mapping relationship between the drawn image information and the three-dimensional space coordinates is the same as or similar to the implementation method for obtaining the drawn image information, and this application will not repeat it here.
[0097] Based on the mapping relationship, the target plot model is filled into the mapping position of the target grid in the three-dimensional space coordinates to generate the target map. The implementation method can be to determine the mapping position of the target grid in the three-dimensional space coordinates based on the mapping relationship, fill the target plot model into the mapping position of the three-dimensional space coordinates to generate the target map.
[0098] By drawing the mapping relationship between image information and three-dimensional space coordinates, the target plot model that meets the plot type is mapped to the mapping position of the target grid in the three-dimensional space coordinates, ensuring the accuracy of filling the target plot model in the three-dimensional space coordinates.
[0099] In an optional embodiment of the present application, the above steps fill the target land parcel model to the mapping position of the target grid in the three-dimensional space coordinates based on the mapping relationship to generate a target map, including the following steps:
[0100] Based on the mapping relationship, the target mount container is mapped to the mapping position of the target grid in the three-dimensional space coordinates;
[0101] Mount the target plot model to the target mount container to generate the target map.
[0102] Specifically, the target mounting container refers to a container used to generate a specified object entity. For example, the target mounting container can be an Actor, which is a basic container that can exist in a scene of three-dimensional space coordinates. If you need to generate a mechanism model in a scene of three-dimensional space coordinates, you need to mount the model under the Actor.
[0103] Based on the mapping relationship, the implementation method of mapping the target mount container to the mapping position of the target grid in the three-dimensional space coordinates can be to determine the mapping position of the target grid in the three-dimensional space coordinates based on the mapping relationship, and map the target mount container to the mapping position of the three-dimensional space coordinates.
[0104] The implementation method of mapping the target mounting container to the mapping position of the three-dimensional space coordinates is to obtain the target mounting container and set the generated target mounting container at the mapping position of the three-dimensional space coordinates.
[0105] Optionally, before mapping other objects except the land parcel model to the three-dimensional space coordinates, the target mounting container may also be mapped to the three-dimensional space coordinates, so as to facilitate mounting other objects on the target mounting container.
[0106] The target plot model is mounted to the target mounting container, and a target map is generated by adjusting the target mounting container based on model attribute information of the target plot model to generate a target map, wherein the model attribute information refers to information characterizing attribute characteristics of the target plot model, for example, the model attribute information may include at least one of a model framework, texture, material, animation, etc.
[0107] Based on the mapping relationship, the target mounting container is mapped to the mapping position of the target grid in the three-dimensional space coordinates, and the target plot model is mounted to the target mounting container, so that the behavioral logic data of the target plot model can be constructed in the target mounting container, so that the behavioral logic data corresponding to each object in the grid of the three-dimensional space coordinates can be generated on the target map.
[0108] In an optional embodiment of the present application, the above steps are based on the object information of the adjacent grids, with the adjacent plot models being seamlessly spliced as a constraint condition, to determine the plot type of the target plot model, including the following steps:
[0109] Based on the object information of the adjacent grids, the stitching type when the target plot model is spliced with the objects of the adjacent grids is determined with the constraint that the adjacent plot models are spliced seamlessly;
[0110] The target plot model is integrated with the splicing type of the objects in the adjacent grids to determine the plot type of the target plot model.
[0111] There are usually multiple adjacent grids of the target grid. There may or may not be objects in the adjacent grids, which is specifically determined according to the object information of the grids contained in the drawn image information.
[0112] An implementation method for determining the type of splicing when a target plot model is spliced with an object of an adjacent grid based on object information of adjacent grids and taking seamless splicing of adjacent plot models as a constraint condition may be based on object information of adjacent grids and taking seamless splicing of adjacent plot models as a constraint condition. When the object type is a plot model, determining the type of splicing when a target plot model is spliced with an object of an adjacent grid as seamless splicing.
[0113] Optionally, seamless splicing refers to a seamless splicing method for splicing the target plot model with the plot model of the adjacent grid, and the seamless splicing method is that the splicing edges of the splicing objects are right-angled edges.
[0114] When the object type is a non-plot model, the splicing type when the target plot model is spliced with the object of the adjacent grid is determined to be normal splicing, wherein normal splicing refers to splicing without gap requirements, which can be seamless with right-angled edges or with seams with non-right-angled edges, and the specific selection is made according to the actual situation.
[0115] Illustratively, the non-right-angled edge may be a chamfered edge.
[0116] The splicing types of each target plot model and objects of a plurality of adjacent grids are comprehensively combined to determine the edge type of each edge of the target plot model, and the plot type of the target plot model is determined based on the edge types.
[0117] The plot type of the target plot model is determined by the splicing type between the target plot model and the objects of the adjacent grids, so that the plot type of the target plot model is determined by the objects of the adjacent grids, thereby ensuring the efficient display of the objects on each grid in the generated target map.
[0118] In an optional embodiment of the present application, the above steps are based on the object information of the adjacent grids, with the adjacent plot models being seamlessly spliced as a constraint condition, to determine the splicing type when the target plot model is spliced with the objects of the adjacent grids, including the following steps:
[0119] Determine the object type of the adjacent grid based on the object information of the adjacent grid;
[0120] When the object type is a plot model, the splicing type when the target plot model is spliced with an object of an adjacent grid is determined to be seamless splicing, wherein the seamless splicing indicates that the splicing edge between the target plot model and the plot model of the adjacent grid is a right-angle edge.
[0121] Specifically, two angles of corresponding sides of a right-angled side of a three-dimensional object are right angles.
[0122] The joint edges between the adjacent plot models that are seamlessly joined are right-angled edges, so that the adjacent plot models can be closely joined through the right-angled edges to achieve complete filling of the plot models in the grid.
[0123] When the object type is a plot type, based on the constraint condition, it is determined that the splicing type when the target plot model is spliced with the object of the adjacent grid (ie, the plot model) is seamless splicing.
[0124] By identifying the object types of objects at adjacent grids, the splicing method between the target plot model and the objects of the adjacent grids can be identified by the object type, so that the plot type of the target plot model can be determined based on the splicing method, and the target plot model can be filled, thereby ensuring the generation of the target map.
[0125] In an optional embodiment of the present application, the above step selects a target plot model that meets the plot type and fills it into the target grid to generate a target map, including the following steps:
[0126] extracting at least one type feature of the land parcel type;
[0127] Matching at least one type feature with at least one reference type feature of the reference plot model, and determining a target plot model that conforms to the plot type based on the matching result;
[0128] Fill the target plot model into the target grid to generate a target map.
[0129] Specifically, the type feature is used to uniquely characterize the plot type of the plot model. The type feature can be a type attribute. The plot type can be determined by the type feature. In the case of a large number of plot types, the plot type can be accurately determined based on the type feature. The type feature of any plot type can be one or more, for example, the type feature can be type size, type edge, right-angle edge ratio, etc. The benchmark type feature refers to the type feature of the benchmark plot.
[0130] There are many ways to extract at least one type feature of the plot type, and the specific selection is based on the actual situation. This application does not limit it here.
[0131] In a possible implementation of the present application, extracting at least one type feature of a plot type may be based on a benchmark feature item, and extracting the type feature from the plot type, wherein the benchmark feature item refers to a pre-set feature item for extracting the type feature.
[0132] In another possible implementation of the present application, at least one type feature of the plot type is extracted, and the plot type can also be input into a feature extraction model to obtain at least one type feature of the plot type output by the feature extraction model, wherein the feature extraction model is pre-trained based on sample object types and label type features.
[0133] The implementation method of matching at least one type feature with at least one baseline type feature of the baseline plot model may be to calculate the cosine distance between the at least one type feature and at least one baseline type feature of the baseline plot model; it may also be to calculate the Euclidean distance between the at least one type feature and at least one baseline type feature of the baseline plot model; it may also be to perform data conversion between the at least one type feature and at least one baseline type feature of the baseline plot model, and match based on the data conversion result.
[0134] By matching at least one type feature of the extracted plot type with at least one baseline type feature of the baseline plot model, a target plot model that meets the plot type is determined based on the matching result to be filled, and a target map is generated, thereby ensuring seamless splicing between adjacent plot models in the generated target map.
[0135] In an optional embodiment of the present application, the above step matches at least one type feature with at least one reference type feature of the reference plot model, and determines a target plot model that meets the plot type based on the matching result, including the following steps:
[0136] Performing data conversion on at least one type feature and at least one reference type feature of the reference land parcel model respectively to obtain first data and second data;
[0137] Based on the first data and the second data, a target parcel model that meets the parcel type is determined.
[0138] The implementation method of performing data conversion on at least one type feature and at least one baseline type feature of the baseline plot model to obtain the first data and the second data may be to convert at least one type feature and at least one baseline type feature of the baseline plot model to the target dimension to obtain the first data and the second data of the target dimension; or may be to convert at least one type feature and at least one baseline type feature of the baseline plot model to the target data format.
[0139] The target dimension may be pre-set, such as binary, hexadecimal, etc., or may be a dimension of a type feature or a dimension of a benchmark type feature.
[0140] An implementation method for determining a target plot model that matches the plot type based on the first data and the second data may be to match the first data and the second data, and determine the target plot model that matches the plot type based on the matching result.
[0141] Data conversion is performed on at least one type feature and at least one baseline type feature of a baseline plot model respectively to obtain first data and second data, so that the first data and the second data are data-converted, and a target plot model that conforms to the plot type is determined based on the first data and the second data obtained by the data conversion, so that the accuracy of the determined target plot model that conforms to the plot type is ensured, thereby ensuring seamlessness between adjacent plot models in the generated target map.
[0142] In an optional embodiment of the present application, the above steps respectively perform data conversion on at least one type feature and at least one reference type feature of the reference land parcel model to obtain first data and second data, including the following steps:
[0143] Performing binary conversion on at least one type feature and at least one reference type feature of the reference land parcel model respectively to obtain first binary data and second binary data;
[0144] The above steps determine the target plot model that meets the plot type based on the first data and the second data, including the following steps:
[0145] A bitwise AND operation is performed on the first binary data and the second binary data, and a reference plot model whose result of the bitwise AND operation is the same as the first binary data is determined as a target plot model that conforms to the plot type.
[0146] An implementation method of converting at least one type feature and at least one baseline type feature of a baseline plot model into binary data to obtain first binary data and second binary data is to convert at least one type feature and at least one baseline type feature of a baseline plot model into binary data to obtain first binary data and second binary data.
[0147] Exemplarily, the first binary data is 010101, and the second binary data is 011101. An AND operation is performed on 010101 and 011101, and the result of the AND operation is 010101. 010101 is compared with the first binary data to determine whether they are the same. If they are the same, the baseline plot model of the second binary data is determined as the target plot model that meets the plot type.
[0148] By converting at least one type feature and at least one baseline type feature of a baseline plot model into binary data, performing an AND operation on the binary data, and determining a target plot model that conforms to the plot type based on the AND operation result, the accuracy of the determined target plot model that conforms to the plot type is ensured.
[0149] In an optional embodiment of the present application, before the above step of responding to the selection instruction of the target plot model from the target map library and determining the position information of the target grid to be placed on the target plot model, the following step is also included:
[0150] Obtain object storage information of a pre-created three-dimensional land parcel model and its storage number in a target texture library;
[0151] Establish the correspondence between the object storage information and the storage label, and record the correspondence in the memory table.
[0152] Specifically, the object storage information refers to the storage information of the object, through which the object storage path, initialization posture, whether to flip, etc. can be obtained. The storage label refers to the storage label of each texture stored in the target texture library, and the corresponding texture can be obtained in the target texture library based on the storage label.
[0153] A correspondence between the object storage information of a pre-created three-dimensional plot model and its storage number in the target map library is established. When responding to a selection instruction of a target plot model from the target map library, the object storage information of the target plot model can be obtained based on the storage number of the target plot model in the target map library, so that the target plot model entity can be obtained based on the object storage information for filling, thereby ensuring the generation of the target map.
[0154] The correspondence between the object storage information and the storage label is recorded in the memory table, so that when there is a need to search for the object storage information, it can be searched from the memory table, thereby improving the efficiency of obtaining the object storage information.
[0155] In an optional embodiment of the present application, the above step selects a target plot model that meets the plot type and fills it into the target grid to generate a target map, including the following steps:
[0156] Determine the target storage number of the target plot model in the target map library, and search the target object storage information corresponding to the target storage number from the memory table;
[0157] Based on the target object storage information, a target plot model that meets the plot type is obtained, and the target plot model is filled into the target grid to generate a target map.
[0158] The implementation method of determining the target storage number of the target plot model in the target map library may be to determine the target storage number of the target plot model in the target map library based on a selection instruction.
[0159] The implementation method of searching the target object storage information corresponding to the target storage label from the memory table may be to compare the target storage label with the storage label in the memory table, and determine the target object storage information based on the comparison result.
[0160] Based on the target object storage information, a target plot model that matches the plot type is obtained, and the target plot model is filled into the target grid to generate a target map. The implementation method can be to determine the target storage path based on the target object storage information, search for the target plot model that matches the plot type based on the target storage path, and fill the target plot model into the target grid to generate a target map.
[0161] Based on the target storage number of the target plot model in the target map library, the target object storage information of the target plot model is searched, and based on the target object storage information, the stored target plot model is obtained and filled to obtain the target map, thereby ensuring the accuracy of the generated target map and ensuring that the filled target plot model conforms to the plot type, so that there is no gap between adjacent filled plot models.
[0162] The following combination Figure 2a Taking the application of the map generation method provided by the present application in generating a target map by splicing a three-dimensional land model as an example, the map generation method is further described. Figure 2a A flowchart of a processing process of a map generation method provided by an embodiment of the present application is shown, which specifically includes the following steps.
[0163] Step 202: Create multiple three-dimensional land parcel models.
[0164] The three-dimensional plot model is a 3D seamless standard part, wherein the 3D seamless standard part is built on digital content creation (DCC) software.
[0165] Composite objects such as 3D assets, props, enemies, 3D seamless standard parts, etc. onto TileAtlas, which contains the textures of each object.
[0166] The front end can drag the texture of each object into the blank drawing image by dragging the texture in TileAtlas, and obtain the drawing image information of the drawing completion based on the dragging of the front end.
[0167] See also Figure 2b , Figure 2bA schematic diagram of generating and displaying drawn image information in a map generation method provided by an embodiment of the present application is shown.
[0168] Figure 2b The image shown in the figure is divided into two parts. The left side is Ti leAt l as, which includes a 3D plot model, a wall, a guide sign, and a character map. In the figure, a represents a 3D plot model, b represents a wall, c represents a guide sign, and d represents a character. The right side is a drawn image, which contains 5*6=30 grids. Each grid is based on the developer dragging the Ti leAt l As the textures of the objects in the as are to the right, some grids contain textures of the objects, while some grids do not. Specifically, the grids with coordinates (2,3), (3,4), (3,3), and (3,2) are filled with textures of the 3D land model; the grids with coordinates (0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (1,5), (2,5), (3,5), (4,5), (4,4), (4,3), and (4,2) are filled with textures of the walls; the grids with coordinates (2,2) and (2,4) are filled with textures of the guide signs; and the grids with coordinates (2,0) and (3,0) are filled with textures of the characters. Based on the developer's texture filling for the grid in the drawing image, the drawing image information is generated. For example, after the drawing image is drawn, the developer can click the drawing completion button, and the server generates the drawing image information based on the received selection instruction of the drawing completion button. Among them, the object type of the three-dimensional plot model is the plot model, and the object type of the wall, guide sign, and character is non-plot model.
[0169] Obtain the object storage information of the pre-created three-dimensional land parcel model and its storage number in the target map library; establish a corresponding relationship between the object storage information and the storage number, and record the corresponding relationship in the memory table.
[0170] Among them, the object storage information is the 3D asset path, initialization posture, and whether it is flipped, etc.; the storage label is the index of the cell in TileAt l as; Ti leAt l as is the target tile library; and the memory table is DataTable le.
[0171] Step 204: Obtaining drawing image information, wherein the drawing image information includes a plurality of grids and object information of each grid.
[0172] The drawn image information is determined based on the drawn Ti leMap.
[0173] Step 206: for a target grid whose object type is a land parcel model, determine the position information of the target grid, and the object placed on the target grid is the target land parcel model.
[0174] Continue with the above Figure 2b , select the grid with coordinates (2,3) as the target grid, and place a three-dimensional plot model on the target grid.
[0175] Step 208: Identify adjacent grids adjacent to the target grid according to the position information.
[0176] Continue with the above Figure 2b , based on the coordinates of the target grid, the coordinates of the adjacent grids adjacent to the target grid with coordinates (2,3) are identified as (2,2), (3,3), (2,4), and (1,3).
[0177] Step 210: Read object information of adjacent grids from the drawn image information.
[0178] Continue with the above Figure 2b , it is read that the objects of the adjacent grids with coordinates (2,2) and (2,4) are the guide mark c, the object of the adjacent grid with coordinates (3,3) is the three-dimensional plot model a, and the object of the adjacent grid with coordinates (1,3) is empty.
[0179] Step 212: Determine the object type of the adjacent grid based on the object information of the adjacent grid.
[0180] Continue with the above Figure 2b Based on the object information of the adjacent grids, it is determined that the object type of the adjacent grid with coordinates (2,2) is a non-plot model, the object type of the adjacent grid with coordinates (3,3) is a plot model, the object type of the adjacent grid with coordinates (2,4) is a non-plot model, and the object type of the adjacent grid with coordinates (1,3) is a non-plot model.
[0181] Step 214: when the object type is a plot model, determine that the splicing type when splicing the target plot model with the object of the adjacent grid is seamless splicing, wherein the seamless splicing indicates that the splicing edge between the target plot model and the plot model of the adjacent grid is a right-angle edge.
[0182] Continue with the above Figure 2b , determine that the target plot model needs to be seamlessly spliced with the right side, and does not need to be seamlessly spliced with the top, left, and bottom sides, where the splicing edges corresponding to seamless splicing can be right-angled edges, and the splicing edges that do not require seamless splicing can be chamfered edges.
[0183] Step 216: Integrate the splicing types of the target plot model and the objects of the adjacent grids to determine the plot type of the target plot model.
[0184] Based on the fact that the target plot model needs to be seamlessly joined with the right side but not with the top, left and bottom sides, it is determined that the right edge of the target plot model is a right-angled edge, and the top, left and bottom edges are chamfered edges.
[0185] Step 218: Extract at least one type feature of the land parcel type.
[0186] Step 220: Perform binary conversion on at least one type feature and at least one reference type feature of the reference plot model respectively to obtain first binary data and second binary data.
[0187] Step 222: Perform a bitwise AND operation on the first binary data and the second binary data, and determine the reference plot model whose result of the bitwise AND operation is the same as the first binary data as the target plot model that meets the plot type.
[0188] A plot model that has a right edge as a right angle and top, left, and bottom edges as chamfered edges is a three-side chamfered type plot model.
[0189] Step 224: Obtain the mapping relationship between the drawn image information and the three-dimensional space coordinates.
[0190] Step 226: Based on the mapping relationship, map the target mounting container to the mapping position of the target grid in the three-dimensional space coordinates.
[0191] Step 228: Mount the target plot model to the target mounting container to generate a target map.
[0192] By applying the solution of the embodiment of the present application, the position information of the target grid where the target plot model is to be placed is determined by selecting instructions, and based on the position information, the object information of the adjacent grids of the target grid is identified to determine the type of plot on which the target plot model is to be placed at the target grid. The adjacent plot models must be seamlessly spliced as a constraint condition, and target plot models that meet the type conditions are selected based on the plot type to fill the target grid, and a target map is generated, so that there are no gaps between adjacent plot models in the generated target map, thereby ensuring the effect of the generated three-dimensional target map.
[0193] Corresponding to the above method embodiment, the present application also provides a map generation device embodiment, Figure 3 FIG. 1 is a schematic diagram showing the structure of a map generating device provided by an embodiment of the present application. Figure 3 As shown, the device comprises:
[0194] The response module 302 is configured to determine the position information of the target grid where the target land parcel model is to be placed in response to the selection instruction of the target land parcel model from the target map library, wherein the target map library includes the pre-created three-dimensional land parcel model, and the target grid is obtained by pre-segmenting the map;
[0195] The identification module 304 is configured to identify object information of adjacent grids of the target grid according to the position information;
[0196] The determination module 306 is configured to determine the plot type of the target plot model based on the object information of the adjacent grids and with the constraint that the adjacent plot models are seamlessly spliced;
[0197] The generation module 308 is configured to select a target land parcel model that meets the land parcel type and fill it into the target grid to generate a target map.
[0198] Optionally, the recognition module is further configured to obtain drawing image information, wherein the drawing image information includes multiple grids and object information of each grid; identify adjacent grids adjacent to the target grid according to the position information; and read the object information of the adjacent grids from the drawing image information.
[0199] Optionally, the drawn image information is a two-dimensional array structure; the recognition module is further configured to read object information of adjacent grids from the drawn image information based on the two-dimensional array index of the adjacent grids.
[0200] Optionally, the generation module is further configured to obtain a mapping relationship between the drawn image information and the three-dimensional space coordinates; select a target plot model that meets the plot type, and based on the mapping relationship, fill the target plot model into the mapping position of the target grid in the three-dimensional space coordinates to generate a target map.
[0201] Optionally, the generation module is further configured to map the target mounting container to a mapping position of the target grid in the three-dimensional space coordinates based on a mapping relationship; mount the target plot model to the target mounting container to generate a target map.
[0202] Optionally, the determination module is further configured to determine the splicing type when the target plot model is spliced with the objects of the adjacent grids based on the object information of the adjacent grids, with the constraint that the adjacent plot models are spliced seamlessly; integrate the splicing type when the target plot model is spliced with the objects of the adjacent grids to determine the plot type of the target plot model.
[0203] Optionally, the determination module is further configured to determine the object type of the adjacent grid based on the object information of the adjacent grid; when the object type is a plot model, the splicing type when the target plot model and the object of the adjacent grid are spliced is determined to be seamless splicing, wherein the seamless splicing characterizes that the splicing edge between the target plot model and the plot model of the adjacent grid is a right-angle edge.
[0204] Optionally, the generation module is further configured to extract at least one type feature of the plot type; match the at least one type feature with at least one baseline type feature of the baseline plot model, and determine a target plot model that meets the plot type based on the matching result; fill the target plot model into the target grid to generate a target map.
[0205] Optionally, the generation module is further configured to perform data conversion on at least one type feature and at least one baseline type feature of the baseline plot model respectively to obtain first data and second data; based on the first data and the second data, determine a target plot model that meets the plot type.
[0206] Optionally, the generation module is further configured to perform binary conversion on at least one type feature and at least one benchmark type feature of the benchmark plot model, respectively, to obtain first binary data and second binary data; perform a bitwise AND operation on the first binary data and the second binary data, and determine the benchmark plot model whose result of the bitwise AND operation is the same as the first binary data as the target plot model that meets the plot type.
[0207] Optionally, the map generation method also includes establishing a module configured to obtain object storage information of a pre-created three-dimensional plot model and a storage label in a target map library; the correspondence between the object storage information and the storage label, and record the correspondence in a memory table.
[0208] Optionally, the generation module is further configured to determine the target storage number of the target plot model in the target map library, and search for the target object storage information corresponding to the target storage number from the memory table; based on the target object storage information, obtain the target plot model that meets the plot type, and fill the target plot model into the target grid to generate a target map.
[0209] By applying the solution of the embodiment of the present application, the position information of the target grid where the target plot model is to be placed is determined by selecting instructions, and based on the position information, the object information of the adjacent grids of the target grid is identified to determine the type of plot on which the target plot model is to be placed at the target grid. The adjacent plot models must be seamlessly spliced as a constraint condition, and target plot models that meet the type conditions are selected based on the plot type to fill the target grid, and a target map is generated, so that there are no gaps between adjacent plot models in the generated target map, thereby ensuring the effect of the generated three-dimensional target map.
[0210] The above is a schematic scheme of a map generation device of this embodiment. It should be noted that the technical scheme of the map generation device and the technical scheme of the map generation method described above are of the same concept, and the details not described in detail in the technical scheme of the map generation device can be found in the description of the technical scheme of the map generation method described above.
[0211] Figure 4 The block diagram of a computing device provided by an embodiment of the present application is shown. The components of the computing device 400 include but are not limited to a memory 410 and a processor 420. The processor 420 is connected to the memory 410 via a bus 430, and the database 450 is used to store data.
[0212] The computing device 400 also includes an access device 440 that enables the computing device 400 to communicate via one or more networks 460. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of network interface, wired or wireless (e.g., a network interface card (NIC)), such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, and a Near Field Communication (NFC).
[0213] In one embodiment of the present application, the above components of the computing device 400 and Figure 4 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 4 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0214] The computing device 400 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 400 may also be a mobile or stationary server.
[0215] The processor 420 is used to execute the following computer program / instructions, which implement the steps of the above-mentioned map generation method when executed by the processor.
[0216] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned map generation method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned map generation method.
[0217] An embodiment of the present application further provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned map generation method when executed by a processor.
[0218] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned map generation method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned map generation method.
[0219] An embodiment of the present application further provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned map generation method when executed by a processor.
[0220] The above is a schematic solution of a computer program product of this embodiment. It should be noted that the technical solution of the computer program product and the technical solution of the above-mentioned map generation method belong to the same concept, and the details not described in detail in the technical solution of the computer program product can be referred to the description of the technical solution of the above-mentioned map generation method.
[0221] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0222] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0223] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware 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 be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of the present application.
[0224] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0225] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A map generation method, characterized in that: include: In response to a selection instruction for a target plot model from a target map library, determining position information of a target grid where the target plot model is to be placed, wherein the target map library includes pre-created three-dimensional plot models, and the target grid is obtained by pre-segmenting a map; According to the position information, identifying object information of adjacent grids of the target grid; Based on the object information of the adjacent grids, the land parcel type of the target land parcel model is determined with the constraint that the adjacent land parcel models are seamlessly spliced; The target plot model that matches the plot type is selected and filled into the target grid to generate a target map.
2. The method according to claim 1, characterized in that The step of identifying object information of adjacent grids of the target grid according to the position information includes: Acquire drawing image information, wherein the drawing image information includes a plurality of grids and object information of each grid; According to the position information, identifying adjacent grids adjacent to the target grid; The object information of the adjacent grid is read from the drawn image information.
3. The method according to claim 2, characterized in that The drawn image information is a two-dimensional array structure; The step of reading the object information of the adjacent grid from the drawn image information comprises: Based on the two-dimensional array index of the adjacent grid, object information of the adjacent grid is read from the drawn image information.
4. The method according to claim 3, characterized in that The step of selecting the target land parcel model that matches the land parcel type and filling it into the target grid to generate a target map includes: Acquire a mapping relationship between the drawn image information and three-dimensional space coordinates; The target plot model that matches the plot type is selected, and based on the mapping relationship, the target plot model is filled into the mapping position of the target grid in the three-dimensional space coordinates to generate a target map.
5. The method according to claim 4, characterized in that The method of filling the target land parcel model into the mapping position of the target grid in the three-dimensional space coordinates based on the mapping relationship to generate a target map includes: Based on the mapping relationship, mapping the target mounting container to the mapping position of the target grid in the three-dimensional space coordinates; The target plot model is mounted to the target mounting container to generate a target map.
6. The method according to any one of claims 1 to 5, characterized in that: The determining of the land parcel type of the target land parcel model based on the object information of the adjacent grids and taking the adjacent land parcel models seamlessly spliced as a constraint condition includes: Based on the object information of the adjacent grids, and with the adjacent plot models seamlessly spliced as a constraint, determining a splicing type when the target plot model is spliced with the object of the adjacent grids; The splicing type when the target plot model is spliced with the objects of the adjacent grids is integrated to determine the plot type of the target plot model.
7. The method according to claim 6, characterized in that The determining of the splicing type when the target land parcel model is spliced with the object of the adjacent grid based on the object information of the adjacent grid and taking the adjacent land parcel model splicing without gaps as a constraint condition includes: Determining the object type of the adjacent grid based on the object information of the adjacent grid; When the object type is a plot model, the splicing type when the target plot model is spliced with the object of the adjacent grid is determined to be seamless splicing, wherein seamless splicing indicates that the splicing edge between the target plot model and the plot model of the adjacent grid is a right-angle edge.
8. The method according to any one of claims 1 to 5, characterized in that: The step of selecting the target land parcel model that matches the land parcel type and filling it into the target grid to generate a target map includes: extracting at least one type feature of the land parcel type; Matching the at least one type feature with at least one reference type feature of a reference plot model, and determining the target plot model that conforms to the plot type based on the matching result; The target land parcel model is filled into the target grid to generate a target map.
9. The method according to claim 8, characterized in that The matching of the at least one type feature with at least one reference type feature of a reference plot model, and determining the target plot model that matches the plot type based on the matching result, includes: Performing data conversion on the at least one type feature and at least one reference type feature of the reference land parcel model respectively to obtain first data and second data; The target plot model that conforms to the plot type is determined based on the first data and the second data.
10. The method according to claim 9, characterized in that The step of converting the at least one type feature into at least one reference type feature of the reference land parcel model to obtain first data and second data comprises: Performing binary conversion on the at least one type feature and at least one reference type feature of the reference land parcel model respectively to obtain first binary data and second binary data; The step of determining the target plot model that matches the plot type based on the first data and the second data includes: A bitwise AND operation is performed on the first binary data and the second binary data, and a reference plot model having the same operation result of the bitwise AND operation as the first binary data is determined as the target plot model that conforms to the plot type.
11. The method according to any one of claims 1 to 5, characterized in that: Before determining the position information of the target grid to be placed of the target land parcel model in response to the selection instruction of the target land parcel model from the target map library, the method further includes: Obtain object storage information of a pre-created three-dimensional land parcel model and its storage number in a target texture library; A correspondence between the object storage information and the storage label is established, and the correspondence is recorded in a memory table.
12. The method according to claim 11, characterized in that The step of selecting the target land parcel model that matches the land parcel type and filling it into the target grid to generate a target map includes: Determine the target storage number of the target plot model in the target map library, and search the memory table for target object storage information corresponding to the target storage number; Based on the target object storage information, the target plot model that matches the plot type is acquired, and the target plot model is filled into the target grid to generate a target map.
13. A map generating device, characterized in that: include: A response module is configured to determine, in response to a selection instruction for a target plot model from a target map library, position information of a target grid where the target plot model is to be placed, wherein the target map library includes pre-created three-dimensional plot models, and the target grid is obtained by pre-segmenting a map; an identification module, configured to identify object information of adjacent grids of the target grid according to the position information; A determination module is configured to determine the plot type of the target plot model based on the object information of the adjacent grids and with the constraint that the adjacent plot models are seamlessly spliced; The generation module is configured to select the target plot model that meets the plot type and fill it into the target grid to generate a target map.
14. A computing device, characterized in that include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the map generation method according to any one of claims 1 to 12 are implemented.
15. A computer-readable storage medium, characterized in that: It stores a computer program / instruction, which, when executed by a processor, implements the steps of the map generation method described in any one of claims 1 to 12.
16. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the steps of the map generation method according to any one of claims 1 to 12.
Citation Information
Cited By
Method for dynamically realizing complex irregular model by taking wave function collapse algorithm as core
CN119003677A
