Model generation method, apparatus, and electronic device
By receiving instructions to generate a water area model, adjusting the mesh structure, and assigning preset materials, a complete water area model is automatically generated. This solves the problems of high labor costs and splicing gaps in existing technologies, and improves the quality of game graphics and scene presentation.
Patent Information
- Application Number
- CN202310291597.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-21
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-03-21
AI Technical Summary
Existing technologies require the manual creation and stitching of multiple fragment models when generating river and lake models in hexagonal grid game maps. This results in high labor costs and is prone to creating stitching gaps, affecting the quality of the game graphics.
By receiving instructions to generate a water area model, determining the target mesh cells, adjusting the mesh structure and assigning preset materials according to the water area type parameters, a complete water area model is automatically generated, avoiding seams between the meshes.
It reduced labor costs and improved the quality of game graphics. The generated models have no gaps, and the material settings enrich the expression of game scenes.
Smart Images

Figure CN116510291B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer graphics, and in particular to a model generation method, apparatus, and electronic device. Background Technology
[0002] In related technologies, rivers are usually generated in a hexagonal grid game map by splicing. This method requires artists to manually create multiple river segment models, and then select the target river segment model to splice together to obtain a complete river model. However, this method increases the labor cost of creating river segment models, and there may be gaps at the splicing points of two adjacent river segment models in the complete river model, which affects the quality of the game screen. Summary of the Invention
[0003] The purpose of this invention is to provide a model generation method, apparatus, and electronic device to generate lake and river models based on hexagonal meshes, and the models are complete without any splicing gaps, thereby improving the quality of game graphics.
[0004] In a first aspect, the present invention provides a model generation method, the method comprising: receiving a water area model generation instruction; wherein the water area model generation instruction includes: water area type parameters and water area location of the water area model to be generated; determining the target grid cell in a game map where the water area model to be generated is located based on the water area model generation instruction; wherein the game map is composed of multiple grid cells, each grid cell including multiple triangular grids; adjusting the grid structure of the target grid cell according to the water area type parameters of the water area model to be generated, to obtain the adjusted grid cell; determining the target triangular grid where the water area model to be generated is located from the adjusted grid cell, and assigning a preset water area material to the target triangular grid to generate the water area model to be generated in the game map.
[0005] Secondly, the present invention provides a model generation apparatus, comprising: an instruction receiving module for receiving a water area model generation instruction; wherein the water area model generation instruction includes: water area type parameters and water area location of the water area model to be generated; a mesh unit determination module for determining the target mesh unit where the water area model to be generated is located in a game map based on the water area model generation instruction; wherein the game map is composed of multiple mesh units, each mesh unit including multiple triangular meshes; a mesh structure adjustment module for adjusting the mesh structure of the target mesh unit according to the water area type parameters of the water area model to be generated, to obtain the adjusted mesh unit; and a material assignment module for determining the target triangular mesh where the water area model to be generated is located from the adjusted mesh unit, and assigning a preset water area material to the target triangular mesh to generate the water area model to be generated in the game map.
[0006] Thirdly, the present invention provides an electronic device including a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the above-described model generation method.
[0007] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the above-described model generation method.
[0008] The embodiments of the present invention bring the following beneficial effects:
[0009] This invention provides a model generation method, apparatus, and electronic device. First, it receives a water model generation instruction containing water type parameters and the location of the water body to be generated. Then, based on the water model generation instruction, it determines the target mesh cell in a game map where the water body to be generated is located. The game map consists of multiple mesh cells, each containing multiple triangular meshes. Next, according to the water type parameters of the water body to be generated, the mesh structure of the target mesh cell is adjusted to obtain an adjusted mesh cell. Then, the target triangular mesh where the water body to be generated is located is determined from the adjusted mesh cell, and a preset water material is assigned to the target triangular mesh to generate the water body model in the game map. This method can automatically generate a complete water body model by adjusting the mesh structure of the mesh cells in the game map according to the water model generation instruction, thus avoiding gaps at the stitching points when obtaining a water body model through splicing, thereby improving the quality of the game graphics. At the same time, this method eliminates the need to pre-create water body segment models for splicing, thus reducing significant labor costs.
[0010] Other features and advantages of the invention will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.
[0011] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0012] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0013] Figure 1 A flowchart of a model generation method provided in an embodiment of the present invention;
[0014] Figure 2 A flowchart of another model generation method provided in an embodiment of the present invention;
[0015] Figure 3 This is a schematic diagram of a hexagonal grid division provided in an embodiment of the present invention;
[0016] Figure 4 A schematic diagram of a hexagonal mesh structure provided in an embodiment of the present invention;
[0017] Figure 5 A schematic diagram showing different river flow directions within a grid cell provided in an embodiment of the present invention;
[0018] Figure 6 Add a schematic diagram to the vertices when the river directly passes through the grid cell, as provided in the embodiments of the present invention;
[0019] Figure 7 Add a schematic diagram to the vertices of the river flowing through the grid cells at an acute angle, as provided in the embodiments of the present invention;
[0020] Figure 8 Add a schematic diagram to the vertices of the river flowing through the grid cells at an obtuse angle, as provided in the embodiments of the present invention;
[0021] Figure 9 A flowchart of another model generation method provided in an embodiment of the present invention;
[0022] Figure 10 A schematic diagram of a lake model provided in an embodiment of the present invention;
[0023] Figure 11 This is a schematic diagram of the structure of a model generation device provided in an embodiment of the present invention;
[0024] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0026] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0027] In related technologies, rivers or lakes are typically generated in a hexagonal grid game map by splicing. This method requires artists to manually create multiple river or lake fragment models in modeling software, and then select the target river or lake fragment model to splice together. After splicing, a complete river or lake model is obtained. However, this method increases the labor cost of creating river and lake fragment models. In addition, the river or lake models generated by splicing may have insufficient precision, resulting in gaps at the splicing points of two adjacent fragment models in the complete river or lake model, affecting the quality of the game graphics.
[0028] To address the aforementioned issues, this invention provides a model generation method, apparatus, and electronic device. This technology can be applied to scenarios where water models are generated in game maps, particularly in scenarios where river or lake models are generated in game maps.
[0029] To facilitate understanding of the embodiments of the present invention, a model generation method, apparatus, and electronic device disclosed in the embodiments of the present invention will first be described in detail, such as... Figure 1 As shown, this method includes the following specific steps:
[0030] Step S102: Receive water area model generation instruction; wherein, the water area model generation instruction includes: water area type parameters and water area location of the water area model to be generated.
[0031] During game development, developers can add water models to the game map according to game rules or development needs. This means developers can send a water model generation command on the client side when adding a water model. During gameplay, players can add water models to the game map as needed, again sending a water model generation command on the game client. The water model generation command specifies the water type parameters and location of the water model to be generated. The water location indicates the position of the water model on the game map. The water type parameter indicates the type of water model to be generated, which includes at least river and lake types. When the water model to be generated is a river, the water type parameter also includes the river's flow direction.
[0032] Step S104: Based on the above water area model generation instructions, determine the target grid cell in the game map where the water area model to be generated is located; wherein, the game map is composed of multiple grid cells, and each grid cell includes multiple triangular grids.
[0033] In practical implementation, the target grid cell occupied by the water area model in the game map can be determined based on the water area location contained in the water area model generation instruction. Specifically, the game map consists of multiple grid cells, each of which is a hexagonal grid, and each grid cell includes multiple triangular grids, that is, a hexagonal grid contains multiple triangular grids.
[0034] Step S106: Adjust the mesh structure of the target mesh cell according to the water type parameters of the water model to be generated, and obtain the adjusted mesh cell.
[0035] In practice, different water area type parameters require different methods to adjust the mesh structure of the target mesh cells corresponding to the water area model to be generated, resulting in different adjusted mesh cells. The mesh structure adjustment method for each water area type parameter is pre-set and can be implemented programmatically.
[0036] Step S108: Determine the target triangular mesh where the water area model to be generated is located from the adjusted mesh cells, and assign the target triangular mesh a preset water area material to generate the water area model to be generated in the game map.
[0037] In practical implementation, different water body materials need to be set for different water body models, and the water body materials set for different locations within the same water body model also need to be different. For example, if the water body model is a river model, the material parameters of the river model need to be increased from the beginning to the end of the river to achieve the water flow effect in the water body material; if the water body model is a lake model, a water body material with a water ripple effect needs to be set in the water surface area of the lake model, and in the water shore area, the material parameters need to be increased as the distance from the shore increases to achieve the white foam effect on the shore, thereby enriching the game visual presentation of the water body models in the game map.
[0038] This invention provides a model generation method. First, it receives a water model generation instruction containing water type parameters and the location of the water body to be generated. Then, based on the water model generation instruction, it determines the target grid cell containing the water body to be generated in a game map. The game map consists of multiple grid cells, each containing multiple triangular meshes. Next, according to the water type parameters of the water body to be generated, the mesh structure of the target grid cell is adjusted to obtain the adjusted grid cell. Then, the target triangular mesh containing the water body to be generated is determined from the adjusted grid cell, and a preset water material is assigned to the target triangular mesh to generate the water body model in the game map. This method can automatically generate a complete water body model by adjusting the mesh structure of the grid cells in the game map according to the water model generation instruction, thus avoiding gaps at the splicing points when obtaining a water body model through stitching, thereby improving the quality of the game graphics. At the same time, this method eliminates the need to pre-create water body segment models for splicing, thus reducing significant labor costs.
[0039] This invention also provides another model generation method, which is implemented based on the above embodiments. This method focuses on the following steps when the water body model to be generated is a river model: determining the target mesh cell in the game map based on the water body model generation command (implemented through step S204 below); adjusting the mesh structure of the target mesh cell according to the water body type parameters of the water body model to be generated, obtaining the adjusted mesh cell (implemented through steps S206-S208 below); and determining the target triangular mesh in the game map from the adjusted mesh cell, and assigning the target triangular mesh a preset water body material to the target triangular mesh (implemented through step S210 below). Figure 2 As shown, the method includes the following specific steps:
[0040] Step S202: Receive water area model generation instructions; wherein, the water area model generation instructions include: the river type, river flow direction and river location of the river model to be generated.
[0041] In practical applications, the above-mentioned water area model can be a river model. In this case, the water area type parameter of the water area model is used to indicate that the water area model is of the river type, and also to indicate the direction of river flow.
[0042] Step S204: Based on the river location of the river model, determine the target grid cell through which the river model flows in the game map.
[0043] In practice, based on the river location indicated in the water area model generation instruction, the grid cell through which the river model will flow can be determined in the game map. That is, the grid cell through which the river model flows in the game map is the target grid cell, which can be one or more.
[0044] Step S206: Add target vertices to the target grid cells according to the river flow direction of the river model.
[0045] In practice, the location of the target vertices added to the target grid cell varies depending on the river flow direction, and the number of target vertices added to the target grid cell may also differ. The method for adding target vertices for each river flow direction is pre-set, allowing the program to automatically add target vertices to the target grid cell.
[0046] In practical applications, the aforementioned grid unit is a hexagonal grid, which corresponds to a hexagonal tile in the game map. Rivers typically consist of a riverbed and a surface. Generating a riverbed requires modifying the existing land tiles in the game map (which are generated from hexagonal grids). For each hexagonal grid of a land tile, it needs to be divided outwards from the center into a central part, a transition part, and an outer part. The central part is the hexagonal region at the center of the grid, the transition part surrounds the central part, and the outer part surrounds the transition part. For example... Figure 3 The diagram shown is a schematic representation of a hexagonal grid provided in an embodiment of the present invention, wherein... Figure 3 In the diagram, the hexagonal region corresponding to 3 is the central part, the hexagonal region corresponding to 2 excluding the central part is the transition part, and the hexagonal region corresponding to 1 excluding both the central and transition parts is the outer part. This hexagonal mesh division allows for better height and material transitions. A hexagonal mesh of a plot generated using this method is shown below. Figure 4 As shown, Figure 4 The grid unit corresponding to the hexagon drawn with a set of lines is the hexagonal grid; the central part of the hexagonal grid consists of six triangular grids of equal size.
[0047] In practical implementation, when a river flows through a hexagonal mesh, the mesh structure of the hexagonal mesh needs to be modified to generate the river model. When changing the mesh structure of the hexagonal mesh, the target vertices need to be added to the hexagonal mesh according to the river flow direction in the river model. This can be achieved through the following steps 10-13:
[0048] Step 10: Based on the river flow direction of the river model, determine the first grid cell where the river begins and the second grid cell where the river ends from the target grid cell (equivalent to the hexagonal grid mentioned above), and determine the first triangular grid in the center of the first grid cell and the second triangular grid in the center of the second grid cell; the center of the grid cell consists of six triangular grids of equal size.
[0049] In specific implementations, the river flow direction mentioned above includes one of the following: the river flows through the target mesh cell in a straight line, the river flows through the target mesh cell at an acute angle, and the river flows through the target mesh cell at an obtuse angle; wherein, the preset vertex addition rule corresponding to each river flow direction is different, and each vertex addition rule is pre-set. For example... Figure 5 The diagram shown illustrates different river flow directions within a grid cell provided in an embodiment of the present invention. Figure 5 The first hexagon in the first row indicates that there is no river in the grid cell. The second hexagon in the first row indicates that the river's start and end points are within the grid cell. The first hexagon in the second row indicates that the river crosses the grid cell at an acute angle, and the second hexagon in the second row indicates that the river crosses the grid cell at an obtuse angle. The third hexagon in the third row indicates that the river crosses the grid cell in a straight line. When the river crosses the grid cell at an acute or obtuse angle, the river's inflection point is located in the center of the grid cell, and the river's start and end points are also located in the center of the grid cell.
[0050] Step 11: Add a first target vertex at the center of the edge in the first triangular mesh that flows in the same direction as the river, and add a second target vertex at the center of the edge in the second triangular mesh that flows in the opposite direction to the river.
[0051] When a target mesh cell has river inflow or outflow along a certain river flow direction, a series of vertices need to be added in the middle of the corresponding river connection area to create a concave riverbed. For the central region of the target mesh cell, the addition of target vertices needs to be determined based on the river flow direction. First, for the river's beginning and end, the first mesh cell (the starting point of the river) and the second mesh cell (the ending point of the river) need to be determined from the target mesh cells. Then, a first triangular mesh is determined in the center of the first mesh cell, and a second triangular mesh is determined in the center of the second mesh cell. The first target vertex is added in the middle of the edge corresponding to the river inflow direction (equivalent to the direction in the same direction as the river flow) in the first triangular mesh, and the second target vertex is added in the middle of the edge in the second triangular mesh corresponding to the opposite direction of the river flow.
[0052] Step 12: Based on the river flow direction and preset vertex addition rules, add a third target vertex in the center of the target grid cell other than the first and second grid cells.
[0053] In practice, different river flow directions correspond to different preset vertex addition rules, so the target vertices added to the center of the target grid cells other than the first and second grid cells are also different.
[0054] Step 13: Based on the first target vertex, the second target vertex, and the third target vertex, add multiple fourth target vertices to the transition and outer parts of the river model in the target mesh cell; wherein the height of the target vertex is lower than that of the original vertex.
[0055] like Figure 6 The diagram shown is a schematic of vertex addition when a river directly passes through a grid cell, according to an embodiment of the present invention. Figure 6 The image on the right shows the grid structure when the river flows directly through the grid cells. This grid structure is also the grid structure of the riverbed grid in the river model. Figure 6 The image on the left shows the riverbed effect formed on the game map when a river flows directly through a grid cell. Figure 6 The two dark-colored triangles represent the triangular meshes corresponding to the beginning and end of the river. The circular points added to the edges of these two triangular meshes are the first and second target vertices. The height of these first and second target vertices is lower than the original vertices in the mesh cells; this height is represented by the Z-coordinate value. After adding the first and second target vertices, the original triangles actually evolve into two triangles. It can be seen that the riverbed mesh contains parts of the river, and the mesh is denser compared to other parts. Because the added target vertices are offset towards the negative Z-coordinate (i.e., their height is lower than the original vertices), a V-shaped riverbed is formed.
[0056] For the central part of the grid cell through which the river directly passes, that is... Figure 6 For the area represented by the dark hexagon, two additional vertices need to be added on either side of the center point of the central part. The distance between these two vertices should be equal to the side length of the hexagon corresponding to the central part, which is also the width of the river. These two additional vertices, along with the original vertices of the central part, are then re-subdivided into triangles to obtain the adjusted mesh cells. Figure 6 The circular point drawn on the right side of the image, excluding the first and second target vertices, is the fourth target vertex. The fourth target vertex is on a straight line with the first and second target vertices, which is the midline of the river.
[0057] like Figure 7 The diagram shown is a schematic diagram of vertex addition when a river flows through a grid cell at an acute angle, according to an embodiment of the present invention. Figure 7 The image on the right shows the grid structure when the river flows through the grid cells at an acute angle. This grid structure is also the grid structure of the riverbed grid in the river model. Figure 7 The image on the left shows the riverbed effect formed on the game map when a river flows through grid cells at an acute angle. Figure 7 The dark hexagon in the image represents the central part of the grid cell through which the river flows at an acute angle. Three vertices need to be added below the center point of the central part; these three vertices are the third target vertices, automatically added according to preset vertex addition rules. The Z coordinates of these three vertices are offset towards the negative coordinates, and then, together with the original vertices of the central part, they are re-subdivided into triangles to obtain the adjusted grid cell. Figure 7 The fourth target vertex, which is not shown at the location where the river flows, is actually on a straight line with the vertex of the third target vertex on the edge of the central part, which is the centerline of the river.
[0058] like Figure 8 The diagram shown is a schematic diagram of vertex addition when a river flows through a grid cell at an obtuse angle, according to an embodiment of the present invention. Figure 8 The image on the right shows the grid structure when the river flows through the grid cells at an obtuse angle. This grid structure is also the grid structure of the riverbed grid in the river model. Figure 8 The image on the left shows the effect of a riverbed forming on the game map when a river flows through grid cells at an obtuse angle. Figure 8 The dark hexagons in the image represent the central part of the grid cell through which the river flows at an obtuse angle. Three vertices need to be added near the center point of this central part; these three vertices are the third target vertices, automatically added according to preset vertex addition rules. The Z coordinates of these three vertices are offset towards the negative coordinates. Then, together with the original vertices of the central part, they are re-subdivided into triangles to obtain the adjusted grid cell. Figure 8 The fourth target vertex, which is not shown at the location where the river flows, is actually on a straight line with the vertex of the third target vertex on the edge of the central part, which is the centerline of the river.
[0059] Step S208: Based on the target vertex and the original vertices in the target mesh cell, the target mesh cell is re-subdivided into triangular meshes to obtain the adjusted mesh cell.
[0060] In practical implementation, the target mesh cells can be re-triangulated based on the first, second, third, and fourth target vertices to obtain adjusted mesh cells. In the adjusted mesh cells, the triangular mesh corresponding to the area through which the river model flows is denser, and the width of the river model is equal to the side length of the hexagon corresponding to the center part of the mesh cell. Specifically, the first, second, third, and fourth target vertices need to be reconnected to the original vertices in the target mesh cells, and the target mesh cells are then re-triangulated to obtain the adjusted mesh cells.
[0061] Step S210: Determine the target triangular mesh where the river model is located from the adjusted mesh cells, and set the water area material for the target triangular mesh where the river model is located according to the preset river material setting rules, so as to obtain the river model generated in the game map.
[0062] In practical implementation, the above-mentioned river material setting rules include: setting the water area material of the river model according to the rule that the material parameters increase sequentially from the beginning to the end of the river. Specifically, the river surface part of the river model is actually just finding the corresponding vertices on both sides of the riverbed, shifting the Z coordinates of the vertices downwards to generate a facet, and then assigning the river material. The target triangular mesh corresponding to the river model needs to process UV0 so that the value of UV0.Y (equivalent to the above material parameters) increases sequentially from the beginning to the end of the river. In this way, the water flow effect can be achieved in the water area material.
[0063] The above model generation method can generate river models without additional art costs, and the generated river models are complete models without any seams. Furthermore, by writing data into the UV channels, the generated river models define data such as the river's flow direction, enabling the achievement of better river flow effects.
[0064] This invention also provides another model generation method, which is implemented based on the above embodiments. This method focuses on the following steps when the water body model to be generated is a lake model: determining the target mesh cell in the game map based on the water body model generation command (implemented through step S904 below); adjusting the mesh structure of the target mesh cell according to the water body type parameters of the water body model to be generated, obtaining the adjusted mesh cell (implemented through steps S906-S908 below); and determining the target triangular mesh where the water body model to be generated is located from the adjusted mesh cell, and assigning the target triangular mesh a preset water body material to generate the water body model in the game map (implemented through step S910 below). Figure 9 As shown, the method includes the following specific steps:
[0065] Step S902: Receive water area model generation instruction; the water area model generation instruction includes: the water area model to be generated is of the lake type, and the lake location of the lake model to be generated.
[0066] In practical applications, the above-mentioned water body model can be a lake model. In this case, the water body type parameter of the water body model is used to indicate that the type of the water body model is a lake.
[0067] Step S904: Based on the lake location of the lake model, determine the target grid cell where the lake model is located in the game map.
[0068] In practice, based on the lake location indicated in the water area model generation instructions, the target grid cell where the lake model is located can be determined in the game map. This target grid cell can be one or more.
[0069] Step S906: Determine the shore area and water surface area of the lake model from the target grid cells; wherein, the shore area is the area connecting the water surface area and the shore plots.
[0070] In practice, open bodies of water like lakes will not affect the terrain mesh. As long as the water level of a grid cell is higher than the elevation, a simple water surface mesh will be generated on the plot, with a mesh structure similar to the terrain.
[0071] Step S908: Adjust the grid structure corresponding to the water surface area and the shore area in the target grid cell to obtain the adjusted grid cell.
[0072] In the actual implementation, the grid structures corresponding to the water surface area and the shore area are pre-set and can be automatically set by the program. Specifically, the lake actually consists of two parts: the water surface area in the middle, which only requires a simple hexagonal grid; and the shore area, which is the flat area connecting the water surface and the shore plots, used to create the effect of white foam on the shore.
[0073] Step S910: Determine the target triangular mesh where the lake model is located from the adjusted mesh cells, and set the water area material for the target triangular mesh where the lake model is located according to the preset lake material setting rules, so as to obtain the lake model generated in the game map.
[0074] The aforementioned lake material setting rules include: setting a water surface material with a water ripple effect in the water surface area corresponding to the target triangular mesh; and setting the water surface material in the shore area corresponding to the target triangular mesh according to the rule that the material parameter increases with distance from the shore. Specifically, the water surface area and the shore area need to be implemented separately using a fixed material. The material for the water surface area is relatively simple; a water ripple effect based on UV distortion can be created. For the shore area, UV0.Y (equivalent to the aforementioned material parameter) increases with distance from the shore, thereby achieving the effect of white foam on the shore and enriching the game's visual presentation.
[0075] like Figure 10 The image shown is a schematic diagram of a lake model provided in an embodiment of the present invention. Figure 10 The first image shows the generated effect of the lake model in the game map, the second image shows the mesh structure corresponding to the water surface area of the lake model, and the third image shows the mesh structure corresponding to the shore area.
[0076] The above model generation method can generate lake models without additional art costs, and the generated lake models are complete models without any stitching gaps. Furthermore, by writing data into the UV channels, the generated lake models define data such as the distance between the lake and the shore, allowing for better white foam effects along the shore.
[0077] Corresponding to the above method embodiments, this invention also provides a model generation apparatus, such as... Figure 11 As shown, the device includes:
[0078] The instruction receiving module 90 is used to receive water area model generation instructions; wherein, the water area model generation instructions include: water area type parameters and water area location of the water area model to be generated.
[0079] The grid cell determination module 91 is used to determine the target grid cell in the game map where the water area model to be generated is located based on the water area model generation instructions; wherein, the game map is composed of multiple grid cells, and each grid cell includes multiple triangular grids.
[0080] The mesh structure adjustment module 92 is used to adjust the mesh structure of the target mesh cell according to the water type parameter of the water model to be generated, so as to obtain the adjusted mesh cell.
[0081] The material assignment module 93 is used to determine the target triangular mesh where the water model to be generated is located from the adjusted mesh cells, and to assign the target triangular mesh a preset water material to generate the water model to be generated in the game map.
[0082] The aforementioned model generation device first receives a water model generation instruction containing water type parameters and the location of the water body to be generated. Then, based on the water model generation instruction, it determines the target mesh cell containing the water body to be generated within the game map. This game map consists of multiple mesh cells, each containing multiple triangular meshes. Next, according to the water type parameters of the water body to be generated, the mesh structure of the target mesh cell is adjusted to obtain the adjusted mesh cell. Then, the target triangular mesh containing the water body to be generated is determined from the adjusted mesh cell, and a preset water material is assigned to the target triangular mesh to generate the water body model within the game map. This method can automatically generate a complete water body model by adjusting the mesh structure of the mesh cells in the game map according to the water model generation instruction, thus avoiding the gaps at the stitching points that occur when using a splicing method to obtain a water body model, thereby improving the quality of the game's visuals. Furthermore, this method eliminates the need to pre-create water body segment models for splicing, significantly reducing labor costs.
[0083] Specifically, the above-mentioned water area model to be generated includes a river model, and the water area type parameters include river type and river flow direction; the above-mentioned grid cell determination module 91 is also used to: determine the target grid cell through which the river model flows in the game map based on the river location of the river model.
[0084] Furthermore, the aforementioned mesh structure adjustment module 92 is used to: add target vertices to the target mesh cell according to the river flow direction of the river model; and re-subdivide the target mesh cell into triangular meshes based on the target vertices and the original vertices in the target mesh cell to obtain the adjusted mesh cell.
[0085] In practical applications, the aforementioned grid unit is a hexagonal grid, which is divided into a central part, a transition part, and an outer part from the center outwards. The central part is the hexagonal region at the center of the hexagonal grid, the transition part surrounds the central part, and the outer part surrounds the transition part. The aforementioned grid structure adjustment module 92 is further configured to: determine the first grid unit where the river begins and the second grid unit where the river ends from the target grid unit according to the river flow direction of the river model; determine a first triangular grid in the central part of the first grid unit and a second triangular grid in the central part of the second grid unit; the central part of the grid unit consists of six triangular grids of equal size; add a first target vertex at the center of the edge in the first triangular grid that flows in the same direction as the river flow, and add a second target vertex at the center of the edge in the second triangular grid that flows in the opposite direction to the river flow; based on the river flow direction and preset vertex addition rules, add a third target vertex in the central part of the target grid unit other than the first and second grid units; based on the first, second, and third target vertices, add multiple fourth target vertices in the transition and outer parts of the target grid unit through which the river model flows; wherein the height of the target vertices is lower than the original vertices.
[0086] In practical applications, the above-mentioned river flow direction includes one of the following: the river passes through the target grid cell in a straight line, the river passes through the target grid cell at an acute angle, and the river passes through the target grid cell at an obtuse angle; wherein, the preset vertex addition rules are different for each river flow direction.
[0087] Specifically, the aforementioned mesh structure adjustment module 92 is also used to: re-subdivide the target mesh unit into triangular meshes based on the first target vertex, the second target vertex, the third target vertex, and the fourth target vertex to obtain the adjusted mesh unit; wherein, in the adjusted mesh unit, the triangular mesh corresponding to the area through which the river model flows is denser, and the width of the river model is equal to the side length of the hexagon corresponding to the center part of the mesh unit.
[0088] Furthermore, the aforementioned material assignment module 93 is used to: set the water area material for the target triangular mesh where the river model is located according to the preset river material setting rules, so as to obtain the river model generated in the game map; wherein, the river material setting rules include: setting the water area material of the river model according to the rule that the material parameters are sequentially increased from the beginning to the end of the river.
[0089] In practical applications, the aforementioned water area model to be generated includes a lake model, and the water area location includes the lake location; the aforementioned grid cell determination module 91 is used to: determine the target grid cell where the lake model is located in the game map based on the lake location of the lake model; the aforementioned grid structure adjustment module 92 is used to: determine the waterfront area and water surface area of the lake model from the target grid cell; wherein, the waterfront area is the area connecting the water surface area and the shore plot; adjust the grid structure corresponding to the water surface area and waterfront area in the target grid cell to obtain the adjusted grid cell.
[0090] Furthermore, the aforementioned material assignment module 93 is used to: set water area material for the target triangular mesh where the lake model is located according to the preset lake material setting rules, so as to obtain the lake model generated in the game map; wherein, the lake material setting rules include: setting water area material with water wave disturbance effect in the water surface area corresponding to the target triangular mesh; and setting water area material in the waterfront area corresponding to the target triangular mesh according to the rule that the material parameter is larger the farther away from the shore.
[0091] The model generation apparatus provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the apparatus embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0092] This invention also provides an electronic device, such as... Figure 12 As shown, the electronic device includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, which executes the machine-executable instructions to implement the model generation method described above.
[0093] Specifically, the above-mentioned model generation method includes: receiving a water area model generation instruction; wherein the water area model generation instruction includes: water area type parameters and water area location of the water area model to be generated; determining the target grid cell where the water area model to be generated is located in the game map based on the water area model generation instruction; wherein the game map is composed of multiple grid cells, and each grid cell includes multiple triangular grids; adjusting the grid structure of the target grid cell according to the water area type parameters of the water area model to be generated, to obtain the adjusted grid cell; determining the target triangular grid where the water area model to be generated is located from the adjusted grid cell, and assigning the target triangular grid a preset water area material, so as to generate the water area model to be generated in the game map.
[0094] The above-mentioned model generation method can adjust the grid structure of the grid cells in the game map according to the water area model generation instructions, and automatically generate a complete water area model. This avoids the phenomenon of gaps at the splicing points when obtaining a water area model by splicing, thus helping to improve the quality of the game screen. At the same time, this method does not require the pre-production of water area segment models for splicing, thus reducing a lot of manpower costs.
[0095] In an optional embodiment, the above-mentioned water area model to be generated includes a river model, and the water area type parameters include river type and river flow direction; the above-mentioned step of determining the target grid cell where the water area model to be generated is located in the game map based on the water area model generation instruction includes: determining the target grid cell through which the river model flows in the game map based on the river position of the river model.
[0096] In an optional embodiment, the step of adjusting the mesh structure of the target mesh cell according to the water type parameter of the water model to be generated to obtain the adjusted mesh cell includes: adding target vertices in the target mesh cell according to the river flow direction of the river model; and re-subdividing the target mesh cell into triangular meshes based on the target vertices and the original vertices in the target mesh cell to obtain the adjusted mesh cell.
[0097] In an optional embodiment, the aforementioned mesh unit is a hexagonal mesh, which is divided into a central portion, a transition portion, and an outer portion from the center outwards; wherein, the central portion is the hexagonal region at the center of the hexagonal mesh, the transition portion surrounds the central portion, and the outer portion surrounds the transition portion; the aforementioned step of adding target vertices in the target mesh unit according to the river flow direction of the river model includes: determining a first mesh unit where the river begins and a second mesh unit where the river ends from the target mesh unit according to the river flow direction of the river model, determining a first triangular mesh in the central portion of the first mesh unit, and determining a second triangular mesh in the central portion of the second mesh unit. Corner mesh; the central part of the mesh cell consists of six triangular meshes of equal size; a first target vertex is added to the center of the edge in the first triangular mesh that is in the same direction as the river flow, and a second target vertex is added to the center of the edge in the second triangular mesh that is in the opposite direction to the river flow; based on the river flow direction and a preset vertex addition rule, a third target vertex is added to the central part of the target mesh cell other than the first and second mesh cells; based on the first, second, and third target vertices, multiple fourth target vertices are added to the transition and outer parts through which the river model flows in the target mesh cell; wherein, the height of the target vertex is lower than that of the original vertex.
[0098] In an optional embodiment, the river flow direction includes one of the following: the river passes through the target grid cell in a straight line, the river passes through the target grid cell at an acute angle, and the river passes through the target grid cell at an obtuse angle; wherein, the preset vertex addition rules are different for each river flow direction.
[0099] In an optional embodiment, the step of re-triangulating the target mesh unit based on the target vertex and the original vertices in the target mesh unit to obtain the adjusted mesh unit includes: re-triangulating the target mesh unit based on the first target vertex, the second target vertex, the third target vertex, and the fourth target vertex to obtain the adjusted mesh unit; wherein, in the adjusted mesh unit, the triangular mesh corresponding to the area through which the river model flows is denser, and the width of the river model is equal to the side length of the hexagon corresponding to the central part of the mesh unit.
[0100] In an optional embodiment, the step of assigning a preset water area material to the target triangular mesh to generate a water area model to be generated in the game map includes: setting a water area material for the target triangular mesh where the river model is located according to a preset river material setting rule, thereby obtaining a river model generated in the game map; wherein, the river material setting rule includes: setting the water area material of the river model according to the rule of sequentially increasing material parameters from the beginning to the end of the river.
[0101] In an optional embodiment, the above-mentioned water area model to be generated includes a lake model, and the water area location includes the lake location; the step of determining the target grid cell where the water area model to be generated is located in the game map based on the water area model generation instructions includes: determining the target grid cell where the lake model is located in the game map based on the lake location of the lake model; the step of adjusting the grid structure of the target grid cell according to the water area type parameters of the water area model to be generated to obtain the adjusted grid cell includes: determining the shore area and water surface area of the lake model from the target grid cell; wherein, the shore area is the area connecting the water surface area and the shore plot; adjusting the grid structure corresponding to the water surface area and the shore area in the target grid cell to obtain the adjusted grid cell.
[0102] In an optional embodiment, the step of assigning a preset water surface material to the target triangular mesh to generate a water surface model to be generated in the game map includes: setting a water surface material for the target triangular mesh where the lake model is located according to a preset lake material setting rule, thereby obtaining a lake model generated in the game map; wherein, the lake material setting rule includes: setting a water surface material with a water wave disturbance effect in the water surface area corresponding to the target triangular mesh; and setting the water surface material of the waterfront area corresponding to the target triangular mesh according to the rule that the material parameter is larger the farther away from the shore.
[0103] Furthermore, Figure 12 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 101, the communication interface 103 and the memory 100 connected via the bus 102.
[0104] The memory 100 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 12 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0105] Processor 101 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 101 or by instructions in software form. Processor 101 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 100, and processor 101 reads information from memory 100 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0106] This invention also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the above-described model generation method. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0107] Specifically, the above-mentioned model generation method includes: receiving a water area model generation instruction; wherein the water area model generation instruction includes: water area type parameters and water area location of the water area model to be generated; determining the target grid cell where the water area model to be generated is located in the game map based on the water area model generation instruction; wherein the game map is composed of multiple grid cells, and each grid cell includes multiple triangular grids; adjusting the grid structure of the target grid cell according to the water area type parameters of the water area model to be generated, to obtain the adjusted grid cell; determining the target triangular grid where the water area model to be generated is located from the adjusted grid cell, and assigning the target triangular grid a preset water area material, so as to generate the water area model to be generated in the game map.
[0108] The above-mentioned model generation method can adjust the grid structure of the grid cells in the game map according to the water area model generation instructions, and automatically generate a complete water area model. This avoids the phenomenon of gaps at the splicing points when obtaining a water area model by splicing, thus helping to improve the quality of the game screen. At the same time, this method does not require the pre-production of water area segment models for splicing, thus reducing a lot of manpower costs.
[0109] In an optional embodiment, the above-mentioned water area model to be generated includes a river model, and the water area type parameters include river type and river flow direction; the above-mentioned step of determining the target grid cell where the water area model to be generated is located in the game map based on the water area model generation instruction includes: determining the target grid cell through which the river model flows in the game map based on the river position of the river model.
[0110] In an optional embodiment, the step of adjusting the mesh structure of the target mesh cell according to the water type parameter of the water model to be generated to obtain the adjusted mesh cell includes: adding target vertices in the target mesh cell according to the river flow direction of the river model; and re-subdividing the target mesh cell into triangular meshes based on the target vertices and the original vertices in the target mesh cell to obtain the adjusted mesh cell.
[0111] In an optional embodiment, the aforementioned mesh unit is a hexagonal mesh, which is divided into a central portion, a transition portion, and an outer portion from the center outwards; wherein, the central portion is the hexagonal region at the center of the hexagonal mesh, the transition portion surrounds the central portion, and the outer portion surrounds the transition portion; the aforementioned step of adding target vertices in the target mesh unit according to the river flow direction of the river model includes: determining a first mesh unit where the river begins and a second mesh unit where the river ends from the target mesh unit according to the river flow direction of the river model, determining a first triangular mesh in the central portion of the first mesh unit, and determining a second triangular mesh in the central portion of the second mesh unit. Corner mesh; the central part of the mesh cell consists of six triangular meshes of equal size; a first target vertex is added to the center of the edge in the first triangular mesh that is in the same direction as the river flow, and a second target vertex is added to the center of the edge in the second triangular mesh that is in the opposite direction to the river flow; based on the river flow direction and a preset vertex addition rule, a third target vertex is added to the central part of the target mesh cell other than the first and second mesh cells; based on the first, second, and third target vertices, multiple fourth target vertices are added to the transition and outer parts through which the river model flows in the target mesh cell; wherein, the height of the target vertex is lower than that of the original vertex.
[0112] In an optional embodiment, the river flow direction includes one of the following: the river passes through the target grid cell in a straight line, the river passes through the target grid cell at an acute angle, and the river passes through the target grid cell at an obtuse angle; wherein, the preset vertex addition rules are different for each river flow direction.
[0113] In an optional embodiment, the step of re-triangulating the target mesh unit based on the target vertex and the original vertices in the target mesh unit to obtain the adjusted mesh unit includes: re-triangulating the target mesh unit based on the first target vertex, the second target vertex, the third target vertex, and the fourth target vertex to obtain the adjusted mesh unit; wherein, in the adjusted mesh unit, the triangular mesh corresponding to the area through which the river model flows is denser, and the width of the river model is equal to the side length of the hexagon corresponding to the central part of the mesh unit.
[0114] In an optional embodiment, the step of assigning a preset water area material to the target triangular mesh to generate a water area model to be generated in the game map includes: setting a water area material for the target triangular mesh where the river model is located according to a preset river material setting rule, thereby obtaining a river model generated in the game map; wherein, the river material setting rule includes: setting the water area material of the river model according to the rule of sequentially increasing material parameters from the beginning to the end of the river.
[0115] In an optional embodiment, the above-mentioned water area model to be generated includes a lake model, and the water area location includes the lake location; the step of determining the target grid cell where the water area model to be generated is located in the game map based on the water area model generation instructions includes: determining the target grid cell where the lake model is located in the game map based on the lake location of the lake model; the step of adjusting the grid structure of the target grid cell according to the water area type parameters of the water area model to be generated to obtain the adjusted grid cell includes: determining the shore area and water surface area of the lake model from the target grid cell; wherein, the shore area is the area connecting the water surface area and the shore plot; adjusting the grid structure corresponding to the water surface area and the shore area in the target grid cell to obtain the adjusted grid cell.
[0116] In an optional embodiment, the step of assigning a preset water surface material to the target triangular mesh to generate a water surface model to be generated in the game map includes: setting a water surface material for the target triangular mesh where the lake model is located according to a preset lake material setting rule, thereby obtaining a lake model generated in the game map; wherein, the lake material setting rule includes: setting a water surface material with a water wave disturbance effect in the water surface area corresponding to the target triangular mesh; and setting the water surface material of the waterfront area corresponding to the target triangular mesh according to the rule that the material parameter is larger the farther away from the shore.
[0117] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal device, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0118] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0119] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A model generation method, characterized in that, The method includes: Receive a water area model generation instruction; wherein the water area model generation instruction includes: water area type parameters and water area location of the water area model to be generated; Based on the water area model generation instructions, the target grid cell where the water area model to be generated is located is determined in the game map; wherein, the game map is composed of multiple grid cells, and each grid cell includes multiple triangular grids; the grid cell is a hexagonal grid, and the hexagonal grid is divided into a central part, a transition part, and an outer part from the center outward; wherein, the central part is the hexagonal region at the center of the hexagonal grid, the transition part surrounds the central part, and the outer part surrounds the transition part; Based on the water type parameters of the water area model to be generated, the mesh structure of the target mesh element is adjusted to obtain the adjusted mesh element; The target triangular mesh where the water area model to be generated is located is determined from the adjusted mesh cells, and the target triangular mesh is assigned a preset water area material to generate the water area model to be generated in the game map. The water area model to be generated includes a river model. The step of adjusting the mesh structure of the target mesh element according to the water area type parameters of the water area model to obtain the adjusted mesh element includes: Based on the river flow direction of the river model, a first grid cell where the river begins and a second grid cell where the river ends are determined from the target grid cells. A first triangular grid is determined in the central part of the first grid cell, and a second triangular grid is determined in the central part of the second grid cell. The central part of the grid cell consists of six triangular grids of equal size. Add a first target vertex at the center of the edge in the first triangular mesh that flows in the same direction as the river, and add a second target vertex at the center of the edge in the second triangular mesh that flows in the opposite direction to the river. Based on the river flow direction and the preset vertex addition rules, a third target vertex is added to the center portion of the target grid cell, excluding the first and second grid cells; Based on the first target vertex, the second target vertex, and the third target vertex, multiple fourth target vertices are added to the transition and outer parts of the river model in the target mesh cell; wherein, the height of the target vertex is lower than that of the original vertex; the fourth target vertex is in a straight line with the vertex on the edge of the central part of the third target vertex, or the fourth target vertex is in a straight line with the first target vertex and the second target vertex, and the straight line is the centerline of the river; Based on the target vertex and the original vertices in the target mesh cell, the target mesh cell is re-subdivided into triangular meshes to obtain the adjusted mesh cell.
2. The method according to claim 1, characterized in that, The water area type parameters include river type and river flow direction; The step of determining the target grid cell where the water area model to be generated is located in the game map based on the water area model generation instruction includes: Based on the river location of the river model, the target grid cell through which the river model flows is determined in the game map.
3. The method according to claim 1, characterized in that, The river flow direction includes one of the following: the river passes through the target grid cell in a straight line, the river passes through the target grid cell at an acute angle, and the river passes through the target grid cell at an obtuse angle; wherein, the preset vertex addition rules are different for each river flow direction.
4. The method according to claim 1, characterized in that, In the adjusted grid cell, the triangular grid corresponding to the area through which the river model flows is denser, and the width of the river model is equal to the side length of the hexagon corresponding to the central part of the grid cell.
5. The method according to claim 2, characterized in that, The step of assigning a preset water texture to the target triangular mesh to generate the water model to be generated in the game map includes: According to the preset river material setting rules, water area material is set for the target triangular mesh where the river model is located, so as to obtain the river model generated in the game map; The river material setting rules include: setting the water area material of the river model according to the rule that the material parameters increase sequentially from the beginning to the end of the river; the material parameters are the V-direction components in the UV coordinate system.
6. A model generation apparatus, characterized in that, The device includes: The instruction receiving module is used to receive water area model generation instructions; wherein, the water area model generation instructions include: water area type parameters and water area location of the water area model to be generated; A grid cell determination module is used to determine the target grid cell in the game map where the water area model to be generated is located, based on the water area model generation instruction; wherein, the game map is composed of multiple grid cells, and each grid cell includes multiple triangular grids; the grid cell is a hexagonal grid, and the hexagonal grid is divided into a central part, a transition part, and an outer part from the center outward; wherein, the central part is the hexagonal region at the center of the hexagonal grid, the transition part surrounds the central part, and the outer part surrounds the transition part; The mesh structure adjustment module is used to adjust the mesh structure of the target mesh cell according to the water type parameter of the water model to be generated, so as to obtain the adjusted mesh cell; The material assignment module is used to determine the target triangular mesh where the water model to be generated is located from the adjusted mesh cells, and to assign a preset water material to the target triangular mesh in order to generate the water model to be generated in the game map. The water area model to be generated includes a river model. The mesh structure adjustment module is used to: determine a first mesh unit where the river begins and a second mesh unit where the river ends from the target mesh units according to the river flow direction of the river model; determine a first triangular mesh in the center of the first mesh unit and a second triangular mesh in the center of the second mesh unit; the center of the mesh unit consists of six triangular meshes of equal size; add a first target vertex to the center of the edge in the first triangular mesh that is in the same direction as the river flow direction, and add a second target vertex to the center of the edge in the second triangular mesh that is in the opposite direction to the river flow direction; based on the river flow direction and a preset vertex addition rule, adjust the mesh structure in the second triangular mesh, except for the first mesh unit and the second... A third target vertex is added to the central portion of the target mesh cell outside the target mesh cell; based on the first target vertex, the second target vertex, and the third target vertex, multiple fourth target vertices are added to the transition and outer portions of the river model within the target mesh cell; wherein the height of the target vertices is lower than the original vertices; the fourth target vertices are aligned with the vertices of the third target vertices on the edges of the central portion, or the fourth target vertices are aligned with the first target vertex and the second target vertex, the straight line being the midline of the river; based on the target vertices and the original vertices in the target mesh cell, the target mesh cell is re-subdivided into triangular meshes to obtain the adjusted mesh cell.
7. An electronic device, characterized in that, It includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the model generation method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the model generation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Landform generation method and device, computer equipment and storage medium
CN111784789A