CN112569602A - Method and device for constructing terrain in virtual scene - Google Patents

Method and device for constructing terrain in virtual scene Download PDF

Info

Publication number
CN112569602A
CN112569602A CN202011562531.1A CN202011562531A CN112569602A CN 112569602 A CN112569602 A CN 112569602A CN 202011562531 A CN202011562531 A CN 202011562531A CN 112569602 A CN112569602 A CN 112569602A
Authority
CN
China
Prior art keywords
terrain
target
triangular patch
vertex
processed
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
CN202011562531.1A
Other languages
Chinese (zh)
Other versions
CN112569602B (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.)
Zhuhai Kingsoft Online Game Technology Co Ltd
Original Assignee
Zhuhai Kingsoft Online Game 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 Zhuhai Kingsoft Online Game Technology Co Ltd filed Critical Zhuhai Kingsoft Online Game Technology Co Ltd
Priority to CN202011562531.1A priority Critical patent/CN112569602B/en
Publication of CN112569602A publication Critical patent/CN112569602A/en
Application granted granted Critical
Publication of CN112569602B publication Critical patent/CN112569602B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • 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
    • 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
    • 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/66Methods for processing data by generating or executing the game program for rendering three dimensional images

Landscapes

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

Abstract

The present specification provides a method and an apparatus for constructing a terrain in a virtual scene, wherein the method comprises: receiving a processing instruction of a terrain to be processed, wherein the processing instruction comprises processing data; processing the terrain to be processed based on the processing data, and determining grid data of a target terrain grid corresponding to the processed terrain, wherein the target terrain grid comprises at least one triangular patch, and the grid data comprises vertex coordinates and texture coordinates of each vertex, a triangle drawing sequence and a normal of the at least one triangular patch; constructing a target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence and the normal of at least one triangular patch; and rendering the target terrain grid based on the texture coordinates to obtain and display a rendered target terrain model. By the method, the terrain can be constructed according to the requirements of users, various terrains can be constructed, and the flexibility of terrain construction is improved.

Description

Method and device for constructing terrain in virtual scene
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for constructing a terrain in a virtual scene.
Background
With the increasing diversification of game functions and the increasing scale of three-dimensional games, terrain construction in game scenes becomes an important part in scene construction, but during the game process, terrain may change due to the operation of a player, and in this case, the terrain after the change needs to be reconstructed, and the terrain after the change needs to be rendered and displayed, so as to provide better game effects for users. For example, a player may dig a pit in a game, and the device may render the pit on the floor.
Therefore, a method that can construct terrain in a virtual scene is needed.
Disclosure of Invention
In view of this, the present specification provides a method for constructing a terrain in a virtual scene. The present specification also relates to an apparatus for constructing a terrain in a virtual scene, a computing device, and a computer-readable storage medium, which are used for solving the technical defects in the prior art.
According to a first aspect of embodiments of the present specification, there is provided a method for constructing a terrain in a virtual scene, including:
receiving a processing instruction of a terrain to be processed, wherein the processing instruction comprises processing data;
processing the terrain to be processed based on the processing data, and determining grid data of a target terrain grid corresponding to the processed terrain, wherein the target terrain grid is a part of the processed terrain grid, which is different from the part of the processed terrain grid, of the processed terrain, the target terrain grid comprises at least one triangular patch, and the grid data comprises texture coordinates, vertex coordinates of each vertex, a triangle drawing sequence of the at least one triangular patch and a normal;
constructing the target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence and the normal of the at least one triangular patch;
and rendering the target terrain grid based on the texture coordinates to obtain and display a rendered target terrain model.
Optionally, the processing data includes a center coordinate, a first distance in a horizontal direction, a second distance, and a third distance in a vertical direction, and the processing the terrain to be processed based on the processing data includes:
determining a target terrain model to be removed in the terrain to be processed based on the first distance, the second distance and the third distance by taking a point corresponding to the central coordinate as a center;
and deleting the target terrain model from the terrain to be processed to obtain the processed terrain.
Optionally, the determining the grid data of the target terrain grid corresponding to the processed terrain includes:
determining vertex coordinates for each vertex in the target terrain mesh based on the center coordinates, the first distance, the second distance, and the third distance;
determining at least one triangular patch included by the target terrain mesh;
determining a normal and a triangle drawing sequence of the at least one triangular patch based on a position of each triangular patch in the target terrain mesh;
determining the texture coordinate based on a mapping relation between the vertex coordinate of the fusion map of the target terrain mesh and the vertex coordinate of the vertex of the target terrain mesh;
and taking the texture coordinates, the vertex coordinates of each vertex, the triangle drawing sequence of the at least one triangular patch and the normal as the grid data of the target terrain grid.
Optionally, the constructing the target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence of the at least one triangular patch, and the normal includes:
determining vertex coordinates of vertices included in each of the at least one triangular patch based on the triangle drawing sequence of the at least one triangular patch;
constructing each triangular patch based on the vertex coordinates of the vertex included by each triangular patch, the triangle drawing sequence of each triangular patch and the normal of each triangular patch to obtain at least one triangular patch;
constructing the target terrain mesh based on the at least one triangular patch.
Optionally, constructing each triangular patch based on the vertex coordinates of the vertices included in each triangular patch, the triangle drawing sequence of each triangular patch, and the normal of each triangular patch includes:
sequencing the vertexes of the target triangular patch based on a triangular drawing sequence of the target triangular patch to obtain a vertex sequence of the target triangular patch, wherein the target triangular patch is any triangular patch of the at least one triangular patch;
and according to the vertex sequence of the target triangular patch, constructing the target triangular patch based on the vertex coordinates of the vertices included by the target triangular patch and the normal of the target triangular patch.
Optionally, the constructing the target terrain mesh based on the at least one triangular patch includes:
determining the position relation between any two triangular patches in the at least one triangular patch based on the vertex coordinates of the vertexes included in each triangular patch;
and splicing the at least one triangular patch based on the determined position relation to obtain the target terrain mesh.
Optionally, the method further comprises:
and if the position of the target terrain grid comprises a target object, rendering and displaying the target object.
According to a second aspect of embodiments herein, there is provided an apparatus for constructing a terrain in a virtual scene, comprising:
the processing module is configured to receive a processing instruction of a terrain to be processed, wherein the processing instruction comprises processing data;
a determining module configured to process the terrain to be processed based on the processing data, and determine mesh data of a target terrain mesh corresponding to the processed terrain, wherein the target terrain mesh is a different part of the terrain mesh of the processed terrain from the terrain mesh of the processed terrain, the target terrain mesh includes at least one triangular patch, and the mesh data includes texture coordinates, vertex coordinates of each vertex, a triangle drawing sequence of the at least one triangular patch, and a normal;
a mesh construction module configured to construct the target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence of the at least one triangular patch, and a normal;
and the display module is configured to render the target terrain grid based on the texture coordinates, obtain a rendered target terrain model and display the rendered target terrain model.
According to a third aspect of embodiments herein, there is provided a computing device comprising:
a memory and a processor;
the memory is to store computer-executable instructions, and the processor is to execute the computer-executable instructions to:
receiving a processing instruction of a terrain to be processed, wherein the processing instruction comprises processing data;
processing the terrain to be processed based on the processing data, and determining grid data of a target terrain grid corresponding to the processed terrain, wherein the target terrain grid is a part of the processed terrain grid, which is different from the part of the processed terrain grid, of the processed terrain, the target terrain grid comprises at least one triangular patch, and the grid data comprises texture coordinates, vertex coordinates of each vertex, a triangle drawing sequence of the at least one triangular patch and a normal;
constructing the target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence and the normal of the at least one triangular patch;
and rendering the target terrain grid based on the texture coordinates to obtain and display a rendered target terrain model.
According to a fourth aspect of embodiments herein, there is provided a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the method of constructing terrain in a virtual scene.
The method for constructing the terrain in the virtual scene provided by the specification receives a processing instruction of the terrain to be processed, wherein the processing instruction can comprise processing data. Processing a terrain to be processed based on processing data, and determining grid data of a target terrain grid corresponding to the processed terrain, wherein the target terrain grid is a different part of the processed terrain grid from the processed terrain grid, the target terrain grid comprises at least one triangular patch, and the grid data comprises texture coordinates, vertex coordinates of each vertex, a triangle drawing sequence of the at least one triangular patch and a normal; constructing the target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence and the normal of the at least one triangular patch; and rendering the target terrain grid based on the texture coordinates to obtain and display a rendered target terrain model. By the method, the terrain can be constructed according to the requirements of the user, various terrains can be constructed, the flexibility of terrain construction is improved, the participation degree of the user is increased, and the game experience of the user is further improved.
Drawings
Fig. 1 is a flowchart of a method for constructing a terrain in a virtual scene according to an embodiment of the present disclosure;
FIG. 2 is a schematic illustration of a cross-sectional view of a processed terrain provided by an embodiment of the present description;
FIG. 3 is a schematic illustration of a cross-sectional view of a processed terrain provided in another embodiment of the present description;
FIG. 4 is a schematic diagram of a target terrain model provided in one embodiment of the present description;
FIG. 5 is a process flow diagram of a method for building terrain in a virtual scene applied to a game excavation scene according to an embodiment of the present specification;
fig. 6 is a schematic structural diagram of an apparatus for constructing a terrain in a virtual scene according to an embodiment of the present specification;
fig. 7 is a block diagram of a computing device according to an embodiment of the present disclosure.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present description. This description may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein, as those skilled in the art will be able to make and use the present disclosure without departing from the spirit and scope of the present disclosure.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first can also be referred to as a second and, similarly, a second can also be referred to as a first without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
First, the noun terms to which one or more embodiments of the present specification relate are explained.
The terrain to be processed is: the virtual scene has been constructed and the user selects the terrain on which the processing operation is to be performed. Wherein the processing operation may be a digging operation.
Processing data: data required for processing the terrain to be processed. For example, the process data may be depth, length, and width of the excavation.
Target terrain grid: the processed terrain Mesh which needs to be reconstructed and rendered may also be referred to as Mesh. For example, the terrain to be processed is a cube having a side length of 20 m, and the processing of the terrain to be processed is to dig a cube-shaped pit having a side length of 2 m in the terrain to be processed, the target terrain grid includes a terrain grid having four side surfaces and a bottom surface among the cube-shaped pits having a side length of 2 m.
Mesh: mesh is a component in Unity (game engine), called a grid component. Generally speaking, Mesh refers to a Mesh of a model, a 3D (Three Dimensional) model is formed by splicing polygons, and a complex polygon is actually formed by splicing a plurality of triangular patches. The surface of a 3D model is composed of a plurality of triangular patches connected to each other. In the three-dimensional space, the set of points and edges of the triangle that constitute these triangle patches is the Mesh.
Vertex coordinates: the spatial coordinates of each vertex in the target terrain mesh.
Texture coordinates: and coordinates of pixel points in the fusion map of the target terrain grid in the target terrain grid.
Triangle drawing sequence: the target terrain mesh is composed of a plurality of triangular patches, and a triangle drawing sequence is the sequence of three vertexes in each triangular patch.
Normal line: the normal of each triangular patch in the target terrain mesh.
In the present specification, a method for constructing a terrain in a virtual scene is provided, and the present specification relates to an apparatus for constructing a terrain in a virtual scene, a computing device, and a computer-readable storage medium, which are described in detail in the following embodiments one by one.
Fig. 1 is a flowchart illustrating a method for constructing a terrain in a virtual scene according to an embodiment of the present specification, which specifically includes the following steps:
step 102, receiving a processing instruction of a terrain to be processed, wherein the processing instruction comprises processing data.
In the process of playing the game by the user, if the user wants to modify the terrain in the game scene, the digging operation can be carried out in the game, and different terrains are constructed in the game scene through digging. As an example, the terrain to be processed is terrain requiring a digging operation to be performed.
As an example, a terrain processing option may be displayed on a screen of the computing device, a plurality of shapes to be selected may be presented in response to a trigger operation on the terrain processing option, and a parameter of a target shape in the plurality of shapes to be selected may be set in response to a selection operation on the target shape, so that it may be determined that a processing instruction of a terrain to be processed is received, and the processing instruction may include the parameter of the target shape, which is processing data.
For example, the terrain processing option displayed on the screen may be "build", and after the user clicks the "build" option with a mouse, a plurality of shapes to be selected, such as a cube, a sphere, an irregular shape, etc., may be displayed on the screen, and if the user wants to dig a pit in the cube on the terrain to be processed, the target shape of the cube may be selected with the mouse, and the length, the width, and the height of the cube may be set.
Therefore, the shape of the dug land and the length, the width and the depth of the dug land can be selected by the user, the fixed length, the fixed width and the fixed height set by the developer can be not limited, the participation sense of the user can be increased, terrains in various shapes can be constructed, the interest of the game is improved, and the game experience of the user is further improved.
And 104, processing the terrain to be processed based on the processing data, and determining grid data of a target terrain grid corresponding to the processed terrain.
The target terrain mesh is a different part of the processed terrain mesh from the terrain mesh of the terrain to be processed, the target terrain mesh comprises at least one triangular patch, and the mesh data can comprise texture coordinates, vertex coordinates of each vertex, a triangle drawing sequence of the at least one triangular patch and a normal.
In an implementation, the processing data may include the center coordinates, the first distance in the horizontal direction, the second distance, and the third distance in the vertical direction. In this case, the specific implementation of processing the terrain to be processed based on the processing data may include: determining a target terrain model to be removed in the terrain to be processed based on the first distance, the second distance and the third distance by taking a point corresponding to the central coordinate as a center; and deleting the target terrain model from the terrain to be processed to obtain the processed terrain.
As an example, the center coordinates may be coordinates of a center point of the terrain to be processed.
That is, processing the terrain to be processed may be understood as determining a target terrain model to be deleted from the terrain to be processed based on the processing data, and deleting the target terrain model from the terrain to be processed, that is, stopping displaying the target terrain model, so as to obtain the processed terrain.
In some embodiments, the point corresponding to the center coordinate may be used as an origin, the X axis and the Y axis may be configured in the horizontal direction, and the Z axis may be configured in the vertical direction, and then the first distance in the horizontal direction in the processed data may be a distance in the X axis direction, the second distance in the horizontal direction may be a distance in the Y axis direction, and the third distance in the vertical direction may be a distance in the Z axis direction. In this manner, the size and depth of the pit that the user wants to dig can be clearly determined, facilitating the computing device to process the terrain to be processed based on the processing data.
As an example, referring to fig. 2, assuming that the target shape selected by the user is a cube, the shaded portion in fig. 2 is a cross-sectional view of the target terrain model to be removed, and the center coordinate may be the coordinate of the center point O of the terrain to be processed. Assuming that the first distance is 1, the second distance is 1, and the third distance is 2, it may be determined that the target terrain model is a cube whose length, width, and height are 2. After the cube is deleted from the terrain to be processed, a cross-sectional view of the terrain to be processed can be obtained as shown in fig. 2.
As another example, referring to fig. 3, assuming that the target shape selected by the user is a sphere, the shaded portion in fig. 3 is a cross-sectional view of the target terrain model to be removed, and the center coordinate may be the coordinate of the center point O of the terrain to be processed. In this case, assuming that the first distance, the second distance, and the third distance are all 1, it may be determined that the target terrain model is a hemisphere with a radius of 1. After the hemisphere is deleted from the terrain to be processed, a cross-sectional view of the terrain to be processed can be obtained and is shown in fig. 3.
In this way, the computing device can process the terrain to be processed based on the requirements of the user to obtain the terrain shape desired by the user, and the flexibility of the land digging game is improved.
In implementation, after processing the terrain to be processed, determining a specific implementation of the mesh data of the target terrain mesh corresponding to the processed terrain may include: determining vertex coordinates for each vertex in the target terrain mesh based on the center coordinates, the first distance, the second distance, and the third distance; determining at least one triangular patch included by the target terrain mesh; determining a normal and a triangle drawing sequence of the at least one triangular patch based on a position of each triangular patch in the target terrain mesh; determining the texture coordinate based on a mapping relation between the vertex coordinate of the fusion map of the target terrain mesh and the vertex coordinate of the vertex of the target terrain mesh; and taking the texture coordinates, the vertex coordinates of each vertex, the triangle drawing sequence of the at least one triangular patch and the normal as the grid data of the target terrain grid.
In some embodiments, referring to fig. 4, assuming that the shape of the target terrain model is a cube, and the first and second distances are 1 and the third distance is 2, i.e., the side length of the cube is 2, the vertices of the cube are numbered as vertices 0, 1, 2, 3, 4, 5, 6, and 7, respectively. With the center point of the top surface of the cube as the origin of coordinates, it can be determined that the coordinates of vertex 0 are (-1, -1, 2), the coordinates of vertex 1 are (1, -1, 2), the coordinates of vertex 2 are (1, 1, 2), the coordinates of vertex 3 are (-1, 1, 2), the coordinates of vertex 4 are (-1, -1, 0), the coordinates of vertex 5 are (1, -1, 0), the coordinates of vertex 6 are (1, 1, 0), and the coordinates of vertex 7 are (-1, 1, 0).
In some embodiments, continuing with the above example, assuming that the terrain to be processed is a cube with a side length of 20, if the target terrain model is a cube with a side length of 2, the target terrain mesh includes terrain meshes of four sides and a bottom of the target terrain model. Each of the four sides and the bottom of the cube is divided into two triangles, then 10 triangular patches may be included in the target terrain mesh.
In some embodiments, with continued reference to fig. 4, the normals of the two triangular patches included in the left side of the cube are positive X-axis directions, the normals of the two triangular patches included in the right side are negative X-axis directions, the normals of the two triangular patches included in the front side are positive Y-axis directions, the normals of the two triangular patches included in the back side are negative Y-axis directions, and the normals of the two triangular patches included in the bottom side are negative Z-axis directions. Since the normal of the triangular patch and the triangle drawing sequence of the triangular patch satisfy the left-hand spiral theorem, it can be determined that the triangle drawing sequences of the two triangular patches included in the front side are (0, 1, 5) and (0, 5, 4), the triangle drawing sequences of the two triangular patches included in the rear side are (3, 7, 6) and (3, 7, 6, 2), the triangle drawing sequences of the two triangular patches included in the left side are (0, 4, 7) and (0, 7, 3), the triangle drawing sequences of the two triangular patches included in the right side are (1, 2, 6) and (1, 6, 5), and the triangle drawing sequences of the two triangular patches included in the bottom side are (0, 3, 2) and (0, 2, 1), respectively.
In some embodiments, a fusion map of the target terrain mesh may be obtained, where the fusion map includes a plurality of pixel points, a mapping relationship between vertex coordinates of the fusion map and vertex coordinates of vertices of the target terrain mesh is predetermined, and coordinates, i.e., texture coordinates, of the plurality of pixel points in the fusion map in the target terrain mesh may be determined based on the coordinates of the plurality of pixel points in the fusion map.
Through the above manner, the vertex coordinates and texture coordinates of 8 vertices in the target terrain mesh in fig. 4, the triangle drawing sequence of each of 10 triangle patches, and the normal of each triangle patch can be determined, and then the mesh data of the target terrain mesh is obtained. The target terrain grid is the terrain grid which needs to be reconstructed and rendered in the processed terrain, so that only the terrain grid which needs to be reconstructed and rendered can be determined, the whole processed terrain does not need to be reconstructed, and computing resources can be saved.
And 106, constructing the target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence and the normal of the at least one triangular patch.
In implementation, the specific implementation of this step may include: determining vertex coordinates of vertices included in each of the at least one triangular patch based on the triangle drawing sequence of the at least one triangular patch; constructing each triangular patch based on the vertex coordinates of the vertex included by each triangular patch, the triangle drawing sequence of each triangular patch and the normal of each triangular patch to obtain at least one triangular patch; constructing the target terrain mesh based on the at least one triangular patch.
That is, since the vertex composing each triangular patch is included in the triangle drawing sequence of each triangular patch, the vertex coordinates of the vertex included in each triangular patch can be determined with the vertex coordinates of the vertex in the target terrain mesh being known. And then, according to a triangle drawing sequence of each triangular patch, the vertex coordinates of the vertex included by each triangular patch and the normal of each triangular patch, constructing each triangular patch, and constructing the target terrain mesh based on each triangular patch.
In some embodiments, constructing a specific implementation of each triangular patch based on the vertex coordinates of the vertices included in each triangular patch, the triangle rendering sequence of each triangular patch, and the normal of each triangular patch may include: sequencing the vertexes of the target triangular patch based on a triangular drawing sequence of the target triangular patch to obtain a vertex sequence of the target triangular patch, wherein the target triangular patch is any triangular patch of the at least one triangular patch; and according to the vertex sequence of the target triangular patch, constructing the target triangular patch based on the vertex coordinates of the vertices included by the target triangular patch and the normal of the target triangular patch.
For example, referring to fig. 4, assuming that the target triangle patch is the front side and the triangle draws a triangle patch having a sequence of (0, 1, 5), it can be determined that the vertex sequence of the target triangle patch is 0, 1, and 5, and the coordinates of vertex 0 are (-1, -1, 2), the coordinates of vertex 1 are (1, -1, 2), and the coordinates of vertex 5 are (1, -1, 0). The target triangular patch may be constructed in accordance with the vertex sequence based on the vertex coordinates of the three vertices and the normal of the target triangular patch.
In some embodiments, the specific implementation of constructing the target terrain mesh based on the at least one triangular patch may include: determining the position relation between any two triangular patches in the at least one triangular patch based on the vertex coordinates of the vertexes included in each triangular patch; and splicing the at least one triangular patch based on the determined position relation to obtain the target terrain mesh.
That is to say, after each triangular patch in the target terrain mesh is constructed, the position relationship between the triangular patches can be determined according to the vertex coordinates of the triangular patches, and the triangular patches are spliced based on the relationship between the triangular patches to obtain the target terrain mesh.
And 108, rendering the target terrain grid based on the texture coordinates to obtain and display a rendered target terrain model.
In some embodiments, rendering the triangle patches may be divided into rendering the front side and rendering the back side, so that the direction of the normal line generally points to the surface to be rendered of each triangle patch, and the surface to be rendered of each triangle patch is already determined by the normal line in the process of constructing the target terrain mesh. In this step, a color value of a corresponding coordinate can be acquired from the fusion map based on the coordinate of each pixel point in the texture coordinate, the target terrain grid is rendered by the acquired color value, and a rendered target terrain model is obtained and displayed so as to visually present the effect after digging the ground.
Further, if the position of the target terrain grid comprises a target object, rendering and displaying the target object. For example, referring to fig. 2, if water is provided in advance when the ground is dug to a certain depth, the water may be rendered and displayed. Furthermore, the game role can be controlled to swim, dive and the like in water, so that the interest of the game can be increased, and the game experience of a user can be improved.
It should be noted that the target object may be any object, and fig. 2 illustrates water as an example. In other embodiments, the target object may also be an ore, a magma, or the like. The embodiments of the present application do not limit this. In addition, after the ore or the magma is dug, the ore or the magma may also be displayed and may correspond to the game logic of the ore or the magma.
The method for constructing the terrain in the virtual scene provided by the specification receives a processing instruction of the terrain to be processed, wherein the processing instruction can comprise processing data. Processing a terrain to be processed based on processing data, and determining grid data of a target terrain grid corresponding to the processed terrain, wherein the target terrain grid is a different part of the processed terrain grid from the processed terrain grid, the target terrain grid comprises at least one triangular patch, and the grid data comprises texture coordinates, vertex coordinates of each vertex, a triangle drawing sequence of the at least one triangular patch and a normal; constructing the target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence and the normal of the at least one triangular patch; and rendering the target terrain grid based on the texture coordinates to obtain and display a rendered target terrain model. By the method, the terrain can be constructed according to the requirements of the user, various terrains can be constructed, the flexibility of terrain construction is improved, the participation degree of the user is increased, and the game experience of the user is further improved.
The method for constructing a terrain in a virtual scene is further described below with reference to fig. 5, by taking an application of the method for constructing a terrain in a virtual scene provided in the present specification in a game digging scene as an example. Fig. 5 shows a processing flow chart of a method for constructing a terrain in a virtual scene, which is applied to a game excavation scene and provided in an embodiment of the present specification, and in the embodiment corresponding to fig. 5, taking a model in which a target terrain model is a cube as an example, the method may specifically include the following steps:
step 502, a land excavation instruction for a terrain in a game scene is received, wherein the land excavation instruction comprises processing data.
Wherein the processing data may include the center coordinates, the first distance in the horizontal direction, the second distance, and the third distance in the vertical direction. The size and depth of the pit that the user wants to dig can be determined by this processing data.
And step 504, determining a cubic terrain model to be excavated in the terrain to be processed based on the first distance, the second distance and the third distance by taking a point corresponding to the central coordinate as a center.
And step 506, digging the cube terrain model from the terrain to be processed to obtain the terrain processed by digging.
It should be noted that, for specific implementation of step 504 and step 506, reference may be made to related description of processing the terrain to be processed based on the processing data in step 104, and details of this embodiment are not described herein again.
And step 508, determining the vertex coordinates of each vertex in the square terrain mesh based on the center coordinates, the first distance, the second distance and the third distance.
The cubic terrain grid is a part of the terrain grid of the excavated terrain, which is different from the part of the terrain grid of the terrain to be processed.
For example, in the case where the target terrain model is a cube-shaped terrain model, the vertex coordinates of each of the 8 vertices of the cube may be determined.
And step 510, determining ten triangular patches included in the cubic terrain mesh, and determining normals and triangle drawing sequences of the ten triangular patches based on the position of each triangular patch in the cubic terrain mesh.
Referring to fig. 4, the topographic grids of the four side surfaces and the bottom surface of the cube in fig. 4 are cube topographic grids. The cube terrain mesh includes five faces, each of which may include two triangular patches, and then includes ten triangular patches in the cube terrain mesh.
In addition, in fig. 4, the normals of the two triangular patches included in the left side surface of the cube are positive directions of the X axis, the normals of the two triangular patches included in the right side surface are negative directions of the X axis, the normals of the two triangular patches included in the front side surface are positive directions of the Y axis, the normals of the two triangular patches included in the rear side surface are negative directions of the Y axis, and the normals of the two triangular patches included in the bottom surface are negative directions of the Z axis. Since the normal of the triangular patch and the triangle drawing sequence of the triangular patch satisfy the left-hand spiral theorem, it can be determined that the triangle drawing sequences of the two triangular patches included in the front side are (0, 1, 5) and (0, 5, 4), the triangle drawing sequences of the two triangular patches included in the rear side are (3, 7, 6) and (3, 7, 6, 2), the triangle drawing sequences of the two triangular patches included in the left side are (0, 4, 7) and (0, 7, 3), the triangle drawing sequences of the two triangular patches included in the right side are (1, 2, 6) and (1, 6, 5), and the triangle drawing sequences of the two triangular patches included in the bottom side are (0, 3, 2) and (0, 2, 1), respectively.
And step 512, determining texture coordinates based on the mapping relation between the vertex coordinates of the fusion map of the cubic terrain mesh and the vertex coordinates of the vertex of the cubic terrain mesh.
And step 514, taking the texture coordinates, the vertex coordinates of each vertex, the triangle drawing sequence of the ten triangular patches and the normal line as grid data of the cubic terrain grid.
It should be noted that, for specific implementation of the above steps 508 to 514, reference may be made to related description of determining the mesh data of the target terrain mesh corresponding to the processed terrain in step 104, and this embodiment is not described herein again.
In step 516, vertex coordinates of vertices included in each triangular patch are determined based on the triangle drawing sequences of the ten triangular patches.
Since the triangle drawing sequence of each triangular patch includes the numbers of three vertices, the vertex coordinates of the vertices included in each triangular patch can be determined with the vertex coordinates of the vertices in the square terrain mesh known.
And 518, constructing each triangular patch based on the vertex coordinates of the vertex included by each triangular patch, the triangle drawing sequence of each triangular patch and the normal of each triangular patch to obtain ten triangular patches.
And sequencing the vertexes of the target triangular patch based on the triangular drawing sequence of the target triangular patch to obtain the vertex sequence of the target triangular patch, wherein the target triangular patch is any one of the ten triangular patches. According to the vertex sequence of the target triangular patch, based on the vertex coordinates of the vertices included in the target triangular patch and the normal of the target triangular patch, the target triangular patch can be constructed.
And step 520, constructing a cubic terrain mesh based on the ten triangular patches.
And determining the position relation between any two triangular patches in the ten triangular patches based on the vertex coordinates of the vertexes included by each triangular patch, and splicing the ten triangular patches based on the determined position relation to obtain the square terrain mesh.
It should be noted that, for specific implementation of steps 516 to 520, reference may be made to the related description of step 106, and this embodiment is not described herein again.
And 522, rendering the cube terrain grid based on the texture coordinates, and obtaining and displaying a rendered cube terrain model.
It should be noted that, for specific implementation of this step, reference may be made to the related description of step 108, and this embodiment is not described herein again.
At step 524, if the square terrain grid includes water or other objects, the water or other objects may be rendered and displayed.
For example, the other objects may be ores, magma, pre-set treasures, and the like.
For example, if water or ore is dug during the process of digging the ground, the water or ore needs to be displayed.
In step 526, the game character can be controlled to swim or dive in the water under the condition that the water is displayed in the screen.
The method for constructing the terrain in the virtual scene provided by the specification receives a processing instruction of the terrain to be processed, wherein the processing instruction can comprise processing data. Processing a terrain to be processed based on processing data, and determining grid data of a target terrain grid corresponding to the processed terrain, wherein the target terrain grid is a different part of the processed terrain grid from the processed terrain grid, the target terrain grid comprises at least one triangular patch, and the grid data comprises texture coordinates, vertex coordinates of each vertex, a triangle drawing sequence of the at least one triangular patch and a normal; constructing the target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence and the normal of the at least one triangular patch; and rendering the target terrain grid based on the texture coordinates to obtain and display a rendered target terrain model. By the method, the terrain can be constructed according to the requirements of the user, various terrains can be constructed, the flexibility of terrain construction is improved, the participation degree of the user is increased, and the game experience of the user is further improved.
Corresponding to the above method embodiment, the present specification further provides an embodiment of an apparatus for constructing a terrain in a virtual scene, and fig. 6 shows a schematic structural diagram of an apparatus for constructing a terrain in a virtual scene provided in an embodiment of the present specification. As shown in fig. 6, the apparatus includes:
a receiving module 602, configured to receive a processing instruction of a terrain to be processed, where the processing instruction includes processing data;
a determining module 604, configured to process the terrain to be processed based on the processing data, and determine mesh data of a target terrain mesh corresponding to the processed terrain, where the target terrain mesh is a different part of the terrain mesh of the processed terrain from the terrain mesh of the processed terrain, the target terrain mesh includes at least one triangular patch, and the mesh data includes texture coordinates, vertex coordinates of each vertex, a triangle drawing sequence of the at least one triangular patch, and a normal;
a mesh construction module 606 configured to construct the target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence and the normal of the at least one triangular patch;
and a display module 608 configured to render the target terrain mesh based on the texture coordinates, obtain a rendered target terrain model, and display the rendered target terrain model.
Optionally, the determining module 604 is configured to:
the processing data comprises a center coordinate, a first distance in the horizontal direction, a second distance and a third distance in the vertical direction, and a target terrain model to be removed in the terrain to be processed is determined based on the first distance, the second distance and the third distance by taking a point corresponding to the center coordinate as a center;
and deleting the target terrain model from the terrain to be processed to obtain the processed terrain.
Optionally, the determining module 604 is configured to:
determining vertex coordinates for each vertex in the target terrain mesh based on the center coordinates, the first distance, the second distance, and the third distance;
determining at least one triangular patch included by the target terrain mesh;
determining a normal and a triangle drawing sequence of the at least one triangular patch based on a position of each triangular patch in the target terrain mesh;
determining the texture coordinate based on a mapping relation between the vertex coordinate of the fusion map of the target terrain mesh and the vertex coordinate of the vertex of the target terrain mesh;
and taking the texture coordinates, the vertex coordinates of each vertex, the triangle drawing sequence of the at least one triangular patch and the normal as the grid data of the target terrain grid.
Optionally, the grid construction module 606 is configured to:
determining vertex coordinates of vertices included in each of the at least one triangular patch based on the triangle drawing sequence of the at least one triangular patch;
constructing each triangular patch based on the vertex coordinates of the vertex included by each triangular patch, the triangle drawing sequence of each triangular patch and the normal of each triangular patch to obtain at least one triangular patch;
constructing the target terrain mesh based on the at least one triangular patch.
Optionally, the grid construction module 606 is configured to:
sequencing the vertexes of the target triangular patch based on a triangular drawing sequence of the target triangular patch to obtain a vertex sequence of the target triangular patch, wherein the target triangular patch is any triangular patch of the at least one triangular patch;
and according to the vertex sequence of the target triangular patch, constructing the target triangular patch based on the vertex coordinates of the vertices included by the target triangular patch and the normal of the target triangular patch.
Optionally, the grid construction module 606 is configured to:
determining the position relation between any two triangular patches in the at least one triangular patch based on the vertex coordinates of the vertexes included in each triangular patch;
and splicing the at least one triangular patch based on the determined position relation to obtain the target terrain mesh.
Optionally, the display module 608 is further configured to:
and if the position of the target terrain grid comprises a target object, rendering and displaying the target object.
The method for constructing the terrain in the virtual scene provided by the specification receives a processing instruction of the terrain to be processed, wherein the processing instruction can comprise processing data. Processing a terrain to be processed based on processing data, and determining grid data of a target terrain grid corresponding to the processed terrain, wherein the target terrain grid is a different part of the processed terrain grid from the processed terrain grid, the target terrain grid comprises at least one triangular patch, and the grid data comprises texture coordinates, vertex coordinates of each vertex, a triangle drawing sequence of the at least one triangular patch and a normal; constructing the target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence and the normal of the at least one triangular patch; and rendering the target terrain grid based on the texture coordinates to obtain and display a rendered target terrain model. By the method, the terrain can be constructed according to the requirements of the user, various terrains can be constructed, the flexibility of terrain construction is improved, the participation degree of the user is increased, and the game experience of the user is further improved.
The above is a schematic scheme of an apparatus for constructing a terrain in a virtual scene according to this embodiment. It should be noted that the technical solution of the apparatus for constructing a terrain in a virtual scene is the same as the technical solution of the method for constructing a terrain in a virtual scene, and details of the technical solution of the apparatus for constructing a terrain in a virtual scene, which are not described in detail, can be referred to the description of the technical solution of the method for constructing a terrain in a virtual scene.
FIG. 7 illustrates a block diagram of a computing device 700 provided in accordance with one embodiment of the present description. The components of the computing device 700 include, but are not limited to, memory 710 and a processor 720. Processor 720 is coupled to memory 710 via bus 730, and database 750 is used to store data.
Computing device 700 also includes access device 740, access device 740 enabling computing device 700 to communicate via one or more networks 760. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. Access device 740 may include one or more of any type of network interface, e.g., a Network Interface Card (NIC), wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the above-described components of computing device 700, as well as other components not shown in FIG. 7, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 7 is for purposes of example only and is not limiting as to the scope of the present description. Those skilled in the art may add or replace other components as desired.
Computing device 700 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smartphone), wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 700 may also be a mobile or stationary server.
Wherein processor 720 is configured to execute the following computer-executable instructions:
receiving a processing instruction of a terrain to be processed, wherein the processing instruction comprises processing data;
processing the terrain to be processed based on the processing data, and determining grid data of a target terrain grid corresponding to the processed terrain, wherein the target terrain grid is a part of the processed terrain grid, which is different from the part of the processed terrain grid, of the processed terrain, the target terrain grid comprises at least one triangular patch, and the grid data comprises texture coordinates, vertex coordinates of each vertex, a triangle drawing sequence of the at least one triangular patch and a normal;
constructing the target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence and the normal of the at least one triangular patch;
and rendering the target terrain grid based on the texture coordinates to obtain and display a rendered target terrain model.
The above is an illustrative scheme of a computing device of the present embodiment. It should be noted that the technical solution of the computing device and the technical solution of the above method for constructing a terrain in a virtual scene belong to the same concept, and details that are not described in detail in the technical solution of the computing device can be referred to the description of the technical solution of the above method for constructing a terrain in a virtual scene.
An embodiment of the present specification also provides a computer readable storage medium storing computer instructions that, when executed by a processor, are operable to:
receiving a processing instruction of a terrain to be processed, wherein the processing instruction comprises processing data;
processing the terrain to be processed based on the processing data, and determining grid data of a target terrain grid corresponding to the processed terrain, wherein the target terrain grid is a part of the processed terrain grid, which is different from the part of the processed terrain grid, of the processed terrain, the target terrain grid comprises at least one triangular patch, and the grid data comprises texture coordinates, vertex coordinates of each vertex, a triangle drawing sequence of the at least one triangular patch and a normal;
constructing the target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence and the normal of the at least one triangular patch;
and rendering the target terrain grid based on the texture coordinates to obtain and display a rendered target terrain model.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the above-mentioned method for constructing a terrain in a virtual scene, and details that are not described in detail in the technical solution of the storage medium can be referred to the description of the technical solution of the above-mentioned method for constructing a terrain in a virtual scene.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, etc. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present disclosure is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present disclosure. Further, those skilled in the art should also appreciate that the embodiments described in this specification are preferred embodiments and that acts and modules referred to are not necessarily required for this description.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present specification disclosed above are intended only to aid in the description of the specification. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the specification and its practical application, to thereby enable others skilled in the art to best understand the specification and its practical application. The specification is limited only by the claims and their full scope and equivalents.

Claims (10)

1. A method of constructing terrain in a virtual scene, the method comprising:
receiving a processing instruction of a terrain to be processed, wherein the processing instruction comprises processing data;
processing the terrain to be processed based on the processing data, and determining grid data of a target terrain grid corresponding to the processed terrain, wherein the target terrain grid is a part of the processed terrain grid, which is different from the part of the processed terrain grid, of the processed terrain, the target terrain grid comprises at least one triangular patch, and the grid data comprises texture coordinates, vertex coordinates of each vertex, a triangle drawing sequence of the at least one triangular patch and a normal;
constructing the target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence and the normal of the at least one triangular patch;
and rendering the target terrain grid based on the texture coordinates to obtain and display a rendered target terrain model.
2. A method of constructing terrain in a virtual scene as claimed in claim 1, wherein the processing data includes center coordinates, a first distance in a horizontal direction, a second distance, and a third distance in a vertical direction, and wherein processing the terrain to be processed based on the processing data includes:
determining a target terrain model to be removed in the terrain to be processed based on the first distance, the second distance and the third distance by taking a point corresponding to the central coordinate as a center;
and deleting the target terrain model from the terrain to be processed to obtain the processed terrain.
3. The method of constructing terrain in a virtual scene as claimed in claim 2, wherein said determining mesh data of a target terrain mesh corresponding to the processed terrain comprises:
determining vertex coordinates for each vertex in the target terrain mesh based on the center coordinates, the first distance, the second distance, and the third distance;
determining at least one triangular patch included by the target terrain mesh;
determining a normal and a triangle drawing sequence of the at least one triangular patch based on a position of each triangular patch in the target terrain mesh;
determining the texture coordinate based on a mapping relation between the vertex coordinate of the fusion map of the target terrain mesh and the vertex coordinate of the vertex of the target terrain mesh;
and taking the texture coordinates, the vertex coordinates of each vertex, the triangle drawing sequence of the at least one triangular patch and the normal as the grid data of the target terrain grid.
4. A method of constructing a terrain in a virtual scene as set forth in claim 1, wherein constructing the target terrain mesh based on vertex coordinates of each vertex, a triangle drawing sequence of the at least one triangular patch, and a normal comprises:
determining vertex coordinates of vertices included in each of the at least one triangular patch based on the triangle drawing sequence of the at least one triangular patch;
constructing each triangular patch based on the vertex coordinates of the vertex included by each triangular patch, the triangle drawing sequence of each triangular patch and the normal of each triangular patch to obtain at least one triangular patch;
constructing the target terrain mesh based on the at least one triangular patch.
5. The method of constructing a terrain in a virtual scene of claim 4, wherein constructing each triangular patch based on the vertex coordinates of the vertices each triangular patch includes, the triangle drawing sequence of each triangular patch, and the normal of each triangular patch comprises:
sequencing the vertexes of the target triangular patch based on a triangular drawing sequence of the target triangular patch to obtain a vertex sequence of the target triangular patch, wherein the target triangular patch is any triangular patch of the at least one triangular patch;
and according to the vertex sequence of the target triangular patch, constructing the target triangular patch based on the vertex coordinates of the vertices included by the target triangular patch and the normal of the target triangular patch.
6. A method of constructing terrain in a virtual scene as set forth in claim 4, wherein said constructing the target terrain mesh based on the at least one triangular patch comprises:
determining the position relation between any two triangular patches in the at least one triangular patch based on the vertex coordinates of the vertexes included in each triangular patch;
and splicing the at least one triangular patch based on the determined position relation to obtain the target terrain mesh.
7. A method of constructing terrain in a virtual scene as claimed in claim 1, wherein the method further comprises:
and if the position of the target terrain grid comprises a target object, rendering and displaying the target object.
8. An apparatus for constructing terrain in a virtual scene, the apparatus comprising:
the processing module is configured to receive a processing instruction of a terrain to be processed, wherein the processing instruction comprises processing data;
a determining module configured to process the terrain to be processed based on the processing data, and determine mesh data of a target terrain mesh corresponding to the processed terrain, wherein the target terrain mesh is a different part of the terrain mesh of the processed terrain from the terrain mesh of the processed terrain, the target terrain mesh includes at least one triangular patch, and the mesh data includes texture coordinates, vertex coordinates of each vertex, a triangle drawing sequence of the at least one triangular patch, and a normal;
a mesh construction module configured to construct the target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence of the at least one triangular patch, and a normal;
and the display module is configured to render the target terrain grid based on the texture coordinates, obtain a rendered target terrain model and display the rendered target terrain model.
9. A computing device, comprising:
a memory and a processor;
the memory is configured to store computer-executable instructions, and the processor is configured to execute the computer-executable instructions to implement the method of:
receiving a processing instruction of a terrain to be processed, wherein the processing instruction comprises processing data;
processing the terrain to be processed based on the processing data, and determining grid data of a target terrain grid corresponding to the processed terrain, wherein the target terrain grid is a part of the processed terrain grid, which is different from the part of the processed terrain grid, of the processed terrain, the target terrain grid comprises at least one triangular patch, and the grid data comprises texture coordinates, vertex coordinates of each vertex, a triangle drawing sequence of the at least one triangular patch and a normal;
constructing the target terrain mesh based on the vertex coordinates of each vertex, the triangle drawing sequence and the normal of the at least one triangular patch;
and rendering the target terrain grid based on the texture coordinates to obtain and display a rendered target terrain model.
10. A computer readable storage medium storing computer instructions which, when executed by a processor, carry out the steps of the method of constructing terrain in a virtual scene of any of claims 1 to 7.
CN202011562531.1A 2020-12-25 2020-12-25 Method and device for constructing terrain in virtual scene Active CN112569602B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011562531.1A CN112569602B (en) 2020-12-25 2020-12-25 Method and device for constructing terrain in virtual scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011562531.1A CN112569602B (en) 2020-12-25 2020-12-25 Method and device for constructing terrain in virtual scene

Publications (2)

Publication Number Publication Date
CN112569602A true CN112569602A (en) 2021-03-30
CN112569602B CN112569602B (en) 2022-08-30

Family

ID=75140552

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011562531.1A Active CN112569602B (en) 2020-12-25 2020-12-25 Method and device for constructing terrain in virtual scene

Country Status (1)

Country Link
CN (1) CN112569602B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113426131A (en) * 2021-07-02 2021-09-24 腾讯科技(成都)有限公司 Virtual scene picture generation method and device, computer equipment and storage medium
CN113546410A (en) * 2021-04-23 2021-10-26 网易(杭州)网络有限公司 Terrain model rendering method and device, electronic equipment and storage medium
CN113808243A (en) * 2021-09-23 2021-12-17 光线云(杭州)科技有限公司 Method and device for drawing deformable snow grid
WO2023273117A1 (en) * 2021-06-30 2023-01-05 完美世界(北京)软件科技发展有限公司 Terrain rendering method and apparatus, computer device, and storage medium
CN116758204A (en) * 2023-08-17 2023-09-15 腾讯科技(深圳)有限公司 Rendering processing method and related device based on line renderer

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050151735A1 (en) * 2003-12-20 2005-07-14 Martijn Boekhorst Method for determining the bounding voxelisation of a 3D polygon
CN108875936A (en) * 2018-06-11 2018-11-23 上海理工大学 The method for solving the minimum distance in three-dimensional space between any two polyhedron
CN109360260A (en) * 2018-10-22 2019-02-19 南京科远自动化集团股份有限公司 A kind of cut-away restructing algorithm of triangle gridding threedimensional model

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050151735A1 (en) * 2003-12-20 2005-07-14 Martijn Boekhorst Method for determining the bounding voxelisation of a 3D polygon
CN108875936A (en) * 2018-06-11 2018-11-23 上海理工大学 The method for solving the minimum distance in three-dimensional space between any two polyhedron
CN109360260A (en) * 2018-10-22 2019-02-19 南京科远自动化集团股份有限公司 A kind of cut-away restructing algorithm of triangle gridding threedimensional model

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113546410A (en) * 2021-04-23 2021-10-26 网易(杭州)网络有限公司 Terrain model rendering method and device, electronic equipment and storage medium
WO2023273117A1 (en) * 2021-06-30 2023-01-05 完美世界(北京)软件科技发展有限公司 Terrain rendering method and apparatus, computer device, and storage medium
CN113426131A (en) * 2021-07-02 2021-09-24 腾讯科技(成都)有限公司 Virtual scene picture generation method and device, computer equipment and storage medium
CN113426131B (en) * 2021-07-02 2023-06-30 腾讯科技(成都)有限公司 Picture generation method and device of virtual scene, computer equipment and storage medium
CN113808243A (en) * 2021-09-23 2021-12-17 光线云(杭州)科技有限公司 Method and device for drawing deformable snow grid
CN113808243B (en) * 2021-09-23 2023-09-15 光线云(杭州)科技有限公司 Drawing method and device for deformable snowfield grid
CN116758204A (en) * 2023-08-17 2023-09-15 腾讯科技(深圳)有限公司 Rendering processing method and related device based on line renderer
CN116758204B (en) * 2023-08-17 2024-05-03 腾讯科技(深圳)有限公司 Rendering processing method and related device based on line renderer

Also Published As

Publication number Publication date
CN112569602B (en) 2022-08-30

Similar Documents

Publication Publication Date Title
CN112569602B (en) Method and device for constructing terrain in virtual scene
US11270497B2 (en) Object loading method and apparatus, storage medium, and electronic device
CN107358649B (en) Processing method and device of terrain file
US8665267B2 (en) System and method for generating 3D surface patches from unconstrained 3D curves
CN109949693B (en) Map drawing method and device, computing equipment and storage medium
KR20080018404A (en) Computer readable recording medium having background making program for making game
CN111617483A (en) Map editing method and device
CN109697748A (en) Model compression processing method, model pinup picture processing method device, storage medium
CN111651055A (en) City virtual sand table display method and device, computer equipment and storage medium
CN110349267B (en) Method and device for constructing three-dimensional heat model
CN116385619B (en) Object model rendering method, device, computer equipment and storage medium
US20200143589A1 (en) Computer graphics method for terrain rendering
CN114092663B (en) Three-dimensional reconstruction method, device, equipment and medium for urban information model building
KR100693134B1 (en) Three dimensional image processing
CN112221150B (en) Ripple simulation method and device in virtual scene
CN110827303B (en) Image editing method and device for virtual scene
CN114529648A (en) Model display method, device, apparatus, electronic device and storage medium
Alonso et al. Real-time rendering and physics of complex dynamic terrains modeled as CSG trees of DEMs carved with spheres
Tousant et al. The Digital Restitution of Lot 3317: Using Underwater Image Based Modelling to Generate Value in Virtual Heritage Experiences
JP7368950B2 (en) Method and apparatus for efficient building footprint identification
CN117292075A (en) Spherical topography generation method and device, computing equipment and medium
CN113902871A (en) Immersion type rapid modeling method based on volume skeleton convolution curved surface
CN112604276A (en) Terrain modification method and terrain modification device
Raheja Assessing the Performance of Procedurally Generated Terrains Using Houdini’s Clustering Method
CN115861559A (en) Game scene terrain modeling method and device, electronic equipment and storage medium

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
CB02 Change of applicant information

Address after: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Applicant after: Zhuhai Jinshan Digital Network Technology Co.,Ltd.

Address before: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Applicant before: ZHUHAI KINGSOFT ONLINE GAME TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant