Method, apparatus, device and medium for generating a state model during the construction of a virtual building

By generating the state model of the virtual building, and using the construction completion state model to generate a cuboid frame and columnar structure, the problem of large storage overhead is solved and the game display effect and user experience is improved.

CN114359507BActive Publication Date: 2025-08-05NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111592297.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-23
Publication Date
2025-08-05
Estimated Expiration
2041-12-23

AI Technical Summary

Technical Problem

In the prior art, the solution to display the state model in virtual building construction has high requirements for device storage performance, resulting in large storage overhead, high art cost, and single display effect.

Method used

By extracting the construction completion state model, the first cuboid and the second cuboid are generated, and the cuboid frame structure model and columnar structure model are generated. As the state model under construction, it is displayed at the target position. Only the construction completion state model needs to be pre-stored to reduce storage overhead.

Benefits of technology

It realizes that with lower storage overhead and art costs, enrich game content, improve user experience, and enhance visual effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114359507B_ABST
    Figure CN114359507B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, apparatus, device, and medium for generating a model of a virtual building under construction, comprising: in response to receiving an instruction to construct a target virtual building at a target location, extracting a completed-state model of the target virtual building, and generating a first cuboid and a second cuboid based on the completed-state model; wherein the second cuboid contains the completed-state model; and the first cuboid contains the main body of the completed-state model; generating a cuboid frame structure model based on the first cuboid; generating a plurality of sampling points within the second cuboid, connecting the sampling points on the surface of the completed-state model, and generating a columnar structure model based on the connected lines; and using the cuboid frame structure model and the columnar structure model together as the under-construction model of the target virtual building, and displaying them at the target location. The present disclosure does not require pre-production and storage of the under-construction model of the virtual building, thereby reducing storage overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer animation technology, and in particular to a method, device, equipment and medium for generating a state model of a virtual building under construction. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the application that are recited in the claims. No statement herein is admitted to be prior art by virtue of its inclusion in this section.

[0003] In the field of computer animation technology, especially in electronic games, when constructing a virtual building, a model of the virtual building in the construction state can be displayed at the target location first. After a preset time period or a preset time point, the model of the virtual building in the completed construction state can be displayed at the target location. This can enrich the game content, enhance the visual effect, and improve the user experience.

[0004] In related art, for virtual buildings that can be constructed in games, the aforementioned effect is typically achieved by storing pre-made models of both the in-progress and completed states on the device, loading and displaying the corresponding models at different times. However, this approach to displaying in-progress models of virtual buildings places high demands on the device's storage performance. Summary of the Invention

[0005] In view of this, the purpose of the present disclosure is to provide a method, device, equipment and medium for generating a construction status model of a virtual building.

[0006] Based on the above objectives, an exemplary embodiment of the present disclosure provides a method for generating a model of a virtual building under construction, comprising:

[0007] In response to receiving an instruction to construct a target virtual building at a target location, extracting a construction-completed model of the target virtual building, and generating a first cuboid and a second cuboid based on the construction-completed model; wherein the second cuboid contains the construction-completed model; and the first cuboid contains a main portion of the construction-completed model;

[0008] generating a rectangular parallelepiped frame structure model according to the first rectangular parallelepiped;

[0009] generating a plurality of sampling points within the second cuboid, connecting the sampling points on the surface of the model in the completed state, and generating a columnar structure model based on the connecting lines;

[0010] The rectangular parallelepiped frame structure model and the columnar structure model are used together as the under-construction model of the target virtual building, and the under-construction model is displayed at the target position.

[0011] In some exemplary embodiments, the same model in the completed state is displayed at different levels of detail under different screen space occupancy.

[0012] The extracting of the construction completion state model of the target virtual building specifically includes:

[0013] The construction completion state model with the lowest detail display level is extracted.

[0014] In some exemplary embodiments, the second cuboid is a minimum cuboid that contains the model in the completed construction state.

[0015] In some exemplary embodiments, generating a rectangular parallelepiped frame structure model based on the first rectangular parallelepiped specifically includes:

[0016] The length of the edge of the rectangular parallelepiped frame structure model is configured according to the size information of the first rectangular parallelepiped, and the thickness of the edge of the rectangular parallelepiped frame structure model is configured according to preset thickness information to obtain the rectangular parallelepiped frame structure model.

[0017] In some exemplary embodiments, generating a rectangular parallelepiped frame structure model based on the first rectangular parallelepiped specifically includes:

[0018] The first cuboid is divided into a plurality of third cuboids, and a plurality of the cuboid frame structure models are generated based on the plurality of third cuboids.

[0019] In some exemplary embodiments, dividing the first cuboid into a plurality of third cuboids specifically includes:

[0020] The determined size of the third cuboid is calculated based on the size of the first cuboid and the preset candidate size of the reference cube, and the first cuboid is divided into a plurality of third cuboids based on the determined size of the third cuboid.

[0021] In some exemplary embodiments, generating a plurality of sampling points within the second cuboid, connecting the sampling points on the surface of the completed model with lines, and generating a columnar structure model based on the connecting lines specifically includes:

[0022] generating a plurality of sampling points within the second cuboid, and deleting the sampling points that are not on the surface of the model in the completed state;

[0023] The remaining sampling points are used as the sampling points on the surface of the model in the completed state, and are grouped. The sampling points in the same group are connected in series to obtain lines, and a columnar structure model is generated according to the lines.

[0024] In some exemplary embodiments, the sampling point is a sampling sphere;

[0025] Deleting the sampling points that are not on the surface of the model in the completed state specifically includes:

[0026] In response to determining that the distance between the center of the sampling sphere and the plane where the triangular facets of the completed model are located is greater than the radius of the sampling sphere, the sampling sphere is deleted.

[0027] In some exemplary embodiments, generating a plurality of sampling points within the second cuboid, connecting the sampling points on the surface of the completed model with lines, and generating a columnar structure model based on the connecting lines specifically includes:

[0028] The sampling points on the surface of the model in the completed state are grouped in pairs. In response to determining that the number of the sampling points on the surface of the model in the completed state is an odd number, the remaining sampling points during the grouping are added to any one of the groups.

[0029] Based on the same inventive concept, the exemplary embodiments of the present disclosure further provide a device for generating a model of a virtual building under construction, comprising:

[0030] A reference cuboid generation module is configured to, in response to receiving an instruction to construct a target virtual building at a target location, extract a construction-completed model of the target virtual building, and generate a first cuboid and a second cuboid based on the construction-completed model; wherein the second cuboid contains the construction-completed model; and the first cuboid contains a main portion of the construction-completed model.

[0031] a rectangular parallelepiped frame structure model generating module, configured to generate a rectangular parallelepiped frame structure model according to the first rectangular parallelepiped;

[0032] a columnar structure model generating module configured to generate a plurality of sampling points within the second cuboid, connect the sampling points on the surface of the completed model, and generate a columnar structure model based on the connecting lines;

[0033] The under-construction state model display module is configured to use the rectangular parallelepiped frame structure model and the columnar structure model together as the under-construction state model of the target virtual building, and display the under-construction state model at the target position.

[0034] Based on the same inventive concept, an exemplary embodiment of the present disclosure further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above methods when executing the program.

[0035] Based on the same inventive concept, an exemplary embodiment of the present disclosure further provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute any of the above methods.

[0036] As can be seen from the above, the embodiment of the present disclosure provides a method, device, equipment and medium for generating a model of a virtual building in a state of construction. The method includes: in response to receiving an instruction to build a target virtual building at a target location, extracting a model of the target virtual building in a completed state of construction, and generating a first cuboid and a second cuboid based on the completed state of construction model; wherein the second cuboid contains the completed state of construction model; the first cuboid contains the main part of the completed state of construction model; generating a cuboid frame structure model based on the first cuboid; generating a number of sampling points in the second cuboid, connecting the sampling points on the surface of the completed state of construction model, and generating a columnar structure model based on the connecting lines; using the cuboid frame structure model and the columnar structure model together as the model of the target virtual building in a state of construction, and displaying the model in a state of construction at the target location. The present disclosure does not require the pre-production and storage of the model of the virtual building in a state of construction, thereby reducing storage overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0038] Figure 1 A schematic diagram of an application scenario provided according to an embodiment of the present disclosure;

[0039] Figure 2 A flowchart of a method for generating a state model of a virtual building under construction provided by an embodiment of the present disclosure;

[0040] Figure 3 A schematic structural diagram of a first cuboid and a second cuboid provided according to an embodiment of the present disclosure;

[0041] Figure 4 A schematic structural diagram of a rectangular parallelepiped frame structure model provided according to an embodiment of the present disclosure;

[0042] Figure 5 A schematic diagram of the structure of a sampling point provided according to an embodiment of the present disclosure;

[0043] Figure 6 A schematic diagram of the structure of the intersection sampling points provided according to an embodiment of the present disclosure;

[0044] Figure 7 A schematic structural diagram of a columnar structure model provided according to an embodiment of the present disclosure;

[0045] Figure 8 A schematic diagram of the structure of a model in a construction state according to an embodiment of the present disclosure;

[0046] Figure 9 A schematic diagram of the structure of a device for generating a model of a virtual building under construction according to an embodiment of the present disclosure;

[0047] Figure 10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0048] To make the objectives, technical solutions, and advantages of the present disclosure more clearly understood, the principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided solely to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present application in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0049] According to an embodiment of the present disclosure, a method, device, electronic device, and storage medium for generating a model of a virtual building under construction are proposed.

[0050] It should be understood herein that any number of elements in the drawings is for illustration only and not for limitation, and any naming is only for distinction and does not have any limiting meaning.

[0051] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should have the usual meanings understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative position relationships. When the absolute position of the described object changes, the relative position relationship may also change accordingly.

[0052] The principles and spirit of the present application are explained in detail below with reference to several representative implementations of the present application. SUMMARY OF THE INVENTION

[0054] In the related art, a solution for displaying a construction status model of a virtual building being constructed to a user has high requirements on the storage performance of the device, that is, the storage overhead is large.

[0055] The inventors of this disclosure discovered that the high storage overhead associated with displaying the under-construction models of virtual buildings in the aforementioned related art is due to the fact that a video game typically includes multiple buildable virtual buildings. Considering the differences in their appearance, each virtual building requires a customized under-construction model. However, these under-construction models significantly increase the storage space required for game resources, resulting in significant storage overhead. Furthermore, the art costs associated with creating these multiple under-construction models are also high.

[0056] In this case, if you want to reduce storage overhead, you can only reduce the number of under-construction models. For example, for virtual buildings of different shapes, use the same under-construction model. However, this method will cause the same under-construction model to appear repeatedly, the display effect is relatively simple, and the user experience is poor.

[0057] In summary, the solution for displaying a pre-made, on-demand model of a virtual building under construction to the user suffers from high storage overhead when displaying rich visual effects, while reducing storage overhead results in a monotonous display effect. This approach fails to strike a balance between visual effects and performance overhead. Therefore, the problem addressed by this disclosure is how to balance game storage overhead, the richness of the game content experience, and the production cost of game art resources, achieving high visual effects with reduced art resource production costs and low performance overhead during the construction of virtual buildings.

[0058] To solve the above problems, this application provides a solution for generating a model of a virtual building under construction, which specifically includes:

[0059] In response to receiving an instruction to construct a target virtual building at a target location, a completed-state model of the target virtual building is extracted, and a first cuboid and a second cuboid are generated based on the completed-state model; wherein the second cuboid contains the completed-state model; the first cuboid contains the main body of the completed-state model; a cuboid frame structure model is generated based on the first cuboid; a number of sampling points are generated within the second cuboid, and lines are connected to the sampling points on the surface of the completed-state model, and a columnar structure model is generated based on the lines; the cuboid frame structure model and the columnar structure model are used together as the under-construction model of the target virtual building, and the under-construction model is displayed at the target location. The present disclosure generates an under-construction model of a virtual building based on the completed-state model of the virtual building. Therefore, only the completed-state model needs to be pre-made and stored, which reduces storage overhead and saves art costs.

[0060] After introducing the basic principles of the present application, various non-limiting implementation methods of the present application are described in detail below.

[0061] Application Scenario Overview

[0062] refer to Figure 1 , which is a schematic diagram of an application scenario of the method for generating a state model of a virtual building under construction provided by an embodiment of the present disclosure. The application scenario includes a terminal device 101, a server 102, and a data storage system 103. The terminal device 101, the server 102, and the data storage system 103 can be connected via a wired or wireless communication network. The terminal device 101 includes but is not limited to a desktop computer, a mobile phone, a mobile computer, a tablet computer, a media player, a smart wearable device, a personal digital assistant (PDA), or other electronic devices capable of implementing the above functions. The server 102 and the data storage system 103 can both be independent physical servers, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0063] The server 102 is used to provide data update services to the user of the terminal device 101 and receive data uploaded by the user of the terminal device 101.

[0064] The data storage system 103 is used to store data.

[0065] The following combination Figure 1The following application scenarios are used to describe the solution for generating a model of a virtual building under construction according to an exemplary embodiment of the present disclosure. It should be noted that the above application scenarios are provided solely to facilitate understanding of the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. Rather, the embodiments of the present disclosure can be applied to any applicable scenario.

[0066] Exemplary Methods

[0067] refer to Figure 2 , which is a flow chart of a method for generating a construction status model of a virtual building provided by an embodiment of the present disclosure.

[0068] A method for generating a model of a virtual building under construction includes the following steps:

[0069] Step S210: In response to receiving an instruction to construct a target virtual building at a target location, extract a construction completion state model of the target virtual building, and generate a first cuboid and a second cuboid based on the construction completion state model; wherein the second cuboid contains the construction completion state model; and the first cuboid contains the main part of the construction completion state model.

[0070] The under-construction state model of the virtual building refers to a model indicating that the virtual building is under construction; and the completed state model refers to a model indicating that the virtual building has been completed.

[0071] In electronic games, when constructing a virtual building, a model of the virtual building in the construction state can be displayed at the target location first. After a preset time period or a preset time point, the model of the virtual building in the completed state can be displayed at the target location. This can enrich the game content, enhance the visual effects, and improve the user experience.

[0072] In related art, for virtual buildings that can be constructed in games, both pre-made models of the in-progress state and the completed state are typically stored on the device, with the corresponding models loaded and displayed at different times to achieve the aforementioned effect. However, this approach to displaying the in-progress state model of the virtual building places high demands on the device's storage performance. To reduce this demand on the device's storage performance, the present disclosure pre-makes and stores only the completed state model, while the in-progress state model is generated based on the completed state model.

[0073] In some exemplary embodiments, the same construction completion state model may be displayed at different levels of detail under different screen space usages. Extracting the construction completion state model of the target virtual building may include:

[0074] Extracted detail shows the model in its as-built state at the lowest level.

[0075] Among them, for the same completed construction state model, when its screen space occupies a small proportion, that is, it only covers a smaller area in the display area, a lower detail display level can be used; when its screen space occupies a large proportion, that is, it only covers a larger area in the display area, a higher detail display level can be used.

[0076] When generating an under-construction model based on a completed state model, only the outer contour information of the completed state model is required, and the requirement for the detail display level of the completed state model is relatively low. Therefore, the completed state model with the lowest detail display level can be used to increase processing speed and reduce equipment load.

[0077] In some exemplary embodiments, the second cuboid is a smallest cuboid that contains the model in the completed state.

[0078] The second cuboid is used to simply and roughly represent the spatial size of the model in the completed state. The smallest cuboid that contains the model in the completed state and whose sides are parallel to the coordinate axis is preferred. It can also be slightly larger than the smallest cuboid, but it should not be too larger than the smallest cuboid, which will lead to inaccurate representation and waste of resources.

[0079] The first cuboid is used to simply and roughly represent the spatial size of the main part of the model in the completed state. A cuboid that contains the main part of the model in the completed state and whose sides are parallel to the coordinate axis is preferred. It can also be slightly smaller than the cuboid, but it should not be too smaller than the cuboid, which will lead to inaccurate representation and unreasonable visual effects.

[0080] refer to Figure 3 , which is a structural schematic diagram of a first cuboid and a second cuboid provided according to an embodiment of the present disclosure.

[0081] The second cuboid contains the model in the completed state, that is, the second cuboid can completely wrap the model in the completed state.

[0082] The first cuboid contains the main part of the model in the completed state, that is, the first cuboid can wrap the main part of the model in the completed state.

[0083] As an example, Figure 3 As shown, the second cuboid not only wraps the main body of the house, but also the chimney and boxes around the house. The first cuboid only wraps the main body of the house, but does not wrap the chimney and boxes around the house.

[0084] The first cuboid and the second cuboid are both represented in perspective wireframes to serve as reference cuboids when implementing this solution.

[0085] S220: Generate a rectangular parallelepiped frame structure model based on the first rectangular parallelepiped.

[0086] In some exemplary embodiments, generating a rectangular parallelepiped frame structure model based on the first rectangular parallelepiped specifically includes:

[0087] The length of the edge of the rectangular parallelepiped frame structure model is configured according to the size information of the first rectangular parallelepiped, and the thickness of the edge of the rectangular parallelepiped frame structure model is configured according to the preset thickness information to obtain the rectangular parallelepiped frame structure model.

[0088] During specific implementation, the texture and shape of the edges of the rectangular frame structure model are configured according to the preset material components. For example, the edges of the rectangular frame structure model are rectangles or cylinders with texture maps on the surface. In ancient style games, the edges of the rectangular frame structure model are wooden boards with concave and convex shapes. In science fiction games, the edges of the rectangular frame structure model are metals with technological structures, etc., thereby enriching the visual effects.

[0089] refer to Figure 4 , which is a structural diagram of a rectangular frame structure model provided according to an embodiment of the present disclosure.

[0090] In some exemplary embodiments, generating a rectangular parallelepiped frame structure model based on the first rectangular parallelepiped specifically includes:

[0091] The first cuboid is divided into a plurality of third cuboids, and a plurality of cuboid frame structure models are generated according to the plurality of third cuboids.

[0092] In specific implementation, the display effect of a rectangular frame structure model is relatively simple. In order to enrich the display effect, the present disclosure divides the first rectangular parallelepiped into multiple third rectangular parallelepipeds, and generates multiple rectangular parallelepiped frame structure models based on the multiple third rectangular parallelepipeds.

[0093] In some exemplary embodiments, dividing the first cuboid into a plurality of third cuboids specifically includes:

[0094] The determined size of the third cuboid is calculated based on the size of the first cuboid and the size of a preset reference cube, and the first cuboid is divided into a plurality of third cuboids based on the determined size of the third cuboid.

[0095] As an example, the length (L), width (W) and height (H) of the first cuboid are 8.8 m, 4.9 m and 5.4 m respectively, and the side length (U) of the preset reference cube is 5 m.

[0096] Based on the dimensions of the first cuboid, namely its length (L), width (W), and height (H), and the dimensions of the preset reference cube, namely its side length (U), calculate the dimensions of the third cuboid obtained after division, namely its length (L1), width (W1), and height (H1) (where the Math.Round function returns the rounded integer value):

[0097] L1=L / Math.Round(L / U)=8.8m / Math.Round(8.8m / 5m)=4.4m;

[0098] W1=W / Math.Round(W / U)=4.9m / Math.Round(4.9m / 5m)=4.9m;

[0099] H1=H / Math.Round(H / U)=5.4m / Math.Round(5.4m / 5m)=5.4m.

[0100] In specific implementation, a unified reference cube can be used in the same game project. Although there are many types of virtual buildings in a game, their sizes generally follow a unified artistic style. The reference cube is similar to the smallest unit of the virtual building. In the same game, the basic size of the smallest unit is similar, which can make the display effect more reasonable.

[0101] S230 , generating a number of sampling points in the second cuboid, connecting the sampling points on the surface of the model in the completed state, and generating a columnar structure model based on the connecting lines.

[0102] In some exemplary embodiments, S230 specifically includes:

[0103] Generate sample points within the second cuboid.

[0104] In some exemplary embodiments, the sampling points are evenly distributed within the second cuboid.

[0105] The density of sampling points can be set and adjusted. A high density results in high accuracy but high performance overhead, while a low density results in low performance overhead but low accuracy.

[0106] refer to Figure 5 , which is a structural diagram of a sampling point provided according to an embodiment of the present disclosure.

[0107] Among them, 64 sampling points are evenly distributed in the second cuboid in the form of 4*4*4.

[0108] In specific implementation, an unequal number of sampling points may be set in the three dimensions of length, width and height. For example, 3, 4 and 5 sampling points may be generated in the length, width and height directions, respectively.

[0109] In addition, Figure 5 , a completed model with a higher level of detail and a completed model with a lower level of detail are also shown.

[0110] It can be seen that the as-built model with a lower level of detail is much simpler than the as-built model with a higher level of detail. Therefore, using the as-built model with a lower level of detail to calculate whether the sampling point intersects the model can significantly reduce the performance cost.

[0111] Delete sampling points that are no longer on the model surface in the completed state.

[0112] refer to Figure 6 , which is a structural diagram of intersection sampling points provided according to an embodiment of the present disclosure.

[0113] In some exemplary embodiments, the sampling points are sampling spheres.

[0114] The sampling sphere includes two properties: the center position coordinates and the radius.

[0115] Delete sampling points on the model surface that are no longer in the completed state, including:

[0116] In response to determining that the distance between the center of the sampling sphere and the plane where the triangular faces of the completed model are located is greater than the radius of the sampling sphere, the sampling sphere is deleted.

[0117] The sampling points are projected onto the plane where the triangle faces are located in sequence, and then the distance can be calculated based on the triangle barycentric coordinate system.

[0118] refer to Figure 7 , which is a structural diagram of a columnar structure model provided according to an embodiment of the present disclosure.

[0119] The remaining sampling points are used as sampling points on the surface of the model in the completed state, and are grouped. The sampling points in the same group are connected in series to obtain lines, and a columnar structure model is generated based on the lines.

[0120] In some exemplary embodiments, a plurality of sampling points are generated within the second cuboid, and lines are connected between the sampling points on the surface of the model in the completed state, and a columnar structure model is generated based on the lines, specifically including:

[0121] The sampling points on the model surface in the completed state are grouped in pairs. In response to determining that the number of sampling points on the model surface in the completed state is an odd number, the remaining sampling points during the grouping are added to any one of the groups.

[0122] S240: The rectangular parallelepiped frame structure model and the columnar structure model are used together as the under-construction model of the target virtual building, and the under-construction model is displayed at the target location.

[0123] refer to Figure 8 , which is a structural diagram of a construction state model provided according to an embodiment of the present disclosure.

[0124] In some exemplary embodiments, the rectangular parallelepiped frame structure model and the columnar structure model are merged into one model as the under-construction model of the target virtual building, and the under-construction model is displayed at the target location.

[0125] As can be seen from the above, the method for generating a virtual building's under-construction status model provided by the embodiment of the present disclosure, first, does not require the pre-production of the virtual building's under-construction status model, thus saving the cost of producing art resources; second, does not require the pre-storage of the virtual building's under-construction status model, thus reducing storage overhead; in addition, for virtual buildings of different sizes and shapes in the game, matching under-construction status models can be generated based on their storage and shape characteristics, thus enriching the game content, enhancing the visual effects, and improving the user experience.

[0126] It should be noted that the method of the embodiments of the present disclosure can be performed by a single device, such as a computer or server. The method of the embodiments of the present disclosure can also be applied in a distributed scenario, where multiple devices cooperate to perform the method. In such a distributed scenario, one of the multiple devices may only perform one or more steps of the method of the embodiments of the present disclosure, and the multiple devices will interact with each other to complete the method.

[0127] It should be noted that the above description is limited to some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0128] Exemplary devices

[0129] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure further provides a device for generating a model of a virtual building under construction.

[0130] refer to Figure 9 The device for generating a model of a virtual building under construction comprises:

[0131] Referring to the cuboid generation module 910, it is configured to extract a construction completion state model of the target virtual building in response to receiving an instruction to build a target virtual building at a target location, and generate a first cuboid and a second cuboid based on the construction completion state model; wherein the second cuboid contains the construction completion state model; and the first cuboid contains the main part of the construction completion state model.

[0132] The cuboid frame structure model generating module 920 is configured to generate a cuboid frame structure model according to the first cuboid.

[0133] The columnar structure model generating module 930 is configured to generate a number of sampling points in the second cuboid, connect the sampling points on the surface of the model in the completed state, and generate a columnar structure model based on the connection lines.

[0134] The under-construction model display module 940 is configured to use the rectangular parallelepiped frame structure model and the columnar structure model as the under-construction model of the target virtual building, and display the under-construction model at the target location.

[0135] In some exemplary embodiments, the same completed model may be displayed at different levels of detail under different screen space usages. Referring to the cuboid generation module 910 , the module is specifically configured as follows:

[0136] Extracted detail shows the model in its as-built state at the lowest level.

[0137] In some exemplary embodiments, the second cuboid is a smallest cuboid that contains the model in the completed state.

[0138] In some exemplary embodiments, the cuboid frame structure model generating module 920 is specifically configured to:

[0139] The length of the edge of the rectangular parallelepiped frame structure model is configured according to the size information of the first rectangular parallelepiped, and the thickness of the edge of the rectangular parallelepiped frame structure model is configured according to the preset thickness information to obtain the rectangular parallelepiped frame structure model.

[0140] In some exemplary embodiments, the cuboid frame structure model generating module 920 is specifically configured to:

[0141] The first cuboid is divided into a plurality of third cuboids, and a plurality of cuboid frame structure models are generated according to the plurality of third cuboids.

[0142] In some exemplary embodiments, the cuboid frame structure model generating module 920 is specifically configured to:

[0143] The determined size of the third cuboid is calculated based on the size of the first cuboid and the preset candidate size of the reference cube, and the first cuboid is divided into a plurality of third cuboids based on the determined size of the third cuboid.

[0144] In some exemplary embodiments, the columnar structure model generation module 930 is specifically configured to:

[0145] Generate several sampling points in the second cuboid and delete the sampling points that are not on the surface of the model in the completed state;

[0146] The remaining sampling points are used as sampling points on the surface of the model in the completed state, and are grouped. The sampling points in the same group are connected in series to obtain lines, and a columnar structure model is generated based on the lines.

[0147] In some exemplary embodiments, the sampling point is a sampling sphere; the columnar structure model generation module 930 is specifically configured to:

[0148] In response to determining that the distance between the center of the sampling sphere and the plane where the triangular faces of the completed model are located is greater than the radius of the sampling sphere, the sampling sphere is deleted.

[0149] In some exemplary embodiments, the columnar structure model generation module 930 is specifically configured to:

[0150] The sampling points on the model surface in the completed state are grouped in pairs. In response to determining that the number of sampling points on the model surface in the completed state is an odd number, the remaining sampling points during the grouping are added to any one of the groups.

[0151] For the convenience of description, the above devices are described as being functionally divided into various modules. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0152] The apparatus of the above embodiment is used to implement the method for generating a construction state model of a virtual building corresponding to any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0153] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the program, it implements the method for generating a construction status model of a virtual building described in any of the above embodiments.

[0154] Figure 1010 is a schematic diagram showing a more specific hardware structure of an electronic device provided in this embodiment. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other within the device via the bus 1050.

[0155] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0156] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage devices, dynamic storage devices, etc. The memory 1020 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.

[0157] The input / output interface 1030 is used to connect an input / output module to implement information input and output. The input / output module can be configured as a component in the device (not shown in the figure) or can be externally connected to the device to provide corresponding functions. Input devices may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and output devices may include a display, speaker, vibrator, indicator light, etc.

[0158] The communication interface 1040 is used to connect to a communication module (not shown) to enable communication between the device and other devices. The communication module can communicate via a wired method (such as USB, network cable, etc.) or a wireless method (such as mobile network, WiFi, Bluetooth, etc.).

[0159] The bus 1050 comprises a path for transmitting information between the various components of the device (eg, the processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 ).

[0160] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, it will be understood by those skilled in the art that the above device may only include the components necessary to implement the embodiments of this specification, and does not necessarily include all the components shown in the figure.

[0161] The electronic device of the above embodiment is used to implement the method for generating a construction state model of a virtual building corresponding to any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0162] Exemplary Program Products

[0163] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method for generating a construction status model of a virtual building as described in any of the above embodiments.

[0164] The above-mentioned non-transitory computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO)), optical storage (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (such as ROMs, EPROMs, EEPROMs, non-volatile memories (NAND FLASH), solid-state drives (SSDs)), etc.

[0165] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the method for generating a construction state model of a virtual building as described in any embodiment of the above exemplary method part, and have the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0166] Those skilled in the art will appreciate that embodiments of the present disclosure may be implemented as a system, method, or computer program product. Therefore, the present disclosure may be implemented in the following forms: entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some exemplary embodiments, the present disclosure may also be implemented in the form of a computer program product in one or more computer-readable media containing computer-readable program code.

[0167] Any combination of one or more computer-readable media can be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive examples) of computer-readable storage media can include, for example: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0168] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-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 computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0169] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0170] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0171] It should be understood that each block in the flowchart and / or block diagram, and combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine. These computer program instructions are executed by the computer or other programmable data processing device to produce a device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.

[0172] These computer program instructions can also be stored in a computer-readable medium that enables a computer or other programmable data processing device to operate in a specific manner. In this way, the instructions stored in the computer-readable medium produce a product that includes an instruction device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.

[0173] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, such that the instructions executed on the computer or other programmable apparatus provide a process that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.

[0174] Furthermore, although the operations of the disclosed method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in that particular order, or that all of the operations shown must be performed to achieve the desired results. Rather, the steps depicted in the flowcharts may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into a single step, and / or a single step may be broken down into multiple steps.

[0175] The use of the verbs "comprise", "include" and their conjugations in the application documents does not exclude the presence of elements or steps other than those stated in the application documents. The article "a" or "an" preceding an element does not exclude the presence of a plurality of such elements.

[0176] Although the spirit and principles of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the specific embodiments disclosed, and the division into various aspects does not mean that the features of these aspects cannot be combined to benefit. Such division is merely for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the appended claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.

Claims

1. A method for generating a model of a virtual building under construction, comprising: In response to receiving an instruction to construct a target virtual building at a target location, extracting a construction-completed model of the target virtual building, and generating a first cuboid and a second cuboid based on the construction-completed model; wherein the second cuboid comprises a minimum cuboid containing the construction-completed model; and the first cuboid contains a main portion of the construction-completed model; generating a rectangular parallelepiped frame structure model according to the first rectangular parallelepiped; generating a plurality of sampling points within the second cuboid, connecting the sampling points on the surface of the model in the completed state, and generating a columnar structure model based on the connecting lines; The rectangular parallelepiped frame structure model and the columnar structure model are used together as the under-construction model of the target virtual building, and the under-construction model is displayed at the target position.

2. The method according to claim 1, wherein The same model in the completed state may be displayed at different levels of detail under different screen space usage. The extracting of the construction completion state model of the target virtual building specifically includes: The construction completion state model with the lowest detail display level is extracted.

3. The method according to claim 1, wherein Generating a rectangular parallelepiped frame structure model according to the first rectangular parallelepiped specifically includes: The length of the edge of the rectangular parallelepiped frame structure model is configured according to the size information of the first rectangular parallelepiped, and the thickness of the edge of the rectangular parallelepiped frame structure model is configured according to preset thickness information to obtain the rectangular parallelepiped frame structure model.

4. The method according to claim 1, wherein Generating a rectangular parallelepiped frame structure model according to the first rectangular parallelepiped specifically includes: The first cuboid is divided into a plurality of third cuboids, and a plurality of the cuboid frame structure models are generated based on the plurality of third cuboids.

5. The method according to claim 4, wherein The dividing the first cuboid into a plurality of third cuboids specifically includes: The determined size of the third cuboid is calculated based on the size of the first cuboid and the preset candidate size of the reference cube, and the first cuboid is divided into a plurality of third cuboids based on the determined size of the third cuboid.

6. The method according to claim 1, wherein Generating a plurality of sampling points in the second cuboid, connecting the sampling points on the surface of the completed model, and generating a columnar structure model according to the connecting lines specifically includes: generating a plurality of sampling points within the second cuboid, and deleting the sampling points that are not on the surface of the model in the completed state; The remaining sampling points are used as the sampling points on the surface of the model in the completed state, and are grouped. The sampling points in the same group are connected in series to obtain lines, and a columnar structure model is generated according to the lines.

7. The method according to claim 6, wherein: The sampling point is a sampling sphere; Deleting the sampling points that are not on the surface of the model in the completed state specifically includes: In response to determining that the distance between the center of the sampling sphere and the plane where the triangular facets of the completed model are located is greater than the radius of the sampling sphere, the sampling sphere is deleted.

8. The method according to claim 1, wherein Generating a plurality of sampling points in the second cuboid, connecting the sampling points on the surface of the completed model, and generating a columnar structure model according to the connecting lines specifically includes: The sampling points on the surface of the model in the completed state are grouped in pairs. In response to determining that the number of the sampling points on the surface of the model in the completed state is an odd number, the remaining sampling points during the grouping are added to any one of the groups.

9. A device for generating a model of a virtual building under construction, comprising: A reference cuboid generation module is configured to, in response to receiving an instruction to construct a target virtual building at a target location, extract a construction-completed model of the target virtual building and generate a first cuboid and a second cuboid based on the construction-completed model; wherein the second cuboid comprises a minimum cuboid containing the construction-completed model; and the first cuboid contains a main portion of the construction-completed model. a rectangular parallelepiped frame structure model generating module, configured to generate a rectangular parallelepiped frame structure model according to the first rectangular parallelepiped; a columnar structure model generating module configured to generate a plurality of sampling points within the second cuboid, connect the sampling points on the surface of the completed model, and generate a columnar structure model based on the connecting lines; The under-construction state model display module is configured to use the rectangular parallelepiped frame structure model and the columnar structure model together as the under-construction state model of the target virtual building, and display the under-construction state model at the target position.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 8 when executing the program. 11 . A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are configured to cause a computer to execute the method according to claim 1 .

Citation Information

Patent Citations

  • Method and device for generating virtual building model in game, processor and terminal

    CN110148203A

  • Game scene optimization method and device, electronic equipment and storage medium

    CN111530077A