CN117959707A - Terrain generation method, device, equipment and storage medium - Google Patents

Terrain generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN117959707A
CN117959707A CN202410219257.XA CN202410219257A CN117959707A CN 117959707 A CN117959707 A CN 117959707A CN 202410219257 A CN202410219257 A CN 202410219257A CN 117959707 A CN117959707 A CN 117959707A
Authority
CN
China
Prior art keywords
data
map
point
height
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410219257.XA
Other languages
Chinese (zh)
Inventor
刘怡安
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202410219257.XA priority Critical patent/CN117959707A/en
Publication of CN117959707A publication Critical patent/CN117959707A/en
Pending legal-status Critical Current

Links

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The application provides a terrain generation method, a device, equipment and a storage medium, and relates to the technical field of data processing. The method comprises the following steps: acquiring a plurality of control points configured with topographic texture data and height data, wherein the control points are control points corresponding to each map block in a grid map of a preset area; performing difference processing on each map block to generate a plurality of data points in each map block; configuring height data for each data point in a preset regional grid map according to the height data of each control point; determining the terrain type of each data point according to the height data of each data point and a preset height change condition; and according to the topographic texture data of each control point and the topographic type of each data point, configuring the topographic texture data for each data point in the preset area grid map so as to generate a target grid map of the preset area. Compared with the prior art, the method and the device avoid the problems that the terrain generation mode needs additional input and the universality is poor.

Description

Terrain generation method, device, equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a terrain generating method, apparatus, device, and storage medium.
Background
With the development of internet technology, games are more and more common in people's lives and are part of leisure and entertainment of people.
Various terrains such as hillside terrains, water terrains, plain terrains and the like are commonly displayed in games, different terrains have different height expression forms, and in the prior art, various flat land vertexes of the flat land terrains are usually shifted through a height map, or various components such as components, waterfall components, river components and the like are placed on the flat land terrains to achieve generation of different terrains.
However, this topography generation requires additional input and is less versatile.
Disclosure of Invention
The application aims to provide a terrain generation method, a device, equipment and a storage medium for solving the problems that the terrain generation mode in the prior art needs extra input and has poor universality.
In order to achieve the above purpose, the technical scheme adopted by the embodiment of the application is as follows:
In a first aspect, an embodiment of the present application provides a terrain generating method, including:
acquiring a plurality of control points configured with topographic texture data and height data, wherein the control points are control points corresponding to each map block in a grid map of a preset area;
Performing difference processing on each map block to generate a plurality of data points in each map block;
configuring height data for each data point in the preset regional grid map according to the height data of each control point;
Determining the terrain type of each data point according to the height data of each data point and a preset height change condition;
And according to the topographic texture data of each control point and the topographic type of each data point, configuring topographic texture data for each data point in the preset area grid map so as to generate a target grid map of the preset area.
In a second aspect, another embodiment of the present application provides a terrain generating apparatus, the apparatus comprising: the device comprises an acquisition module, a generation module, a configuration module and a determination module, wherein:
The acquisition module is used for acquiring a plurality of control points configured with topographic texture data and height data, wherein the control points are control points corresponding to each map block in a grid map of a preset area;
The generation module is used for carrying out difference value processing on each map block so as to generate a plurality of data points in each map block;
the configuration module is specifically configured to configure height data for each data point in the preset area grid map according to the height data of each control point;
The determining module is used for determining the terrain type of each data point according to the height data of each data point and the preset height change condition;
the generation module is specifically configured to configure, for each data point in the preset area grid map, topographic texture data according to topographic texture data of each control point and a topographic type of each data point, so as to generate a target grid map of the preset area.
In a third aspect, another embodiment of the present application provides a terrain generating apparatus, comprising: a processor, a storage medium storing machine-readable instructions executable by the processor, the processor in communication with the storage medium via the bus when the terrain generating device is in operation, the processor executing the machine-readable instructions to perform the steps of the method as described in any of the first aspects above.
In a fourth aspect, another embodiment of the application provides a storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method according to any of the first aspects described above.
The beneficial effects of the application are as follows: by adopting the terrain generation method provided by the application, the corresponding terrain texture data can be configured for each control point in each map block according to the terrain texture data corresponding to each map block in the grid map of the preset area, interpolation processing is carried out on each map block so as to generate a plurality of data points in each map block, then the height data is configured for each data point in the grid map of the preset area according to the height data of each control point, the corresponding terrain type of each control point is determined according to the height data of each control point and the preset height change condition, then the terrain texture data is configured for each data point in the grid map of the preset area based on the terrain texture data and the terrain type of each control point, so as to generate the target grid map of the preset area, and the configuration mode can be based on each control point configured with the terrain texture data and the height data, so as to carry out data configuration for each data point, and automatically generate the target grid map with various terrain area types.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a terrain generating method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of boundary expansion according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of a terrain generating method according to another embodiment of the present application;
FIG. 4 is a schematic diagram of a map block according to an embodiment of the present application;
FIG. 5 is a schematic flow chart of a terrain generating method according to another embodiment of the present application;
FIG. 6 is a schematic diagram of a terrain generating apparatus according to an embodiment of the present application;
FIG. 7 is a schematic view of a terrain generating apparatus according to another embodiment of the present application;
fig. 8 is a schematic structural diagram of a terrain generating apparatus according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application.
The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present application.
The topography generation method in one embodiment of the present application may be run on a local terminal device or a server. When the terrain generation method is run on a server, the method can be realized and executed based on a cloud interaction system, wherein the cloud interaction system comprises the server and the client device.
In an alternative embodiment, various cloud applications may be run under the cloud interaction system, for example: and (5) cloud game. Taking cloud game as an example, cloud game refers to a game mode based on cloud computing. In the cloud game operation mode, the game program operation main body and the game picture presentation main body are separated, the storage and operation of the topography generation method are completed on the cloud game server, the client device is used for receiving and sending data and presenting the game picture, for example, the client device can be a display device which is close to a player side and has a data transmission function, such as a mobile terminal, a television, a computer, a palm computer and the like; but the cloud game server which performs information processing is a cloud. When playing the game, the player operates the client device to send an operation instruction to the cloud game server, the cloud game server runs the game according to the operation instruction, codes and compresses data such as game pictures and the like, returns the data to the client device through a network, and finally decodes the data through the client device and outputs the game pictures.
In an alternative embodiment, taking a game as an example, the local terminal device stores a game program and is used to present a game screen. The local terminal device is used for interacting with the player through the graphical user interface, namely, conventionally downloading and installing the game program through the electronic device and running. The manner in which the local terminal device provides the graphical user interface to the player may include a variety of ways, for example, may be rendered for display on a display screen of the terminal, or provided to the player by holographic projection. For example, the local terminal device may include a display screen for presenting a graphical user interface including game visuals, and a processor for running the game, generating the graphical user interface, and controlling the display of the graphical user interface on the display screen.
Additionally, flowcharts used in this disclosure illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be implemented out of order and that steps without logical context may be performed in reverse order or concurrently. Moreover, one or more other operations may be added to or removed from the flow diagrams by those skilled in the art under the direction of the present disclosure.
To facilitate understanding of embodiments of the present application, the following description is provided for the explanation of some of the terms involved in the present application:
Mesh: the surface and vertex are composed of a rendering object in computer graphics, and also have information such as UV channels, vertex colors and the like.
Quad, one of the basic units of computer rendering, namely a square patch consisting of four vertices, is specifically composed of 2 triangles. Is an infrastructure element for data adjustment in the scheme.
A terrain generating method provided by the embodiment of the present application is explained below in conjunction with a plurality of specific application examples. Fig. 1 is a flow chart of a terrain generating method according to an embodiment of the present application, as shown in fig. 1, the method includes:
s101: a plurality of control points configured with terrain texture data and elevation data are acquired.
The control points are control points corresponding to each map block in the grid map of the preset area.
In some embodiments, in order to ensure the processing effect of the boundary grid in the subsequent processing process, the algorithm in the subsequent processing process is ensured to be normally applied to the boundary grid, for example, before each map block is acquired, the boundary of the grid map needs to be expanded, for example, a plurality of map blocks are added to the boundary of the grid map, so as to obtain an expanded grid map.
Fig. 2 is a schematic diagram of boundary expansion provided in an embodiment of the present application, as shown in fig. 2, taking an extreme case as an example, for example, only one map block exists in a grid of a preset area, for example, one circle of map blocks can be supplemented around the periphery of the map block to obtain an expanded grid map, wherein the grid of the preset area can be, for example, a map block with thicker lines at the center of fig. 2, one circle of map blocks around the map block with thicker lines is the expanded supplemented map block, and the map blocks together form the expanded grid map; it should be understood that the foregoing embodiments are merely exemplary, and that the manner in which the map blocks are specifically supplemented may be flexibly adjusted according to the needs of the user, and are not limited to the foregoing embodiments.
The method can ensure the integrity of the grid map of the preset area, ensure the integrity of the grid map of the whole preset area, ensure the uniformity and normalization of the information corresponding to each control point on the grid map of the preset area, and more accurately determine the positions of each control point on the grid map of the preset area by supplementing the boundary at the periphery so as to facilitate the subsequent space analysis, wherein the data value of each data point corresponding to each supplemented map block can be 0, for example, or can be other preset data values, and the specific setting can be flexibly adjusted according to the needs of users and is not limited to the embodiment.
In the embodiment of the present application, the preset area may be, for example, a preset grid area (chunk), where the preset grid area includes at least one map block (cell), where each map block has 4 control points, for example, four vertices of each map block, and the control points are used for configuring relevant parameters corresponding to each map block later.
In the embodiment of the present application, the manner of configuring the topographic texture data may be, for example, determining a topographic texture array corresponding to each map block according to a preset topographic map corresponding to a grid map of a preset area, where, for example, the corresponding topographic texture data may be configured for each point in each map block in a preset sequence with a target control point at a preset position in each map block as a starting point.
Specifically, for example, the control point at the upper right corner of each map block is taken as a target control point, the map block at the upper right corner of the preset regional grid map is taken as a traversal starting point, and the configuration of the topographic texture data is performed according to the preset sequence, according to the data content in the topographic texture array TextureArrayIndex, by taking each map block as a unit, for each control point in the map block.
For example, for each map block in the grid map of the preset area, traversing each map block in sequence from left to right and from top to bottom, and for each map block, using a target control point of the map block as a starting point, and configuring corresponding terrain texture data for each control point in each map block according to a preset clockwise/anticlockwise sequence; it should be understood that the foregoing embodiments are merely illustrative, and the specific preset sequence and the selection of the target control points may be flexibly adjusted according to the needs of the user, for example, the control points at the lower right corner in each map block may also be selected as the target control points, and the preset sequence may also be, for example, from right to left, from bottom to top, etc., and is not limited to the foregoing embodiments.
The data content in the topographic texture array TextureArrayIndex is stored in the grid map of the preset area in a sequence and according to a preset sequence, and the stored data content includes, but is not limited to, the code number corresponding to the map stored by each control point in each map block, and what map should be used by the map block Quad formed by each grid point in the actual rendering process of each control point, and how to mix (weight setting) if there are multiple maps for rendering, that is, the topographic texture array includes color information of each control point.
In the embodiment of the application, after the topographic texture array of the preset topographic map corresponding to each map block is obtained, the target pixel point corresponding to each control point in each map block can be determined according to the texture data of each pixel point in the preset topographic map, and the corresponding topographic texture data is configured for each control point according to each target pixel point, so that the configuration of the topographic texture data of each control point in each map block can be realized directly according to the preset topographic map corresponding to each map block without additional input, the configuration effect of the topographic texture data is greatly improved, and the map has better universality.
S102: the difference processing is performed on each map block to generate a plurality of data points within each map block.
In other possible embodiments, the data points in the terrain area in each map block are further subjected to high interpolation, so that a map block after the high interpolation is obtained, that is, the data points in the terrain area are increased by the high interpolation mode, so that the data points in the grid map are increased.
S103: and configuring height data for each data point in the preset regional grid map according to the height data of each control point.
In the embodiment of the present application, the height data is preconfigured, and the configuration manner may be, for example, that according to the height data corresponding to each map block, with each target control point in each map block as a starting point, the corresponding height data is configured for each control point in each map block according to a preset sequence.
S104: and determining the terrain type of each data point according to the height data of each data point and the preset height change condition.
When the terrain type of each data point is determined, the application can determine the height change value between adjacent data points according to the height data corresponding to each data point, and determine the terrain type of each data point by taking the preset height change condition as a distinguishing standard.
For example, in an embodiment of the present application, the preset height change conditions may include, for example: the second preset height change condition may be, for example, a second preset height change value, for example, may be 2; determining a second data point from the data points according to the height data corresponding to the data points and a second preset height change condition; wherein the second data point is a data point of which the terrain type is cliff type.
That is, the terrain type may be classified into the land type and the cliff type by the second preset height variation value, and when the height variation value between the adjacent data points is smaller than the second preset height variation condition, it is indicated that the height difference between the adjacent data points is smaller, and at this time, for example, it may be determined that the terrain types of the adjacent data points are all the land type; when the height change value between the adjacent data points is greater than or equal to the second preset height change condition, it is indicated that the height difference between the adjacent data points is greater, and then, for example, the terrain type of one data point with greater height in the adjacent data points can be determined to be the cliff type.
In other possible embodiments of the present application, the preset height variation condition may include, for example: the first preset height change condition may be, for example, a first preset height change value, for example, may be 1; determining a first data point from the data points according to the height data of the data points and a first preset height change condition; wherein the first data point is a data point having a terrain type of a ramp type.
In order to ensure that data points in a grid map of a terrain area meeting a preset height change condition are more detailed, in the embodiment of the application, for example, a height change value between adjacent data points can be determined according to height data corresponding to each data point, the terrain type can be divided into a level land type and a slope type according to the height change value and a first preset height change condition by the first preset height change value, and when the height change value between the adjacent data points is smaller than the first preset height change condition, the condition that the height difference between the adjacent data points is smaller is indicated, and at the moment, for example, the terrain types of the adjacent data points can be determined to be all the level land type; when the height variation value between the adjacent data points is greater than or equal to the first preset height variation condition, the height difference between the adjacent data points is larger, and the terrain type of one data point with larger height data among the adjacent data points can be determined to be a slope type.
In other possible embodiments, the terrain type may be classified into a level type, a slope type and a cliff type by, for example, a first preset height variation value and a second height variation value, wherein the slope type is an area having a certain height difference but a smaller height difference; cliffs are of the type having a certain height difference and areas where the height difference is large, for example: when the height change value between the adjacent data points is smaller than the first preset height change condition, the height difference between the adjacent data points is smaller, and at the moment, for example, the terrain types of the adjacent data points can be determined to be land leveling types; when the height change value between the adjacent data points is larger than or equal to the first preset height change condition and smaller than the second preset height change condition, the height difference between the adjacent data points is larger, and the terrain type of one data point with larger height data in the adjacent data points can be determined to be a slope type; when the height variation value between the adjacent data points is greater than or equal to the second preset height variation condition, it is indicated that the height difference between the adjacent data points is greater, and at this time, for example, it may be determined that the terrain type of one data point with greater height among the adjacent data points is a cliff type, that is, further subdivision of the terrain type may be achieved through the first preset height variation condition and the second preset height variation condition, so as to improve the performance effect of the subsequent grid map.
In the embodiment of the application, linear interpolation processing is carried out on the sub map block corresponding to the first data point; and carrying out multiple subdivision processing on the sub map blocks corresponding to the second data points.
It should be noted that, if the terrain type of all the data points/control points in the sub map blocks is the level land type, determining that the terrain type corresponding to the sub map block is the level land type; if the terrain type of at least one data point/control point in the sub map block is a slope type, determining that the terrain type corresponding to the sub map block is a slope type; if the topography type of at least one data point/control point in the sub map block is cliff type, determining that the topography type corresponding to the sub map block is cliff type; if the terrain type of at least one data point/control point in the sub map block is a slope type and the terrain type of at least one data point/control point is a cliff type, determining that the terrain type corresponding to the sub map block is the cliff type.
That is, for slope-type sub-map blocks with smaller height differences, the improvement of the data point precision can be generally achieved by adopting a linear difference mode, for cliff areas with larger height differences, the subdivision degree can be further configured according to the performance, for example, four times of subdivision can be performed on each sub-map block of the cliff area, namely four times of subdivision is performed on each sub-map block of the cliff area, so that the original sub-map block is scattered into finer grids, and the grid precision and accuracy are improved, so that the data points in the sub-map blocks of the cliff area are changed from original 4 data points (including control points) to 16 data points (including control points), the sub-map blocks of the cliff area have smoother and natural overdegree effects, and the four times of subdivision sub-map blocks are more abundant and finer in appearance; it should be understood that the foregoing embodiments are merely illustrative, and the manner of performing multiple subdivision on the cliff area may be, for example, two-fold subdivision or eight-fold subdivision, and the subdivision parameters of the multiple subdivision may be flexibly adjusted according to the configuration situation and the user needs, so that multiple subdivision on the sub-map blocks corresponding to the cliff area may be implemented, which is not limited to the foregoing embodiments, so as to increase smoothness and detail expressive ability of the sub-map blocks.
S105: and according to the terrain texture data and the terrain type of each control point, configuring the terrain texture data for each data point in the grid map of the preset area so as to generate a target grid map of the preset area.
In the embodiment of the application, as each data point is the generated target grid map (mesh file) after the terrain area division is carried out according to the height data, the terrain type of each data point can be embodied in the target grid map, and the target grid map is the grid map after interpolation processing, the data representation and transition are more accurate and fine, and the processing mode can be used for generating the target grid map after the terrain area division directly based on the configured terrain texture data and the height data, so that the automatic and rapid generation of the target grid map is realized.
By adopting the terrain generation method provided by the application, the corresponding terrain texture data can be configured for each control point in each map block according to the terrain texture data corresponding to each map block in the grid map of the preset area, interpolation processing is carried out on each map block so as to generate a plurality of data points in each map block, then the height data is configured for each data point in the grid map of the preset area according to the height data of each control point, the corresponding terrain type of each control point is determined according to the height data of each control point and the preset height change condition, then the terrain texture data is configured for each data point in the grid map of the preset area based on the terrain texture data and the terrain type of each control point, so as to generate the target grid map of the preset area, and the configuration mode can be based on each control point configured with the terrain texture data and the height data, so as to carry out data configuration for each data point, and automatically generate the target grid map with various terrain area types.
In some possible embodiments, the height data may be configured by, for example, configuring the height data for each data point in the preset area grid map according to a preset traversal order with each control point as a starting point according to the height data of each control point.
If the target data point is configured with the height data in the configuration process, updating the height data of the target data point according to the current height data and the configured height data.
In the configuration process, since one data point may belong to two adjacent map blocks at the same time, there may be a case that one data point is repeatedly configured by different control points, if the target data point has been configured with height data in the configuration process, special processing is not required for the height data of the target data point when the configured height data is consistent with the current height data, and when the configured height data is inconsistent with the current height data, the height data of the target data point can be updated according to the current height data and the configured height data.
In the embodiment of the present application, the height data of each target data point is, for example, an integer value, and the update manner may be, for example: firstly, according to configured height data and current height data of a target data point, determining the height difference between the configured height data and the current height data of the target data point, if the height difference is larger than or equal to a preset height difference threshold value, for example, 2, adding a cliff label to the target data point to determine the attribute of the current target data point as a cliff attribute, and determining the height data of the target data point as 2, for example, if the configured height data is 0 and the current height data is 2, the height difference between the configured height data and the current height data is 2 and is equal to the preset height difference threshold value 2, then indicating that the current target data point has a larger fall between two adjacent map blocks, belongs to a cliff type terrain point, and marking the terrain point belonging to the cliff type is needed.
If the height difference is smaller than the preset height difference threshold value, for example, the height data with higher height value of the height data can be taken as the height data corresponding to the current target data point from the configured height data and the current height data, for example, if the configured height data is 2, the current height data is 3, the height difference between the configured height data and the current height data can be determined to be 1 and smaller than the preset height difference threshold value 2, the height data of the target data point can be updated, the current height data of the target data point is determined to be 3, and the determination mode is that the height data with higher height value of 2 and 3 is taken.
Optionally, on the basis of the foregoing embodiment, an embodiment of the present application may further provide a terrain generating method, where an implementation procedure of the foregoing method is illustrated in the following description with reference to the accompanying drawings. Fig. 3 is a flow chart of a terrain generating method according to another embodiment of the present application, where, as shown in fig. 3, before S105, the method may further include:
S111: and determining the mixing weight of each data point in the sub-map blocks according to the terrain type corresponding to each data point in the sub-map blocks.
In an embodiment of the present application, the preset height change condition includes: a second preset height variation condition; for example, after determining the sub map blocks with the terrain type being cliff type according to the height data of each data point and the second preset height change condition, the mixing weight of each data point in the sub map blocks can be determined according to the first calculation mode corresponding to the cliff type.
In other possible embodiments, after the sub-map blocks with the land type according to the height data of each data point and the second preset height variation condition, the mixing weights of each data point in the sub-map blocks can be determined according to the second calculation mode corresponding to the land type.
S112: and according to the topographic texture data of each control point and the mixed weight of each data point, configuring the topographic texture data for each data point in the preset regional grid map.
The manner of determining the terrain type of each data point may be, for example, that by determining the height difference between the height data of the adjacent data points (the data points adjacent to each data point may be interpolated data points or may be control points), determining the relationship between the height difference and the second preset height change condition, and if the height difference is greater than or equal to the second preset height change condition, determining that the terrain type corresponding to the data point with greater height data between two adjacent data points is cliff type; if the height difference is smaller than the second preset height change condition, determining that the terrain types corresponding to the two adjacent data points are all land leveling types.
Wherein, for example, a cliff label can be added to a data point with a topography type of cliff type, wherein if the topography type of the control point is determined to be the cliff type, the cliff label is also required to be added to the control point with the cliff type, and the label is not required to be added to the control point/data point with a level land type; in some possible embodiments, the second preset height change condition may be, for example, 2, and it should be understood that, of course, the setting of the specific second preset height change condition may be flexibly adjusted according to the needs of the user, and is not limited to the above embodiments.
In an embodiment of the present application, for different terrain types, the mixing weights of the data points in the sub-map blocks are determined, fig. 4 is a schematic diagram of the sub-map blocks provided by an embodiment of the present application, and as shown in fig. 4, one sub-map block may include 4 vertices GP0, GP1, GP2 and GP3, where GP0 is a control point, GP1, GP2 and GP3 are data points, that is, for example, the lower left corner of each sub-map block is a control point, and the other points are data points, and if the terrain types of all the data points/control points in the current sub-map block are all of the land types, the determining that the sub-map block is a land type sub-map block may be, for example:
GP1:(0.5,0.5,0,0);
GP2 (0.25 (1 + the same number of points as TexArrIndex of GP2 in the other three points),
0.25 X (number of TexArrIndex points identical to GP2 in the other three points of 1),
0.25 X (number of TexArrIndex points identical to GP2 in the other three points of 1),
0.25 (Same number as TexArrIndex points of GP2 in three other points of 1)
GP3:(0.5,0,0,0.5)。
If the terrain type of at least one data point/control point in the current sub-map block is cliff type, determining that the sub-map block is a cliff type sub-map block, for example, determining that the type of the current target control point is cliff type, except for the mixing weights of other data points in the target map block corresponding to the target control point, for example, may be:
GP1:(0.5,gp1.isCliff1f:0.5f,0,0);
GP2 (0.25 (1 + the same number of points as TexArrIndex of GP 2) among the other three points),
0.25 X (1 + the same number of points as TexArrIndex of GP2 + the number of points of cliffs in the other three points),
0.25 X (1 + number of points of the other three points that are identical to TexArrIndex of GP2 + number of points of the other three points that are cliffs),
0.25 X (1+number of points identical to TexArrIndex of GP2 in the other three points+number of points of cliffs in the other three points));
GP3:(0.5,0,0,gp3.isCliff1f:0.5f)。
the target control point is a data point for recording relevant data of the target control point corresponding to the target map block, so that the mixing weight of the control point in each map block is a preset weight, for example, the mixing weight can be (1, 0), and other data points except the target control point in the map block are not stored with data, so that the mixing weights of other data points except the target control point in each map block need to be calculated and determined according to the target control point in the adjacent map block, and therefore, the target control point does not participate in calculation of the mixing weights, and only the mixing weights of other data points except the target control point in the map block are calculated.
S113: and mixing the first topographic texture data and the target topographic texture data according to the mixing weight to obtain target topographic texture data of other data points in the target map block corresponding to the target control point.
The determining method can accurately determine the mixing weight of other data points in the target map block corresponding to the target control point according to the terrain type of the control point in each map block so as to well mix the terrain texture data of the subsequent data points, thereby ensuring the mixing effect among the map blocks.
In order to further ensure the mixing effect of the topographic texture data, for example, after normalizing each mixing weight, at least two topographic texture data are mixed based on the normalized mixing weight, so as to obtain the target topographic texture data of other data points in the target map block corresponding to the target control point after mixing.
Optionally, on the basis of the foregoing embodiment, an embodiment of the present application may further provide a terrain generating method, where an implementation procedure of the foregoing method is illustrated in the following description with reference to the accompanying drawings. Fig. 5 is a flowchart of a terrain generating method according to another embodiment of the present application, where, as shown in fig. 5, before S105, the method may further include:
S121: randomly sampling a preset noise graph, and carrying out noise disturbance on the coordinates of each data point in each map block based on the random sampling result so as to obtain the coordinates of each data point in each map block after disturbance.
The method for carrying out noise disturbance on each data point can reduce the regular sense of the generated target grid map, carries out random disturbance on a horizontal plane on the position of each data point, randomly samples a preset noise map according to the coordinates of each data point before noise disturbance, calculates disturbance values based on random sampling results, and translates the coordinates of each data point in each map block based on the disturbance values so as to enable the target grid map to have better stereoscopic sense.
In the embodiment of the present application, if the current application scenario is a fixed-view application scenario, the method provided by the present application further includes: the coordinates of each data point in each map tile are translated based on the Euler angle of the virtual camera to obtain the coordinates of each data point in each translated map tile.
For example, taking the case where the euler angle of the virtual camera is (ea.x, 0) as an example, the calculation formula for determining the use of noise disturbance is as follows:
v(vx,vy,vz)=v(vx,vy,vz+vy*sin(EA.x)*(0.1*dist(camera))
wherein dist (camera) represents the distance between the virtual camera and the bound virtual persona.
In other possible embodiments, the geometric grid body of the preset area may also be generated according to the target grid map of the preset area and the map of the preset area.
After the target grid map is generated, a map of a preset area is added for building a complete terrain, and the map can be, for example, a water body map, a grassland map, a mountain map or any other surface map, and the water body is manufactured by taking the map of the preset area as a water body map for illustration, and the water body is divided into a river bed generation and a water body grid map generation. The generation of the river bed can be regarded as a downward cliff generation process, in which, for example, the water depth parameters corresponding to the control points of each map block corresponding to the river bed range can be recorded according to the configured water depth parameters, then these points are moved downward, then grid map data of the river bed part is generated according to the cliff generation mode, and the cliff map at the river bed edge can be replaced with the river bank map. And then, at the position before the control points of the map blocks corresponding to the riverbed range move, acquiring all grid land blocks adjacent to the map blocks corresponding to the riverbed range, and shifting the coordinates of all grid land block points downward by one point as a whole, so that the riverbed and the land are ensured to be fused correctly. The method provided by the application can be used for constructing the water body grid map in a low-surface number plane mode, and because the grid map is constructed based on map blocks in a preset area range after screening, the data information of the data points of each map block is preconfigured according to the terrain texture array and the height data in advance, and the grid ground has the data point information of all map blocks, the water body grid map in the preset area range can be directly obtained without combining the grid map.
After the terrain generating method provided by the application is adopted, after the control points configured with the terrain texture data and the height data are acquired, the corresponding terrain texture data and the height data can be configured for each control point in each map block according to the terrain texture array of the preset terrain map and the height data corresponding to each map block, after interpolation processing is carried out on each map block, each map block is divided into a plurality of sub-map blocks based on each control point and each interpolated data point, the height data are configured for each data point obtained by interpolation based on the height data of each control point, so as to determine the terrain type of each data point, different difference processing is carried out on sub-map blocks of different terrain types based on the terrain texture data corresponding to each control point and the terrain type of each data point, and the mixing weight of each data point in each sub-map block is determined according to the sub-map blocks of different terrain types, so that a target grid map of a preset area is generated based on the terrain texture data of each control point and the mixing weight of each data point, namely, the method provided by the application can be adopted, the terrain texture can be configured with the control point and the height data and the interpolated data, the high-level map can be directly obtained under the preset control point, the high-level map can be directly adjusted, the geometric map can be generated on the basis of the surface of the target grid can be directly and the geometric map can be quickly adjusted, the geometric map can be generated, and the geometric map can be quickly adjusted, and the geometric map can be accurately and the geometric map can be accurately generated.
The terrain generating apparatus provided by the present application is explained below with reference to the accompanying drawings, and the terrain generating apparatus may perform any of the terrain generating methods of fig. 1 to 5, and specific implementation and beneficial effects thereof refer to the above, and are not repeated below.
Fig. 6 is a schematic structural diagram of a terrain generating apparatus according to an embodiment of the present application, as shown in fig. 6, the apparatus includes: an acquisition module 201, a generation module 202, a configuration module 203, and a determination module 204, wherein:
An obtaining module 201, configured to obtain a plurality of control points configured with topographic texture data and altitude data, where the control points are control points corresponding to each map block in a grid map of a preset area;
A generating module 202, configured to perform a difference processing on each map block to generate a plurality of data points in each map block;
the configuration module 203 is configured to configure height data for each data point in a preset area grid map according to the height data of each control point;
A determining module 204, configured to determine a terrain type of each data point according to the height data of each data point and a preset height change condition;
the generating module 202 is specifically configured to configure the topographic texture data for each data point in the preset area grid map according to the topographic texture data of each control point and the topographic type of each data point, so as to generate the target grid map of the preset area.
Optionally, the generating module 202 is specifically configured to expand the boundary of the grid map to obtain an expanded grid map.
Optionally, the configuration module 203 is specifically configured to configure, according to the height data of each control point, the height data for each data point in the preset area grid map with each control point as a starting point according to a preset traversal sequence.
Optionally, the configuration module 203 is specifically configured to update the height data of the target data point according to the current height data and the configured height data if the target data point has been configured with the height data in the configuration process.
Optionally, the map block includes a plurality of sub-map blocks, each sub-map block includes a control point and three data points, and the preset altitude change condition includes: the determining module 204 is specifically configured to determine a first data point from the data points according to the height data of the data points and the first preset height change condition;
The generating module 202 is specifically configured to perform linear interpolation processing on the sub-map block corresponding to the first data point.
Optionally, the map block includes a plurality of sub-map blocks, each sub-map block includes a control point and three data points, and the preset altitude change condition includes: the determining module 204 is specifically configured to determine a second data point from the data points according to the height data corresponding to the data points and the second preset height change condition;
The generating module 202 is specifically configured to perform multiple subdivision processing on the sub-map block corresponding to the second data point.
Optionally, the map block includes a plurality of sub-map blocks, each sub-map block includes a control point and three data points, and the determining module 204 is specifically configured to determine a mixing weight of each data point in the sub-map block according to a terrain type corresponding to each data point in the sub-map block;
The configuration module 203 is specifically configured to configure the topographic texture data for each data point in the preset regional grid map according to the topographic texture data of each control point and the mixing weight of each data point.
Optionally, the preset height change condition includes: a determining module 204, configured to determine, according to the height data of each data point and the second preset height change condition, a sub-map block with a cliff type of the terrain type; and determining the mixing weight of each data point in the sub-map blocks according to the first calculation mode corresponding to the cliff type.
Optionally, the preset height change condition includes: the determining module 204 is specifically configured to determine, according to the height data of each data point and the second preset height change condition, a sub-map block with a terrain type being a level land type; and determining the mixing weight of each data point in the sub-map blocks according to a second calculation mode corresponding to the land leveling type.
Optionally, on the basis of the foregoing embodiment, an embodiment of the present application may further provide a terrain generating device, where an implementation procedure of the device shown in fig. 6 is described below by way of example with reference to the accompanying drawings. Fig. 7 is a schematic structural diagram of a terrain generating apparatus according to another embodiment of the present application, as shown in fig. 7, the apparatus further includes: the processing module 205 is configured to randomly sample a preset noise map, and perform noise disturbance on coordinates of each data point in each map block based on a result of the random sampling, so as to obtain coordinates of each data point in each map block after the disturbance.
Optionally, the processing module 205 is specifically configured to translate coordinates of each data point in each map tile based on the euler angle of the virtual camera, so as to obtain coordinates of each data point in each map tile after the translation.
Optionally, the generating module 202 is specifically configured to generate a geometric grid body of the preset area according to the target grid map of the preset area and the map of the preset area.
Optionally, the determining module 204 is specifically configured to determine a terrain texture array corresponding to each map block according to a preset terrain map corresponding to the grid map of the preset area.
The terrain generating device provided by the application can be used for configuring the corresponding terrain texture data for each control point in each map block according to the terrain texture data corresponding to each map block in the grid map of the preset area, carrying out interpolation processing on each map block so as to generate a plurality of data points in each map block, then configuring the height data for each data point in the grid map of the preset area according to the height data of each control point, determining the terrain type corresponding to each control point according to the height data of each control point and the preset height change condition, and then configuring the terrain texture data for each data point in the grid map of the preset area based on the terrain texture data and the terrain type of each control point so as to generate the target grid map of the preset area.
The foregoing apparatus is used for executing the method provided in the foregoing embodiment, and its implementation principle and technical effects are similar, and are not described herein again.
The above modules may be one or more integrated circuits configured to implement the above methods, for example: one or more Application SPECIFIC INTEGRATED Circuits (ASIC), or one or more microprocessors, or one or more field programmable gate arrays (Field Programmable GATE ARRAY FPGA), etc. For another example, when a module above is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 8 is a schematic structural diagram of a topography generating device according to an embodiment of the present application, where the topography generating device may be integrated in a terminal device or a chip of the terminal device.
As shown in fig. 8, the topography generating device comprises: a processor 501, a bus 502, and a storage medium 503.
The processor 501 is configured to store a program, and the processor 501 invokes the program stored in the storage medium 503 to execute the method embodiments corresponding to fig. 1 to 5.
The specific processor 501 performs the steps of the terrain generation method described above, including:
acquiring a plurality of control points configured with topographic texture data and height data, wherein the control points are control points corresponding to each map block in a grid map of a preset area;
Performing difference processing on each map block to generate a plurality of data points in each map block;
configuring height data for each data point in the preset regional grid map according to the height data of each control point;
Determining the terrain type of each data point according to the height data of each data point and a preset height change condition;
And according to the topographic texture data of each control point and the topographic type of each data point, configuring topographic texture data for each data point in the preset area grid map so as to generate a target grid map of the preset area.
In some embodiments, the processor 501 is further configured to, prior to executing the acquiring the plurality of control points configured with terrain texture data and altitude data, execute:
and expanding the boundary of the grid map to obtain an expanded grid map.
In some embodiments, when executing the configuration of the height data for each data point in the preset area grid map according to the height data of each control point, the processor 501 is further configured to execute:
And according to the height data of each control point, configuring the height data for each data point in the preset regional grid map according to a preset traversal sequence by taking each control point as a starting point.
In some embodiments, when executing the configuration of the corresponding height data for each data point in each map tile according to the height data corresponding to each map tile, the processor 501 is further configured to execute:
If the target data point is configured with the height data in the configuration process, updating the height data of the target data point according to the current height data and the configured height data.
In some embodiments, the map block includes a plurality of sub-map blocks, each of the sub-map blocks includes a control point and three data points, and the preset altitude change condition includes: the first preset altitude change condition, when executing the determining the terrain type of each data point according to the altitude data of each data point and the preset altitude change condition, the processor 501 is further configured to execute:
Determining a first data point from the data points according to the height data of the data points and a first preset height change condition;
the processor 501, when executing the difference processing on each map block, is further configured to execute:
and carrying out linear interpolation processing on the sub map block corresponding to the first data point.
In some embodiments, the map block includes a plurality of sub-map blocks, each of the sub-map blocks includes a control point and three data points, and the preset altitude change condition includes: the processor 501 is further configured to, when executing the determining the terrain type of each control point according to the height data of each control point and the preset height change condition, execute:
Determining a second data point from the data points according to the height data corresponding to the data points and a second preset height change condition;
the processor 501, when executing the difference processing on each map block, is further configured to execute:
and carrying out multiple subdivision processing on the sub map blocks corresponding to the second data points.
In some embodiments, the map block includes a plurality of sub-map blocks, each of the sub-map blocks includes a control point and three data points, and the processor 501 is further configured, when executing the configuration of the topographic texture data for each of the data points in the preset area grid map according to the topographic texture data for each of the control points and the topographic type of each of the data points, to execute:
determining the mixing weight of each data point in the sub-map blocks according to the terrain type corresponding to each data point in the sub-map blocks;
And according to the topographic texture data of each control point and the mixed weight of each data point, configuring topographic texture data for each data point in the preset regional grid map.
In some embodiments, the preset height variation condition includes: the processor 501 is further configured to, when executing the determining the terrain type of each data point according to the height data of each data point and the preset height change condition, execute:
determining sub-map blocks with the terrain type being cliff type according to the height data of each data point and a second preset height change condition;
processor 501, when executing the determining the mixing weight of each data point in the sub-map block according to the terrain type corresponding to each data point in the sub-map block, is further configured to execute:
And determining the mixing weight of each data point in the sub map block according to a first calculation mode corresponding to the cliff type.
In some embodiments, the preset height variation condition includes: the processor 501 is further configured to, when executing the determining the terrain type of each control point according to the height data of each control point and the preset height change condition, execute:
According to the height data of each data point and a second preset height change condition, the terrain type is a sub-map block of a level land type;
processor 501, when executing the determining the mixing weight of each data point in the sub-map block according to the terrain type corresponding to each data point in the sub-map block, is further configured to execute:
and determining the mixing weight of each data point in the sub-map blocks according to a second calculation mode corresponding to the land leveling type.
In some embodiments, before executing the generating the target grid map of the preset area, the processor 501 is further configured to:
randomly sampling a preset noise map, and carrying out noise disturbance on the coordinates of each data point in each map block based on the random sampling result so as to obtain the coordinates of each data point in each map block after disturbance.
In some embodiments, if the current application scenario is a fixed view application scenario, the processor 501 is further configured to perform:
The coordinates of each data point in each map block are translated based on the Euler angle of the virtual camera to obtain the coordinates of each data point in each translated map block.
In some embodiments, the processor 501 is further configured to perform:
and generating a geometric grid body of the preset area according to the target grid map of the preset area and the map of the preset area.
In some embodiments, the processor 501 is further configured to, prior to executing the acquiring the plurality of control points configured with terrain texture data and altitude data, execute:
Determining a terrain texture array corresponding to each map block according to a preset terrain map corresponding to the grid map of the preset area;
and configuring the topographic texture data for the control points in each map block according to a preset sequence and the topographic texture array corresponding to each map block.
The terrain generating equipment provided by the application can be used for configuring the corresponding terrain texture data for each control point in each map block according to the terrain texture data corresponding to each map block in the grid map of the preset area, carrying out interpolation processing on each map block so as to generate a plurality of data points in each map block, then configuring the height data for each data point in the grid map of the preset area according to the height data of each control point, determining the terrain type corresponding to each control point according to the height data of each control point and the preset height change condition, and then configuring the terrain texture data for each data point in the grid map of the preset area based on the terrain texture data and the terrain type of each control point so as to generate the target grid map of the preset area.
Optionally, the present application also provides a program product, such as a storage medium, on which a computer program is stored, including a program which, when being executed by a processor, performs the corresponding embodiments of the above-mentioned method.
The specific processor executes the steps of the terrain generation method, which comprises the following steps:
acquiring a plurality of control points configured with topographic texture data and height data, wherein the control points are control points corresponding to each map block in a grid map of a preset area;
Performing difference processing on each map block to generate a plurality of data points in each map block;
configuring height data for each data point in the preset regional grid map according to the height data of each control point;
Determining the terrain type of each data point according to the height data of each data point and a preset height change condition;
And according to the topographic texture data of each control point and the topographic type of each data point, configuring topographic texture data for each data point in the preset area grid map so as to generate a target grid map of the preset area.
In some embodiments, the processor, prior to executing the acquiring the plurality of control points configured with terrain texture data and altitude data, is further configured to:
and expanding the boundary of the grid map to obtain an expanded grid map.
In some embodiments, the processor, when executing the configuring the height data for each of the data points in the preset area grid map according to the height data of each of the control points, is further configured to execute:
And according to the height data of each control point, configuring the height data for each data point in the preset regional grid map according to a preset traversal sequence by taking each control point as a starting point.
In some embodiments, when executing the configuration of the corresponding height data for each data point in each map tile according to the height data corresponding to each map tile, the processor is further configured to execute:
If the target data point is configured with the height data in the configuration process, updating the height data of the target data point according to the current height data and the configured height data.
In some embodiments, the map block includes a plurality of sub-map blocks, each of the sub-map blocks includes a control point and three data points, and the preset altitude change condition includes: the first preset altitude change condition, when executing the altitude data according to each data point and the preset altitude change condition, the processor is further configured to execute:
Determining a first data point from the data points according to the height data of the data points and a first preset height change condition;
the processor, when executing the difference processing on each map block, is further configured to execute:
and carrying out linear interpolation processing on the sub map block corresponding to the first data point.
In some embodiments, the map block includes a plurality of sub-map blocks, each of the sub-map blocks includes a control point and three data points, and the preset altitude change condition includes: the processor is further configured to, when executing the determining the terrain type of each control point according to the height data of each control point and the preset height change condition, execute:
Determining a second data point from the data points according to the height data corresponding to the data points and a second preset height change condition;
the processor, when executing the difference processing on each map block, is further configured to execute:
and carrying out multiple subdivision processing on the sub map blocks corresponding to the second data points.
In some embodiments, the map block includes a plurality of sub-map blocks, each of the sub-map blocks includes a control point and three data points, and the processor, when executing the configuration of the terrain texture data for each of the data points in the preset area grid map according to the terrain texture data for each of the control points and the terrain type of each of the data points, is further configured to execute:
determining the mixing weight of each data point in the sub-map blocks according to the terrain type corresponding to each data point in the sub-map blocks;
And according to the topographic texture data of each control point and the mixed weight of each data point, configuring topographic texture data for each data point in the preset regional grid map.
In some embodiments, the preset height variation condition includes: the processor is further configured to, when executing the determining the terrain type of each data point according to the height data of each data point and the preset height change condition, execute:
determining sub-map blocks with the terrain type being cliff type according to the height data of each data point and a second preset height change condition;
The processor is further configured to, when executing the determining the mixing weight of each data point in the sub-map block according to the terrain type corresponding to each data point in the sub-map block, execute:
And determining the mixing weight of each data point in the sub map block according to a first calculation mode corresponding to the cliff type.
In some embodiments, the preset height variation condition includes: the processor is further configured to, when executing the determining the terrain type of each control point according to the height data of each control point and the preset height change condition, execute:
According to the height data of each data point and a second preset height change condition, the terrain type is a sub-map block of a level land type;
The processor is further configured to, when executing the determining the mixing weight of each data point in the sub-map block according to the terrain type corresponding to each data point in the sub-map block, execute:
and determining the mixing weight of each data point in the sub-map blocks according to a second calculation mode corresponding to the land leveling type.
In some embodiments, the processor, prior to executing the generating the target grid map of the preset area, is further configured to:
randomly sampling a preset noise map, and carrying out noise disturbance on the coordinates of each data point in each map block based on the random sampling result so as to obtain the coordinates of each data point in each map block after disturbance.
In some embodiments, if the current application scenario is a fixed view application scenario, the processor is further configured to perform:
The coordinates of each data point in each map block are translated based on the Euler angle of the virtual camera to obtain the coordinates of each data point in each translated map block.
In some embodiments, the processor is further configured to perform:
and generating a geometric grid body of the preset area according to the target grid map of the preset area and the map of the preset area.
In some embodiments, the processor, prior to executing the acquiring the plurality of control points configured with terrain texture data and altitude data, is further configured to:
Determining a terrain texture array corresponding to each map block according to a preset terrain map corresponding to the grid map of the preset area;
and configuring the topographic texture data for the control points in each map block according to a preset sequence and the topographic texture array corresponding to each map block.
The storage medium provided by the application can be used for configuring the corresponding topographic texture data for each control point in each map block according to the topographic texture data corresponding to each map block in the grid map of the preset area, carrying out interpolation processing on each map block to generate a plurality of data points in each map block, then configuring the height data for each data point in the grid map of the preset area according to the height data of each control point, determining the topographic type corresponding to each control point according to the height data of each control point and the preset height change condition, and then configuring the topographic texture data for each data point in the grid map of the preset area based on the topographic texture data and the topographic type of each control point to generate the target grid map of the preset area.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (english: processor) to perform some of the steps of the methods according to the embodiments of the application. And the aforementioned storage medium includes: u disk, mobile hard disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.

Claims (16)

1. A terrain creation method, the method comprising:
acquiring a plurality of control points configured with topographic texture data and height data, wherein the control points are control points corresponding to each map block in a grid map of a preset area;
Performing difference processing on each map block to generate a plurality of data points in each map block;
configuring height data for each data point in the preset regional grid map according to the height data of each control point;
Determining the terrain type of each data point according to the height data of each data point and a preset height change condition;
And according to the topographic texture data of each control point and the topographic type of each data point, configuring topographic texture data for each data point in the preset area grid map so as to generate a target grid map of the preset area.
2. The method of claim 1, wherein prior to the acquiring the plurality of control points configured with terrain texture data and altitude data, the method further comprises:
and expanding the boundary of the grid map to obtain an expanded grid map.
3. The method of claim 1, wherein said configuring height data for each of said data points within said preset area grid map based on height data for each of said control points comprises:
And according to the height data of each control point, configuring the height data for each data point in the preset regional grid map according to a preset traversal sequence by taking each control point as a starting point.
4. The method of claim 3, wherein configuring the corresponding height data for each data point in each map tile based on the height data for each map tile comprises:
If the target data point is configured with the height data in the configuration process, updating the height data of the target data point according to the current height data and the configured height data.
5. The method of claim 1, wherein a plurality of sub-map tiles are included in the map tile, each sub-map tile including one control point and three data points, the predetermined altitude change condition comprising: the determining the terrain type of each data point according to the height data of each data point and the preset height change condition comprises the following steps:
Determining a first data point from the data points according to the height data of the data points and a first preset height change condition;
The performing difference processing on each map block includes:
and carrying out linear interpolation processing on the sub map block corresponding to the first data point.
6. The method of claim 1, wherein a plurality of sub-map tiles are included in the map tile, each sub-map tile including one control point and three data points, the predetermined altitude change condition comprising: the determining the terrain type of each control point according to the height data of each control point and the preset height change condition comprises the following steps:
Determining a second data point from the data points according to the height data corresponding to the data points and a second preset height change condition;
The performing difference processing on each map block includes:
and carrying out multiple subdivision processing on the sub map blocks corresponding to the second data points.
7. The method of claim 1, wherein a plurality of sub-map tiles are included in the map block, each sub-map tile including a control point and three data points, the configuring the terrain texture data for each data point in the pre-set regional grid map based on the terrain texture data for each control point and the terrain type for each data point, comprising:
determining the mixing weight of each data point in the sub-map blocks according to the terrain type corresponding to each data point in the sub-map blocks;
And according to the topographic texture data of each control point and the mixed weight of each data point, configuring topographic texture data for each data point in the preset regional grid map.
8. The method according to claim 7, wherein the predetermined height variation condition includes: a second preset height change condition, wherein the determining the terrain type of each data point according to the height data of each data point and the preset height change condition comprises the following steps:
determining sub-map blocks with the terrain type being cliff type according to the height data of each data point and a second preset height change condition;
the determining the mixing weight of each data point in the sub-map block according to the terrain type corresponding to each data point in the sub-map block comprises:
And determining the mixing weight of each data point in the sub map block according to a first calculation mode corresponding to the cliff type.
9. The method according to claim 7, wherein the predetermined height variation condition includes: the determining the terrain type of each control point according to the height data of each control point and the preset height change condition comprises the following steps:
According to the height data of each data point and a second preset height change condition, the terrain type is a sub-map block of a level land type;
the determining the mixing weight of each data point in the sub-map block according to the terrain type corresponding to each data point in the sub-map block comprises:
and determining the mixing weight of each data point in the sub-map blocks according to a second calculation mode corresponding to the land leveling type.
10. The method of claim 1, wherein prior to generating the target grid map of the preset area, the method further comprises:
randomly sampling a preset noise map, and carrying out noise disturbance on the coordinates of each data point in each map block based on the random sampling result so as to obtain the coordinates of each data point in each map block after disturbance.
11. The method of claim 1, wherein if the current application scenario is a constant view application scenario, the method further comprises:
The coordinates of each data point in each map block are translated based on the Euler angle of the virtual camera to obtain the coordinates of each data point in each translated map block.
12. The method of claim 1, wherein the method further comprises:
and generating a geometric grid body of the preset area according to the target grid map of the preset area and the map of the preset area.
13. The method of claim 1, wherein prior to the acquiring the plurality of control points configured with terrain texture data and altitude data, the method further comprises:
Determining a terrain texture array corresponding to each map block according to a preset terrain map corresponding to the grid map of the preset area;
and configuring the topographic texture data for the control points in each map block according to a preset sequence and the topographic texture array corresponding to each map block.
14. A terrain generating apparatus, the apparatus comprising: the device comprises an acquisition module, a generation module, a configuration module and a determination module, wherein:
The acquisition module is used for acquiring a plurality of control points configured with topographic texture data and height data, wherein the control points are control points corresponding to each map block in a grid map of a preset area;
The generation module is used for carrying out difference value processing on each map block so as to generate a plurality of data points in each map block;
the configuration module is specifically configured to configure height data for each data point in the preset area grid map according to the height data of each control point;
The determining module is used for determining the terrain type of each data point according to the height data of each data point and the preset height change condition;
the generation module is specifically configured to configure, for each data point in the preset area grid map, topographic texture data according to topographic texture data of each control point and a topographic type of each data point, so as to generate a target grid map of the preset area.
15. A terrain generating apparatus, the apparatus comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor in communication with the storage medium via the bus when the terrain generating device is in operation, the processor executing the machine-readable instructions to perform the method of any of the preceding claims 1-13.
16. A storage medium having stored thereon a computer program which, when executed by a processor, performs the method of any of the preceding claims 1-13.
CN202410219257.XA 2024-02-28 2024-02-28 Terrain generation method, device, equipment and storage medium Pending CN117959707A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410219257.XA CN117959707A (en) 2024-02-28 2024-02-28 Terrain generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410219257.XA CN117959707A (en) 2024-02-28 2024-02-28 Terrain generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117959707A true CN117959707A (en) 2024-05-03

Family

ID=90855466

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410219257.XA Pending CN117959707A (en) 2024-02-28 2024-02-28 Terrain generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117959707A (en)

Similar Documents

Publication Publication Date Title
WO2022227910A1 (en) Virtual scene generation method and apparatus, and computer device and storage medium
WO2022048115A1 (en) Terrain deformation method and apparatus, device, and storage medium
KR20100136604A (en) Real-time visualization system of 3 dimension terrain image
KR20080018404A (en) Computer readable recording medium having background making program for making game
WO2022000952A1 (en) Method and apparatus for processing game data, computer program and readable medium
CN104157011A (en) Modeling method for three-dimensional terrain
CN115409957A (en) Map construction method based on illusion engine, electronic device and storage medium
CN112052864A (en) Image drawing method and device, electronic equipment and readable storage medium
CN110136262B (en) Water body virtual visualization method and device
CN115409962B (en) Method for constructing coordinate system in illusion engine, electronic device and storage medium
CN117959707A (en) Terrain generation method, device, equipment and storage medium
CN114255312A (en) Processing method and device of vegetation image and electronic equipment
Scholz et al. Level of Detail for Real-Time Volumetric Terrain Rendering.
CN112002019A (en) Method for simulating character shadow based on MR mixed reality
US11875445B2 (en) Seamless image processing of a tiled image region
US20240193864A1 (en) Method for 3d visualization of sensor data
KR102545445B1 (en) Apparatus and method for third dimension earth XR visualization using unity engine
CN111729303B (en) Large map baking and cutting method and restoration method
JP7368950B2 (en) Method and apparatus for efficient building footprint identification
Cicekci et al. Development of soil profile visualization software using game engines
CN117953134A (en) Perspective projection point aggregation method and device
Tisovčík Cartography in virtual environment
CN114820962A (en) Three-dimensional geographic entity model data base building method
CN116958408A (en) Three-dimensional scene construction method, device, equipment, medium and program product
Grigore et al. Real-time Guided Procedural Terrain Generation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination