Landform type identification method and device, computer device and storage medium
Patent Information
- Application Number
- CN202210462654.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2042-04-28
AI Technical Summary
[0003]相关技术中,在创建虚拟空间后,由开发人员人工标注虚拟空间中的各个区域所属的地貌类型,会耗费较多的人力和时间
[0056] The methods, apparatus, computer devices, and storage media provided in this application determine the region where an element is located in a virtual space by controlling the movement of a collision box in that virtual space, and use the surface material of the element in the virtual space as the material corresponding to the region where the element is located. Considering that the material corresponding to a region can reflect the terrain type to which that region belongs, it can be considered that the terrain type to which the region belongs is also the terrain type to which the material corresponding to that region belongs. Therefore, when it is necessary to identify the terrain type to which a certain region belongs, the terrain type to which the material corresponding to that region belongs can be determined as the terrain type to which that region belongs, or when it is necessary to identify a region belonging to a certain terrain type, the region corresponding to the material belonging to that terrain type can be determined as the region belonging to that terrain type. This provides an automatic method for identifying terrain types without the need for manual annotation, saving manpower and time, and improving the efficiency of terrain type identification.
Smart Images

Figure CN116999843B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer device, and storage medium for identifying landform types. Background Technology
[0002] With the development of computer and multimedia technologies, more and more video games have emerged, greatly enriching people's daily lives. Video games typically offer virtual spaces, which include areas with different terrain types, such as grasslands, snowfields, or forests. To enhance the fun of video games, virtual resources or NPCs (Non-Player Characters) can be spawned in areas belonging to the target terrain type. Therefore, it is necessary to determine the terrain type of the area within the virtual space.
[0003] In related technologies, after creating a virtual space, developers manually label the terrain type of each area in the virtual space, which consumes a lot of manpower and time. Summary of the Invention
[0004] This application provides a method, apparatus, computer device, and storage medium for identifying landform types, which can automatically identify landform types and improve the efficiency of landform type identification. The technical solution is as follows:
[0005] On the one hand, a method for identifying landform types is provided, the method comprising:
[0006] In response to material recognition commands, determine the surface material of elements in the virtual space;
[0007] The collision box is controlled to move in the virtual space. When the collision box collides with the element, the area where the collision box is located is determined as the area where the element is located.
[0008] The surface material of the element is determined to be the material corresponding to the region where the element is located;
[0009] In response to a first identification instruction carrying a first target area, the system determines a first target material corresponding to the first target area and identifies the terrain type to which the first target material belongs as the terrain type to which the first target area belongs; or,
[0010] In response to a second identification instruction carrying a target landform type, a second target material corresponding to the target landform type is determined, and the area corresponding to the second target material is determined as an area belonging to the target landform type.
[0011] Optionally, writing the material identifier of the surface material and the coordinate information of the region into a spatial description file includes:
[0012] The material identifier of the surface material, the coordinate information of the region, and the indication information of the element are associated and written into the spatial description file. The indication information is used to indicate that there are other elements above the element.
[0013] On the other hand, a landform type identification device is provided, the device comprising:
[0014] The material determination module is used to determine the surface material of elements in the virtual space in response to material recognition commands;
[0015] The material determination module is also used to control the movement of the collision box in the virtual space, and when the collision box collides with the element, the area where the collision box is located is determined as the area where the element is located.
[0016] The material determination module is further configured to determine the surface material of the element as the material corresponding to the region where the element is located;
[0017] A type determination module is used to, in response to a first identification instruction carrying a first target area, determine a first target material corresponding to the first target area, and determine the terrain type to which the first target material belongs as the terrain type to which the first target area belongs; or,
[0018] The region determination module is used to respond to a second identification instruction carrying a target landform type, determine a second target material corresponding to the target landform type, and determine the region corresponding to the second target material as a region belonging to the target landform type.
[0019] Optionally, the element is a virtual surface in the virtual space, and the material determination module includes:
[0020] The first determining unit is configured to, in response to the material identification instruction, obtain the material name corresponding to the virtual surface, wherein the material name is used to describe the surface material of the virtual surface.
[0021] The first determining unit is also used to query the material corresponding to the material name;
[0022] The first determining unit is further configured to determine the queried material as the surface material of the virtual ground surface.
[0023] Optionally, the apparatus further includes a rendering module, the rendering module being configured to:
[0024] Render a layer of material onto the virtual surface;
[0025] Query the material name corresponding to the material rendered onto the virtual surface;
[0026] Establish the correspondence between the material name and the virtual surface.
[0027] Optionally, the element is a virtual object in the virtual space, and the material determination module includes:
[0028] The second determining unit is configured to query the additional material identifier corresponding to the virtual object in response to the material identification instruction. The additional material identifier indicates the last material among the at least two layers of materials when the virtual object has rendered at least two layers of materials.
[0029] The second determining unit is further configured to, when an additional material identifier corresponding to the virtual object is found, determine the material indicated by the additional material identifier as the surface material;
[0030] The second determining unit is further configured to, in the absence of finding an additional material identifier corresponding to the virtual object, determine the material indicated by the original material identifier of the virtual object as the surface material, wherein the original material identifier indicates the first layer material rendered onto the virtual object.
[0031] Optionally, the apparatus further includes a rendering module, the rendering module being configured to:
[0032] Render a layer of material onto the virtual object;
[0033] The material identifier corresponding to the material rendered onto the virtual object is determined as the original material identifier.
[0034] Optionally, the apparatus further includes a rendering module, the rendering module being configured to:
[0035] Render at least two layers of material onto the virtual object;
[0036] The material identifier corresponding to the first layer of material rendered onto the virtual object is determined as the original material identifier;
[0037] The material identifier corresponding to the last layer of material rendered onto the virtual object is determined as the additional material identifier.
[0038] Optionally, the virtual space includes multiple subspaces, and the material determination module includes:
[0039] The third determining unit is used to control the collision box to move from the first boundary of the subspace to the second boundary of the subspace, and whenever the collision box collides with any element, the area where the collision box is located is determined as the area where the element is located;
[0040] Wherein, the second boundary is opposite to the first boundary and has the same shape, the first boundary and the second boundary are parallel to the target direction, and the cross-section of the collision box in the target direction is the same as the cross-section of the subspace in the target direction.
[0041] Optionally, the first boundary is the top boundary of the subspace, and the second boundary is the bottom boundary of the subspace. The device further includes:
[0042] The generation module is used to generate indication information corresponding to the element whenever the collision box collides with any element, provided that the collision is not the first collision of the collision box in the subspace. The indication information is used to indicate that there are other elements above the element.
[0043] Optionally, the material determination module includes:
[0044] The writing unit is used to associate the material identifier of the surface material with the coordinate information of the region and write it into the spatial description file.
[0045] Optionally, the writing unit is used to associate the material identifier of the surface material, the coordinate information of the region, and the indication information of the element into the spatial description file, wherein the indication information is used to indicate that there are other elements above the element.
[0046] Optionally, the type determination module is used to:
[0047] Determine the first coordinate information corresponding to the first target region;
[0048] In the spatial description file, the first material identifier corresponding to the first coordinate information is queried, and the material indicated by the first material identifier is determined as the first target material.
[0049] Optionally, the region determination module is used to:
[0050] Determine the second material identifier corresponding to the second target material;
[0051] In the spatial description file, query the second coordinate information corresponding to the second material identifier;
[0052] The area indicated by the second coordinate information obtained from the query is determined as the area belonging to the target landform type.
[0053] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor to perform the operations performed by the landform type identification method as described above.
[0054] On the other hand, a computer-readable storage medium is provided, wherein at least one computer program is stored therein, the at least one computer program being loaded and executed by a processor to perform the operations performed by the landform type identification method as described above.
[0055] On the other hand, a computer program product is provided, including a computer program loaded and executed by a processor to perform the operations performed by the landform type identification method as described above.
[0056] The methods, apparatus, computer devices, and storage media provided in this application determine the region where an element is located in a virtual space by controlling the movement of a collision box in that virtual space, and use the surface material of the element in the virtual space as the material corresponding to the region where the element is located. Considering that the material corresponding to a region can reflect the terrain type to which that region belongs, it can be considered that the terrain type to which the region belongs is also the terrain type to which the material corresponding to that region belongs. Therefore, when it is necessary to identify the terrain type to which a certain region belongs, the terrain type to which the material corresponding to that region belongs can be determined as the terrain type to which that region belongs, or when it is necessary to identify a region belonging to a certain terrain type, the region corresponding to the material belonging to that terrain type can be determined as the region belonging to that terrain type. This provides an automatic method for identifying terrain types without the need for manual annotation, saving manpower and time, and improving the efficiency of terrain type identification. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application;
[0059] Figure 2 This is a flowchart of a landform type identification method provided in an embodiment of this application;
[0060] Figure 3 This is a flowchart of another landform type identification method provided in the embodiments of this application;
[0061] Figure 4 This is a schematic diagram of a virtual space provided in an embodiment of this application;
[0062] Figure 5 This is a schematic diagram of a virtual object provided in an embodiment of this application;
[0063] Figure 6 This is a schematic diagram of another virtual object provided in an embodiment of this application;
[0064] Figure 7 This is a schematic diagram of another virtual object provided in an embodiment of this application;
[0065] Figure 8 This is a flowchart of another landform type identification method provided in the embodiments of this application;
[0066] Figure 9 This is a flowchart of another landform type identification method provided in the embodiments of this application;
[0067] Figure 10 This is a schematic diagram of a virtual space construction method provided in an embodiment of this application;
[0068] Figure 11 This is a schematic diagram of a spatial description file generation method provided in an embodiment of this application;
[0069] Figure 12 This is a schematic diagram of the structure of a terrain type identification device provided in an embodiment of this application;
[0070] Figure 13 This is a schematic diagram of another landform type identification device provided in an embodiment of this application;
[0071] Figure 14 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application;
[0072] Figure 15 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0073] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0074] It is understood that the terms "first," "second," etc., used in this application may be used to describe various concepts herein, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of this application, a first material may be referred to as a second material, and similarly, a second material may be referred to as a first material.
[0075] "At least one" refers to one or more materials. For example, at least one material can be one material, two materials, three materials, or any integer greater than or equal to one. "Multiple" refers to two or more materials. For example, multiple materials can be two materials, three materials, or any integer greater than or equal to two. "Each" refers to each of the at least one materials. For example, each material refers to each of the multiple materials. If the multiple materials consist of three materials, then each material refers to each of the three materials.
[0076] The terrain type identification method provided in this application is executed by a computer device. Optionally, the computer device is a terminal or a server. Optionally, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, etc., but is not limited to these.
[0077] In one possible implementation, the computer device used to identify landform types in this application embodiment is a node in a blockchain system. This node can store the generated spatial description file in the blockchain, and then the node or other nodes in the blockchain can identify the landform type of the area in the virtual space based on the spatial description file.
[0078] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application. See also: Figure 1 The implementation environment includes a server 101 and a terminal 102. The server 101 and the terminal 102 are connected via a wireless or wired network. The server 101 provides a virtual space for the terminal 102, which displays the virtual space provided by the server 101. The server 101 uses the method provided in this embodiment to identify the terrain type of a region within the virtual space, thereby providing backend support for the terminal 102. Optionally, the virtual space may be a virtual space in a video game, etc.
[0079] In one possible implementation, a target application, provided by server 101, is installed on terminal 102. Terminal 102 can then use this target application to perform functions such as displaying and managing virtual spaces. Optionally, the target application can be an application within the operating system of terminal 102 or an application provided by a third party. For example, the target application could be a game application with the function of playing games in a virtual space. This game application could also have other functions, such as review functions, shopping functions, or chat functions. Optionally, server 101 could be a backend server for the target application or a cloud server providing services such as cloud computing and cloud storage. For example, if the target application is a game application, server 101 could be a scene server for the game application, used to implement functions such as field of view management, movement synchronization, skill synchronization, and damage synchronization within the game application.
[0080] Figure 2 This is a flowchart of a landform type identification method provided in an embodiment of this application. This embodiment is executed by a computer device. See also... Figure 2 The method includes:
[0081] 201. The computer device responds to the material recognition command and determines the surface material of the elements in the virtual space.
[0082] Virtual space is a space created within a computer device, also known as a virtual scene. This virtual space can be a three-dimensional space containing various elements, such as virtual terrain like grasslands, deserts, or snowfields, as well as virtual objects like virtual buildings, rocks, animals, or plants. This variety of elements enhances the diversity and realism of the virtual space. Furthermore, this virtual space can be used to simulate real-world environments under different weather conditions, such as sunny days, rainy days, foggy days, or nighttime.
[0083] The material identification command is used to request the identification of the material corresponding to a region in the virtual space. In response to the material identification command, the computer device first determines the surface material of the element in the virtual space. The element in the virtual space is rendered with at least one layer of material, which includes a surface material. The surface material refers to the material displayed on the surface of the element, and the material can be of any type.
[0084] Optionally, the material identification instruction may be sent from a terminal or other device to the computer device, or the material identification instruction may be triggered by a user operation. This application embodiment does not limit the method of obtaining the material identification instruction.
[0085] 202. The computer device controls the movement of the collision box in the virtual space. When the collision box collides with an element, the area where the collision box is located is determined as the area where the element is located.
[0086] The computer device generates a collision box and controls its movement in the virtual space. When the collision box collides with any element, it indicates that the element is included in the area where the collision box is currently located. Therefore, the computer device determines the area where the collision box is located as the area where the element that collided with the collision box is located.
[0087] The area of an element in the virtual space refers to the portion of space occupied by that element in the virtual space. Optionally, the area where the element is located does not include other elements.
[0088] 203. The computer equipment determines the surface material of an element to be the material corresponding to the area where the element is located.
[0089] In this embodiment of the application, considering that the material of the area where the element is located is the surface material of the element, for the area where the element exists in the virtual space, the surface material of the element in the area can be taken as the material corresponding to the area. Therefore, after the computer device determines the surface material of the element and the area where the element is located, it determines the surface material of the element as the material corresponding to the area, thereby determining the material corresponding to the area in the virtual space based on the material of the element in the virtual space.
[0090] After determining the material corresponding to the area, the computer device performs either step 204 or step 205.
[0091] 204. The computer device responds to the first identification instruction carrying the first target area, determines the first target material corresponding to the first target area, and determines the landform type to which the first target material belongs as the landform type to which the first target area belongs.
[0092] The first identification instruction is used to request the identification of the terrain type to which the first target area belongs. The terrain type refers to the surface morphology of an area in virtual space, such as grassland, sand, snow, ocean, or forest.
[0093] Since the correspondence between regions and materials in the virtual space has been determined in step 203 above, the computer device, in response to the first identification instruction, can determine the first target material corresponding to the first target region. In this embodiment, considering that the material corresponding to a region is the surface material of the elements in the region, the material corresponding to a region can reflect the terrain type to which the region belongs. It can be considered that the terrain type to which the region belongs is also the terrain type to which the material corresponding to the region belongs. Therefore, the computer device determines the terrain type to which the first target material corresponding to the first target region belongs as the terrain type to which the first target region belongs.
[0094] 205. In response to a second identification instruction carrying a target landform type, the computer device determines a second target material corresponding to the target landform type and identifies the area corresponding to the second target material as an area belonging to the target landform type.
[0095] The second identification instruction is used to request the identification of a region in the virtual space that belongs to the target terrain type. In response to the second identification instruction, the computer device first determines the second target material that belongs to the target terrain type. Since the terrain type to which the region corresponding to the material belongs is the same as the terrain type to which the material belongs, the region corresponding to the second target material is the region that belongs to the target terrain type. Since the correspondence between the region and the material in the virtual space has been determined in the above step 202, the computer device can query the region corresponding to the second target material and then determine the region as the region that belongs to the target terrain type.
[0096] The method provided in this application determines the region where an element is located in a virtual space by controlling the movement of a collision box in that virtual space, and uses the surface material of the element in the virtual space as the material corresponding to the region where the element is located. Considering that the material corresponding to a region can reflect the terrain type to which that region belongs, it can be considered that the terrain type to which the region belongs is also the terrain type to which the material corresponding to that region belongs. Therefore, when it is necessary to identify the terrain type to which a certain region belongs, the terrain type to which the material corresponding to that region belongs can be determined as the terrain type to which that region belongs; or when it is necessary to identify a region belonging to a certain terrain type, the region corresponding to the material belonging to that terrain type can be determined as the region belonging to that terrain type. This provides an automatic way to identify terrain types without manual annotation, saving manpower and time, and improving the efficiency of terrain type identification.
[0097] In the above Figure 2 Based on the previous implementation, the elements in this virtual space include virtual terrain and virtual objects, as detailed below. Figure 3 Examples of implementations.
[0098] Figure 3This is a flowchart of another landform type identification method provided in this application embodiment. This application embodiment is executed by a computer device. See [link to flowchart]. Figure 3 The method includes:
[0099] 301. Computer devices create virtual spaces, which include virtual terrain and virtual objects.
[0100] First, it should be noted that this application embodiment uses the creation of a virtual space by the computer device as an example for illustration. In another embodiment, the virtual space can be created by other devices, in which case the computer device does not need to perform step 301, but directly performs step 302 as described below. The virtual space includes a variety of different elements, including virtual surfaces and virtual objects.
[0101] Virtual terrain, also known as virtual landscape, includes elements such as grasslands, mountains, rivers, and roads. Virtual objects are those placed on the virtual terrain during the creation of the virtual space; these objects can be virtual trees, rocks, houses, tents, or streetlights.
[0102] The virtual surface and virtual objects are rendered with materials. Materials can be seen as a combination of texture and material composition. In this embodiment, materials refer to the representation of artistic effects, such as metal, wood, sand, and grass. Materials are divided into surface materials and object materials. Surface materials can be rendered onto virtual surfaces or virtual objects, such as snow, grass, soil, or sand. Object materials can be rendered onto virtual objects, such as building materials, ruins materials, or metal materials. Each material has its own material identifier, which indicates the material; for example, the material identifier can be a material's serial number. The material identifiers for various materials are shown in Table 1 below.
[0103] Table 1
[0104] 01 grassland Ground material and object material 02 dry soil Ground material and object material 03 rock Ground material and object material 04 sandy land Ground material and object material 05 snow Ground material and object material 06 ocean Ground material and object material 07 Reserved Ground material and object material 08 Architectural structures (such as stone bridges, houses, tents, etc.) Material of an object 09 Ruins (such as Stonehenge) Material of an object 10 Metals (e.g., containers) Object Material 11 Reserved Material of an object
[0105] In Table 1, the first column is the material identifier represented by the serial number, the second column is the material, and the third column is the type of material. "Surface material and object material" means that the material can be used as both the material of virtual surface and the material of virtual object, and "object material" means that the material is used as the material of virtual object.
[0106] Figure 4 This is a schematic diagram of a virtual space provided in an embodiment of this application, such as... Figure 4As shown, Image 401 illustrates a virtual space in a video game, which includes grass, ponds, rocks, and trees. Elements of different colors in this virtual space are rendered with different materials. Image 402 shows the visualization effect of this virtual space; for example, the grass in the virtual space is rendered with a grass material, and the rocks in the virtual space are rendered with a rock material.
[0107] In one possible implementation, the computer device renders a layer of material onto a virtual surface, queries the material name corresponding to the material rendered onto the virtual surface, and establishes a correspondence between the material name and the virtual surface.
[0108] Computer equipment renders materials onto a virtual terrain, creating effects such as deserts, grasslands, and snowfields. To easily identify the material of this virtual terrain, its corresponding material name can be looked up, establishing a mapping between the material name and the virtual terrain. The material name indicates the material rendered onto the virtual terrain.
[0109] Optionally, the material name consists of a prefix and a suffix. The prefix indicates the material type, and the suffix uniquely identifies a material belonging to that type. For example, material names could be Gra-Grassland1, Gra-Grassland2, Vol-Volcano, or Sno-Snow. In "Gra-Grassland1" and "Gra-Grassland2," "Gra" indicates the material type is grass, "Grassland1" indicates sparse grass, and "Grassland2" indicates lush grass, etc. In "Vol-Volcano," "Vol" indicates the material type is volcano, and in "Sno-Snow," "Sno" indicates the material type is snow, etc.
[0110] Optionally, the virtual surface has a corresponding surface identifier, which is used to indicate the virtual surface. Establishing a correspondence between the material name and the virtual surface means establishing a correspondence between the material name and the surface identifier corresponding to the virtual surface.
[0111] In another possible implementation, the computer device renders a layer of material onto the virtual object, and the material identifier corresponding to the material rendered onto the virtual object is determined as the original material identifier of the virtual object.
[0112] In this process, only one layer of material is rendered on the virtual object. This material can be understood as the original material of the virtual object. For example, if the virtual object is a wooden table, then the wood material is rendered on the virtual object. This wood material is the original material of the virtual object. Therefore, after the computer device renders a layer of material onto the virtual object, it determines the material identifier corresponding to the material and identifies this material identifier as the original material identifier of the virtual object. This original material identifier is used to indicate the original material of the virtual object.
[0113] Optionally, in this embodiment, each material corresponds to a serial number, and different materials have different serial numbers. The serial number corresponding to the material is used as the material identifier. Optionally, the virtual object corresponds to an object identifier, which is used to indicate the virtual object. The computer device also establishes a correspondence between the original material identifier of the virtual object and the object identifier corresponding to the virtual object.
[0114] Figure 5 This is a schematic diagram of a virtual object provided in an embodiment of this application, such as... Figure 5 As shown, interface 501 displays the created virtual space, which includes a virtual tree 511. Interface 502 displays information about the virtual tree 511, such as... Figure 5 As shown, the element identifier (object identifier) of the virtual tree 511 is "tree 3", the element type of the virtual tree 511 is a virtual object, and the original material identifier of the virtual tree 511 is "15", where "15" represents the wood material.
[0115] In another possible implementation, the computer device renders at least two layers of material onto the virtual object, and determines the material identifier corresponding to the first layer of material rendered onto the virtual object as the original material identifier, and determines the material identifier corresponding to the last layer of material rendered onto the virtual object as the additional material identifier.
[0116] The virtual object is rendered with at least two layers of material. The first layer of material rendered onto the virtual object, from bottom to top, can be considered the object's original material. Materials rendered above the first layer can be considered additional materials. For example, if the virtual object is a rock in snowy conditions covered with snow, its original material is stone, and its additional material is snow. Similarly, if the virtual object is a rock in grassy areas covered with moss, its original material is stone, and its additional material is grass. To facilitate subsequent identification of the rendered materials, after rendering at least two layers of material onto the virtual object, the computer determines the material identifier corresponding to the first layer. This material identifier is designated as the original material identifier of the virtual object, indicating its original material, which is the first layer of material rendered onto the virtual object. The computer device determines the material identifier corresponding to the last material layer and identifies the material identifier as an additional material identifier for the virtual object. This additional material identifier indicates the last material layer among the at least two material layers rendered on the virtual object.
[0117] In one possible implementation, the virtual object without rendered materials is a static mesh created by the computer device. After the computer device renders different materials on the static mesh, the static mesh will have different effects and form different virtual objects. For example, for the same static mesh used as a rock, if the snow material is rendered on the rock, the rock can be a rock in the snow. If the grass material is rendered on the rock, the rock can be a rock in the grass. Figure 6 This is a schematic diagram of another virtual object provided in an embodiment of this application, such as... Figure 6 As shown, interface 601 displays a spherical rock in virtual space. The first layer of material on the rock is stone, and the last layer is snow. Interface 602 shows the rock's original material identifier and additional material identifiers, such as... Figure 6 As shown, the original material identifier of the rock is "03", where "03" represents stone material, and the additional material identifier of the rock is "05", where "05" represents snow. Figure 7 This is a schematic diagram of another virtual object provided in an embodiment of this application, such as... Figure 7 As shown, interface 701 displays another spherical rock in the virtual space. The first layer of material for this rock is stone, and the last layer is grass. Interface 702 shows the original material identifier and the additional material identifier for this rock, such as... Figure 7As shown, the original material identifier of the rock is "03", where "03" represents stone material, and the additional material identifier of the rock is "01", where "01" represents grass.
[0118] 302. The computer device responds to the material recognition command and determines the surface material of the virtual ground in the virtual space.
[0119] The material identification command is used to request the identification of the material corresponding to a region in the virtual space. Elements in the virtual space include the virtual surface. After receiving the material identification command, the computer device first determines the surface material of the virtual surface in the virtual space. The virtual surface is rendered with a material layer, and the surface material of the virtual surface is the material rendered by the virtual surface.
[0120] In one possible implementation, the computer device, in response to a material identification command, obtains the material name corresponding to the virtual surface, whereby the material name describes the surface material of the virtual surface. The computer device then queries for the material corresponding to the material name and identifies the found material as the surface material of the virtual surface.
[0121] The computer device stores a mapping between virtual surfaces and material names. The material name corresponding to the virtual surface describes its surface material, as described in step 301 above. After determining the material name corresponding to the virtual surface, the computer device identifies the material corresponding to that material name as the surface material of the virtual surface. The material corresponding to the material name is also the material described by that material name. For example, if the material name of the virtual surface is "Gra-Grassland1," and the material corresponding to "Gra-Grassland1" is grass, then the computer device will identify grass as the surface material of the virtual surface.
[0122] Optionally, the computer device stores a correspondence between surface identifiers and material names. The computer device determines the surface identifier corresponding to the virtual surface and queries the material name corresponding to the surface identifier. Optionally, the computer device stores a correspondence between material names and material identifiers. The computer device queries the material identifier corresponding to the material name and determines the material indicated by the material identifier as the surface material of the virtual surface.
[0123] 303. Computer equipment determines the surface material of virtual objects in virtual space.
[0124] Elements in the virtual space also include virtual objects. After receiving the material recognition instruction, the computer device also determines the surface material of the virtual objects in the virtual space. Specifically, a virtual object may be rendered with one layer of material or at least two layers of material. If the virtual object is rendered with only one layer of material, the computer device directly determines that layer of material rendered to the virtual object as its surface material. If the virtual object is rendered with at least two layers of material, the computer device determines the last layer of material rendered to the virtual object as its surface material.
[0125] In one possible implementation, the computer device, in response to a material recognition command, queries an additional material identifier corresponding to the virtual object. If the additional material identifier is found, the material indicated by the additional material identifier is determined as the surface material. If the additional material identifier is not found, the material indicated by the original material identifier of the virtual object is determined as the surface material.
[0126] The original material identifier indicates the first layer of material rendered onto the virtual object, while the additional material identifier indicates the last of at least two layers of material rendered on the virtual object. Virtual objects in virtual space may or may not have an original material identifier. If the computer device finds an additional material identifier for a virtual object, it means that the virtual object has rendered at least two layers of material, and the additional material identifier indicates the last layer of material on the virtual object. Therefore, the computer device determines the material indicated by the additional material identifier as the surface material of the virtual object. If the computer device does not find an additional material identifier for a virtual object, it means that the virtual object has only rendered one layer of material, and the original material identifier of the virtual object indicates the first layer of material on the virtual object. Therefore, the computer device determines the material indicated by the original material identifier as the surface material of the virtual object.
[0127] 304. The computer device controls the movement of the collision box in the virtual space. Whenever the collision box collides with any element, the area where the collision box is located is determined as the area where the element is located.
[0128] The computer device generates a collision box and controls its movement in the virtual space. When the collision box collides with any element, it indicates that the element is included in the area where the collision box is currently located. Therefore, the computer device determines the area where the collision box is located as the area where the element that collided with the collision box is located.
[0129] In one possible implementation, the virtual space comprises multiple subspaces. Each subspace includes a first boundary and a second boundary, the first boundary being opposite to and identical in shape to the second boundary. The first and second boundaries are parallel to the target direction, and the cross-section of the collision box in the target direction is the same as the cross-section of the subspace in the target direction. A computer device controls the collision box to move from the first boundary to the second boundary of the subspace, and whenever the collision box collides with any element, the area where the collision box is located is determined as the area where the element is located.
[0130] For example, each subspace is a cuboid, and the collision box is also a cuboid. The first boundary of a subspace is its top edge, and the second boundary is its bottom edge. The target direction is horizontal. The horizontal cross-section of the collision box is the same as the horizontal cross-section of the subspace, and the vertical length of the collision box is less than the vertical length of the subspace. The computer controls the collision box to move from the top boundary to the bottom boundary of the subspace. When the collision box reaches the bottom boundary of the subspace, it has essentially moved to any region within that subspace, colliding with every element in the subspace and thus determining the region where each element is located.
[0131] In another possible implementation, the first boundary is the top boundary of the subspace, and the second boundary is the bottom boundary of the subspace. Whenever the collision box collides with any element, if the collision is not the first collision of the collision box in the subspace, the computer device generates indication information corresponding to the element. The indication information is used to indicate that there are other elements above the element.
[0132] Since the collision box moves from the top boundary to the bottom boundary of the subspace, when the collision box collides with the element above it for the first time in the subspace, there are no other elements above the element that collides with the collision box. When the collision box collides with the element above it for the first time in the subspace, it means that the collision box has already collided with other elements during its movement from the top boundary to the bottom boundary. Therefore, there are other elements above the element that collides with the collision box this time.
[0133] In another possible implementation, the virtual space corresponds to a coordinate system. The virtual space includes multiple three-dimensional regions, each with the same volume. The computer device constructs a cuboid with the same volume as each region. For example, if the volume of each region is 20cm*20cm*10cm, then the volume of the cuboid is also 20cm*20cm*10cm. The computer device uses this cuboid as a collision box and controls the collision box to move in the virtual space. Whenever the collision box collides with any element, the computer device determines the horizontal coordinate, vertical coordinate, and height of the collision box in the coordinate system at the time of the collision. Based on the horizontal coordinate, vertical coordinate, and height, the computer device generates coordinate information and determines the area indicated by the coordinate information as the area that collided with the collision box.
[0134] In this embodiment, since the coordinate information generated by the computer device stores the horizontal coordinate, vertical coordinate, and height, this coordinate information can be used to represent the area where three-dimensional objects such as slopes, covered bridges, and lakes are located, which is beneficial for constructing a more realistic virtual space.
[0135] 305. The computer device determines the surface material of the element to be the material corresponding to the region.
[0136] In this embodiment of the application, considering that the material of the area where the element is located is the surface material of the element, for the area where the element exists in the virtual space, the surface material of the element in the area can be taken as the material corresponding to the area. Therefore, after the computer device determines the surface material of the element and the area where the element is located, it determines the surface material of the element as the material corresponding to the area, thereby determining the material corresponding to the area in the virtual space based on the material of the element in the virtual space.
[0137] After determining the material corresponding to the area, the computer device performs step 306 or step 307.
[0138] 306. The computer device responds to the first identification instruction carrying the first target area, determines the first target material corresponding to the first target area, and determines the landform type to which the first target material belongs as the landform type to which the first target area belongs.
[0139] 307. In response to a second identification instruction carrying a target landform type, the computer device determines a second target material corresponding to the target landform type and identifies the area corresponding to the second target material as an area belonging to the target landform type.
[0140] It should be noted that the embodiments of this application only illustrate the example of virtual space including virtual surfaces and virtual objects. In another embodiment, the elements in the virtual space only include virtual surfaces, then the computer device does not need to perform the above step 303, or the elements in the virtual space only include virtual objects, then the computer device does not need to perform the above step 302.
[0141] The method provided in this application determines the region where an element is located in a virtual space by controlling the movement of a collision box in that virtual space, and uses the surface material of the element in the virtual space as the material corresponding to the region where the element is located. Considering that the material corresponding to a region can reflect the terrain type to which that region belongs, it can be considered that the terrain type to which the region belongs is also the terrain type to which the material corresponding to that region belongs. Therefore, when it is necessary to identify the terrain type to which a certain region belongs, the terrain type to which the material corresponding to that region belongs can be determined as the terrain type to which that region belongs; or when it is necessary to identify a region belonging to a certain terrain type, the region corresponding to the material belonging to that terrain type can be determined as the region belonging to that terrain type. This provides an automatic way to identify terrain types without manual annotation, saving manpower and time, and improving the efficiency of terrain type identification.
[0142] Furthermore, querying the material of a virtual object is to determine the material corresponding to a region. The last layer of material of a virtual object can better reflect the characteristics of the region. Therefore, when a virtual object has rendered at least two layers of material, the last layer of material on the virtual object is determined as the material corresponding to the region where the virtual object is located, which improves the accuracy of determining the material corresponding to the region.
[0143] Furthermore, by assigning material names and material identifiers to materials in the virtual space, establishing a correspondence between virtual surfaces and material names, and adding standardized original material identifiers and additional material identifiers to virtual objects, the ability to identify materials in the virtual space is realized, which facilitates the subsequent identification of materials corresponding to areas, thereby determining the landform type to which the material belongs as the landform type to which the area belongs.
[0144] In the above Figure 2 Based on the previous embodiment, the computer device can associate the material identifier of the surface material with the coordinate information of the area and write it into a spatial description file so that subsequent landform type identification can be performed based on the spatial description file. The specific process is detailed below. Figure 8 and Figure 9 Examples of implementations.
[0145] Figure 8 This is a flowchart of another landform type identification method provided in this application embodiment. This application embodiment is executed by a computer device. See [link to flowchart]. Figure 8 The method includes:
[0146] 801. The computer device responds to the material recognition command and determines the surface material of the elements in the virtual space.
[0147] 802. The computer device controls the movement of the collision box in the virtual space. When the collision box collides with an element, the area where the collision box is located is determined as the area where the element is located.
[0148] The process of steps 801-802 is the same as that of steps 201-202 or steps 302-304 mentioned above, and will not be described again here.
[0149] 803. The computer equipment associates the material identifier of the surface material with the coordinate information of the area and writes it into the spatial description file.
[0150] The computer device determines the material identifier corresponding to the surface material of an element and determines the coordinate information of the area where the element is located. It associates the material identifier with the coordinate information and writes it into a spatial description file, thereby establishing a correspondence between materials and areas. This allows for subsequent direct querying of the material corresponding to a certain area or the area corresponding to a certain material based on the spatial description file.
[0151] In one possible implementation, the content of the space description file is as follows: X / L|Y / W|Z / H|ID. Here, ID represents the material identifier, and X, Y, Z, L, W, and H are obtained using the method in step 304. Specifically, X represents the x-coordinate of the collision box when it collides, Y represents the y-coordinate of the collision box when it collides, Z represents the height of the collision box when it collides, L represents the length of a region in the virtual space, W represents the width of the region, and H represents the height of the region.
[0152] In one possible implementation, each element in the virtual space corresponds to an indicator message. This indicator message indicates that other elements exist above the element. The generation method for this indicator message is described in step 304 above. The computer device associates the material identifier of the surface material, the coordinate information of the region, and the indicator message of the element into a spatial description file. Subsequently, when querying the spatial description file, if the corresponding material identifier, coordinate information, and indicator message are found, it indicates that the material corresponding to the region indicated by the coordinate information is the material indicated by the material identifier, and that other elements exist above the region indicated by the coordinate information.
[0153] 804. The computer device responds to the first identification instruction carrying the first target area, determines the first coordinate information corresponding to the first target area, queries the first material identifier corresponding to the first coordinate information in the spatial description file, and determines the material indicated by the first material identifier as the first target material.
[0154] The first identification command is used to request the identification of the terrain type to which the first target area belongs. In response to the first identification command, the computer device determines the first coordinate information corresponding to the first target area. This first coordinate information refers to the location of the first target area in the virtual space. Since the spatial description file stores the coordinate information and corresponding material identifiers, the computer device can directly query the spatial description file for the first material identifier corresponding to the first coordinate information. The material indicated by this first material identifier is also the first target material corresponding to the first target area.
[0155] 805. The computer equipment determines the landform type to which the first target material belongs as the landform type to which the first target area belongs.
[0156] Considering that the material corresponding to a region is the surface material of the elements in the region, the material corresponding to a region can reflect the landform type to which the region belongs. It can be considered that the landform type to which the region belongs is also the landform type to which the material corresponding to the region belongs. Therefore, the computer device determines the landform type to which the first target material corresponding to the first target region belongs as the landform type to which the first target region belongs, thereby realizing the identification of the landform type to which the first target region belongs.
[0157] The method provided in this application, after determining the material corresponding to a region, associates the region's coordinate information with the material identifier and writes it into a spatial description file, realizing an automated process for generating spatial description files. Subsequently, when it is necessary to query the material corresponding to a region, it can be queried directly in the spatial description file without manual annotation, reducing the risk of errors in manual annotation, improving query speed, and further realizing the automated identification of the landform type to which any region belongs.
[0158] Figure 9 This is a flowchart of another landform type identification method provided in this application embodiment. This application embodiment is executed by a computer device. See [link to flowchart]. Figure 9 The method includes:
[0159] 901. The computer device responds to the material recognition command and determines the surface material of the elements in the virtual space.
[0160] 902. The computer device controls the movement of the collision box in the virtual space. When the collision box collides with an element, the area where the collision box is located is determined as the area where the element is located.
[0161] 903. The computer equipment associates the material identifier of the surface material with the coordinate information of the area and writes it into the spatial description file.
[0162] The process of steps 901-903 is the same as that of steps 801-803 above, and will not be repeated here.
[0163] 904. The computer device responds to the second identification instruction carrying the target terrain type and determines the second target material corresponding to the target terrain type.
[0164] The second identification instruction is used to request the identification of a region in the virtual space that belongs to the target terrain type. In response to the second identification instruction, the computer device determines the second target material corresponding to the target terrain type. The second target material corresponding to the target terrain type refers to the target material that belongs to the target terrain type.
[0165] For example, if the target terrain type is snow, then the material of the second target is snow; as another example, if the target terrain type is sand, then the material of the second target is sand.
[0166] 905. The computer equipment determines the second material identifier corresponding to the second target material, queries the second coordinate information corresponding to the second material identifier in the spatial description file, and determines the area indicated by the queried second coordinate information as the area belonging to the target landform type.
[0167] Considering that the material corresponding to a region is the surface material of the elements within that region, the material corresponding to a region can reflect the terrain type to which that region belongs. Therefore, it can be assumed that the terrain type of the region corresponding to the material is the same as the terrain type to which the material itself belongs. Thus, the region corresponding to the second target material is a region belonging to that target terrain type. Since the spatial description file stores coordinate information and corresponding material identifiers, the computer device determines the second material identifier corresponding to the second target material and then directly queries the spatial description file for the second coordinate information corresponding to that second material identifier. The region indicated by this second coordinate information is also a region belonging to that target terrain type.
[0168] The method provided in this application, after determining the material corresponding to a region, associates the region's coordinate information with the material's identifier and writes it into a spatial description file, thus realizing an automated process for generating spatial description files. Subsequently, when it is necessary to query the material corresponding to a region, it can be queried directly in the spatial description file without manual annotation, reducing the risk of errors in manual annotation, improving query speed, and further realizing the automated identification of regions belonging to any landform type.
[0169] Figure 10 This is a schematic diagram of a virtual space construction method provided in an embodiment of this application, such as... Figure 10 As shown, the method includes the following:
[0170] (i) Material Generation: The computer device generates various materials, including surface materials and object materials. Surface materials are rendered onto the virtual ground, such as grass, snow, and sand. Object materials are rendered onto virtual objects, such as building materials and metal materials. The computer device assigns a corresponding material identifier to each material, which is used to indicate the material.
[0171] (II) Generating Virtual Surfaces and Virtual Objects: The computer device generates virtual surfaces, renders surface materials onto them to make the virtual surfaces appear as grasslands, snowfields, rivers, or deserts, and assigns corresponding material names to the virtual surfaces. The computer device generates virtual objects, renders object materials onto them to make the virtual objects appear as trees, houses, or bridges, and assigns original material identifiers and additional material identifiers to the virtual objects.
[0172] (III) Constructing Virtual Space: Computer devices place generated virtual objects onto a virtual surface to form a virtual space. The virtual space can then be supplemented and optimized to make it richer and more aesthetically pleasing.
[0173] (iv) Exporting the Virtual Space File, Virtual Space Description File, and Installation Package File: Based on the created virtual space, the computer device exports a virtual space file, and then exports a virtual space description file and an installation package file based on this virtual space file. The virtual space file includes the virtual space itself; the virtual space description file includes the mapping between region coordinates and material identifiers; and the installation package file is a simplified version of the virtual space file. The virtual space description file is used during server runtime to allow the server to query the mapping between regions and materials, while the installation package file is used when installing applications on the terminal.
[0174] Figure 11 This is a schematic diagram of a spatial description file generation method provided in an embodiment of this application, such as... Figure 11 As shown, the method includes the following:
[0175] 1101. Generating a Virtual Object Identification File: The computer device traverses the virtual objects in the virtual space. If an additional material identifier corresponding to the virtual object is found, this additional material identifier is designated as the surface material identifier of the virtual object, indicating the surface material of the virtual object. If no additional material identifier is found, the original material identifier of the virtual object is retrieved and designated as the surface material identifier of the virtual object. The computer device generates an identification file for the virtual object, which includes the object identifier and the surface material identifier of the virtual object.
[0176] 1102. Generating a Virtual Surface Identification File: The computer device traverses the virtual surfaces in the virtual space, queries the material name corresponding to the virtual surface, and determines the surface material identifier of the virtual surface based on the material name. The computer device generates a virtual surface identification file, which includes the surface identifier and the surface material identifier of the virtual surface.
[0177] 1103. Determining Coordinate Information: The computer device exports a static spatial file, which includes a virtual surface and virtual objects in the virtual space without rendered materials. The computer device loads this static spatial file using PhysX (a physics engine) to obtain the virtual space, and controls a collision box to move within this virtual space. Whenever the collision box collides with any element, the coordinate information of the area where the collision box is located is determined. This coordinate information can be used to indicate the area where the element that collided with the collision box is located.
[0178] 1104. Associate coordinate information and surface material identifiers and write them into the spatial description file: After the computer device obtains the coordinate information, it queries the element identifiers corresponding to the elements in the area indicated by the coordinate information. The element identifiers are either surface identifiers or object identifiers. In the identifier file generated in steps 1101 and 1102 above, the computer device queries the surface material identifiers corresponding to the element identifiers and associates the queried surface material identifiers with the coordinate information and writes them into the spatial description file.
[0179] The terrain type identification method provided in this application can be applied to any scenario where the terrain type of a region in a virtual space is identified. For example, in the context of a video game, the virtual space is a virtual space within the video game. The following description uses a video game as an example to illustrate the application scenario of this application.
[0180] In video games, a vast game world is created for the user; this game world, also known as the virtual space in this embodiment, allows the user to explore and freely choose when and how to complete game tasks. Users can also interact with elements within the game world, such as chopping down trees, building houses, harvesting crops, making fire, and cooking. To enhance the fun of video games, the method provided in this embodiment can be used to identify the terrain type of areas within the virtual space, thereby refreshing and controlling elements within the virtual space based on the terrain type.
[0181] For example, this application embodiment is applied to scenarios where collectibles are refreshed in a virtual space. In video games, players control virtual objects to perform activities in a virtual space, such as collecting virtual plants or picking up virtual items. To enhance the fun of video games, virtual plants can be randomly refreshed in the virtual space, such as virtual strawberries in a grassy area, virtual watermelons in a sandy area, and virtual lotus flowers in a lake. Therefore, the method provided in this application embodiment can be used to identify the terrain type of a region in the virtual space and refresh virtual plants that match the terrain type of that region.
[0182] For example, embodiments of this application are applied to scenarios where artificial intelligence (AI) objects are controlled to move within a virtual space. In video games, AI objects are controlled to move within an environment suitable for their survival. For instance, if an AI object's attribute is a penguin, it is controlled to move in snowy terrain within the virtual space; if its attribute is a monkey, it is controlled to move in a forest within the virtual space. Therefore, the method provided in embodiments of this application can be used to identify the terrain type of a region in the virtual space and control the movement of AI objects matching that terrain type within that region.
[0183] For example, this application embodiment is applied to scenarios where elements are refreshed based on environmental conditions in a virtual space. In video games, virtual space can also be used to simulate real environments under different conditions, such as sunny days, rainy days, foggy days, or nighttime. Computer devices can refresh elements in the virtual space under target environmental conditions. For example, when the target environmental condition is rainy, moss-like plants can be refreshed on rocks; when the target environmental condition is nighttime, bioluminescent insects such as fireflies can be refreshed in the forest. Therefore, the method provided in this application embodiment can be used to identify areas in the virtual space that belong to rocks or forests, thereby refreshing the corresponding elements and making the virtual space more realistic and richer.
[0184] In addition, the method provided in this application can also be applied to scenarios involving the creation of virtual spaces. For example, video game developers create virtual spaces to serve as game worlds. Developers create virtual surfaces and virtual objects through a space creation interface displayed on a terminal, render materials for the virtual surfaces and virtual objects, and set the material names corresponding to the virtual surfaces and the original or additional material identifiers corresponding to the virtual objects in the space creation interface. Then, the virtual objects are placed on the virtual surfaces to form the virtual space. Subsequently, the method provided in this application can be used to identify the terrain type of each area within the virtual space.
[0185] Figure 12This is a schematic diagram of the structure of a terrain type identification device provided in an embodiment of this application. See also... Figure 12 The device includes:
[0186] Material determination module 1201 is used to determine the surface material of elements in the virtual space in response to material recognition instructions;
[0187] The material determination module 1201 is also used to control the movement of the collision box in the virtual space. When the collision box collides with an element, the area where the collision box is located is determined as the area where the element is located.
[0188] The material determination module 1201 is also used to determine the surface material of the element as the material corresponding to the area where the element is located;
[0189] The type determination module 1202 is configured to, in response to a first identification instruction carrying a first target area, determine a first target material corresponding to the first target area, and determine the terrain type to which the first target material belongs as the terrain type to which the first target area belongs; or,
[0190] The region determination module 1203 is used to respond to a second identification instruction carrying a target landform type, determine a second target material corresponding to the target landform type, and determine the region corresponding to the second target material as a region belonging to the target landform type.
[0191] The terrain type recognition device provided in this application determines the region where an element is located in a virtual space by controlling the movement of a collision box in that virtual space, and uses the surface material of the element in the virtual space as the material corresponding to the region where the element is located. Considering that the material corresponding to a region can reflect the terrain type to which that region belongs, it can be considered that the terrain type to which the region belongs is also the terrain type to which the material corresponding to that region belongs. Therefore, when it is necessary to identify the terrain type to which a certain region belongs, the terrain type to which the material corresponding to that region belongs can be determined as the terrain type to which that region belongs, or when it is necessary to identify a region belonging to a certain terrain type, the region corresponding to the material belonging to that terrain type can be determined as the region belonging to that terrain type. This provides an automatic method for identifying terrain types, eliminating the need for manual labeling, saving manpower and time, and improving the efficiency of terrain type recognition.
[0192] Optionally, see Figure 13 The element is the virtual surface in the virtual space, and the material determination module 1201 includes:
[0193] The first determining unit 1211 is used to obtain the material name corresponding to the virtual surface in response to the material identification instruction. The material name is used to describe the surface material of the virtual surface.
[0194] The first determining unit 1211 is also used to query the material corresponding to the material name;
[0195] The first determining unit 1211 is also used to determine the queried material as the surface material of the virtual surface.
[0196] Optionally, see Figure 13 The device also includes a rendering module 1204, which is used for:
[0197] Render a layer of material onto the virtual surface;
[0198] Query the material name corresponding to the material rendered onto the virtual surface;
[0199] Establish the correspondence between the material name and the virtual surface.
[0200] Optionally, see Figure 13 The element is a virtual object in the virtual space, and the material determination module 1201 includes:
[0201] The second determining unit 1221 is used to query the additional material identifier corresponding to the virtual object in response to the material identification instruction. The additional material identifier indicates the last material among the at least two layers of materials when the virtual object has rendered at least two layers of materials.
[0202] The second determining unit 1221 is further configured to determine the material indicated by the additional material identifier as the surface material when the additional material identifier corresponding to the virtual object is found.
[0203] The second determining unit 1221 is further configured to determine the material indicated by the original material identifier of the virtual object as the surface material when no additional material identifier corresponding to the virtual object is found, and the original material identifier indicates the first layer material rendered on the virtual object.
[0204] Optionally, see Figure 13 The device also includes a rendering module 1204, which is used for:
[0205] Render a layer of material onto the virtual object;
[0206] The material identifier corresponding to the material rendered onto the virtual object is determined as the original material identifier.
[0207] Optionally, see Figure 13 The device also includes a rendering module 1204, which is used for:
[0208] Render at least two layers of material onto the virtual object;
[0209] The material identifier corresponding to the first layer of material rendered onto the virtual object is determined as the original material identifier;
[0210] The material identifier corresponding to the last layer of material rendered onto the virtual object is determined as the additional material identifier.
[0211] Optionally, see Figure 13 The virtual space includes multiple subspaces, and the material determination module 1201 includes:
[0212] The third determining unit 1231 is used to control the collision box to move from the first boundary of the subspace to the second boundary of the subspace. Whenever the collision box collides with any element, the area where the collision box is located is determined as the area where the element is located.
[0213] The second boundary is opposite to the first boundary and has the same shape. The first boundary and the second boundary are parallel to the target direction. The cross-section of the collision box in the target direction is the same as the cross-section of the subspace in the target direction.
[0214] Optionally, see Figure 13 The first boundary is the top boundary of the subspace, the second boundary is the bottom boundary of the subspace, and the device further includes:
[0215] The generation module 1205 is used to generate indication information corresponding to the element whenever the collision box collides with any element, provided that the collision is not the first collision of the collision box in the subspace. The indication information is used to indicate that there are other elements above the element.
[0216] Optionally, see Figure 13 The material determination module 1201 includes:
[0217] The writing unit 1241 is used to associate the material identifier of the surface material with the coordinate information of the area and write it into the spatial description file.
[0218] Optionally, see Figure 13 The writing unit 1241 is used to associate the material identifier of the surface material, the coordinate information of the area and the indication information of the element into the spatial description file. The indication information is used to indicate that there are other elements above the element.
[0219] Optionally, see Figure 13 The type determination module 1202 is used for:
[0220] Determine the first coordinate information corresponding to the first target area;
[0221] In the spatial description file, the first material identifier corresponding to the first coordinate information is queried, and the material indicated by the first material identifier is determined as the first target material.
[0222] Optionally, see Figure 13 The region determination module 1203 is used for:
[0223] Determine the second material identifier corresponding to the second target material;
[0224] In the spatial description file, query the second coordinate information corresponding to the second material identifier;
[0225] The area indicated by the second coordinate information obtained from the query is identified as the area belonging to the target landform type.
[0226] It should be noted that the terrain type identification device provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the terrain type identification device and the terrain type identification method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0227] This application also provides a computer device, which includes a processor and a memory. The memory stores at least one computer program, which is loaded and executed by the processor to perform the operations performed in the landform type identification method of the above embodiments.
[0228] Optionally, the computer device is provided as a terminal. Figure 14 A schematic diagram of the structure of a terminal 1400 provided in an exemplary embodiment of this application is shown.
[0229] Terminal 1400 includes a processor 1401 and a memory 1402.
[0230] Processor 1401 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 1401 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1401 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1401 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen.
[0231] The memory 1402 may include one or more computer-readable storage media, which may be non-transitory. The memory 1402 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1402 are used to store at least one computer program, which is used by the processor 1401 to implement the terrain type identification method provided in the method embodiments of this application.
[0232] In some embodiments, the terminal 1400 may also optionally include a peripheral device interface 1403 and at least one peripheral device. The processor 1401, memory 1402, and peripheral device interface 1403 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1403 via a bus, signal line, or circuit board. Optionally, the peripheral device includes at least one of a radio frequency circuit 1404 or a display screen 1405.
[0233] Peripheral device interface 1403 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1401 and memory 1402. In some embodiments, processor 1401, memory 1402 and peripheral device interface 1403 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1401, memory 1402 and peripheral device interface 1403 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0234] Radio frequency (RF) circuit 1404 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. RF circuit 1404 communicates with communication networks and other communication devices via electromagnetic signals. RF circuit 1404 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, RF circuit 1404 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. RF circuit 1404 can communicate with other devices using at least one wireless communication protocol.
[0235] Display screen 1405 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1405 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1401 for processing. In this case, display screen 1405 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1405, disposed on the front panel of terminal 1400; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal 1400 or in a folded design; in still other embodiments, display screen 1405 may be a flexible display screen, disposed on a curved or folded surface of terminal 1400.
[0236] Those skilled in the art will understand that Figure 14 The structure shown does not constitute a limitation on terminal 1400 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0237] Optionally, the computer device is provided as a server. Figure 15 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1500 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 1501 and one or more memories 1502. The memories 1502 store at least one computer program, which is loaded and executed by the processor 1501 to implement the methods provided in the above-described method embodiments. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be elaborated upon here.
[0238] This application also provides a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to implement the operations performed by the landform type identification method of the above embodiments.
[0239] This application also provides a computer program product, including a computer program loaded and executed by a processor to perform the operations performed by the terrain type identification method of the above embodiments. In some embodiments, the computer program involved in this application may be deployed and executed on a single computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed across multiple locations and interconnected via a communication network. These multiple computer devices distributed across multiple locations and interconnected via a communication network can form a blockchain system.
[0240] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0241] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present application should be included within the protection scope of the present application.
Claims
1. A method for identifying landform types, characterized in that, The method includes: In response to a material identification command, if the element in the virtual space is a virtual object, query the additional material identifier corresponding to the virtual object. The additional material identifier indicates the last material among the at least two layers of materials if the virtual object has been rendered with at least two layers of materials. If an additional material identifier corresponding to the virtual object is found, the material indicated by the additional material identifier is determined as the surface material of the element; if no additional material identifier corresponding to the virtual object is found, the material indicated by the original material identifier of the virtual object is determined as the surface material of the element, and the original material identifier indicates the first layer of material rendered on the virtual object. The collision box is controlled to move in the virtual space. When the collision box collides with the element, the area where the collision box is located is determined as the area where the element is located. The surface material of the element is determined to be the material corresponding to the region where the element is located; In response to a first identification instruction carrying a first target area, the system determines a first target material corresponding to the first target area and identifies the terrain type to which the first target material belongs as the terrain type to which the first target area belongs; or, In response to a second identification instruction carrying a target landform type, a second target material corresponding to the target landform type is determined, and the area corresponding to the second target material is determined as an area belonging to the target landform type.
2. The method according to claim 1, characterized in that, The method further includes: In response to the material identification instruction, if the element is a virtual surface, the material name corresponding to the virtual surface is obtained, and the material name is used to describe the surface material of the virtual surface. Search for the material corresponding to the given material name; The material found in the query is determined as the surface material of the virtual ground.
3. The method according to claim 2, characterized in that, In response to the material identification instruction, before obtaining the material name corresponding to the virtual surface when the element is a virtual surface, the method further includes: Render a layer of material onto the virtual surface; Query the material name corresponding to the material rendered onto the virtual surface; Establish the correspondence between the material name and the virtual surface.
4. The method according to claim 1, characterized in that, Before querying the additional material identifier corresponding to the virtual object when the element in the virtual space is a virtual object, in response to the material recognition command, the method further includes: Render a layer of material onto the virtual object; The material identifier corresponding to the material rendered onto the virtual object is determined as the original material identifier.
5. The method according to claim 1, characterized in that, Before querying the additional material identifier corresponding to the virtual object when the element in the virtual space is a virtual object, in response to the material recognition command, the method further includes: Render at least two layers of material onto the virtual object; The material identifier corresponding to the first layer of material rendered onto the virtual object is determined as the original material identifier; The material identifier corresponding to the last layer of material rendered onto the virtual object is determined as the additional material identifier.
6. The method according to claim 1, characterized in that, The virtual space includes multiple subspaces. The control collision box moves within the virtual space. When the collision box collides with an element, the area where the collision box is located is determined as the area where the element is located, including: The collision box is controlled to move from the first boundary of the subspace to the second boundary of the subspace. Whenever the collision box collides with any element, the area where the collision box is located is determined as the area where the element is located. Wherein, the second boundary is opposite to the first boundary and has the same shape, the first boundary and the second boundary are parallel to the target direction, and the cross-section of the collision box in the target direction is the same as the cross-section of the subspace in the target direction.
7. The method according to claim 6, characterized in that, The first boundary is the top boundary of the subspace, the second boundary is the bottom boundary of the subspace, and the method further includes: Whenever the collision box collides with any element, if the collision is not the first collision of the collision box in the subspace, an indication message corresponding to the element is generated, which is used to indicate that there are other elements above the element.
8. The method according to claim 1, characterized in that, Determining the surface material of the element as the material corresponding to the region where the element is located includes: The material identifier of the surface material is associated with the coordinate information of the region and written into the spatial description file.
9. The method according to claim 8, characterized in that, Determining the first target material corresponding to the first target region includes: Determine the first coordinate information corresponding to the first target region; In the spatial description file, the first material identifier corresponding to the first coordinate information is queried, and the material indicated by the first material identifier is determined as the first target material.
10. The method according to claim 8, characterized in that, The step of determining the area corresponding to the second target material as an area belonging to the target landform type includes: Determine the second material identifier corresponding to the second target material; In the spatial description file, query the second coordinate information corresponding to the second material identifier; The area indicated by the second coordinate information obtained from the query is determined as the area belonging to the target landform type.
11. A landform type identification device, characterized in that, The device includes: The material determination module is used to respond to the material identification command and, when the element in the virtual space is a virtual object, query the additional material identifier corresponding to the virtual object. The additional material identifier indicates the last material among the at least two layers of materials when the virtual object has been rendered. The material determination module is further configured to, when an additional material identifier corresponding to the virtual object is found, determine the material indicated by the additional material identifier as the surface material of the element; when no additional material identifier corresponding to the virtual object is found, determine the material indicated by the original material identifier of the virtual object as the surface material of the element, wherein the original material identifier indicates the first layer material rendered on the virtual object. A type determination module is used to, in response to a first identification instruction carrying a first target area, determine a first target material corresponding to the first target area, and determine the terrain type to which the first target material belongs as the terrain type to which the first target area belongs; or, The region determination module is used to respond to a second identification instruction carrying a target landform type, determine a second target material corresponding to the target landform type, and determine the region corresponding to the second target material as a region belonging to the target landform type.
12. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one computer program, which is loaded and executed by the processor to perform the operations performed by the landform type identification method as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to perform the operations of the landform type identification method as described in any one of claims 1 to 10.
14. A computer program product, comprising a computer program, characterized in that, The computer program is loaded and executed by a processor to perform the operations performed by the landform type identification method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Material discrimination method and device for game entity
CN112190947A