Virtual building material splicing method, device, equipment and storage medium in a game
By determining the adjacency relationship between virtual building materials and adjacent virtual building materials, a target virtual building that conforms to rationality is generated, the problem of unreasonable splicing of virtual building materials in the existing technology is solved and flexible building construction is achieved.
Patent Information
- Application Number
- CN202210365199.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-07
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-04-07
AI Technical Summary
In existing architectural games, virtual building materials are prone to interspersed or hollowed out problems when splicing, resulting in the generated target virtual buildings that do not conform to the rationality of building buildings.
By determining the adjacency relationship between the virtual building materials to be placed and the adjacency virtual building materials, the adjacency relationship is used to generate the target virtual building in the game scene, including indexing the adjacency virtual building material list, traversing the relative position and orientation, determining the area transformation method, and performing transformation to generate the target virtual building that conforms to rationality.
The target virtual buildings generated in the game scene are more in line with the rationality of the building and meet the user's flexible construction needs.
Smart Images

Figure CN114939274B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing. Specifically, it relates to a method, device, equipment, and storage medium for virtual building material splicing in a game. Background Art
[0002] With the development of Internet technology, games play an increasingly important role in people's lives. In the context of leisure and entertainment, people usually choose games as a way to pass the time.
[0003] Among a large number of game types, construction games have a wide audience. In construction games, users can place virtual building materials in the game scene to generate a target virtual building in the game scene according to the splicing between the virtual building materials, so as to satisfy the game experience of users building virtual buildings by themselves.
[0004] However, in existing construction games, during the process of splicing the target virtual building, there are prone to problems such as interpenetration or hollowing between the virtual building materials, resulting in the generated target virtual building not conforming to the rationality of building construction. Summary of the Invention
[0005] The purpose of this application is to provide a method, device, equipment, and storage medium for virtual building material splicing in a game to solve the problem that the generated target virtual building in the existing technology does not conform to the rationality of building construction for the deficiencies in the above-mentioned existing technology.
[0006] To achieve the above purpose, the technical solutions adopted in the embodiments of this application are as follows:
[0007] In a first aspect, an embodiment of this application provides a method for virtual building material splicing in a game, and the method includes:
[0008] In response to a placement operation of a virtual building material to be placed, determine at least one adjacent virtual building material of the virtual building material to be placed in the game scene;
[0009] Determine the adjacency relationship between the virtual building material to be placed and each of the adjacent virtual building materials;
[0010] According to the virtual building material to be placed, the at least one adjacent virtual building material, and using the adjacency relationship, generate a target virtual building at the target position corresponding to the placement operation in the game scene.
[0011] Optionally, the determining the adjacency relationship between the virtual building material to be placed and each of the adjacent virtual building materials includes:
[0012] Index the adjacent virtual building materials corresponding to the to-be-placed virtual building material according to each of the adjacent virtual building materials. The adjacent virtual building material list includes: the positions and orientations of each of the adjacent virtual building materials;
[0013] Traverse the adjacent virtual building material list to determine the relative positions and relative orientations between each of the adjacent virtual building materials and the to-be-placed virtual building material;
[0014] Determine the adjacency relationships between the to-be-placed virtual building material and each of the adjacent virtual building materials according to the relative positions and the relative orientations.
[0015] Optionally, the generating the target virtual building at the target position corresponding to the placement operation in the game scene according to the to-be-placed virtual building material, the at least one adjacent virtual building material, and using the adjacency relationships includes:
[0016] Determine the area transformation methods corresponding to the to-be-placed virtual building material and each of the adjacent virtual building materials according to the adjacency relationships;
[0017] Generate the target virtual building at the target position in the game scene according to the to-be-placed virtual building material, the at least one adjacent virtual building material, and using the area transformation methods.
[0018] Optionally, the generating the target virtual building at the target position in the game scene according to the to-be-placed virtual building material, the at least one adjacent virtual building material, and using the area transformation methods includes:
[0019] Transform the adjacent virtual building materials and / or the to-be-placed virtual building material according to the to-be-placed virtual building material, each of the adjacent virtual building materials, and using the area transformation methods corresponding to each of the adjacent virtual building materials, so as to generate the target virtual building at the target position in the game scene.
[0020] Optionally, before the determining the area transformation methods corresponding to the to-be-placed virtual building material and each of the adjacent virtual building materials according to the adjacency relationships, the method further includes:
[0021] Determine the transformation area of the to-be-placed virtual building material;
[0022] The determining the area transformation methods corresponding to the to-be-placed virtual building material and each of the adjacent virtual building materials according to the adjacency relationships includes:
[0023] Respectively determine the area transformation methods corresponding to each of the transformation areas of the to-be-placed virtual building material and each of the adjacent virtual building materials according to the adjacency relationships.
[0024] Optionally, the transformation area for determining the virtual building material to be placed includes:
[0025] Determine the hanging area of the virtual building material to be placed;
[0026] Determine the transformation area of the virtual building material to be placed according to the hanging area.
[0027] Optionally, the determining of at least one adjacent virtual building material of the virtual building material to be placed in response to the placement operation of the virtual building material to be placed includes:
[0028] In response to the placement operation of the virtual building material to be placed, determine the placement position corresponding to the placement operation in the game scene;
[0029] Determine at least one adjacent virtual building material of the virtual building material to be placed in the game scene according to the physical overlap detection algorithm and the placement position.
[0030] In a second aspect, another embodiment of the present application provides a virtual building material splicing device in a game. The device includes: a determination module and a generation module, where:
[0031] The determination module is configured to determine at least one adjacent virtual building material of the virtual building material to be placed in the game scene in response to the placement operation of the virtual building material to be placed; determine the adjacency relationship between the virtual building material to be placed and each of the adjacent virtual building materials;
[0032] The generation module is configured to generate a target virtual building at the target position corresponding to the placement operation in the game scene according to the virtual building material to be placed, the at least one adjacent virtual building material, and using the adjacency relationship.
[0033] Optionally, the device further includes: an indexing module and a traversing module, where:
[0034] The indexing module is configured to index an adjacent virtual building material list corresponding to the virtual building material to be placed according to each of the adjacent virtual building materials. The adjacent virtual building material list includes: the positions and orientations of each of the adjacent virtual building materials;
[0035] The traversing module is configured to traverse the adjacent virtual building material list to determine the relative positions and relative orientations between each of the adjacent virtual building materials and the virtual building material to be placed;
[0036] The determination module is specifically configured to determine the adjacency relationship between the virtual building material to be placed and each of the adjacent virtual building materials according to the relative position and the relative orientation.
[0037] Optionally, the determining module is specifically configured to determine, according to the adjacency relationship, area transformation methods corresponding to the virtual building materials to be placed and each of the adjacent virtual building materials respectively;
[0038] The generating module is specifically configured to generate the target virtual building at the target position in the game scene by using the area transformation method according to the virtual building materials to be placed and the at least one adjacent virtual building material.
[0039] Optionally, the generating module is specifically configured to transform the adjacent virtual building materials and / or the virtual building materials to be placed by using the area transformation methods corresponding to the adjacent virtual building materials according to the virtual building materials to be placed and each of the adjacent virtual building materials, so as to generate the target virtual building at the target position in the game scene.
[0040] Optionally, the determining module is specifically configured to determine the transformation area of the virtual building materials to be placed; and determine, according to the adjacency relationship, area transformation methods corresponding to each of the transformation areas of the virtual building materials to be placed and each of the adjacent virtual building materials respectively.
[0041] Optionally, the determining module is specifically configured to determine the hanging area of the virtual building materials to be placed; and determine the transformation area of the virtual building materials to be placed according to the hanging area.
[0042] Optionally, the determining module is specifically configured to, in response to a placement operation of the virtual building materials to be placed, determine a placement position corresponding to the placement operation in the game scene; and determine at least one adjacent virtual building material of the virtual building materials to be placed in the game scene according to a physical overlap detection algorithm and the placement position.
[0043] In a third aspect, another embodiment of the present application provides a virtual building material splicing device in a game, including: a processor, a storage medium, and a bus. The storage medium stores machine-readable instructions executable by the processor. When the virtual building material splicing device in the game runs, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of any method in the first aspect as described above.
[0044] In a fourth aspect, another embodiment of the present application provides a storage medium, on which a computer program is stored. When the computer program is run by a processor, it performs the steps of any method in the first aspect as described above.
[0045] The beneficial effects of the present application are as follows: By adopting the method for splicing virtual building materials in the game provided by the present application, for different virtual building materials to be placed and different adjacent virtual building materials, different adjacent relationships may be corresponding. Thus, during the process of placing the virtual building materials to be placed, according to the corresponding adjacent relationship, as well as the virtual building materials to be placed and the adjacent virtual building materials corresponding to this adjacent relationship, a target virtual building is generated at the target position corresponding to the placement operation in the game scene, making the generated target virtual building more in line with building rationality, thereby realizing flexible processing of most model transformation requirements in the game scene and achieving flexible construction of the target virtual building. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0047] Figure 1 It is a schematic flowchart of the method for splicing virtual building materials in the game provided by an embodiment of the present application;
[0048] Figure 2 It is a schematic flowchart of the method for splicing virtual building materials in the game provided by another embodiment of the present application;
[0049] Figure 3 It is a schematic diagram of the model space provided by an embodiment of the present application;
[0050] Figure 4 It is a schematic flowchart of a method for splicing virtual building materials in the game provided by another embodiment of the present application;
[0051] Figure 5 It is a schematic diagram of the game scene provided by an embodiment of the present application;
[0052] Figure 6 It is a schematic diagram of the structure of the device for splicing virtual building materials in the game provided by an embodiment of the present application;
[0053] Figure 7 It is a schematic diagram of the structure of the device for splicing virtual building materials in the game provided by another embodiment of the present application;
[0054] Figure 8 It is a schematic diagram of the structure of the device for splicing virtual building materials in the game provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0055] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Apparently, the described embodiments are some, but not all, of the embodiments of this application.
[0056] The components of the embodiments of this application usually described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of this application claimed, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative efforts fall within the scope of protection of this application.
[0057] In addition, the flowcharts used in this application illustrate the operations implemented according to some embodiments of this application. It should be understood that the operations in the flowchart may not be implemented in sequence, and steps without logical context relationships may be reversed or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart or remove one or more operations from the flowchart under the guidance of the content of this application.
[0058] The following explains and illustrates a virtual building material splicing method in a game provided by the embodiments of this application in combination with multiple specific application examples. Figure 1 The flowchart of a virtual building material splicing method in a game provided by an embodiment of this application is as Figure 1 shown. The method includes:
[0059] S101: In response to a placement operation of a virtual building material to be placed, determine at least one adjacent virtual building material of the virtual building material to be placed in the game scene.
[0060] Among them, in a building game, the player selects at least one virtual building material from the virtual building material library provided by the game and splices and generates a target virtual building in the game scene; during the splicing process, the player generally needs to select a suitable virtual building material from multiple virtual building materials as the virtual building material to be placed, and then select a suitable placement position in the game scene to place the virtual building material to be placed, and generate a target virtual building according to the multiple virtual building materials placed in the game scene.
[0061] In some possible embodiments, after the player selects the virtual building material to be placed, the player can determine the placement position corresponding to the placement operation for the virtual building material to be placed according to the placement operation for the virtual building material to be placed, and determine whether there are adjacent virtual building materials around the placement position in the game scene according to the placement position of the virtual building material to be placed in the game scene. If so, determine at least one adjacent virtual building material corresponding to the virtual building material to be placed in the game scene.
[0062] In an embodiment of the present application, the method for determining adjacent virtual building materials may be, for example: in response to a placement operation of a virtual building material to be placed, determining a placement position corresponding to the placement operation in the game scene; and determining at least one adjacent virtual building material of the virtual building material to be placed in the game scene according to a physical overlap detection algorithm and the placement position.
[0063] S102: Determine the adjacency relationship between the virtual building material to be placed and each adjacent virtual building material.
[0064] In some possible embodiments, for example, according to the relative orientation and relative position between the virtual building material to be placed and each adjacent virtual building material, query in a preset relationship definition table to determine the adjacency relationship corresponding to the current relative orientation and relative position, so as to determine the adjacency relationship between the virtual building material to be placed and each adjacent virtual building material.
[0065] In an embodiment of the present application, the preset relationship definition table includes a plurality of predefined adjacency relationships. Each adjacency relationship describes the relative position relationship between two adjacent building materials, and describes the corresponding transformation situation under the current relative position relationship, that is, each adjacency relationship defines a transformation method corresponding to two adjacent virtual building materials. Among them, the transformation method may be, for example, a transformation method that only transforms the virtual building material to be placed (the main body virtual building material), or a transformation method that only transforms the adjacent virtual building material (the target virtual building material), or a transformation method that simultaneously transforms the virtual building material to be placed and the adjacent virtual building material. It should be understood that the above embodiments are only illustrative. The specific transformation method is pre-configured in the preset relationship definition table and can be flexibly adjusted according to user needs, and is not limited to those given in the above embodiments.
[0066] S103: Generate a target virtual building at the target position corresponding to the placement operation in the game scene according to the virtual building material to be placed, at least one adjacent virtual building material, and the adjacency relationship.
[0067] In some possible embodiments, transform the virtual building material to be placed and the adjacent virtual building material corresponding to the current adjacency relationship by using the adjacency relationship, and generate a target virtual building at the target position corresponding to the placement operation in the game scene according to the transformed virtual building material to be placed and the transformed adjacent virtual building material.
[0068] By adopting the virtual building material splicing method in the game provided by this application, for different virtual building materials to be placed and different adjacent virtual building materials, different adjacent relationships may be corresponding. Therefore, during the process of placing the virtual building materials to be placed, according to the corresponding adjacent relationship, as well as the virtual building materials to be placed and the adjacent virtual building materials corresponding to this adjacent relationship, a target virtual building is generated at the target position corresponding to the placement operation in the game scene, making the generated target virtual building more in line with the building rationality, thereby realizing the flexible processing of most model transformation requirements in the game scene and realizing the flexible construction of the target virtual building.
[0069] Optionally, on the basis of the above embodiments, the embodiments of this application can also provide a virtual building material splicing method in the game. The following is an example to illustrate the implementation process of determining the adjacent relationship between the virtual building materials to be placed and each adjacent virtual building material in the above method in combination with the accompanying drawings. Figure 2 It is a schematic flowchart of a virtual building material splicing method in the game provided by another embodiment of this application, as Figure 2 shown, S102 may include:
[0070] S104: Index the adjacent virtual building material list corresponding to the virtual building material to be placed according to each adjacent virtual building material.
[0071] In the embodiments of this application, when the virtual building material to be placed is placed in the game scene, other virtual building materials that already exist in the game scene within a preset range around the placement position of the virtual building material to be placed can be detected through a physical detection algorithm (physical overlap detection algorithm) and the placement position, and the other virtual building materials are used as adjacent virtual building materials. Subsequently, the adjacent virtual building material list corresponding to the virtual building material to be placed is further indexed according to each adjacent virtual building material. The adjacent virtual building material list includes: the positions and orientations of each adjacent virtual building material; wherein, the size of the preset range can be flexibly adjusted according to user needs, and this application does not make any restrictions here.
[0072] S105: Traverse the adjacent virtual building material list to determine the relative positions and relative orientations between each adjacent virtual building material and the virtual building material to be placed.
[0073] In the embodiments of this application, traverse the adjacent virtual building material list to determine the relative positions and relative orientations of each adjacent virtual building material in the model space after the virtual building material to be placed is placed, relative to the virtual building material to be placed.
[0074] Among them, in the three-dimensional game model space, the relative position between two virtual building materials can be reflected by three-dimensional position coordinates, for example, and the relative orientation can be reflected by three-dimensional orientation coordinates. For example, when the relative position coordinates of an adjacent virtual building material relative to the virtual building material to be placed are (1.5, 0, 1.5), and the relative orientation coordinates of the adjacent virtual building material relative to the virtual building material to be placed can be (-1, 0, 0), the included angle between the current adjacent virtual building material and the virtual building material to be placed can be obtained as 90°, and the adjacent virtual building material is located on the left side of the virtual building material to be placed; when the relative position coordinates of the adjacent virtual building material relative to the virtual building material to be placed are (-1.5, 0, 1.5), and the relative orientation coordinates of the adjacent virtual building material relative to the virtual building material to be placed can be (1, 0, 0), the included angle between the current adjacent virtual building material and the virtual building material to be placed can be obtained as 90°, and the adjacent virtual building material is located on the right side of the virtual building material to be placed; it should be understood that the above embodiments are only exemplary descriptions, and the present application makes no limitations here.
[0075] S106: Determine the adjacency relationship between the virtual building material to be placed and each adjacent virtual building material according to the relative position and relative orientation.
[0076] In some possible embodiments, the way to determine the adjacency relationship can be, for example: in a preset relationship definition table, query according to the relative position and relative orientation of each adjacent virtual building material to determine the adjacency relationship between the virtual building material to be placed and each adjacent virtual building material.
[0077] Figure 3 The schematic diagram of the model space provided by an embodiment of the present application is as Figure 3 shown. The current model space includes a virtual building material A to be placed and an adjacent virtual building material B. Among them, the virtual building material A to be placed is a triangular virtual building material, and the adjacent virtual building material B is a quadrilateral virtual building material. After placing the virtual building material A to be placed in the model space, the adjacent virtual building material B is adjacent to the left side of the virtual building material A to be placed. Subsequently, the simulation space can be constructed with the origin of the virtual building material to be placed as the center to establish a space coordinate system. At this time, the relative position coordinates of the adjacent virtual building material B in the current model space relative to the virtual building material A to be placed are P, and the relative orientation is D. According to the relative position and relative orientation, the adjacency relationship between the virtual building material A to be placed and the adjacent virtual building material B can be determined in the preset relationship definition table.
[0078] Optionally, on the basis of the above embodiments, the embodiments of the present application can also provide a method for splicing virtual building materials in a game. The following is an example to illustrate the implementation process of determining the adjacency relationship between the virtual building material to be placed and each adjacent virtual building material in the above method in conjunction with the accompanying drawings. Figure 4 The flowchart of a method for splicing virtual building materials in a game provided by another embodiment of the present application is asFigure 4 As shown, S103 may include:
[0079] S107: Determine the area transformation methods corresponding to the virtual building materials to be placed and each adjacent virtual building material according to the adjacency relationship.
[0080] In the embodiments of the present application, before determining the area transformation method, it is necessary to first determine the transformation area of the virtual building materials to be placed, and then, according to the adjacency relationship, determine the area transformation methods corresponding to each transformation area of the virtual building materials to be placed and each adjacent virtual building material.
[0081] In some possible embodiments, the way to determine the transformation area may be, for example: first determine the hanging area of the virtual building materials to be placed; according to the hanging area, determine the transformation area of the virtual building materials to be placed.
[0082] In the embodiments of the present application, the way to determine the transformation area of the virtual building materials to be placed may be, for example, determined according to the shape of the virtual building materials to be placed. For example, for quadrilateral virtual building materials, they can be divided into four hanging areas according to the number of sides of the virtual building materials: left hanging area (left), right hanging area (right), upper hanging area (top), and lower hanging area (bottom), and the virtual building materials to be placed are divided into four transformation areas: up, down, left, and right according to the four hanging areas; for triangular virtual building materials, they can be divided into four hanging areas according to the number of sides of the virtual building materials: left hanging area (left), right hanging area (right), and lower hanging area (bottom), and the virtual building materials to be placed are divided into three transformation areas: down, left, and right according to the three hanging areas; it should be understood that the above embodiments are only illustrative, and the specific way to determine the transformation area of the virtual building materials to be placed can be flexibly adjusted according to user needs, and is not limited to those given in the above embodiments.
[0083] S108: Generate a target virtual building at the target position in the game scene according to the virtual building materials to be placed and at least one adjacent virtual building material, using the area transformation method.
[0084] In the embodiments of the present application, each regional transformation method can, for example, be to take only the adjacent virtual building materials as the transformation target and transform the adjacent virtual building materials so as to generate a target virtual building according to the transformed adjacent virtual building materials and the virtual building materials to be placed; or, it can also be to take only the virtual building materials to be placed as the transformation target and transform the virtual building materials to be placed so as to generate a target virtual building according to the transformed virtual building materials to be placed and the adjacent virtual building materials; or, it can also be to take both the virtual building materials to be placed and the adjacent virtual building materials as the transformation targets and transform both the virtual building materials to be placed and the adjacent virtual building materials so as to generate a target virtual building according to the transformed virtual building materials to be placed and the adjacent virtual building materials; that is, in the embodiments of the present application, according to the virtual building materials to be placed and each adjacent virtual building material, the regional transformation method corresponding to each adjacent virtual building material can be used to transform the adjacent virtual building materials and / or the virtual building materials to be placed to generate a target virtual building at the target position in the game scene; the transformation target for the specific regional transformation can be flexibly adjusted according to user needs and is not limited to those given in the above embodiments.
[0085] In some possible embodiments, the transformation method can, for example, be determined according to the transformation type. In some possible embodiments, the transformation type can be divided into, for example, hanging, transformation, prohibition, etc., where:
[0086] For the hanging transformation type, the current adjacent virtual building materials can be determined by querying in the preset relationship definition table, and the target virtual building material resources corresponding to the relative position and relative orientation between the adjacent virtual building materials and the virtual building materials to be placed currently can be directly loaded. According to the preset contact algorithm, the target virtual building material resources are hung on the virtual building materials to be placed. At the same time, in order to meet the possible different-angle hanging of the same virtual building materials to be placed due to different adjacent relationships, the relative space parameters, that is, the relative position and relative rotation matrix, of the target virtual building material resources in the model space corresponding to the virtual building materials to be placed also need to be provided in the adjacent relationship table. So that during hanging, after adjusting the spatial position of the target virtual building material resources by reading all the parameters, hanging can be carried out, thus ensuring the effect of the finally generated target building.
[0087] In the embodiments of the present application, Figure 5 is a schematic diagram of the game scene provided by an embodiment of the present application. The hanging type mainly aims at the transformation of the supplementary type, such as Figure 5 as shown in (a) on the left. On the left are the virtual building materials to be placed and the adjacent virtual building materials before transformation. At this time, both the virtual building materials to be placed and the adjacent virtual building materials are triangles. In order for the target virtual building to be more in line with the rationality of the building, it is necessary to transform the virtual building materials to be placed and / or the adjacent virtual building materials. For example, a triangular virtual building material can be added to the virtual building materials to be placed and the adjacent virtual building materials, thus generating the target building, such as Figure 5As shown in (b) on the right side, a target building that meets architectural rationality is generated.
[0088] In some other possible embodiments, the application scenarios of the hanging type can also be, for example, when both the virtual building material to be placed and the adjacent virtual building material are right-angled quadrilaterals, it is necessary to eliminate the right angles in the adjacent area. For example, the right angles in the adjacent area between the virtual building material to be placed and the adjacent virtual building material can be eliminated by means of radian processing; or, when both the virtual building material to be placed and the adjacent virtual building material are virtual spiral staircases, for example, there are guardrails at the top of each virtual spiral staircase. At this time, it is necessary to eliminate the interconnection in the adjacent area between the virtual building material to be placed and the adjacent virtual building material, and only retain the virtual guardrail at the top of the complete virtual spiral staircase obtained by splicing; it should be understood that the above embodiments are only exemplary illustrations, and the application scenarios of the specific hanging type can be flexibly adjusted according to user needs, and are not limited to those given in the above embodiments.
[0089] For the transformation type, the main transformation target is defined in the preset relationship definition table. Different from the hanging type, the transformation type mainly focuses on the transformation of the interpenetration type. In the transformation type, there is no need to specify spatial parameters. Just load the transformation target resource corresponding to the main body resource, then delete the main body resource, and replace it with the corresponding transformation resource. Among them, the origin of the transformation resource and the main body resource needs to be kept consistent; in the embodiments of the present application, the main body resource can be, for example, the adjacent area between the virtual building material to be placed and / or the adjacent virtual building material.
[0090] For the prohibition type, it is to solve the problem of model interpenetration caused by prohibiting some default hangings; for example, when a roof virtual building material is placed alone in a game scene, there is usually a virtual edge pendant hanging under the roof virtual building material. If another roof virtual building material is placed at the adjacent position of the current roof virtual building material, at this time, the virtual edge pendants between the two roof virtual building materials will overlap. Therefore, it is necessary to change the adjacent virtual edge pendants so that the two roof virtual building materials are adjacent to each other, and the virtual edge pendants do not overlap.
[0091] By using the virtual building material splicing method provided by the present application, during the process of placing the virtual building material to be placed, it can determine different adjacent relationships corresponding to the virtual building material to be placed and different adjacent virtual building materials in the preset relationship definition table according to the relative position and relative orientation between the virtual building material to be placed and the adjacent virtual building materials. Then, according to the corresponding adjacent relationship, the virtual building material to be placed and / or the adjacent virtual building materials corresponding to the adjacent relationship are transformed, so as to generate a target virtual building at the target position corresponding to the placement operation of the transformed virtual building material to be placed and / or the adjacent virtual building materials in the game scene, making the generated target virtual building more in line with architectural rationality, thereby realizing flexible processing of most model transformation requirements in the game scene and realizing flexible construction of the target virtual building.
[0092] The following explains the virtual building material splicing device in the game provided by the present application in conjunction with the accompanying drawings. The virtual building material splicing device in the game can execute the above Figures 1 - 5 any virtual building material splicing method in the game. For its specific implementation and beneficial effects, refer to the above, and will not be elaborated below.
[0093] Figure 6 The following is a schematic structural diagram of the virtual building material splicing device in the game provided by an embodiment of the present application. As Figure 6 shown, the device includes: a determination module 201 and a generation module 202, where:
[0094] The determination module 201 is configured to determine at least one adjacent virtual building material of the virtual building material to be placed in the game scene in response to the placement operation of the virtual building material to be placed; and determine the adjacency relationship between the virtual building material to be placed and each adjacent virtual building material;
[0095] The generation module 202 is configured to generate a target virtual building at the target position corresponding to the placement operation in the game scene according to the virtual building material to be placed, at least one adjacent virtual building material, and using the adjacency relationship.
[0096] Optionally, on the basis of the above embodiment, the embodiment of the present application can also provide a virtual building material splicing device in the game. The following explains the Figure 6 implementation process of the device given above by way of example in conjunction with the accompanying drawings. Figure 7 The following is a schematic structural diagram of the virtual building material splicing device in the game provided by another embodiment of the present application. As Figure 7 shown, the device further includes: an indexing module 203 and a traversal module 204, where:
[0097] The indexing module 203 is configured to index a list of adjacent virtual building materials corresponding to the virtual building material to be placed according to each adjacent virtual building material. The list of adjacent virtual building materials includes: the positions and orientations of each adjacent virtual building material;
[0098] The traversal module 204 is configured to traverse the list of adjacent virtual building materials to determine the relative positions and relative orientations between each adjacent virtual building material and the virtual building material to be placed;
[0099] The determination module 201 is specifically configured to determine the adjacency relationship between the virtual building material to be placed and each adjacent virtual building material according to the relative positions and relative orientations.
[0100] Optionally, the determination module 201 is specifically configured to determine the area transformation methods corresponding to the virtual building material to be placed and each adjacent virtual building material according to the adjacency relationship;
[0101] The generating module 202 is specifically configured to generate a target virtual building at a target position in the game scene by using a region transformation method according to the virtual building materials to be placed and at least one adjacent virtual building material.
[0102] Optionally, the generating module 202 is specifically configured to transform the adjacent virtual building materials and / or the virtual building materials to be placed by using the region transformation methods corresponding to the respective adjacent virtual building materials according to the virtual building materials to be placed and the respective adjacent virtual building materials, so as to generate a target virtual building at a target position in the game scene.
[0103] Optionally, the determining module 201 is specifically configured to determine the transformation area of the virtual building materials to be placed; and respectively determine the region transformation methods corresponding to the respective transformation areas of the virtual building materials to be placed and the respective adjacent virtual building materials according to the adjacency relationship.
[0104] Optionally, the determining module 201 is specifically configured to determine the hanging area of the virtual building materials to be placed; and determine the transformation area of the virtual building materials to be placed according to the hanging area.
[0105] Optionally, the determining module 201 is specifically configured to, in response to the placement operation of the virtual building materials to be placed, determine the corresponding placement position in the game scene of the placement operation; and determine at least one adjacent virtual building material of the virtual building materials to be placed in the game scene according to the physical overlap detection algorithm and the placement position.
[0106] The above device is used to execute the method provided in the foregoing embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here.
[0107] The above modules may be one or more integrated circuits configured to implement the above method, for example: one or more application specific integrated circuits (ASICs), or, one or more microprocessors, or, one or more field programmable gate arrays (FPGAs), etc. Again, when the above certain module is implemented in the form of a processing element scheduling program code, the processing element may be a general purpose processor, such as a central processing unit (CPU) or other processors that can call program code. Again, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0108] Figure 8 It is a schematic structural diagram of a virtual building material splicing device in a game provided by an embodiment of the present application. The virtual building material splicing device in the game may be integrated into a terminal device or a chip of the terminal device.
[0109] As shown Figure 8 in the figure, the virtual building material splicing device in the game includes: a processor 501, a storage medium 502, and a bus 503.
[0110] The processor 501 is used to store programs, and the processor 501 calls the programs stored in the storage medium 502 to execute the above Figures 1 - 5 corresponding method embodiments, for example:
[0111] In response to the placement operation of the virtual building material to be placed, determine at least one adjacent virtual building material of the virtual building material to be placed in the game scene;
[0112] Determine the adjacency relationship between the virtual building material to be placed and each of the adjacent virtual building materials;
[0113] According to the virtual building material to be placed, the at least one adjacent virtual building material, and using the adjacency relationship, generate a target virtual building at the target position corresponding to the placement operation in the game scene.
[0114] Optionally, the determining the adjacency relationship between the virtual building material to be placed and each of the adjacent virtual building materials includes:
[0115] Index the adjacent virtual building material list corresponding to the virtual building material to be placed according to each of the adjacent virtual building materials, and the adjacent virtual building material list includes: the positions and orientations of each of the adjacent virtual building materials;
[0116] Traverse the adjacent virtual building material list to determine the relative positions and relative orientations between each of the adjacent virtual building materials and the virtual building material to be placed;
[0117] According to the relative positions and the relative orientations, determine the adjacency relationship between the virtual building material to be placed and each of the adjacent virtual building materials.
[0118] Optionally, the generating a target virtual building at the target position corresponding to the placement operation in the game scene according to the virtual building material to be placed, the at least one adjacent virtual building material, and using the adjacency relationship includes:
[0119] Determine the area transformation methods corresponding to the virtual building material to be placed and each of the adjacent virtual building materials according to the adjacency relationship;
[0120] According to the virtual building material to be placed, the at least one adjacent virtual building material, and using the area transformation method, generate the target virtual building at the target position in the game scene.
[0121] Optionally, generating the target virtual building at the target position in the game scene according to the virtual building materials to be placed, the at least one adjacent virtual building material, and using the area transformation method includes:
[0122] According to the virtual building materials to be placed and each of the adjacent virtual building materials, using the area transformation method corresponding to each of the adjacent virtual building materials to transform the adjacent virtual building materials and / or the virtual building materials to be placed, so as to generate the target virtual building at the target position in the game scene.
[0123] Optionally, before determining the area transformation methods corresponding to the virtual building materials to be placed and each of the adjacent virtual building materials according to the adjacency relationship, the method further includes:
[0124] Determine the transformation area of the virtual building materials to be placed;
[0125] Determining the area transformation methods corresponding to the virtual building materials to be placed and each of the adjacent virtual building materials according to the adjacency relationship includes:
[0126] According to the adjacency relationship, respectively determine the area transformation methods corresponding to each of the transformation areas of the virtual building materials to be placed and each of the adjacent virtual building materials.
[0127] Optionally, determining the transformation area of the virtual building materials to be placed includes:
[0128] Determine the hanging area of the virtual building materials to be placed;
[0129] According to the hanging area, determine the transformation area of the virtual building materials to be placed.
[0130] Optionally, responding to the placement operation of the virtual building materials to be placed and determining at least one adjacent virtual building material of the virtual building materials to be placed includes:
[0131] Responding to the placement operation of the virtual building materials to be placed, determine the placement position corresponding to the placement operation in the game scene;
[0132] According to the physical overlap detection algorithm and the placement position, determine at least one adjacent virtual building material of the virtual building materials to be placed in the game scene.
[0133] In the above manner, for different virtual building materials to be placed and different adjacent virtual building materials, different adjacent relationships may be corresponding. Thus, during the process of placing the virtual building materials to be placed, according to the corresponding adjacent relationships, as well as the virtual building materials to be placed and the adjacent virtual building materials corresponding to the adjacent relationships, a target virtual building is generated at the target position corresponding to the placement operation in the game scene, making the generated target virtual building more in line with the building rationality, thereby realizing the flexible handling of most model transformation requirements in the game scene and the flexible construction of the target virtual building.
[0134] The specific implementation manners and technical effects are similar and will not be elaborated here.
[0135] Optionally, the present application further provides a program product, such as a storage medium, on which a computer program is stored, including a program that, when run by a processor, executes the corresponding embodiments of the above method, for example:
[0136] In response to the placement operation of the virtual building materials to be placed, determine at least one adjacent virtual building material of the virtual building materials to be placed in the game scene;
[0137] Determine the adjacent relationships between the virtual building materials to be placed and each of the adjacent virtual building materials;
[0138] According to the virtual building materials to be placed, the at least one adjacent virtual building material, and by using the adjacent relationships, generate a target virtual building at the target position corresponding to the placement operation in the game scene.
[0139] Optionally, the determining the adjacent relationships between the virtual building materials to be placed and each of the adjacent virtual building materials includes:
[0140] Index the adjacent virtual building material list corresponding to the virtual building materials to be placed according to each of the adjacent virtual building materials, and the adjacent virtual building material list includes: the positions and orientations of each of the adjacent virtual building materials;
[0141] Traverse the adjacent virtual building material list to determine the relative positions and relative orientations between each of the adjacent virtual building materials and the virtual building materials to be placed;
[0142] According to the relative positions and the relative orientations, determine the adjacent relationships between the virtual building materials to be placed and each of the adjacent virtual building materials.
[0143] Optionally, the generating a target virtual building at the target position corresponding to the placement operation in the game scene according to the virtual building materials to be placed, the at least one adjacent virtual building material, and by using the adjacent relationships includes:
[0144] Determine the area transformation methods corresponding to the virtual building materials to be placed and each of the adjacent virtual building materials according to the adjacency relationship;
[0145] According to the virtual building materials to be placed and the at least one adjacent virtual building material, use the area transformation method to generate the target virtual building at the target position in the game scene.
[0146] Optionally, the step of using the area transformation method to generate the target virtual building at the target position in the game scene according to the virtual building materials to be placed and the at least one adjacent virtual building material includes:
[0147] According to the virtual building materials to be placed and each of the adjacent virtual building materials, use the area transformation methods corresponding to each of the adjacent virtual building materials to transform the adjacent virtual building materials and / or the virtual building materials to be placed, so as to generate the target virtual building at the target position in the game scene.
[0148] Optionally, before determining the area transformation methods corresponding to the virtual building materials to be placed and each of the adjacent virtual building materials according to the adjacency relationship, the method further includes:
[0149] Determine the transformation area of the virtual building materials to be placed;
[0150] The step of determining the area transformation methods corresponding to the virtual building materials to be placed and each of the adjacent virtual building materials according to the adjacency relationship includes:
[0151] According to the adjacency relationship, respectively determine the area transformation methods corresponding to each of the transformation areas of the virtual building materials to be placed and each of the adjacent virtual building materials.
[0152] Optionally, the step of determining the transformation area of the virtual building materials to be placed includes:
[0153] Determine the hanging area of the virtual building materials to be placed;
[0154] According to the hanging area, determine the transformation area of the virtual building materials to be placed.
[0155] Optionally, the step of determining at least one adjacent virtual building material of the virtual building materials to be placed in response to the placement operation of the virtual building materials to be placed includes:
[0156] In response to the placement operation of the virtual building materials to be placed, determine the placement position corresponding to the placement operation in the game scene;
[0157] According to the physical overlap detection algorithm and the placement position, determine at least one adjacent virtual building material of the virtual building materials to be placed in the game scene.
[0158] In the above manner, for different virtual building materials to be placed and different adjacent virtual building materials, different adjacent relationships may be corresponding. Thus, during the process of placing the virtual building materials to be placed, according to the corresponding adjacent relationships, as well as the virtual building materials to be placed and the adjacent virtual building materials corresponding to the adjacent relationships, a target virtual building is generated at the target position corresponding to the placement operation in the game scene, so that the generated target virtual building is more in line with the architectural rationality, thereby realizing the flexible handling of most model transformation requirements in the game scene and realizing the flexible construction of the target virtual building.
[0159] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some interfaces. The indirect coupling or communication connection of the devices or units can be in electrical, mechanical or other forms.
[0160] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0161] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of a combination of hardware and software functional units.
[0162] The above integrated units implemented in the form of software functional units can be stored in a computer-readable storage medium. The above software functional units are stored in a storage medium and include several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to execute some steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (English: Read-Only Memory, abbreviated as: ROM), random access memories (English: Random Access Memory, abbreviated as: RAM), magnetic disks or optical discs that can store program codes.
Claims
1. A method for virtual building material splicing in a game, characterized in that, The method includes: In response to a placement operation of a virtual building material to be placed, determining at least one adjacent virtual building material of the virtual building material to be placed in the game scene; Determining the adjacency relationship between the virtual building material to be placed and each of the adjacent virtual building materials; the adjacency relationship is determined according to the relative orientation and relative position between the virtual building material to be placed and each of the adjacent virtual building materials; According to the virtual building material to be placed, the at least one adjacent virtual building material, and using the adjacency relationship, generating a target virtual building at the target position corresponding to the placement operation in the game scene.
2. The method according to claim 1, wherein, The determining the adjacency relationship between the virtual building material to be placed and each of the adjacent virtual building materials includes: Indexing, according to each of the adjacent virtual building materials, an adjacent virtual building material list corresponding to the virtual building material to be placed, where the adjacent virtual building material list includes: the positions and orientations of each of the adjacent virtual building materials; Traversing the adjacent virtual building material list to determine the relative position and relative orientation between each of the adjacent virtual building materials and the virtual building material to be placed; According to the relative position and the relative orientation, determining the adjacency relationship between the virtual building material to be placed and each of the adjacent virtual building materials.
3. The method according to claim 1, wherein The generating a target virtual building at the target position corresponding to the placement operation in the game scene according to the virtual building material to be placed, the at least one adjacent virtual building material, and using the adjacency relationship includes: Determining, according to the adjacency relationship, area transformation methods corresponding to the virtual building material to be placed and each of the adjacent virtual building materials respectively; According to the virtual building material to be placed, the at least one adjacent virtual building material, and using the area transformation method, generating the target virtual building at the target position in the game scene.
4. The method according to claim 3, characterized in that The generating a target virtual building at the target position in the game scene according to the virtual building material to be placed, the at least one adjacent virtual building material, and using the area transformation method includes: According to the virtual building material to be placed and each of the adjacent virtual building materials, using the area transformation methods corresponding to each of the adjacent virtual building materials to transform the adjacent virtual building materials and / or the virtual building material to be placed, so as to generate the target virtual building at the target position in the game scene.
5. The method according to claim 3, characterized in that, Before the determining, according to the adjacency relationship, area transformation methods corresponding to the virtual building material to be placed and each of the adjacent virtual building materials respectively, the method further includes: Determining the transformation area of the virtual building material to be placed; The determining, according to the adjacency relationship, area transformation methods corresponding to the virtual building material to be placed and each of the adjacent virtual building materials respectively includes: According to the adjacency relationship, respectively determining the area transformation methods corresponding to each of the transformation areas of the virtual building material to be placed and each of the adjacent virtual building materials.
6. The method according to claim 5, wherein The determining the transformation area of the virtual building material to be placed includes: Determining the hanging area of the virtual building material to be placed; According to the hanging area, determining the transformation area of the virtual building material to be placed.
7. The method according to claim 1, characterized in that, The determining at least one adjacent virtual building material of the virtual building material to be placed in response to a placement operation of the virtual building material to be placed includes: In response to the placement operation of the virtual building material to be placed, determine the corresponding placement position in the game scene for the placement operation; According to the physical overlap detection algorithm and the placement position, determine at least one adjacent virtual building material of the virtual building material to be placed in the game scene.
8. A virtual building material splicing device in a game, characterized in that, The device includes: a determination module and a generation module, where: The determination module is configured to, in response to the placement operation of the virtual building material to be placed, determine at least one adjacent virtual building material of the virtual building material to be placed in the game scene; determine the adjacency relationship between the virtual building material to be placed and each of the adjacent virtual building materials; the adjacency relationship is determined according to the relative orientation and relative position between the virtual building material to be placed and each of the adjacent virtual building materials; The generation module is configured to generate a target virtual building at the target position corresponding to the placement operation in the game scene according to the virtual building material to be placed, the at least one adjacent virtual building material, and using the adjacency relationship.
9. A virtual building material splicing device in a game, characterized in that The device includes: a processor, a storage medium, and a bus. The storage medium stores machine-readable instructions executable by the processor. When the virtual building material splicing device in the game runs, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the method according to any one of the above claims 1-7.
10. A storage medium, characterized in that, A computer program is stored on the storage medium, and when the computer program is run by the processor, it performs the method according to any one of the above claims 1-7.
Citation Information
Patent Citations
Display method and display device for virtual house decoration
CN108460840A
Building material informatization management and control method and system based on building information model
CN111339112A