Methods and apparatus for generating virtual buildings, storage media and electronic devices
By generating a planar grid distribution of virtual buildings and automating the assembly of building units, the problems of low efficiency and insufficient diversity in virtual building generation are solved, enabling efficient and low-cost virtual building construction.
Patent Information
- Application Number
- CN202210774835.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-01
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-07-01
AI Technical Summary
Existing technologies for generating virtual building models are inefficient and lack model diversity, requiring developers to manually model, which leads to resource waste and increased repetitive work.
By acquiring building outline description information and unit generation information, a planar grid distribution of virtual buildings is generated, and building units are generated on the planar grid distribution based on this information. Finally, the shape of the building units is adjusted to obtain the target virtual building, realizing automated assembly and shape adjustment.
It improves the efficiency of virtual building generation, reduces costs, increases model diversity and scene richness, and reduces the need for repetitive construction and human resources.
Smart Images

Figure CN115147548B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a method for generating virtual buildings, an apparatus for generating virtual buildings, a computer storage medium, and an electronic device. Background Technology
[0002] With the development of electronic device technologies and the popularization of the Internet, a wide variety of virtual buildings can be presented in different application scenarios to enhance the user's immersive experience. For example, after the emergence of smart terminals such as smartphones and tablets, the development potential of the game industry has been further highlighted, and a large number of users are attracted to participate in game scenarios through diverse virtual buildings.
[0003] In related technologies, virtual building models are created manually by developers. As the scale of development projects continues to grow, higher demands are placed on development efficiency and model diversity.
[0004] It should be noted that the information in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] The purpose of this disclosure is to provide a method and apparatus for generating virtual buildings, a computer storage medium, and an electronic device to improve the generation efficiency and model diversity of virtual buildings in games.
[0006] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.
[0007] According to one aspect of this disclosure, a method for generating a virtual building is provided, comprising: acquiring building outline description information and building unit generation information, wherein the building unit generation information is used to indicate the generation logic of building units; generating a planar grid distribution of the virtual building based on the building outline description information; generating the building units on the planar grid distribution based on the building unit generation information to obtain a three-dimensional initial virtual building; and adjusting the building form of the building units in the initial virtual building to obtain a target virtual building.
[0008] In an exemplary embodiment of this disclosure, generating a planar grid distribution of a virtual building based on the building outline description information includes: creating a unit outline object based on the building outline description information; moving and rotating the unit outline object according to the building outline description information, and obtaining an initial grid distribution based on the operation trajectory; and adjusting the outline shape of the initial grid distribution to obtain the planar grid distribution.
[0009] In one exemplary embodiment of this disclosure, the step of moving and rotating the unit outline object according to the building outline information and obtaining an initial grid distribution based on the operation trajectory includes: moving and rotating the unit outline object according to the building outline information and obtaining the growth direction of the current grid distribution based on the operation trajectory; if the growth direction is within a preset direction growth range, then continuing to move and rotate according to the building outline information to obtain the initial grid distribution; if the growth direction is not within the preset direction growth range, then deleting the current grid distribution.
[0010] In an exemplary embodiment of this disclosure, generating a planar grid distribution of a virtual building based on the building outline description information includes: generating an initial building curve outline based on the building outline description information; subdividing the initial building curve outline to obtain a subdivided building outline; and performing a planar gridding operation on the subdivided building outline to obtain the planar grid distribution.
[0011] In an exemplary embodiment of this disclosure, generating the building units on the planar grid distribution based on the building unit generation information to obtain an initial three-dimensional virtual building includes: generating wall building units on the planar grid distribution according to wall unit generation information to obtain a first virtual building; generating edging building units on the wall building units of the first virtual building according to edging unit generation information to obtain a second virtual building; generating door building units on the wall building units of the second virtual building according to door unit generation information to obtain a third virtual building; and generating roof units of the third virtual building based on roof generation information to obtain the initial virtual building.
[0012] In an exemplary embodiment of this disclosure, generating wall building units on the planar grid distribution based on wall unit generation information to obtain a first virtual building includes: performing an extrusion operation on the planar grid distribution to obtain a three-dimensional virtual building body, the three-dimensional virtual building body including a side surface and a top surface; determining the surface normal direction of the side surface based on the wall unit generation information; and mapping a preset virtual wall module onto the side surface according to the surface normal direction to generate the wall building unit to obtain the first virtual building.
[0013] In one exemplary embodiment of this disclosure, determining the surface normal direction of the side based on the wall unit generation information includes: creating a first center node on the side based on the wall unit generation information; and passing the surface normal attribute to the first center node to add the surface normal direction to the first center node.
[0014] In an exemplary embodiment of this disclosure, the step of generating an edge-sealing building unit on the wall building unit of the first virtual building based on edge-sealing unit generation information to obtain a second virtual building includes: creating a reference object vector based on the edge-sealing unit generation information, the reference object vector being used to indicate the direction corresponding to the wall building unit; determining the positions of different types of edge-sealing on the first virtual building by combining the point normal direction of the planar grid point corresponding to the wall building unit and the reference object vector; and mapping a preset virtual edge-sealing module to the position corresponding to the edge-sealing type according to the point normal direction corresponding to the position, thereby generating the edge-sealing building unit to obtain the second virtual building.
[0015] In one exemplary embodiment of this disclosure, determining the positions of different types of edges on the first virtual building by combining the point normal direction of the planar grid points corresponding to the wall building unit and the reference object vector includes: transferring the surface normal attribute to the planar grid points to obtain the point normal direction; assigning the planar grid points to edge groups corresponding to different types of edges according to the dot product of the point normal direction and the reference object vector; and determining the positions of different types of edges on the first virtual building according to the edge groups.
[0016] In one exemplary embodiment of this disclosure, the step of generating a door building unit on the wall building unit of the second virtual building according to the door unit generation information to obtain a third virtual building includes: comparing the area of the wall building unit of the second virtual building with a preset area threshold range based on the door unit generation information, and filtering the wall building units of the second virtual building according to the comparison result; generating the door building unit on the filtered target wall building unit to obtain the third virtual building.
[0017] In one exemplary embodiment of this disclosure, the step of generating the door building unit on the selected target wall building unit to obtain the third virtual building includes: creating a second center node on the target wall building unit; transferring the surface normal attribute to the second center node to add a surface normal direction to the second center node; and mapping a preset virtual door building module to the second center node according to the surface normal direction of the second center node to generate the door building unit to obtain the third virtual building.
[0018] In an exemplary embodiment of this disclosure, after mapping a preset virtual door building module to the second center node according to the surface normal direction of the second center node to generate the door building unit to obtain the third virtual building, the method further includes: deleting, in the third virtual building, edge building units that overlap with the door building unit in area.
[0019] In an exemplary embodiment of this disclosure, generating the roof unit of the third virtual building based on roof generation information to obtain the initial virtual building includes: creating a third center point on the top surface of the third virtual building based on the roof generation information; adjusting the point normal direction of the third center point to a tangent direction; and mapping a preset virtual roof building module to the third center point according to the tangent direction to generate the roof unit, thereby obtaining the initial virtual building.
[0020] In one exemplary embodiment of this disclosure, adjusting the architectural form of the building unit in the initial virtual building to obtain the target virtual building includes: obtaining adjustable parameter information in the initial virtual building, the adjustable parameter information being used to indicate the architectural form of the building unit in the initial virtual building; importing the initial virtual building into a game engine; and changing the architectural form of the target building unit in response to an adjustment operation on the adjustable parameter information to obtain the target virtual building.
[0021] In one exemplary embodiment of this disclosure, importing the initial virtual building into the game engine and changing the building form of the target building unit in response to an adjustment operation on the target adjustable parameter information to obtain the target virtual building includes: adjusting the building form of the first target building unit corresponding to the adjustment operation in response to the adjustment operation on the target adjustable parameter information; adjusting the building form of the second target building unit associated with the first target building unit accordingly based on the adjusted building form of the first target building unit; and generating the target virtual building based on the adjusted first target building unit, the adjusted second target building unit, and other unadjusted building units.
[0022] According to one aspect of this disclosure, a virtual building generation apparatus is provided, comprising: an information acquisition module for acquiring building outline description information and building unit generation information, wherein the building unit generation information is used to indicate the generation logic of building units; a first generation module for generating a planar grid distribution of the virtual building based on the building outline description information; a second generation module for generating the building units on the planar grid distribution based on the building unit generation information to obtain a three-dimensional initial virtual building; and an adjustment module for adjusting the building form of the building units in the initial virtual building to obtain a target virtual building.
[0023] According to one aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method described in any of the preceding claims.
[0024] According to one aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method described in any of the preceding methods by executing the executable instructions.
[0025] The virtual building generation method in the exemplary embodiments of this disclosure generates a planar grid distribution of the virtual building based on building outline description information, generates building units on the planar grid distribution based on building unit generation information, obtains a three-dimensional initial virtual building, and finally adjusts the architectural form of the building units in the initial virtual building to obtain the target virtual building. This embodiment of the disclosure eliminates the need for developers to manually combine and edit the building units in the virtual building. Instead, it generates a planar grid distribution based on building outline description information to indicate the shape of the virtual building, and then generates each building unit on the planar grid distribution based on building unit generation information, achieving automated assembly of building units, improving the generation efficiency of virtual buildings, and reducing costs. By adjusting the architectural form of the building units in the initial virtual building, it can quickly generate target virtual buildings with rich styles without repeatedly building structures, reducing project iteration costs, increasing scene diversity, and becoming an effective method for efficiently constructing large-scale virtual buildings through a procedural virtual model construction process.
[0026] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0027] The above and other objects, features, and advantages of this disclosure will become readily apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. Several embodiments of this disclosure are illustrated in the drawings by way of example and not limitation, in which:
[0028] Figure 1 A flowchart illustrating a method for generating a virtual building according to an exemplary embodiment of the present disclosure is shown;
[0029] Figure 2 A schematic diagram of a preset virtual module according to an exemplary embodiment of the present disclosure is shown;
[0030] Figure 3 A flowchart illustrating the planar grid distribution for generating virtual buildings according to an exemplary embodiment of this disclosure is shown;
[0031] Figure 4 A schematic diagram illustrating the generation of an initial mesh distribution according to an exemplary embodiment of the present disclosure is shown;
[0032] Figure 5 A schematic diagram showing relevant descriptive information of some building outline descriptive information according to an exemplary embodiment of the present disclosure is provided;
[0033] Figure 6 A flowchart illustrating the correction of a generated initial mesh distribution according to an exemplary embodiment of the present disclosure is shown;
[0034] Figure 7 A schematic diagram of the current grid distribution according to an exemplary embodiment of the present disclosure is shown;
[0035] Figure 8 A flowchart illustrating the generation of a planar grid distribution of a virtual building based on building outline description information according to an exemplary embodiment of the present disclosure is shown.
[0036] Figure 9 A schematic diagram of a subdivided building outline according to an exemplary embodiment of the present disclosure is shown;
[0037] Figure 10 A flowchart illustrating the process of obtaining an initial three-dimensional virtual building according to an exemplary embodiment of the present disclosure is shown;
[0038] Figure 11 A schematic diagram of a three-dimensional building body including a side surface and a top surface according to an exemplary embodiment of the present disclosure is shown;
[0039] Figure 12 A flowchart illustrating how, according to an exemplary embodiment of the present disclosure, the surface normal vector of a side surface can be determined based on information generated from wall elements;
[0040] Figure 13 A flowchart illustrating the process of obtaining a second virtual building according to an exemplary embodiment of this disclosure is shown;
[0041] Figure 14 A schematic diagram of two types of edging (solid line boxes) according to exemplary embodiments of the present disclosure is shown;
[0042] Figure 15 A schematic diagram illustrating the generation of a third virtual building according to an exemplary embodiment of the present disclosure is shown;
[0043] Figure 16 A schematic diagram showing the normal orientation of a building unit according to an exemplary embodiment of the present disclosure is provided;
[0044] Figure 17 A schematic diagram showing the tangential orientation of a building unit according to an exemplary embodiment of the present disclosure is shown.
[0045] Figure 18 A flowchart illustrating the process of obtaining a target virtual building according to an exemplary embodiment of this disclosure is shown;
[0046] Figure 19 A schematic diagram of the structure of a device for generating virtual buildings in a game according to an exemplary embodiment of the present disclosure is shown;
[0047] Figure 20 A schematic diagram of a computer-readable storage medium according to exemplary embodiments of the present disclosure is shown; and
[0048] Figure 21 A block diagram of an electronic device according to an exemplary embodiment of the present disclosure is shown.
[0049] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation
[0050] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of exemplary embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and therefore their detailed description will be omitted.
[0051] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced without one or more of the specific details described, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known structures, methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0052] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, or in one or more software-hardened modules, or in different network and / or processor devices and / or microcontroller devices.
[0053] In many applications, such as virtual games, film production, or navigation map creation, it is necessary to construct virtual buildings within a given scene. For example, existing methods for generating virtual buildings in games involve artists manually modeling the buildings in 3D software (such as Maya, 3ds Max, or Cinema 4D), editing, arranging, and combining different components to complete the virtual building's construction. However, as development projects grow larger, the resources required increase, necessitating greater investment of manpower and time. If different architectural styles need to be constructed, the above construction process must be repeated, resulting in a significant amount of repetitive work and highlighting the urgent need to improve development efficiency.
[0054] Based on this, in the exemplary embodiments of this disclosure, a method for generating virtual buildings is first provided. The following, in conjunction with... Figure 1 The method for generating virtual buildings in the exemplary embodiments of this disclosure will be further described. For example... Figure 1 The method for generating virtual buildings in an exemplary embodiment of this disclosure may include steps S110 to S140:
[0055] In step S110, building outline description information and building unit generation information are obtained.
[0056] In an exemplary embodiment of this disclosure, the building outline description information is used to define the planar shape of the virtual building, that is, the relevant description information indicating the top view of the virtual building. The building unit generation information is used to indicate the generation logic of the building units. A building unit refers to each component of the virtual building, including but not limited to wall units, edging units, door units, roof units, and pattern units on each building unit. Virtual modules corresponding to the building units can be pre-made, such as... Figure 2 The diagram shown is an exemplary embodiment of the present disclosure of a preset virtual module. As a pre-made art asset, the preset virtual module can be directly called during the subsequent procedural generation of the target virtual building model, thereby improving the utilization rate of the virtual module.
[0057] In step S120, a planar grid distribution of the virtual building is generated based on the building outline description information.
[0058] In an exemplary embodiment of this disclosure, the planar grid distribution is used to indicate the planar shape of the virtual building, and the planar grid distribution of the virtual building can be generated first based on the building outline description information.
[0059] In step S130, building units are generated on a planar grid distribution based on building unit generation information to obtain an initial three-dimensional virtual building.
[0060] In an exemplary embodiment of this disclosure, building units can be generated on a planar grid distribution based on building unit generation information, so as to build building units on the planar grid distribution and obtain an initial three-dimensional virtual building.
[0061] Among these features, the initial 3D virtual buildings can be saved as art assets for easy reuse and secondary iterative development.
[0062] In step S140, the architectural form of the building unit in the initial virtual building is adjusted to obtain the target virtual building.
[0063] In an exemplary embodiment of this disclosure, after obtaining the initial virtual building, the architectural forms of the building units within the initial virtual building can be adjusted. The architectural form adjustment includes adjusting the architectural form of at least one building unit. Optionally, only a single building unit can be adjusted; alternatively, multiple related building units can be adjusted simultaneously. For example, if multiple building units are connected, adjusting the architectural form of a certain building unit will change the architectural form of the building units connected to that building unit. Architectural forms include, but are not limited to, building height, wall unit style, edging unit length and style, door unit area, position and style, roof unit style, etc. All relevant architectural forms that affect the style of the virtual building are included in the architectural forms described in this embodiment of the disclosure, and will not be listed individually in this embodiment.
[0064] The virtual building generation method in the exemplary embodiments of this disclosure eliminates the need for developers to manually assemble and edit individual building units within the virtual building. Instead, it first generates a planar grid distribution based on the building outline description information to indicate the shape of the virtual building. Then, it generates individual building units on the planar grid distribution based on the building unit generation information, achieving automated assembly of building units. This improves the generation efficiency of virtual buildings and reduces costs. By adjusting the building forms of the building units in the initial virtual building, it can quickly generate target virtual buildings with diverse styles without repeatedly building them, reducing project iteration costs and increasing scene diversity. Through a procedural virtual model construction process, it becomes a method for efficiently constructing large-scale virtual buildings.
[0065] In an exemplary embodiment of this disclosure, an implementation method for generating a planar mesh distribution is provided. Generating a planar mesh distribution of a virtual building based on building outline description information may include steps S310 to S330:
[0066] Step S310: Create a unit outline object based on the building outline description information.
[0067] In this exemplary embodiment, the building outline description information includes the initial position, length, movement step rules, rotation orientation rules, and grid area size of the unit outline object. The unit outline object can be a unit curve, a unit grid, etc. This embodiment can create corresponding unit outline objects based on the building outline description information.
[0068] Step S320: Move and rotate the unit outline object according to the building outline description information, and obtain the initial mesh distribution based on the operation trajectory.
[0069] In this exemplary embodiment, the unit outline object is used as a reference, and the unit outline object is moved and rotated according to the building outline description information, and the initial grid distribution is obtained according to the operation trajectory.
[0070] like Figure 4 This illustration shows a schematic diagram of generating an initial mesh distribution according to an exemplary embodiment of the present disclosure, where the cell outline object is a line segment, i.e. Figure 4 The side length of any given cell grid is used to move and rotate the cell outline object according to the movement step rules and rotation orientation rules in the building outline information, so as to obtain an initial grid distribution that matches the architectural shape of the desired virtual building.
[0071] like Figure 5 The following describes some of the building outline description information in the embodiments of this disclosure. For example, "F" is used to indicate that the unit outline object moves forward one step and the line segment before and after the movement is connected by a line segment; "+" is used to indicate that the unit outline object rotates to the right by a preset angle; "A" is used to indicate the arc length from the initial position point of the unit outline object to the current position point, etc., which will not be described in detail here.
[0072] Wherein, if the building outline description information includes Rule:(A=F+A:0.5), it indicates that the unit outline object moves forward one step, and the probability of rotating left or right by a preset angle is 50%. It is worth noting that, since the rotation direction of the unit outline has a certain degree of randomness, in order to avoid the growth direction of the generated initial mesh distribution deviating from the preset orientation, this embodiment of the disclosure can also correct the generated initial mesh distribution through the following steps S610 to S630:
[0073] Step S610: Move and rotate the unit outline object according to the building outline information, and obtain the growth direction of the current mesh distribution based on the operation trajectory.
[0074] In this exemplary embodiment, the growth orientation is used to reflect the current position of the initial object of the cell in the current mesh distribution, and compared with the orientation of the initial position of the cell outline object, it can reflect the approximate orientation of the final generated target virtual building. For example... Figure 7 A schematic diagram of the current grid distribution according to an exemplary embodiment of the present disclosure is shown. The position of line segment A is the initial position of the cell outline object, the position of line segment B is the current position of the cell outline object, and the line connecting line segment A and line segment B indicates the growth direction of the current grid distribution.
[0075] Step S620: If the growth direction is within the preset direction growth range, continue to perform movement and rotation operations according to the building outline information to obtain the initial grid distribution.
[0076] In this exemplary embodiment, the growth direction of the current grid distribution can be compared with a preset growth range of the orientation. If the growth direction is within the preset growth range of the orientation, the movement and rotation operations are continued according to the building outline information to obtain the initial grid distribution.
[0077] In step S630, if the growth direction is not within the preset direction growth range, then delete the current grid distribution.
[0078] In this exemplary embodiment, if the growth direction is not within the preset direction growth range, the current mesh distribution is deleted, and the unit outline object is moved and rotated again according to the building outline information. Only when the growth direction of the current mesh distribution after each operation is within the preset direction growth range, the initial mesh distribution is finally obtained.
[0079] Step S330: Adjust the outline shape of the initial grid distribution to obtain a planar grid distribution.
[0080] In this exemplary embodiment, after generating the initial mesh distribution, the contour shape corresponding to the adjustment operation can also be adjusted in response to the adjustment operation on the initial mesh distribution, such as adjusting the size of the facets of the unit mesh in the planar mesh distribution.
[0081] It should be noted that after adjusting the outline shape of the initial mesh distribution, the individual unit outline objects in the initial mesh can be merged to connect the unit outline objects to create a surface, thus obtaining the final initial mesh distribution.
[0082] In the process of moving and rotating the unit outline according to the building outline information, the unit outline rotates to the left or right according to a predetermined rotation probability, which can increase the randomness and diversity of the generated initial grid distribution. By judging the growth direction of the current grid distribution, the final initial grid distribution can avoid unexpected deviations from the actual shape of the target virtual building. Furthermore, by adjusting the outline shape of the initial grid distribution, the matching degree between the planar grid distribution and the target virtual building can be further improved.
[0083] In an exemplary embodiment of this disclosure, another implementation for generating a planar mesh distribution is also provided. Generating a planar mesh distribution of a virtual building based on building outline description information may include steps S810 to S830:
[0084] Step S810: Obtain the initial building curve profile.
[0085] In this exemplary embodiment, an initial building outline curve can be randomly generated, and the length, curvature, position, etc. of the initial building outline curve can be arbitrarily adjusted.
[0086] Step S820: Based on the building outline description information, the initial building curve outline is subdivided to obtain the subdivided building outline.
[0087] In this exemplary embodiment, the initial building curve profile can be subdivided according to the building profile description information. For example, multiple nodes can be randomly generated on the initial building curve profile according to the building profile description information, and the positions of the multiple nodes can be adjusted according to the building profile description information. Correspondingly, when the multiple nodes are moved, the curve profiles connected to the nodes are adjusted accordingly.
[0088] like Figure 9 A schematic diagram of a subdivided building profile is shown according to an exemplary embodiment of the present disclosure, wherein a subdivided building profile is formed by randomly generating multiple nodes on an initial building profile and dragging the positions of the multiple nodes.
[0089] Step S830: Perform planar meshing on the subdivided building outline to obtain a planar mesh distribution.
[0090] In this exemplary embodiment, since the nodes or curves in the subdivided building contour may be difficult to align on the same plane during the acquisition of the subdivided building contour, a planar meshing operation can be performed on the subdivided building contour. Specifically, the subdivided building contour can be enclosed into patches based on the nodes and curves in the subdivided building contour (see continued). Figure 9 The facets are then re-divided into meshes, and these meshes are aligned with the nodes in the subdivided building outline to obtain a planar mesh distribution. The specific area size of the mesh can be set according to actual modeling needs, and this embodiment does not impose any special limitations on it.
[0091] For example, the coordinates of all points on the subdivided building outline can be zeroed along the Y-axis to obtain a patch of the subdivided building outline on the XZ plane. Of course, different coordinate zeroing methods can be selected according to the actual modeling scenario, and this disclosure does not impose any special limitations on this.
[0092] This exemplary embodiment provides users with an autonomous method for generating planar grid distributions, allowing users to flexibly adjust the planar grid distribution according to the needs of the target building model.
[0093] In an exemplary embodiment of this disclosure, after obtaining the planar grid distribution of the virtual building, a method for generating an initial three-dimensional virtual building is also provided. Generating the building units on the planar grid distribution based on building unit generation information to obtain the initial three-dimensional virtual building may include steps S1010 to S1040:
[0094] Step S1010: Based on the wall unit generation information, generate wall building units on the planar grid distribution to obtain the first virtual building.
[0095] In this exemplary embodiment, wall element generation information is used in the wall element generation logic. Before generating wall building elements on the planar mesh distribution, a shared edge deletion operation can also be performed on the planar mesh distribution, that is, deleting mesh edges other than outlines in the planar mesh distribution.
[0096] Based on the wall element generation information, wall building elements are generated on the planar grid distribution to obtain the first virtual building, which may include:
[0097] First, an extrusion operation is performed on the planar mesh distribution to obtain a three-dimensional virtual building, which includes a side surface and a top surface. Second, the surface normal direction of the side surface is determined based on the wall unit generation information. Finally, according to the surface normal direction, the preset virtual wall module is mapped to the side surface to generate a wall building unit, thereby obtaining the first virtual building.
[0098] The extrusion operation refers to setting a preset height for a planar mesh distribution to obtain a three-dimensional virtual building, such as... Figure 11 As shown, after extruding the planar mesh distribution, a three-dimensional building body including the sides and top surface is obtained. To generate wall elements, the surface normal vectors of the sides can be determined based on the wall element generation information. Determining the surface normal vectors can include steps S1210 and S1220:
[0099] Step S1210: Based on the wall unit generation information, create the first center node on the side.
[0100] Step S1220: Pass the face normal attribute to the first center node to add a face normal direction to the first center node.
[0101] In practical implementation, a "For-Each Primitive" loop can be created. Within the loop, an attribute `Wrangle` can be created using `addpoint(0,@P); removeprim(0,@primnum,1)`. This creates a first center node at the center of the side and removes all other nodes outside the first center node using the `Removeprom` function. Then, the face normal attribute is passed to the first center node. Further, a preset virtual wall module is imported and mapped along the face normal direction obtained from the first center node. After generating the front building units for each side, the operations within the "For-Each Primitive" loop are terminated, resulting in the following: Figure 11 The first virtual building shown, in which Figure 11The vector above the first virtual building is the direction of the surface normal obtained by the first center node.
[0102] Through this exemplary embodiment, after obtaining the planar grid distribution, wall building units can be automatically generated based on the planar grid distribution to obtain the first virtual building, eliminating the need for game developers to manually model and improving the efficiency of building development.
[0103] Step S1020: Based on the edge-binding unit generation information, generate edge-binding building units on the wall building units of the first virtual building to obtain the second virtual building.
[0104] In this exemplary embodiment, the edging building unit refers to the decorative unit on the outer side of the wall building unit. Different outer surfaces of the wall building unit may have different types of edging. Generating edging building units on the wall building unit of the first virtual building based on the edging unit generation information to obtain the second virtual building may include steps S1310 to S1330:
[0105] Step S1310: Create a reference object vector based on the edge unit generation information.
[0106] In this exemplary embodiment, the reference object vector is used to indicate the direction corresponding to the wall building unit. The reference object vector is used to measure whether the point normal direction of the planar grid point corresponding to the wall building unit is consistent with the wall building unit, thereby distinguishing different edge types.
[0107] Step S1320: Combine the point normal direction of the planar grid points corresponding to the wall building unit with the reference object vector to determine the positions of different types of edging on the first virtual building.
[0108] In this exemplary embodiment, it can be determined whether the direction of the point normal of the planar grid point corresponding to the wall building unit is consistent with the direction of the reference object vector, and then the planar grid points can be grouped according to the determination result, which may specifically include:
[0109] The surface normal property is passed to the planar mesh points to obtain the point normal direction;
[0110] Based on the dot product of the point normal direction and the reference object vector, the planar grid points are assigned to edge groups corresponding to different types of edge bindings;
[0111] The positions of different types of edging on the first virtual building are determined based on the edging group.
[0112] In practice, after the planar mesh distribution is extruded, the surface normal attributes of each side are transferred to the corresponding planar mesh points of the wall building unit, creating three-dimensional vectors of (0,0,1) and (1,0,0). Then, the point normal vectors obtained from the planar mesh points are dot-producted with the three-dimensional vectors respectively. If the dot-product result is 1 or -1, the planar mesh points are assigned to the first edge group; otherwise, the planar mesh points are assigned to the second edge group. Thus, the positions of different types of edges on the first virtual building are obtained according to each edge group.
[0113] For example, see Figure 14 As shown, Figure 14 The diagram shows two types of borders (solid boxes). For example, the first type of border B1 has a point normal vector obtained from a planar grid point that is in the same direction as the wall building unit it belongs to. The second type of border B2 has a point normal vector obtained from a planar grid point that is not in the same direction as the wall building unit it belongs to. Therefore, the first type of border B1 and the second type of border B2 belong to different border groups. The location of different types of borders on the first virtual building is obtained according to each border group.
[0114] Step S1330: According to the point normal direction corresponding to the position, the preset virtual edge module is mapped to the position of the corresponding edge type to generate an edge building unit, so as to obtain the second virtual building.
[0115] In this exemplary embodiment, a preset virtual edge-binding module can be mapped to the position of the corresponding edge-binding type according to the point normal direction corresponding to the position of different types of edge-binding, thereby generating an edge-binding building unit to obtain a second virtual building.
[0116] Through this exemplary example, the positions of different types of edging can be obtained based on the point normal vectors of the corresponding planar grid points of the wall building unit and the reference object vector. This allows different types of virtual edging modules to be mapped to different types of edging groups, resulting in a rich variety of edging building units, improving the diversity of the second virtual building, and achieving high generation efficiency.
[0117] Step S1030: Based on the door unit generation information, generate door building units on the wall building units of the second virtual building to obtain the third virtual building.
[0118] In this exemplary embodiment, door building units can also be generated on the wall building units to obtain a third virtual building. This can include: filtering the wall building units of the second virtual building according to their area based on the door unit generation information, and generating door building units on the selected target wall building units to obtain the third virtual building.
[0119] The door unit generation information may include a preset area threshold range and filtering rules for the sides of the wall building units (such as the number of filtered sides, the spacing between filtered sides, etc.), which are used to filter the wall building units of the second virtual building. Specifically, based on the door unit generation information, the area of the wall building units of the second virtual building can be compared with the preset area threshold range, and the wall building units of the third virtual building can be filtered according to the comparison result. For example, wall building units corresponding to areas within the preset area threshold range can be identified as wall building units.
[0120] In actual implementation, wall building units can be numbered according to their surfaces (from 0 to 11), and then each number can be filtered using filtering rules. For example, filtering rules include start number, end number, and selection interval (e.g., select 2 first, then 4, then 6, etc.). According to the filtering rules, some wall building units are selected as target wall building units to generate door building units on the target wall building units.
[0121] By filtering wall building units by area, we can avoid having doors on all walls, which would not match the real scene, and improve the similarity between the third virtual building and real-life buildings.
[0122] Generating door building units on the selected target wall building units to obtain a third virtual building may include: First, creating a second center node on the target wall building unit; then, passing the face normal attribute to the second center node to add a face normal direction to the second center node; finally, mapping a preset virtual door building module to the second center node according to the face normal direction of the second center node to generate a door building unit, thus obtaining the third virtual building, as shown below. Figure 15 As shown.
[0123] The surface normal attribute can be obtained by taking the point normal attribute of the plane grid point in the corresponding plane grid point of the wall building unit that has the same orientation as the reference object vector, and then passing the attribute to the second center node.
[0124] Furthermore, in this embodiment of the disclosure, the surrounding building units that overlap with the door building unit in area can also be deleted in the third virtual building. For example, the surrounding building units exposed behind the door building unit can be deleted, as can the surrounding building units that are obscured by the door building unit, thereby making the third virtual building more consistent with the architectural state of real life.
[0125] Step S1040: Based on the roof generation information, generate the roof unit of the third virtual building to obtain the initial virtual building.
[0126] In this exemplary embodiment, since the roof building unit is located on the top surface of the three-dimensional virtual building, the top surface and the sides face different directions. For example... Figure 16 and Figure 17 The normal and tangential orientations of building units are shown respectively. When a virtual building module is mapped to a point, the orientation of the virtual building module is affected by the normal orientation (tangential orientation). Based on this, the roof unit of the third virtual building is generated based on the roof generation information, and the initial virtual building may include:
[0127] Based on the roof generation information, a third center point is created on the top surface of the third virtual building;
[0128] Adjust the direction of the normal to the third center point to the direction of the tangent.
[0129] Map the preset virtual roof building module to the third center point according to the tangent direction to generate roof building units and obtain the initial virtual building.
[0130] Through this exemplary embodiment, the direction of the third center point can be adjusted according to the different orientations of the roof building unit and other building units, so as to correctly map the preset virtual roof building module to the center point. The initial virtual building can be automatically generated without manual intervention, and the generation efficiency of the virtual building is high.
[0131] In an exemplary embodiment of this disclosure, a method for generating a target virtual building is also provided. Adjusting the architectural form of the building units in the initial virtual building to obtain the target virtual building may include steps S1810 and S1820:
[0132] Step S1810: Obtain the parameter information to be adjusted in the initial virtual building, wherein the parameter information to be adjusted is used to indicate the building form of the building unit in the initial virtual building.
[0133] In practice, adjustment parameters can be exposed so that users can adjust the architectural form of building units in the initial virtual building based on the parameter information.
[0134] Step S1820: Import the initial virtual building into the game engine, and in response to the adjustment operation of the parameter information to be adjusted, change the building form of the target building unit to obtain the target virtual building.
[0135] In this exemplary embodiment, the initial virtual building can be imported into the game engine, which can be Unreal Engine 4 (UE4).
[0136] Specifically, in response to adjustment operations on target parameters, the system adjusts the architectural form of the first target building unit corresponding to the adjustment operation. Based on the adjusted architectural form of the first target building unit, the system correspondingly adjusts the architectural form of the second target building unit associated with the first target building unit. Finally, based on the adjusted first target building unit, the adjusted second target building unit, and other unadjusted building units, a target virtual building is generated. For example, when the height of the virtual building increases, wall building units, edging building units, and other art assets are automatically filled in; similarly, changing the orientation of windows automatically changes the associated building units, thereby achieving procedural adjustments to the virtual building, improving model building efficiency, and obtaining diverse virtual buildings through adjustment operations, increasing scene diversity.
[0137] In practice, the target virtual building can be baked and saved after it is obtained, so that it can be modified or iterated on for the project.
[0138] As can be seen from the above, the virtual building generation method of this disclosure embodiment does not require developers to combine and edit the various building units in the virtual building. Instead, it first generates a planar grid distribution based on the building outline description information to indicate the shape of the virtual building. Then, it generates each building unit on the planar grid distribution based on the building unit generation information, realizing the automated assembly of building units, improving the generation efficiency of virtual buildings and reducing costs. By adjusting the building form of the building units in the initial virtual building, it can quickly generate target virtual buildings with rich styles without repeatedly building buildings, reducing project iteration costs, increasing scene diversity, and becoming an efficient method for constructing large-scale virtual buildings through a procedural virtual model construction process.
[0139] In an exemplary embodiment of this disclosure, an apparatus for generating virtual buildings is also provided. (See reference...) Figure 19 As shown, the virtual building generation device 1900 may include an information acquisition module 1910, a first generation module 1920, a second generation module 1930, and an adjustment module 1940. Specifically,
[0140] The information acquisition module 1910 is used to acquire building outline description information and building unit generation information, wherein the building unit generation information is used to indicate the generation logic of building units;
[0141] The first generation module 1920 is used to generate a planar grid distribution of the virtual building based on the building outline description information;
[0142] The second generation module 1930 is used to generate the building units on the planar grid distribution based on the building unit generation information to obtain a three-dimensional initial virtual building;
[0143] The adjustment module 1940 is used to adjust the architectural form of the building unit in the initial virtual building to obtain the target virtual building.
[0144] Since the functional modules of the virtual building generation apparatus of the exemplary embodiments of this disclosure are the same as those in the inventive embodiments of the virtual building generation method described above, they will not be described again here.
[0145] It should be noted that although several modules or units of the virtual building generation device have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0146] Furthermore, in exemplary embodiments of this disclosure, a computer storage medium capable of implementing the above-described methods is also provided. A program product capable of implementing the methods described in this specification is stored thereon. In some possible embodiments, various aspects of this disclosure can also be implemented as a program product including program code, which, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.
[0147] refer to Figure 20 As shown, a program product 2000 for implementing the above-described method according to an exemplary embodiment of the present disclosure is described. This product may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0148] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0149] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0150] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0151] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0152] Furthermore, in exemplary embodiments of this disclosure, an electronic device capable of implementing the above-described methods is also provided. Those skilled in the art will understand that various aspects of this disclosure can be implemented as systems, methods, or program products. Therefore, various aspects of this disclosure can be specifically implemented as entirely hardware embodiments, entirely software embodiments (including firmware, microcode, etc.), or embodiments combining hardware and software aspects, collectively referred to herein as "circuit," "module," or "system."
[0153] The following reference Figure 21 To describe an electronic device 2100 according to such an embodiment of the present disclosure. Figure 21 The electronic device 2100 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0154] like Figure 21As shown, the electronic device 2100 is manifested in the form of a general-purpose computing device. The components of the electronic device 2100 may include, but are not limited to: at least one processing unit 2110, at least one storage unit 2120, a bus 2130 connecting different system components (including storage unit 2120 and processing unit 2110), and a display unit 2140.
[0155] The storage unit stores program code that can be executed by the processing unit 2110, causing the processing unit 2110 to perform the steps described in the "Exemplary Methods" section above according to various exemplary embodiments of this disclosure.
[0156] Storage unit 2120 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 2121 and / or cache memory 2122, and may further include a read-only memory (ROM) 2123.
[0157] Storage unit 2120 may also include a program / utility 2124 having a set (at least one) program module 2125, such program module 2125 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0158] Bus 2130 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0159] Electronic device 2100 can also communicate with one or more external devices 2200 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 2100, and / or any device that enables electronic device 2100 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 2150. Furthermore, electronic device 2100 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 2160. As shown, network adapter 2160 communicates with other modules of electronic device 2100 via bus 2130. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 2100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0160] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0161] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0162] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0163] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for generating virtual buildings, characterized in that, include: Obtain building outline description information and building unit generation information, wherein the building unit generation information is used to indicate the generation logic of building units; A planar grid distribution of the virtual building is generated based on the building outline description information; Based on the building unit generation information, the building units are generated on the planar grid distribution to obtain an initial three-dimensional virtual building; Adjust the architectural form of the building units in the initial virtual building to obtain the target virtual building; The step of generating a planar grid distribution of the virtual building based on the building outline description information includes: Based on the building outline description information, create a unit outline object; The unit outline object is moved and rotated according to the building outline description information, and the initial grid distribution is obtained according to the operation trajectory. Adjust the outline shape of the initial grid distribution to obtain the planar grid distribution; Alternatively, generating the planar grid distribution of the virtual building based on the building outline description information includes: Obtain the initial building curve profile; Based on the building outline description information, the initial building curve outline is subdivided to obtain a subdivided building outline; The subdivided building outline is subjected to planar meshing to obtain the planar mesh distribution.
2. The method according to claim 1, characterized in that, The step of moving and rotating the unit outline object according to the building outline information, and obtaining the initial mesh distribution based on the operation trajectory, includes: The unit outline object is moved and rotated according to the building outline information, and the growth direction of the current grid distribution is obtained according to the operation trajectory. If the growth direction is within the preset direction growth range, then continue to move and rotate according to the building outline information to obtain the initial grid distribution; If the growth direction is not within the preset direction growth range, then the current grid distribution is deleted.
3. The method according to claim 1, characterized in that, The step of generating building units on the planar grid distribution based on the building unit generation information to obtain an initial three-dimensional virtual building includes: Based on the wall unit generation information, wall building units are generated on the planar grid distribution to obtain the first virtual building; Based on the information generated by the edge-binding unit, an edge-binding building unit is generated on the wall building unit of the first virtual building to obtain the second virtual building; Based on the door unit generation information, door building units are generated on the wall building units of the second virtual building to obtain the third virtual building; Based on the roof generation information, the roof unit of the third virtual building is generated to obtain the initial virtual building.
4. The method according to claim 3, characterized in that, The step of generating wall building units on the planar grid distribution based on wall unit generation information to obtain the first virtual building includes: An extrusion operation is performed on the planar grid distribution to obtain a three-dimensional virtual building, which includes a side surface and a top surface. Based on the information generated by the wall unit, determine the direction of the surface normal of the side surface; According to the surface normal direction, the preset virtual wall module is mapped to the side surface to generate the wall building unit, so as to obtain the first virtual building.
5. The method according to claim 4, characterized in that, The step of determining the surface normal direction of the side surface based on the information generated by the wall unit includes: Based on the information generated by the wall unit, a first center node is created on the side surface; The face normal attribute is passed to the first center node to add the face normal direction to the first center node.
6. The method according to claim 3, characterized in that, The step of generating an edge-bound building unit on the wall building unit of the first virtual building based on the edge-bound unit generation information to obtain the second virtual building includes: Based on the information generated by the edge-binding unit, a reference object vector is created, which is used to indicate the direction corresponding to the wall building unit; By combining the point normal direction of the planar grid points corresponding to the wall building unit and the reference object vector, the positions of different types of edging on the first virtual building are determined; According to the point normal direction corresponding to the position, the preset virtual edge module is mapped to the position of the corresponding edge type to generate the edge building unit, so as to obtain the second virtual building.
7. The method according to claim 6, characterized in that, The step of determining the positions of different types of edging on the first virtual building by combining the point normal direction of the planar grid points corresponding to the wall building unit and the reference object vector includes: The surface normal attribute is passed to the planar mesh point to obtain the point normal direction; Based on the dot product of the point normal direction and the reference object vector, the planar grid points are assigned to edge groups corresponding to different types of edge bindings; The positions of different types of edging on the first virtual building are determined based on the edging group.
8. The method according to claim 3, characterized in that, The step of generating door building units on the wall building units of the second virtual building based on the door unit generation information to obtain the third virtual building includes: Based on the information generated by the door unit, the area of the wall building unit of the second virtual building is compared with a preset area threshold range, and the wall building unit of the second virtual building is filtered according to the comparison result. On the selected target wall building units, the door building units are generated to obtain the third virtual building.
9. The method according to claim 8, characterized in that, The step of generating the door building unit on the selected target wall building unit to obtain the third virtual building includes: Create a second center node on the target wall building unit; Pass the face normal attribute to the second center node to add a face normal direction to the second center node; According to the surface normal direction of the second central node, the preset virtual door building module is mapped to the second central node to generate the door building unit, so as to obtain the third virtual building.
10. The method according to claim 9, characterized in that, After mapping the preset virtual door building module to the second central node according to the surface normal direction of the second central node to generate the door building unit to obtain the third virtual building, the method further includes: In the third virtual building, delete the edging building units that overlap in area with the door building unit.
11. The method according to claim 4, characterized in that, The process of generating roof units for the third virtual building based on roof generation information to obtain the initial virtual building includes: Based on the roof generation information, a third center point is created on the top surface of the third virtual building; Adjust the normal direction of the third center point to the tangent direction; According to the tangent direction, the preset virtual roof building module is mapped to the third center point to generate the roof unit, so as to obtain the initial virtual building.
12. The method according to any one of claims 1 to 11, characterized in that, The step of adjusting the architectural form of the building units in the initial virtual building to obtain the target virtual building includes: Obtain the adjustable parameter information in the initial virtual building, the adjustable parameter information being used to indicate the architectural form of the building unit in the initial virtual building; The initial virtual building is imported into the game engine, and in response to the adjustment operation of the parameter information to be adjusted, the building form of the target building unit is changed to obtain the target virtual building.
13. The method according to claim 12, characterized in that, The process of importing the initial virtual building into the game engine, responding to adjustment operations on the target adjustable parameter information, changing the building form of the target building unit, and obtaining the target virtual building includes: In response to an adjustment operation for target adjustable parameter information, the building form of the first target building unit corresponding to the adjustment operation is adjusted; Based on the adjusted architectural form of the first target building unit, the architectural form of the second target building unit associated with the first target building unit will be adjusted accordingly. The target virtual building is generated based on the adjusted first target building unit, the adjusted second target building unit, and other unadjusted building units.
14. A device for generating virtual buildings, characterized in that, The device includes: The information acquisition module is used to acquire building outline description information and building unit generation information, wherein the building unit generation information is used to indicate the generation logic of building units; The first generation module is used to generate a planar grid distribution of the virtual building based on the building outline description information; The second generation module is used to generate the building units on the planar grid distribution based on the building unit generation information to obtain an initial three-dimensional virtual building. An adjustment module is used to adjust the architectural form of the building units in the initial virtual building to obtain the target virtual building; The first generation module is configured to execute: Based on the building outline description information, create a unit outline object; The unit outline object is moved and rotated according to the building outline description information, and the initial grid distribution is obtained according to the operation trajectory. Adjust the outline shape of the initial grid distribution to obtain the planar grid distribution; Alternatively, the first generation module may be configured to execute: Obtain the initial building curve profile; Based on the building outline description information, the initial building curve outline is subdivided to obtain a subdivided building outline; The subdivided building outline is subjected to planar meshing to obtain the planar mesh distribution.
15. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method according to any one of claims 1 to 13.
16. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 13 by executing the executable instructions.