CN114677482A - Terrain construction method and equipment - Google Patents

Terrain construction method and equipment Download PDF

Info

Publication number
CN114677482A
CN114677482A CN202011556758.5A CN202011556758A CN114677482A CN 114677482 A CN114677482 A CN 114677482A CN 202011556758 A CN202011556758 A CN 202011556758A CN 114677482 A CN114677482 A CN 114677482A
Authority
CN
China
Prior art keywords
terrain
model
constructed
generating
axis
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.)
Granted
Application number
CN202011556758.5A
Other languages
Chinese (zh)
Other versions
CN114677482B (en
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.)
Guangzhou Boguan Information Technology Co Ltd
Original Assignee
Guangzhou Boguan Information Technology 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 Guangzhou Boguan Information Technology Co Ltd filed Critical Guangzhou Boguan Information Technology Co Ltd
Priority to CN202011556758.5A priority Critical patent/CN114677482B/en
Publication of CN114677482A publication Critical patent/CN114677482A/en
Application granted granted Critical
Publication of CN114677482B publication Critical patent/CN114677482B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/05Geographic models
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/6009Methods for processing data by generating or executing the game program for importing or creating game content, e.g. authoring tools during game development, adapting content to different platforms, use of a scripting language to create content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/04Indexing scheme for image data processing or generation, in general involving 3D image data

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Remote Sensing (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the application provides a terrain construction method and terrain construction equipment, wherein the method comprises the following steps: acquiring a height map of a terrain to be constructed, reading gray bitmap information of the height map, and determining vertex information of the terrain to be constructed according to the gray bitmap information; and generating a terrain model corresponding to the terrain to be constructed according to the vertex information. In other words, in the embodiment of the present application, the grayscale bitmap information of the height map is read, and the vertex information determined according to the grayscale bitmap information can generate a terrain model corresponding to the terrain to be constructed.

Description

Terrain construction method and equipment
Technical Field
The embodiment of the application relates to the technical field of image processing, in particular to a terrain construction method and terrain construction equipment.
Background
Terrain, as a form of game representation, is widely used in existing game scenarios, such as mountains, plains, streets, etc. in games.
In the existing terrain making method, the terrain is usually made in an illusion Engine 4(un real Engine 4, abbreviated as UE4) directly through a brush tool, or a height map is made by third-party software, then UE4 is introduced, and a corresponding terrain model is obtained through landscapes, or a corresponding terrain model can be obtained by replacing the height map with a common static model based on the height map made.
The terrain model obtained by replacing the altitude map with the common static model is not a real solid terrain model because the vertex position of the static model is mainly processed by a shader, so that the physical attributes of the new terrain model obtained by replacement, such as a collision physical form and the like, are still generated based on the original static model, the original physical attributes are not really changed, and the correct physical collision physical form is difficult to generate.
Disclosure of Invention
The embodiment of the application provides a terrain construction method and equipment, and can solve the technical problem that a terrain model obtained by replacing a height map with a common static model is difficult to generate a correct physical collision shape in the prior art.
In a first aspect, an embodiment of the present application provides a terrain construction method, where the method includes:
acquiring a height map of a terrain to be constructed;
reading gray bitmap information of the height map, and determining vertex information of the terrain to be constructed according to the gray bitmap information;
and generating a terrain model corresponding to the terrain to be constructed according to the vertex information.
In a possible design manner, the generating a terrain model corresponding to the terrain to be constructed according to the vertex information includes:
Generating model parameters of the terrain to be constructed according to the vertex information, wherein the model parameters of the terrain to be constructed comprise a terrain normal, a terrain tangent, UV coordinates and a triangular surface;
and generating a terrain model corresponding to the terrain to be constructed according to the model parameters of the terrain to be constructed.
In a possible design manner, the generating a terrain model corresponding to the terrain to be constructed according to the model parameter of the terrain to be constructed includes:
and calling a program modeling component in an illusion engine, and generating a terrain model corresponding to the terrain to be constructed based on the model parameters of the terrain to be constructed.
In a possible design manner, after the generating a terrain model corresponding to the terrain to be constructed according to the vertex information, the method further includes:
determining the size of a model frame of the terrain model;
calculating a proportional value of the size of the model frame and the size of the pixels in the gray bitmap information;
and adjusting the size proportion of the terrain model according to the calculated proportion value.
In a possible design manner, after generating the terrain model corresponding to the terrain to be constructed according to the vertex information, the method further includes:
Optimizing the terrain model by adopting a preset double-channel optimization mode or a single-channel optimization mode; the two-channel optimization mode is used for sequentially optimizing the terrain model along the Y axis and the X axis of the terrain model, and the single-channel optimization mode is used for optimizing the terrain model along the Y axis or the X axis of the terrain model.
In a first aspect, embodiments of the present application provide a terrain building apparatus, the apparatus comprising:
the acquisition module is used for acquiring a height map of a terrain to be constructed;
the processing module is used for reading the gray bitmap information of the height map and determining the vertex information of the terrain to be constructed according to the gray bitmap information;
and the modeling module is used for generating a terrain model corresponding to the terrain to be constructed according to the vertex information.
In one possible design, the modeling module is configured to:
generating model parameters of the terrain to be constructed according to the vertex information, wherein the model parameters of the terrain to be constructed comprise a terrain normal, a terrain tangent, UV coordinates and a triangular surface;
and generating a terrain model corresponding to the terrain to be constructed according to the model parameters of the terrain to be constructed.
In one possible design, the modeling module is configured to:
and calling a program modeling component in an illusion engine, and generating a terrain model corresponding to the terrain to be constructed based on the model parameters of the terrain to be constructed.
In one possible design, the method further includes:
and the adjusting module is used for adjusting the size proportion of the terrain model according to the model frame of the terrain model after the terrain model corresponding to the terrain to be constructed is generated.
In one possible design, the method further includes:
and the optimization module is used for optimizing the terrain model by adopting a preset optimization mode after the terrain model corresponding to the terrain to be constructed is generated.
In a third aspect, an embodiment of the present application provides an electronic device, including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executes computer-executable instructions stored by the memory, causing the at least one processor to perform a terrain construction method as provided by the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the terrain construction method provided in the first aspect is implemented.
In a fifth aspect, the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements the terrain building method provided in the first aspect.
The terrain construction method and the terrain construction equipment provided by the embodiment of the application have the following steps: acquiring a height map of a terrain to be constructed, reading gray bitmap information of the height map, and determining vertex information of the terrain to be constructed according to the gray bitmap information; and generating a terrain model corresponding to the terrain to be constructed according to the vertex information. In other words, in the embodiment of the present application, the grayscale bitmap information of the height map is read, and the vertex information determined according to the grayscale bitmap information can generate a terrain model corresponding to the terrain to be constructed.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments of the present application or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without inventive exercise.
FIG. 1 is a schematic flow chart of a terrain construction method provided in an embodiment of the present application;
FIG. 2 is a height view of one embodiment of the present application;
FIG. 3 is a schematic view of a terrain provided in an embodiment of the present application;
FIG. 4 is a schematic view of a terrain model provided in an embodiment of the present application;
FIG. 5 is a schematic diagram of program modules of a terrain builder provided in the examples of the present application;
fig. 6 is a schematic hardware structure diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used in the embodiments of the present application have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
In most games, the terrain-playing important role, such as sandbox game, strategy game and numerous role-playing games, the map belonging to the game is elaborated, and then the game scene is arranged based on the map, with the addition of animals, plants, monsters, buildings and characters, so that the terrain-making tool can be an indispensable component of modern game engines.
Currently, the illusion Engine 4 (UE 4) is an excellent and popular 3D game Engine and development tool, which supports the development of 3D games from 2D mobile platform games to computers to game host platforms. The UE4 provides development tool downloading of Windows and Mac platforms, and the manufactured works can run on Windows, Mac, Linux, PS4, X-Box One, iOS, Android and even HTML5 and other platforms.
In the existing scene terrain manufacturing method, terrain construction is usually directly performed in the landscape by a brush tool in the UE4, or a height map is manufactured by third-party software and then led into the UE4, and a corresponding terrain is obtained through the landscape, and then a corresponding terrain is obtained through the height map by using a common static model through replacement.
However, the terrain model obtained by replacing the common static model is mainly processed by the shader on the vertex position of the model, and a real solid terrain model is not created, so that the physical attributes of the new model obtained by replacing, such as a collision physical form and the like, are still generated based on the original model, the original physical attributes are not really changed, and the correct physical collision physical form is difficult to generate. If the character still recognizes the collision form of the original model when walking on the replacement model, and vegetation is generated based on the collision form of the original model when vegetation is spread on the replacement model, there is a penetration phenomenon.
In order to solve the above technical problem, an embodiment of the present application provides a terrain construction method, in which a solid terrain model corresponding to a terrain to be constructed can be generated by reading grayscale bitmap information of a height map and according to vertex information determined by the grayscale bitmap information, and a correct physical collision shape matched with the solid terrain model can be created based on the generated solid terrain model. The following examples are given for the purpose of illustration.
Referring to fig. 1, fig. 1 is a schematic flow chart of a terrain building method provided in an embodiment of the present application. The terrain construction method comprises the following steps:
S101, obtaining a height map of a terrain to be constructed.
In a possible implementation manner, when the terrain is constructed, a height map of the terrain to be constructed is obtained, wherein the height map of the terrain to be constructed can be obtained through various map services, can be pre-drawn by using various graphic software, and can be manufactured by using noise textures.
The height map may be understood as a set of consecutive arrays, where the elements in the array correspond to vertices in the terrain mesh one-to-one, and each element specifies a height value of a vertex of the terrain mesh.
The height map is usually implemented by using a gray scale map, in which the greater the brightness, the higher the terrain height.
For better understanding of the embodiments of the present application, exemplary, refer to fig. 2, and fig. 2 is a height view provided in the embodiments of the present application.
In a game environment, terrains such as hills, valleys, flat lands, cliffs and the like in real life can be simulated by using the height map.
And S102, reading the gray bitmap information of the height map, and determining the vertex information of the terrain to be constructed according to the gray bitmap information.
In the embodiment of the application, after the height map of the terrain to be constructed is obtained, the gray bitmap information of the height map is read, and the vertex information of the terrain to be constructed is determined according to the read gray bitmap information.
In one possible embodiment, the user may first specify the methods and classes required to generate the terrain model in the UE4, such as the component "uprocedurearameshcomponent". In addition, the functions and related parameters required for generating the model are found in advance from the official document API of the UE 4. For example:
an index of the part that needs to be created or replaced; a vertex buffer for all vertex positions of the mesh portion; indicating which vertices make up the index buffer for each triangle, the length must be a multiple of 3; an optional array of normal vectors for each vertex, if provided, must be the same length as the Vertics array; an optional array of texture coordinates for each vertex, if provided, must be the same length as the Vertics array; the optional color array for each vertex, if provided, must be the same length as the Vertics array; an optional array of tangent vectors for each vertex, if provided, must be the same length as the Vertics array; indicating whether a collision should be created for this part.
For example, the UE4 may create an actor named heighLand. Adding a program modeling component 'proceduremoponent' in the newly-built actor. A variable inheriting the 'procedureponent' class is created in the header file, so that the related method and attribute of the 'procedureponent' component can be used.
And S103, generating a terrain model corresponding to the terrain to be constructed according to the vertex information.
In the embodiment of the application, after the vertex information of the terrain to be constructed is determined, model parameters required by the terrain model such as a terrain normal, a terrain tangent, UV coordinates and triangular surfaces are generated according to the vertex information of the terrain to be constructed, and then the terrain model corresponding to the terrain to be constructed can be generated according to the generated model parameters.
After a terrain model corresponding to the terrain to be constructed is generated, a physical collision body matched with the terrain model can be created based on the generated terrain model, and relevant physical calculation is carried out on the replaced terrain model.
For better understanding of the embodiments of the present application, exemplarily, refer to fig. 3 and 4, and fig. 3 is a schematic view of a terrain provided in the embodiments of the present application; fig. 4 is a schematic view of a terrain model provided in an embodiment of the present application.
According to the terrain construction method provided by the embodiment of the application, the gray level bitmap information of the height map is read, and the entity terrain model corresponding to the terrain to be constructed can be generated according to the vertex information determined by the gray level bitmap information, so that the correct physical collision body matched with the entity terrain model can be created based on the generated entity terrain model.
Based on the content described in the foregoing embodiments, in a possible implementation manner of the present application, after the model parameters of the terrain to be constructed are generated, a program modeling component "procedurepoponent" in the UE4 may be called, and then, based on the model parameters of the terrain to be constructed, a terrain model corresponding to the terrain to be constructed is generated.
In one possible embodiment of the present application, after generating the terrain model, the method further includes:
and setting the size of the generated grid, and adjusting the size proportion of the terrain model according to the model frame of the generated terrain model.
Specifically, the size of a model frame of the generated terrain model is read firstly, such as length, width, height and the like; and calculating a ratio of the size of the model frame to the pixel size in the grayscale bitmap information, and adjusting the size ratio of the terrain model according to the calculated ratio and a setworld scale3D function.
In another possible embodiment of the present application, after generating the terrain model, the method further includes:
and optimizing the terrain model by adopting a preset optimization mode.
The optimization mode comprises a FrontAndBack optimization mode and an AxesAlternately optimization mode, wherein the AxesAlternately optimization mode adopts two channels, and optimization is performed along a Y axis and then along an X axis; the frontbackup optimization approach uses a single channel, optimized along either the X-axis or the Y-axis, with the latter optimized along the X-axis if the former was optimized along the Y-axis.
In the plan view of a terrain, the vertical axis is the Z axis, the horizontal axis is the X axis, and the vertical axis is the Y axis.
In addition, in the embodiment of the present application, the sampling frequency may also be optimized at the same time, for example, the sampling frequency is reduced by 2 times or 4 times.
The terrain construction method provided by the embodiment of the application solves the technical problem that in the existing UE4, a terrain model generated by performing replacement operation in materials by using a height map is not a real entity model, so that the physical collision physical form is incorrect. By utilizing the terrain construction method provided by the embodiment of the application, the terrain manufacturing efficiency of terrain manufacturers taking the UE4 as a production tool can be greatly improved, and meanwhile, as the generated terrain model is a static model, richer terrain effects can be manufactured through instantiation, and the overall project performance is optimized. In addition, a real entity terrain model is generated through the replacement of the height map, so that the physical simulation of the whole scene is facilitated, such as character AI simulation on the generated earth surface, interactive collision simulation of particles and the ground and the like.
Based on the content described in the foregoing embodiments, there is also provided a terrain building apparatus in an embodiment of the present application, and referring to fig. 5, fig. 5 is a schematic diagram of program modules of the terrain building apparatus provided in the embodiment of the present application, where the terrain building apparatus 50 includes:
An obtaining module 501, configured to obtain a height map of a terrain to be constructed.
The processing module 502 is configured to read grayscale bitmap information of the height map, and determine vertex information of a terrain to be constructed according to the grayscale bitmap information.
And the modeling module 503 is configured to generate a terrain model corresponding to the terrain to be constructed according to the vertex information.
The terrain construction device 50 provided in the embodiment of the present application can generate an entity terrain model corresponding to a terrain to be constructed by reading grayscale bitmap information of a height map and according to vertex information determined by the grayscale bitmap information, so that a correct physical collision shape matched with the generated terrain model can be created based on the generated terrain model.
In one possible implementation, the modeling module 503 is configured to:
generating model parameters of the terrain to be constructed according to the vertex information, wherein the model parameters of the terrain to be constructed comprise a terrain normal, a terrain tangent, UV coordinates and a triangular surface; and generating a terrain model corresponding to the terrain to be constructed according to the model parameters of the terrain to be constructed.
In one possible implementation, the modeling module 503 is configured to:
and calling a program modeling component in the illusion engine, and generating a terrain model corresponding to the terrain to be constructed based on the model parameters of the terrain to be constructed.
In a possible embodiment, the terrain building apparatus 50 further comprises:
the adjusting module is used for determining the size of a model frame of a terrain model after the terrain model corresponding to the terrain to be constructed is generated, and calculating the proportion value of the size of the model frame and the size of pixels in the gray bitmap information; and adjusting the size proportion of the terrain model according to the calculated proportion value.
In a possible embodiment, the terrain building apparatus 50 further comprises:
the optimization module is used for optimizing the terrain model by adopting a preset double-channel optimization mode or single-channel optimization mode after the terrain model corresponding to the terrain to be constructed is generated; the terrain model is optimized along the Y axis and the X axis of the terrain model in sequence through a double-channel optimization mode, and the terrain model is optimized along the Y axis or the X axis of the terrain model through a single-channel optimization mode.
The terrain construction device 50 provided by the embodiment of the application solves the technical problem that in the existing UE4, a terrain model generated by replacing materials with a height map is not a real entity model, so that the physical collision physical form is incorrect. By utilizing the terrain construction device provided by the embodiment of the application, the terrain manufacturing efficiency of terrain makers using the UE4 as a production tool can be greatly improved, and meanwhile, as the generated terrain model is a static model, richer terrain effects can be manufactured through instantiation, and the overall project performance is optimized. In addition, a real entity terrain model is generated through the replacement of the height map, so that the physical simulation of the whole scene is facilitated, such as character AI simulation on the generated earth surface, interactive collision simulation of particles and the ground and the like.
It should be noted that the content specifically executed by the obtaining module 501, the processing module 502, and the modeling module 503 in this embodiment may refer to each step in the terrain constructing method described in the foregoing embodiment, and details are not described here.
Further, based on the content described in the foregoing embodiments, an electronic device is also provided in an embodiment of the present application, where the electronic device includes at least one processor and a memory; wherein the memory stores computer execution instructions; the at least one processor executes computer-executable instructions stored in the memory to implement the steps of the terrain construction method described in the above embodiments, which are not described herein again.
For better understanding of the embodiment of the present application, referring to fig. 6, fig. 6 is a schematic diagram of a hardware structure of an electronic device provided in the embodiment of the present application.
As shown in fig. 6, the electronic device 60 of the present embodiment includes: a processor 601 and a memory 602; wherein:
a memory 602 for storing computer-executable instructions;
the processor 601 is configured to execute computer execution instructions stored in the memory to implement each step in the terrain construction method described in the foregoing embodiments, which is not described herein again.
Alternatively, the memory 602 may be separate or integrated with the processor 601.
When the memory 602 is provided separately, the device further comprises a bus 603 for connecting said memory 602 and the processor 601.
Further, based on the content described in the foregoing embodiments, an embodiment of the present application further provides a computer-readable storage medium, where a computer-executable instruction is stored in the computer-readable storage medium, and when a processor executes the computer-executable instruction, the steps in the terrain construction method described in the foregoing embodiments are implemented, and details are not repeated here.
Further, based on the content described in the foregoing embodiments, an embodiment of the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements each step in the terrain building method described in the foregoing embodiments, which is not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules is only one logical division, and other divisions may be realized in practice, for example, a plurality of modules may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one unit. The unit formed by the modules can be realized in a hardware form, and can also be realized in a form of hardware and a software functional unit.
The integrated module implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application.
It should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the methods disclosed in the incorporated application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
The memory may comprise a high speed RAM memory, and may further comprise a non-volatile storage NVM, such as at least one magnetic disk memory, and may also be a usb disk, a removable hard disk, a read-only memory, a magnetic or optical disk, or the like.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The storage medium may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the storage medium may reside as discrete components in an electronic device or host device.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and these modifications or substitutions do not depart from the scope of the technical solutions of the embodiments of the present application.

Claims (13)

1. A terrain building method, characterized in that the method comprises:
acquiring a height map of a terrain to be constructed;
reading gray bitmap information of the height map, and determining vertex information of the terrain to be constructed according to the gray bitmap information;
and generating a terrain model corresponding to the terrain to be constructed according to the vertex information.
2. The method according to claim 1, wherein the generating a terrain model corresponding to the terrain to be constructed according to the vertex information comprises:
generating model parameters of the terrain to be constructed according to the vertex information, wherein the model parameters of the terrain to be constructed comprise a terrain normal, a terrain tangent, UV coordinates and a triangular surface;
And generating a terrain model corresponding to the terrain to be constructed according to the model parameters of the terrain to be constructed.
3. The method according to claim 2, wherein the generating of the terrain model corresponding to the terrain to be constructed according to the model parameters of the terrain to be constructed comprises:
and calling a program modeling component in the illusion engine, and generating a terrain model corresponding to the terrain to be constructed based on the model parameters of the terrain to be constructed.
4. The method according to claim 1, wherein after generating the terrain model corresponding to the terrain to be constructed according to the vertex information, the method further comprises:
determining the size of a model frame of the terrain model;
calculating a proportional value of the size of the model frame and the size of the pixels in the gray bitmap information;
and adjusting the size proportion of the terrain model according to the calculated proportion value.
5. The method according to claim 1, wherein after generating the terrain model corresponding to the terrain to be constructed according to the vertex information, the method further comprises:
optimizing the terrain model by adopting a preset double-channel optimization mode or a single-channel optimization mode; the two-channel optimization mode is used for sequentially optimizing the terrain model along the Y axis and the X axis of the terrain model, and the single-channel optimization mode is used for optimizing the terrain model along the Y axis or the X axis of the terrain model.
6. A terrain building apparatus, comprising:
the acquisition module is used for acquiring a height map of a terrain to be constructed;
the processing module is used for reading the gray bitmap information of the height map and determining the vertex information of the terrain to be constructed according to the gray bitmap information;
and the modeling module is used for generating a terrain model corresponding to the terrain to be constructed according to the vertex information.
7. The apparatus of claim 6, wherein the modeling module is configured to:
generating model parameters of the terrain to be constructed according to the vertex information, wherein the model parameters of the terrain to be constructed comprise a terrain normal, a terrain tangent, UV coordinates and a triangular surface;
and generating a terrain model corresponding to the terrain to be constructed according to the model parameters of the terrain to be constructed.
8. The apparatus of claim 7, wherein the modeling module is configured to:
and calling a program modeling component in the illusion engine, and generating a terrain model corresponding to the terrain to be constructed based on the model parameters of the terrain to be constructed.
9. The apparatus of claim 6, further comprising:
the adjusting module is used for determining the size of a model frame of the terrain model after the terrain model corresponding to the terrain to be constructed is generated; calculating a proportional value of the size of the model frame and the size of the pixels in the gray bitmap information; and adjusting the size proportion of the terrain model according to the calculated proportion value.
10. The apparatus of claim 6, further comprising:
the optimization module is used for optimizing the terrain model by adopting a preset double-channel optimization mode or a single-channel optimization mode after the terrain model corresponding to the terrain to be constructed is generated; the two-channel optimization mode is used for sequentially optimizing the terrain model along the Y axis and the X axis of the terrain model, and the single-channel optimization mode is used for optimizing the terrain model along the Y axis or the X axis of the terrain model.
11. An electronic device, comprising: at least one processor and a memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the terrain construction method of any of claims 1-5.
12. A computer-readable storage medium having computer-executable instructions stored thereon which, when executed by a processor, implement the terrain construction method of any of claims 1-5.
13. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, carries out the terrain construction method according to any one of claims 1 to 5.
CN202011556758.5A 2020-12-24 2020-12-24 Terrain construction method and equipment Active CN114677482B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011556758.5A CN114677482B (en) 2020-12-24 2020-12-24 Terrain construction method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011556758.5A CN114677482B (en) 2020-12-24 2020-12-24 Terrain construction method and equipment

Publications (2)

Publication Number Publication Date
CN114677482A true CN114677482A (en) 2022-06-28
CN114677482B CN114677482B (en) 2022-12-20

Family

ID=82070103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011556758.5A Active CN114677482B (en) 2020-12-24 2020-12-24 Terrain construction method and equipment

Country Status (1)

Country Link
CN (1) CN114677482B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160005222A1 (en) * 2013-03-12 2016-01-07 Mitsubishi Electric Corporation Three-dimensional information processing device
CN107358649A (en) * 2017-06-07 2017-11-17 腾讯科技(深圳)有限公司 The treating method and apparatus of terrain file
CN108140254A (en) * 2015-09-25 2018-06-08 微软技术许可有限责任公司 3D models are generated from map datum
CN111508054A (en) * 2020-04-14 2020-08-07 网易(杭州)网络有限公司 Terrain construction method, device and equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160005222A1 (en) * 2013-03-12 2016-01-07 Mitsubishi Electric Corporation Three-dimensional information processing device
CN108140254A (en) * 2015-09-25 2018-06-08 微软技术许可有限责任公司 3D models are generated from map datum
CN107358649A (en) * 2017-06-07 2017-11-17 腾讯科技(深圳)有限公司 The treating method and apparatus of terrain file
CN111508054A (en) * 2020-04-14 2020-08-07 网易(杭州)网络有限公司 Terrain construction method, device and equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
星河太守: "ue4读取灰度图生成三维地形mesh", 《博客园》 *

Also Published As

Publication number Publication date
CN114677482B (en) 2022-12-20

Similar Documents

Publication Publication Date Title
US11270497B2 (en) Object loading method and apparatus, storage medium, and electronic device
CN107358649B (en) Processing method and device of terrain file
CN109377546B (en) Virtual reality model rendering method and device
CN109685909B (en) Image display method, image display device, storage medium and electronic device
CN112241993B (en) Game image processing method and device and electronic equipment
CN111111167B (en) Sound effect playing method and device in game scene and electronic device
CN112675545B (en) Method and device for displaying surface simulation picture, storage medium and electronic equipment
CN111773688B (en) Flexible object rendering method and device, storage medium and electronic device
CN110930484B (en) Animation configuration method and device, storage medium and electronic device
CN112206535A (en) Rendering display method and device of virtual object, terminal and storage medium
CN112132936A (en) Picture rendering method and device, computer equipment and storage medium
CN111784817A (en) Shadow display method and device, storage medium and electronic device
WO2022127275A1 (en) Method and device for model switching, electronic device, and storage medium
CN109697748A (en) Model compression processing method, model pinup picture processing method device, storage medium
CN114677482B (en) Terrain construction method and equipment
US20230326129A1 (en) Method and apparatus for storing visibility data of three-dimensional model, device, and storage medium
CN112419430A (en) Animation playing method and device and computer equipment
CN111462343B (en) Data processing method and device, electronic equipment and storage medium
CN110555916A (en) Terrain editing method and device for virtual scene, storage medium and electronic equipment
CN114255312A (en) Processing method and device of vegetation image and electronic equipment
CN103733221B (en) Image blurring by what inseparable FIR filter was divided
CN114565709A (en) Data storage management method, object rendering method and device
US20180276878A1 (en) System and method for rendering shadows for a virtual environment
CN110728750B (en) Intelligent driving environment live-action modeling method, system, terminal and storage medium
CN108553902A (en) A kind of transform method of the multi-dimension material based on UE engines

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
GR01 Patent grant
GR01 Patent grant