Method and device for generating virtual indoor scene, storage medium, and electronic device
By calculating the construction parameters of the component model and generating rendering resource files, the problem of inefficient modeling of virtual indoor scenes is solved, the standardization and uniformity of the model is achieved, and modeling flexibility and production efficiency are improved.
Patent Information
- Application Number
- CN202111629340.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-12-28
AI Technical Summary
In the prior art, manual operation leads to inefficient modeling of virtual indoor scenes, it is difficult to ensure the standardization and uniformity of the model, and there are a lot of repetitive work and inconvenient iteration problems.
By obtaining the framework geometry data of the framework model of the virtual indoor scene to be built and the layout parameters of the component model, the construction parameters of the component model are calculated, and the rendering resource files of the virtual indoor scene are generated based on these parameters, the inefficiency and normative problems caused by manual operations are solved.
It improves the modeling flexibility and production efficiency of virtual indoor scenarios, ensures the standardization and unity of each component model, reduces repetitive work, and facilitates iteration.
Smart Images

Figure CN114299214B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for generating a virtual indoor scene, a storage medium, and an electronic device. Background Art
[0002] In related technologies, traditional 3D production software, such as 3Dsmax and Maya, is used to model and UV-produce interior spaces and space exhibits. Assets are manually dragged into the engine to place objects.
[0003] In the related art, the input data source is the window model and the coordinate axis is manually dragged to move the window model (model B) to the position P of the art design on the wall model (model A). The operation process is to perform a boolean calculation, thereby removing the window area from the wall model so that light can shine in from the removed part. The output data is the wall model (model A') after the Boolean calculation. It is not easy to ensure the standardization and uniformity. It means that there are several models B, and the position moved manually will cause the distance difference between multiple models B, which cannot meet the requirements of art design. The implementation process in the related art is to manually drag the models B1, B2, B3...Bn to be placed in turn, and move their coordinates P1, P2, P3...Pn to the position in the art design drawing. For example, when performing the operation of opening a window on the wall (the Boolean calculation mentioned above) in the related art, it is necessary to perform the above manual operation on each calculation position in turn, that is, to move the window model (model B) to the position of the art design on the wall model (model A) for boolean calculation. The wall that has undergone Boolean calculation changes the number of vertices and UV distribution, and it is necessary to manually modify the UV. At the same time, Boolean calculations are destructive and it is impossible to simply restore the wall model before the calculation. Therefore, when we want to make a second modification to the wall that has undergone Boolean calculations, it is equivalent to remaking it.
[0004] The relevant technology requires a lot of repetitive modeling work, and manual operation is prone to errors. For example, if there are multiple windows in a building space, the wall at each window position needs to be manually processed in the same way, which makes it difficult to ensure standardization and uniformity. A lot of repetitive placement work, manual operation is time-consuming and labor-intensive, and the position is inaccurate. For example, when dragging the tables and chairs displayed in the lobby of a pub, they need to be placed neatly according to the rules. It is not convenient for iteration. For example, in the window opening problem mentioned in the first defect, when the destructive operation is performed on the wall and then the window position and number are changed, a series of operations need to be performed again. Another example is the problem of placing tables and chairs. When the number of chairs at the round table changes, the position of each chair needs to be readjusted in turn.
[0005] With respect to the above-mentioned problems existing in the related technologies, no effective solutions have been found so far. Summary of the invention
[0006] The embodiments of the present invention provide a method and device for generating a virtual indoor scene, a storage medium, and an electronic device.
[0007] According to one embodiment of the present invention, a method for generating a virtual indoor scene is provided, comprising: obtaining frame geometry data of a frame model of a virtual indoor scene to be constructed and layout parameters of a component model, wherein the layout parameters are used to characterize the distribution sparsity of the component model, and the component model is laid out within the frame model; calculating construction parameters of the component model according to the frame geometry data and the layout parameters, wherein the construction parameters are used to characterize the construction position of the component model in the virtual indoor scene; and generating a rendering resource file of the virtual indoor scene based on the construction parameters.
[0008] Optionally, obtaining frame geometry data of a frame model of a virtual indoor scene to be constructed includes: determining a frame shape of the frame model; obtaining room size parameters of the frame model, and obtaining ceiling parameters of a ceiling in the frame model, wherein the ceiling parameters include shape parameters and size parameters; and preprocessing the frame shape, the room size parameters, and the ceiling parameters based on the position of the surface to generate frame geometry data of the frame model.
[0009] Optionally, obtaining the layout parameters of the component model of the virtual indoor scene to be built includes: responding to an editing instruction of the component model of the virtual indoor scene to be built, displaying an editing page of the component model, wherein the editing page includes a storage path of a model prefab of the component model and multiple editing items; detecting a first layout parameter at a first editing item position on the editing page, wherein the first layout parameter is used to describe the total number of arrangements of the component model within the frame model; detecting a second layout parameter at a second editing item position on the editing page, wherein the second layout parameter is used to describe a distribution direction of the component model within the frame model; detecting a third layout parameter at a third editing item position on the editing page, wherein the third layout parameter is used to describe the spacing distance of the component model within the frame model; detecting a fourth layout parameter at a fourth editing item position on the editing page, wherein the fourth layout parameter is used to indicate an adjustment style of the model prefab of the component model; detecting a fifth layout parameter at a fifth editing item position on the editing page, wherein the fifth layout parameter is used to indicate adding a closed enclosure to the outer wall of the frame model.
[0010] Optionally, calculating the building parameters of the component model according to the framework geometry data and the layout parameters includes: copying and generating a plurality of identical model prefabs in the framework model based on the first layout parameters; calculating the position parameters of the plurality of model prefabs in the framework model according to the second layout parameters and the third layout parameters, wherein the position parameters include: three-dimensional coordinate position and orientation; adjusting the prefab style of the model prefab according to the fourth layout parameters; and adding a closed inclusion to the outer wall of the framework model based on the fifth layout parameters, and leaving a light-transmitting area on the inclusion.
[0011] Optionally, calculating the position parameters of the multiple model preforms in the frame model respectively according to the second layout parameter and the third layout parameter includes: determining the layout space of the component model in the frame model; dividing the layout space into multiple subspaces based on the spacing distance, wherein the number of the subspaces is the same as the number of the model preforms; locating the center point of each subspace, determining the center point as the coordinate position of the model preform in the corresponding subarea, and configuring the same normal information for the model preform in each subarea based on the distribution direction.
[0012] Optionally, the framework geometry data includes: vertex data, corner point data, facet data, and geometry structure data.
[0013] Optionally, the component model includes a model of at least one of the following components: room, door, wall window, skylight, roof, skirting, plaster line, window frame, door frame, beam, column, floor, bar.
[0014] Optionally, generating a rendering resource file of the virtual indoor scene based on the building parameters includes: adding mapping parameters of the component model for each component model; generating a sub-model file of the component model according to the mapping parameters and the building parameters, wherein the sub-model file includes sub-grid information and sub-material information; merging the sub-model files of all component models in the virtual indoor scene to generate a rendering resource file in a predetermined format, wherein the rendering resource file includes several types of sub-model files, and each type of sub-model file includes several sub-model files.
[0015] Optionally, after generating a rendering resource file of the virtual indoor scene based on the construction parameters, the method further includes: importing the rendering resource file into a rendering engine, and importing the point cloud data of the virtual indoor scene into the rendering engine; personalizing the sub-material information of the component model in the rendering engine and generating a three-dimensional scene image of the virtual indoor scene according to the modified construction parameters and the point cloud data; or, directly using the rendering resource file and the point cloud data in the rendering engine to generate a three-dimensional scene image of the virtual indoor scene.
[0016] According to another embodiment of the present invention, a device for generating a virtual indoor scene is provided, comprising: an acquisition module, used to acquire frame geometry data of a frame model of a virtual indoor scene to be constructed and layout parameters of a component model, wherein the layout parameters are used to characterize the distribution sparsity of the component model, and the component model is laid out within the frame model; a calculation module, used to calculate the construction parameters of the component model according to the frame geometry data and the layout parameters, wherein the construction parameters are used to characterize the construction position of the component model in the virtual indoor scene; and a generation module, used to generate a rendering resource file of the virtual indoor scene based on the construction parameters.
[0017] Optionally, the acquisition module includes: a determination unit, used to determine the frame shape of the frame model; an acquisition unit, used to acquire room size parameters of the frame model, and acquire ceiling parameters of the ceiling in the frame model, wherein the ceiling parameters include shape parameters and size parameters; and a generation unit, used to preprocess the frame shape, the room size parameters, and the ceiling parameters based on the position of the surface, and generate frame geometry data of the frame model.
[0018] Optionally, the acquisition module includes: a display unit, which is used to respond to the editing instruction of the component model of the virtual indoor scene to be built, and display the editing page of the component model, wherein the editing page includes the storage path of the model prefabricated body of the component model and multiple editing items; a first detection unit, which is used to detect a first layout parameter at the first editing item position of the editing page, wherein the first layout parameter is used to describe the total number of arrangements of the component model in the frame model; a second detection unit, which is used to detect a second layout parameter at the second editing item position of the editing page, wherein the second layout parameter is used to describe the distribution direction of the component model in the frame model; a third detection unit, which is used to detect a third layout parameter at the third editing item position of the editing page, wherein the third layout parameter is used to describe the spacing distance of the component model in the frame model; a fourth detection unit, which is used to detect a fourth layout parameter at the fourth editing item position of the editing page, wherein the fourth layout parameter is used to indicate the adjustment style of the model prefabricated body of the component model; a fifth detection unit, which is used to detect a fifth layout parameter at the fifth editing item position of the editing page, wherein the fifth layout parameter is used to indicate the addition of a closed enclosure to the outer wall of the frame model.
[0019] Optionally, the calculation module includes: a generation unit, used to copy and generate multiple identical model preforms in the frame model based on the first layout parameters; a calculation unit, used to calculate the position parameters of the multiple model preforms in the frame model according to the second layout parameters and the third layout parameters, wherein the position parameters include: three-dimensional coordinate position and orientation; an adjustment unit, used to adjust the preform style of the model preform according to the fourth layout parameters; an adding unit, used to add a closed inclusion on the outer wall of the frame model based on the fifth layout parameters, and leave a blank light-transmitting area on the inclusion.
[0020] Optionally, the calculation unit includes: a determination subunit, used to determine the layout space of the component model within the framework model; a division subunit, used to evenly divide the layout space into multiple subspaces based on the spacing distance, wherein the number of the subspaces is the same as the number of the model preforms; a configuration subunit, used to locate the center point of each subspace, determine the center point as the coordinate position of the model preform in the corresponding sub-area, and configure the same normal information for the model preform in each sub-area based on the distribution direction.
[0021] Optionally, the framework geometry data includes: vertex data, corner point data, facet data, and geometry structure data.
[0022] Optionally, the component model includes a model of at least one of the following components: room, door, wall window, skylight, roof, skirting, plaster line, window frame, door frame, beam, column, floor, bar.
[0023] Optionally, the generation module includes: an adding unit, used to add the mapping parameters of the component model for each component model; a generating unit, used to generate a sub-model file of the component model according to the mapping parameters and the building parameters, wherein the sub-model file includes sub-grid information and sub-material information; a merging unit, used to merge the sub-model files of all component models in the virtual indoor scene to generate a rendering resource file in a predetermined format, wherein the rendering resource file includes several types of sub-model files, and each type of sub-model file includes several sub-model files.
[0024] Optionally, the device also includes: an import module, which is used to import the rendering resource file into a rendering engine after the generation module generates the rendering resource file of the virtual indoor scene based on the construction parameters, and import the point cloud data of the virtual indoor scene into the rendering engine; a rendering module, which is used to personalize the sub-material information of the component model in the rendering engine and generate a three-dimensional scene image of the virtual indoor scene according to the modified construction parameters and the point cloud data; or, directly use the rendering resource file and the point cloud data in the rendering engine to generate a three-dimensional scene image of the virtual indoor scene.
[0025] According to yet another embodiment of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.
[0026] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0027] Through the present invention, the frame geometry data of the frame model of the virtual indoor scene to be constructed and the layout parameters of the component model are obtained, wherein the layout parameters are used to characterize the distribution sparsity of the component model, and the component model is laid out in the frame model; the construction parameters of the component model are calculated according to the frame geometry data and the layout parameters, wherein the construction parameters are used to characterize the construction position of the component model in the virtual indoor scene; based on the construction parameters, a rendering resource file of the virtual indoor scene is generated, by obtaining the frame geometry data of the frame model and the layout parameters of the component model, and calculating the construction parameters of the component model, the rendering resource file is generated, the technical problem of low efficiency caused by manually making virtual indoor scenes in related technologies is solved, the modeling flexibility of the virtual indoor scenes is improved, the standardization and uniformity of each component model in the virtual indoor scenes are guaranteed, and the production efficiency of the virtual indoor scenes is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0029] Figure 1 It is a hardware structure block diagram of a server for generating a virtual indoor scene according to an embodiment of the present invention;
[0030] Figure 2 is a flow chart of a method for generating a virtual indoor scene according to an embodiment of the present invention;
[0031] Figure 3 is a schematic diagram of outputting building parameters using a tool panel in an embodiment of the present invention;
[0032] Figure 4 is a schematic diagram of a point cloud network and a preview interface in an embodiment of the present invention;
[0033] Figure 5 is a structural block diagram of a device for generating a virtual indoor scene according to an embodiment of the present invention;
[0034] Figure 6 It is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0037] Example 1
[0038] The method embodiment provided in the first embodiment of the present application can be executed in a mobile phone, tablet, server, computer or similar electronic terminal. Taking running on a server as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a server for generating a virtual indoor scene according to an embodiment of the present invention. Figure 1 As shown, the server may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the server may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0039] The memory 104 can be used to store server programs, for example, software programs and modules of application software, such as a server program corresponding to a method for generating a virtual indoor scene in an embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the server program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. In this embodiment, the processor 104 is used to respond to human-computer interaction instructions and game strategies, and render and generate corresponding virtual indoor scenes. The memory 104 is used to store program scripts, configuration information, rendering resources, etc. of electronic games.
[0040] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0041] Optionally, the input-output device 108 further includes a human-computer interaction screen for obtaining human-computer interaction instructions through a human-computer interaction interface and for presenting images in a virtual scene;
[0042] In this embodiment, a method for generating a virtual indoor scene is provided. Figure 2 FIG. 1 is a flow chart of a method for generating a virtual indoor scene according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0043] Step S202, obtaining the frame geometry data of the frame model of the virtual indoor scene to be constructed and the layout parameters of the component models, wherein the layout parameters are used to characterize the distribution sparsity of the component models, and the component models are laid out in the frame model;
[0044] The virtual indoor scene includes a scene frame and scene components. The scene frame is such as the outer frame of a house. The scene components are some small objects inside the scene frame or embedded in the frame, such as seats and furniture inside, doors and windows embedded in the frame, balconies, etc.
[0045] Optionally, the framework geometry data of the framework model includes: vertex data, corner point data, patch data, and geometric structure data.
[0046] Optionally, the component model includes a model of at least one of the following components: room, door, wall window, skylight, roof, skirting, plaster line, window frame, door frame, beam, column, floor, bar.
[0047] Step S204, calculating the construction parameters of the component model according to the framework geometry data and the layout parameters, wherein the construction parameters are used to characterize the construction position of the component model in the virtual indoor scene;
[0048] In this embodiment, the position parameters corresponding to the construction position include: three-dimensional coordinate position, orientation and direction, etc.
[0049] Step S206: Generate a rendering resource file of the virtual indoor scene based on the construction parameters.
[0050] The rendering resource file in this embodiment may be a file of a specified format such as an FBX (film box) file that can be imported and rendered in a scene editing tool.
[0051] Through the above steps, the frame geometry data of the frame model of the virtual indoor scene to be constructed and the layout parameters of the component model are obtained, wherein the layout parameters are used to characterize the distribution sparsity of the component model, and the component model is laid out in the frame model; the construction parameters of the component model are calculated according to the frame geometry data and the layout parameters, wherein the construction parameters are used to characterize the construction position of the component model in the virtual indoor scene; based on the construction parameters, a rendering resource file of the virtual indoor scene is generated, by obtaining the frame geometry data of the frame model and the layout parameters of the component model, and calculating the construction parameters of the component model, the rendering resource file is generated, the technical problem of low efficiency caused by manual production of virtual indoor scenes in related technologies is solved, the modeling flexibility of the virtual indoor scene is improved, the standardization and uniformity of each component model in the virtual indoor scene are guaranteed, and the production efficiency of the virtual indoor scene is improved.
[0052] In one implementation of the present embodiment, obtaining frame geometry data of a frame model of a virtual indoor scene to be constructed includes: determining a frame shape of the frame model; obtaining room size parameters of the frame model, obtaining ceiling parameters of a ceiling in the frame model, wherein the ceiling parameters include shape parameters and size parameters; preprocessing the frame shape, room size parameters, and ceiling parameters based on the position of the surface to generate frame geometry data of the frame model.
[0053] In some examples, the size of the virtual indoor scene and the model of the indoor components are obtained as basic input sources, and are preprocessed (mainly based on the position of the surface) to generate programmable unit modules and data to generate framework geometry data of the framework model.
[0054] The above implementation can generate an indoor space available in a virtual game, which can be a default rectangle (the length, width and height can be adjusted separately, lines can be added, the number and direction can be adjusted, vertex color drawing is convenient, and the plane of the ceiling can be switched to a curved surface or other shapes).
[0055] In an example, in the tool control panel, the parameters are used as the basic input source to generate a cuboid with a length, width and height of 6x6x9. The unit of the room size is meter. The ceiling is designed to be trapezoidal, and the height and inclination angle can be adjusted to facilitate the creation of inclined surfaces for window openings, and it can also be switched to a dome.
[0056] In one implementation of the present embodiment, obtaining the layout parameters of the component model of the virtual indoor scene to be built includes: responding to the editing instruction of the component model of the virtual indoor scene to be built, displaying the editing page of the component model, wherein the editing page includes the storage path of the model prefab of the component model and multiple editing items; detecting the first layout parameter at the first editing item position of the editing page, wherein the first layout parameter is used to describe the total number of arrangements of the component model in the frame model; detecting the second layout parameter at the second editing item position of the editing page, wherein the second layout parameter is used to describe the distribution direction of the component model in the frame model; detecting the third layout parameter at the third editing item position of the editing page, wherein the third layout parameter is used to describe the spacing distance of the component model in the frame model; detecting the fourth layout parameter at the fourth editing item position of the editing page, wherein the fourth layout parameter is used to indicate the adjustment style of the model prefab of the component model; detecting the fifth layout parameter at the fifth editing item position of the editing page, wherein the fifth layout parameter is used to indicate adding a closed enclosure to the outer wall of the frame model.
[0057] In this embodiment, the parameters of the component model are input (such as specific parameters of distribution sparsity such as window height, length, width, height, etc. of the door, as well as optional components such as skirting boards, plaster lines, etc.), and the number n, normal N (orientation) and position P of the component models are calculated based on the frame geometry data of the house frame (including point vertices, vertex corners, primitive patches, detail geometry information, etc.).
[0058] Taking floor distribution data preprocessing as an example, input is made on the tool panel, including specifying the number of windows, adjustable length and width values, and adjustable window positions. The top of the window can be switched to be flat, arc or pointed, and the default is with a basic rectangular section window frame. The window frame can be closed and a custom model can be inserted. In some cases, it can be switched to a custom distribution, which is convenient for the artist to manually control the custom distribution. After adjusting the floor, continue to adjust the relevant parameters of other component models to produce the indoor module parameters expected by the art design. In an example, the distribution sparsity can specify the wall where the door needs to be opened, the number of doors, the default is 1, the default bottom edge is level with the ground, the position is adjustable, with a rectangular section door frame, and a threshold. The door frame can be closed and a custom model can be inserted. The default is a rectangular section skirting, which is close to the ground and has an adjustable height. It can be switched to the wall panel mode with decorative strips on the upper and lower edges. Decorative elements such as skirting plaster lines can be enabled or disabled. If you choose to enable, you can design its style by adjusting the parameters. The default is to have a top decorative strip, with adjustable width, adjustable number, and can be closed, and the top is close to the top. The cross section can be rectangular or without thickness. The exterior has an inclusion to prevent light leakage from baking a single piece. Or the wall and roof have thickness. The bounding box option is an inclusion, which automatically leaves the doors and windows that need to be transparent empty, and the rest is a closed grid. The direction and angle of the corner column can be adjusted. A skylight is added to the roof.
[0059] Based on the above implementation of this embodiment, calculating the construction parameters of the component model according to the framework geometry data and layout parameters includes:
[0060] S11, generating a plurality of identical model prefabricated bodies by copying in the framework model based on the first layout parameter;
[0061] If the virtual indoor scene requires 10 stools, copy 10 identical stool model prefabs.
[0062] S12, calculating position parameters of the plurality of model preforms in the frame model according to the second layout parameter and the third layout parameter, wherein the position parameters include: three-dimensional coordinate position and orientation;
[0063] In one example, calculating the position parameters of multiple model preforms in the framework model according to the second layout parameters and the third layout parameters includes: determining the layout space of the component model in the framework model; dividing the layout space into multiple subspaces based on the spacing distance, wherein the number of subspaces is the same as the number of model preforms; locating the center point of each subspace, determining the center point as the coordinate position of the model preform in the corresponding subarea, and configuring the same normal information for the model preform in each subarea based on the distribution direction.
[0064] S13, adjusting the prefabricated body style of the model prefabricated body according to the fourth layout parameter;
[0065] You can make personalized adjustments to each model prefab, or you can make stylized adjustments to all model prefabs.
[0066] S14, adding a closed inclusion body to the outer wall surface of the frame model based on the fifth layout parameter, and leaving a light-transmitting area on the inclusion body.
[0067] The user first inputs the model file that needs to be arranged (in the engine, drag the model in .fbx or .prefab format into the position of the arrangement object), and the model file is used to generate the model prefab; then input the total number that needs to be arranged; finally set the distribution direction and spacing distance to modify the values of the x, y, and z components of the model position P. In the tool panel, object_merge, copy, bound, CTRL and other nodes are used to implement it. object_merge is the input model. The copy node is used to copy the total number that needs to be arranged. The bound node obtains the length, width, and height of the model. switchX, switchY, and switchZ are used to enable or disable the modification of the X, Y, and Z directions. The CTRL node is used to pass in the spacing value. Figure 3 It is a schematic diagram of outputting building parameters using a tool panel according to an embodiment of the present invention.
[0068] In this embodiment, generating a rendering resource file for a virtual indoor scene based on building parameters includes: adding mapping parameters of the component model for each component model; generating a sub-model file of the component model according to the mapping parameters and the building parameters, wherein the sub-model file includes sub-grid information and sub-material information; merging the sub-model files of all component models in the virtual indoor scene to generate a rendering resource file in a predetermined format, wherein the rendering resource file includes several types of sub-model files, and each type of sub-model file includes several sub-model files.
[0069] The generated component models with adjusted parameters are sorted and merged, and the output models are sorted and standardized, including UV distribution maps and submeshes. The final output of the interior scene is an FBX file, and each part uses sub meshes and sub materials. In an example, the UV distribution is set in the uvunwrap node of the tool panel to paste the material; the groupdelete and attribdelete nodes are used to delete the temporary data generated in the tool production project, and an attribute for splitting the submesh is set in the attribcreate node. In an example, the virtual interior scene is a tavern in the game. In the resource structure of the rendering resource file, the floor, wall, skirting, decorative line, window frame, and door frame are separate meshes. The upper layer has a name called the pinyin of the tavern, which is the identification information of the rendering resource file.
[0070] In the rendering resource file of this embodiment, each component model includes a normal and two sets of UVs, wherein UV1 is used for mapping and UV2 is used for baking a lightmap.
[0071] In some scenarios of the present embodiment, after generating the rendering resource file of the virtual indoor scene based on the construction parameters, it also includes: importing the rendering resource file into the rendering engine, and importing the point cloud data of the virtual indoor scene into the rendering engine; personalizing the sub-material information of the component model in the rendering engine and generating a three-dimensional scene image of the virtual indoor scene according to the modified construction parameters and point cloud data; or, directly using the rendering resource file and point cloud data in the rendering engine to generate a three-dimensional scene image of the virtual indoor scene.
[0072] In this embodiment, a component model composed of several identical or similar model preforms is a component kit, and generating a three-dimensional scene picture of a virtual indoor scene includes: first, generating a point cloud network based on point cloud data, the point cloud network includes several sets of hanging points, each set of hanging points is at least 3, and multiple model preforms of each component kit are positioned in the frame model of the virtual indoor scene through the corresponding 3 hanging points. Since the positions of multiple model preforms in the component kit are relatively fixed, 3 hanging points are used to respectively position three of the model preforms, so that the overall positioning of the component kit can be achieved in the point cloud network. When the number of model preforms is 2, an origin of the three-dimensional coordinate system is added as a hanging point. Double positioning is performed by using the hanging points of the component kit and the three-dimensional coordinate positions of the model preforms to prevent the model preforms from being offset or erroneous in the frame model of the virtual indoor scene.
[0073] Figure 4 It is a schematic diagram of the point cloud network and preview interface in an embodiment of the present invention, which presents the point cloud and hanging points of the locations of modules such as doors, windows, and columns, and is used to load the door and window model prefabricated bodies in the engine, thereby saving the number of faces of the generated indoor scene model itself and improving the positioning accuracy.
[0074] In the tool panel, set three output interfaces. The first Preview node represents the complete result including the final generated model resources and point cloud resources; the second FBX node represents the model file exported by the tool; the third PointsCloud node represents the point cloud data exported by the tool in the .bgeo.sc format. The resources output by the second and third interfaces are used to import into the engine.
[0075] Import the generated FBX file into Unity, and you can see that the model contains a circular material ball, which can be further replaced and modified in the engine. In the scene editing tool (Unity), import the generated point cloud file, use the output point cloud file (.bgeo.sc) to import it into the scene editing tool, such as dragging the point cloud file reading tool into the scene editing tool, drag the fbx into the Hierarchy panel, and the structure of the indoor model is displayed in the scene view. Use the arrangement tool in the present invention to arrange the indoor furnishings, such as tables, chairs, bookshelves, beds, wardrobes and other model presets in the engine.
[0076] This embodiment uses node-based programming to adjust the position and quantity of necessary or optional components (such as rooms, doors, windows, skylights, roofs, decorative skirtings and plaster lines, beams, columns, floors, etc.) and other special modules (such as the bar in this example) for scene construction through parameters to resolve conflicts between components. The input source is the parameters exposed by the tool panel. According to the input parameters, the relationship between each module is established (such as the size of the room affects the size of the floor and the position of the wall, and the position of the wall affects the position of the window on the wall), the position P (x, y, z) of each module, the number n, the automatic expansion of UV, the batching of models (merging meshes of the same material into one) and naming. The output of this tool is an FBX file that can be imported into the game engine, and can be mapped in the engine to present the effect of the indoor scene.
[0077] The solution of this embodiment avoids a lot of repetitive modeling work. Manual operation is prone to errors. For example, if there are multiple windows in a building space, the wall at each window position needs to be manually processed in the same way, which makes it difficult to ensure standardization and uniformity. A lot of repetitive placement work is avoided. Manual operation is time-consuming and labor-intensive, and the position is inaccurate. For example, when dragging the tables and chairs displayed in the lobby of a pub, they need to be placed neatly according to the rules. It avoids the inconvenience of iteration, such as the window opening problem. After the destructive operation is performed on the wall, when changing the window position and number, a series of operations need to be performed again. Another example is the problem of placing tables and chairs. When the number of round table chairs changes, the position of each chair needs to be readjusted in turn.
[0078] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0079] Example 2
[0080] In this embodiment, a device for generating a virtual indoor scene is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0081] Figure 5 is a structural block diagram of a device for generating a virtual indoor scene according to an embodiment of the present invention. Figure 5 As shown, the device includes: an acquisition module 50, a calculation module 52, and a generation module 54, wherein:
[0082] An acquisition module 50 is used to acquire frame geometry data of a frame model of a virtual indoor scene to be constructed and layout parameters of component models, wherein the layout parameters are used to characterize the distribution sparsity of the component models, and the component models are arranged in the frame model;
[0083] A calculation module 52, used for calculating the construction parameters of the component model according to the framework geometry data and the layout parameters, wherein the construction parameters are used to characterize the construction position of the component model in the virtual indoor scene;
[0084] The generating module 54 is used to generate a rendering resource file of the virtual indoor scene based on the building parameters.
[0085] Optionally, the acquisition module includes: a determination unit, used to determine the frame shape of the frame model; an acquisition unit, used to acquire room size parameters of the frame model, and acquire ceiling parameters of the ceiling in the frame model, wherein the ceiling parameters include shape parameters and size parameters; and a generation unit, used to preprocess the frame shape, the room size parameters, and the ceiling parameters based on the position of the surface, and generate frame geometry data of the frame model.
[0086] Optionally, the acquisition module includes: a display unit, which is used to respond to the editing instruction of the component model of the virtual indoor scene to be built, and display the editing page of the component model, wherein the editing page includes the storage path of the model prefabricated body of the component model and multiple editing items; a first detection unit, which is used to detect a first layout parameter at the first editing item position of the editing page, wherein the first layout parameter is used to describe the total number of arrangements of the component model in the frame model; a second detection unit, which is used to detect a second layout parameter at the second editing item position of the editing page, wherein the second layout parameter is used to describe the distribution direction of the component model in the frame model; a third detection unit, which is used to detect a third layout parameter at the third editing item position of the editing page, wherein the third layout parameter is used to describe the spacing distance of the component model in the frame model; a fourth detection unit, which is used to detect a fourth layout parameter at the fourth editing item position of the editing page, wherein the fourth layout parameter is used to indicate the adjustment style of the model prefabricated body of the component model; a fifth detection unit, which is used to detect a fifth layout parameter at the fifth editing item position of the editing page, wherein the fifth layout parameter is used to indicate the addition of a closed enclosure to the outer wall of the frame model.
[0087] Optionally, the calculation module includes: a generation unit, used to copy and generate multiple identical model preforms in the frame model based on the first layout parameters; a calculation unit, used to calculate the position parameters of the multiple model preforms in the frame model according to the second layout parameters and the third layout parameters, wherein the position parameters include: three-dimensional coordinate position and orientation; an adjustment unit, used to adjust the preform style of the model preform according to the fourth layout parameters; an adding unit, used to add a closed inclusion on the outer wall of the frame model based on the fifth layout parameters, and leave a blank light-transmitting area on the inclusion.
[0088] Optionally, the calculation unit includes: a determination subunit, used to determine the layout space of the component model within the framework model; a division subunit, used to evenly divide the layout space into multiple subspaces based on the spacing distance, wherein the number of the subspaces is the same as the number of the model preforms; a configuration subunit, used to locate the center point of each subspace, determine the center point as the coordinate position of the model preform in the corresponding sub-area, and configure the same normal information for the model preform in each sub-area based on the distribution direction.
[0089] Optionally, the framework geometry data includes: vertex data, corner point data, facet data, and geometry structure data.
[0090] Optionally, the component model includes a model of at least one of the following components: room, door, wall window, skylight, roof, skirting, plaster line, window frame, door frame, beam, column, floor, bar.
[0091] Optionally, the generation module includes: an adding unit, used to add the mapping parameters of the component model for each component model; a generating unit, used to generate a sub-model file of the component model according to the mapping parameters and the building parameters, wherein the sub-model file includes sub-grid information and sub-material information; a merging unit, used to merge the sub-model files of all component models in the virtual indoor scene to generate a rendering resource file in a predetermined format, wherein the rendering resource file includes several types of sub-model files, and each type of sub-model file includes several sub-model files.
[0092] Optionally, the device also includes: an import module, which is used to import the rendering resource file into a rendering engine after the generation module generates the rendering resource file of the virtual indoor scene based on the construction parameters, and import the point cloud data of the virtual indoor scene into the rendering engine; a rendering module, which is used to personalize the sub-material information of the component model in the rendering engine and generate a three-dimensional scene image of the virtual indoor scene according to the modified construction parameters and the point cloud data; or, directly use the rendering resource file and the point cloud data in the rendering engine to generate a three-dimensional scene image of the virtual indoor scene.
[0093] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0094] Example 3
[0095] The present application also provides an electronic device, Figure 6 is a structural diagram of an electronic device according to an embodiment of the present invention, such as Figure 6 As shown, it includes a processor 61, a communication interface 62, a memory 63 and a communication bus 64, wherein the processor 61, the communication interface 62, and the memory 63 communicate with each other through the communication bus 64, and the memory 63 is used to store computer programs;
[0096] The processor 61 is used to execute the program stored in the memory 63 to implement the following steps: obtaining the frame geometry data of the frame model of the virtual indoor scene to be constructed and the layout parameters of the component model, wherein the layout parameters are used to characterize the distribution sparsity of the component model, and the component model is laid out in the frame model; calculating the construction parameters of the component model according to the frame geometry data and the layout parameters, wherein the construction parameters are used to characterize the construction position of the component model in the virtual indoor scene; and generating a rendering resource file of the virtual indoor scene based on the construction parameters.
[0097] Optionally, obtaining frame geometry data of a frame model of a virtual indoor scene to be constructed includes: determining a frame shape of the frame model; obtaining room size parameters of the frame model, and obtaining ceiling parameters of a ceiling in the frame model, wherein the ceiling parameters include shape parameters and size parameters; and preprocessing the frame shape, the room size parameters, and the ceiling parameters based on the position of the surface to generate frame geometry data of the frame model.
[0098] Optionally, obtaining the layout parameters of the component model of the virtual indoor scene to be built includes: responding to an editing instruction of the component model of the virtual indoor scene to be built, displaying an editing page of the component model, wherein the editing page includes a storage path of a model prefab of the component model and multiple editing items; detecting a first layout parameter at a first editing item position on the editing page, wherein the first layout parameter is used to describe the total number of arrangements of the component model within the frame model; detecting a second layout parameter at a second editing item position on the editing page, wherein the second layout parameter is used to describe a distribution direction of the component model within the frame model; detecting a third layout parameter at a third editing item position on the editing page, wherein the third layout parameter is used to describe the spacing distance of the component model within the frame model; detecting a fourth layout parameter at a fourth editing item position on the editing page, wherein the fourth layout parameter is used to indicate an adjustment style of the model prefab of the component model; detecting a fifth layout parameter at a fifth editing item position on the editing page, wherein the fifth layout parameter is used to indicate adding a closed enclosure to the outer wall of the frame model.
[0099] Optionally, calculating the building parameters of the component model according to the framework geometry data and the layout parameters includes: copying and generating a plurality of identical model prefabs in the framework model based on the first layout parameters; calculating the position parameters of the plurality of model prefabs in the framework model according to the second layout parameters and the third layout parameters, wherein the position parameters include: three-dimensional coordinate position and orientation; adjusting the prefab style of the model prefab according to the fourth layout parameters; and adding a closed inclusion to the outer wall of the framework model based on the fifth layout parameters, and leaving a light-transmitting area on the inclusion.
[0100] Optionally, calculating the position parameters of the multiple model preforms in the frame model respectively according to the second layout parameter and the third layout parameter includes: determining the layout space of the component model in the frame model; dividing the layout space into multiple subspaces based on the spacing distance, wherein the number of the subspaces is the same as the number of the model preforms; locating the center point of each subspace, determining the center point as the coordinate position of the model preform in the corresponding subarea, and configuring the same normal information for the model preform in each subarea based on the distribution direction.
[0101] Optionally, the framework geometry data includes: vertex data, corner point data, facet data, and geometry structure data.
[0102] Optionally, the component model includes a model of at least one of the following components: room, door, wall window, skylight, roof, skirting, plaster line, window frame, door frame, beam, column, floor, bar.
[0103] Optionally, generating a rendering resource file of the virtual indoor scene based on the building parameters includes: adding mapping parameters of the component model for each component model; generating a sub-model file of the component model according to the mapping parameters and the building parameters, wherein the sub-model file includes sub-grid information and sub-material information; merging the sub-model files of all component models in the virtual indoor scene to generate a rendering resource file in a predetermined format, wherein the rendering resource file includes several types of sub-model files, and each type of sub-model file includes several sub-model files.
[0104] Optionally, after generating a rendering resource file of the virtual indoor scene based on the construction parameters, the method further includes: importing the rendering resource file into a rendering engine, and importing the point cloud data of the virtual indoor scene into the rendering engine; personalizing the sub-material information of the component model in the rendering engine and generating a three-dimensional scene image of the virtual indoor scene according to the modified construction parameters and the point cloud data; or, directly using the rendering resource file and the point cloud data in the rendering engine to generate a three-dimensional scene image of the virtual indoor scene.
[0105] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0106] The communication interface is used for communication between the above terminal and other devices.
[0107] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0108] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0109] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is executed on a computer, the computer executes the method for generating a virtual indoor scene described in any of the above embodiments.
[0110] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the method for generating a virtual indoor scene described in any one of the above embodiments.
[0111] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0112] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0113] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0114] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0115] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0116] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0117] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0118] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for generating a virtual indoor scene, characterized in that: include: Acquire frame geometry data of a frame model of a virtual indoor scene to be constructed and layout parameters of component models, wherein the layout parameters are used to characterize the distribution sparsity of the component models, and the component models are laid out in the frame model; Calculating the construction parameters of the component model according to the framework geometry data and the layout parameters, wherein the construction parameters are used to characterize the construction position of the component model in the virtual indoor scene; Generate a rendering resource file of the virtual indoor scene based on the construction parameters; Among them, the second layout parameter is used to describe the distribution direction of the component model in the frame model, and the third layout parameter is used to describe the spacing distance of the component model in the frame model. Calculating the construction parameters of the component model according to the frame geometry data and the layout parameters includes: calculating the position parameters of multiple model preforms in the frame model according to the second layout parameters and the third layout parameters, wherein the position parameters include: three-dimensional coordinate position and orientation; calculating the position parameters of the multiple model preforms in the frame model according to the second layout parameters and the third layout parameters includes: determining the layout space of the component model in the frame model; dividing the layout space into multiple subspaces based on the spacing distance, wherein the number of the subspaces is the same as the number of the model preforms; locating the center point of each subspace, determining the center point as the coordinate position of the model preform in the corresponding subarea, and configuring the same normal information for the model preforms in each subarea based on the distribution direction.
2. The method according to claim 1, characterized in that Obtaining the frame geometry data of the frame model of the virtual indoor scene to be built includes: Determining a frame shape of the frame model; Acquire room size parameters of the frame model, and acquire ceiling parameters of the ceiling in the frame model, wherein the ceiling parameters include shape parameters and size parameters; The frame shape, the room size parameters, and the ceiling parameters are preprocessed based on the position of the surface to generate frame geometry data of the frame model.
3. The method according to claim 1, characterized in that Obtaining the layout parameters of the component model of the virtual indoor scene to be built includes: In response to an editing instruction of a component model of a virtual indoor scene to be constructed, an editing page of the component model is displayed, wherein the editing page includes a storage path of a model prefab of the component model and a plurality of editing items; Detecting a first layout parameter at a first edit item position on the edit page, wherein the first layout parameter is used to describe the total number of arrangements of the component model within the frame model; Detecting a second layout parameter at a second edit item position on the edit page; Detecting a third layout parameter at a third edit item position on the edit page; detecting a fourth layout parameter at a fourth edit item position on the edit page, wherein the fourth layout parameter is used to indicate an adjustment style of a model prefab of the component model; A fifth layout parameter is detected at a fifth editing item position on the editing page, wherein the fifth layout parameter is used to indicate adding a closed inclusion body to an outer wall surface of the frame model.
4. The method according to claim 3, characterized in that Calculating the building parameters of the component model according to the framework geometry data and the layout parameters also includes: Based on the first layout parameters, a plurality of identical model preforms are generated by copying in the framework model; adjusting the prefabricated body style of the model prefabricated body according to the fourth layout parameter; A closed inclusion body is added to the outer wall surface of the frame model based on the fifth layout parameter, and a light-transmitting area is left on the inclusion body.
5. The method according to claim 1, characterized in that The framework geometry data includes vertex data, corner point data, facet data, and geometry structure data.
6. The method according to claim 1, characterized in that The component model includes a model of at least one of the following components: room, door, wall window, skylight, roof, skirting, plaster line, window frame, door frame, beam, column, floor, bar.
7. The method according to claim 1, characterized in that Generating a rendering resource file of the virtual indoor scene based on the construction parameters includes: For each component model, add the mapping parameters of the component model; Generate a sub-model file of the component model according to the mapping parameters and the building parameters, wherein the sub-model file includes sub-grid information and sub-material information; The sub-model files of all component models in the virtual indoor scene are merged to generate a rendering resource file in a predetermined format, wherein the rendering resource file includes several types of sub-model files, and each type of sub-model file includes several sub-model files.
8. The method according to claim 7, characterized in that After generating the rendering resource file of the virtual indoor scene based on the construction parameters, the method further includes: Importing the rendering resource file into a rendering engine, and importing the point cloud data of the virtual indoor scene into the rendering engine; In the rendering engine, the sub-material information of the component model is personalized and a three-dimensional scene image of the virtual indoor scene is generated according to the modified construction parameters and the point cloud data; or, in the rendering engine, the three-dimensional scene image of the virtual indoor scene is directly generated using the rendering resource file and the point cloud data.
9. A device for generating a virtual indoor scene, characterized in that: include: An acquisition module, used to acquire frame geometry data of a frame model of a virtual indoor scene to be constructed and layout parameters of a component model, wherein the layout parameters are used to characterize the distribution sparsity of the component model, and the component model is arranged in the frame model; A calculation module, used for calculating the construction parameters of the component model according to the framework geometry data and the layout parameters, wherein the construction parameters are used to characterize the construction position of the component model in the virtual indoor scene; A generation module, used to generate a rendering resource file of the virtual indoor scene based on the construction parameters; Among them, the second layout parameter is used to describe the distribution direction of the component model in the frame model, and the third layout parameter is used to describe the spacing distance of the component model in the frame model; the calculation module includes a calculation unit, which is used to calculate the position parameters of multiple model preforms in the frame model according to the second layout parameter and the third layout parameter, wherein the position parameters include: three-dimensional coordinate position and orientation direction; the calculation unit includes: a determination subunit, which is used to determine the layout space of the component model in the frame model; a division subunit, which is used to divide the layout space into multiple subspaces based on the spacing distance, wherein the number of the subspaces is the same as the number of the model preforms; a configuration subunit, which is used to locate the center point of each subspace, determine the center point as the coordinate position of the model preform in the corresponding subarea, and configure the same normal information for the model preform in each subarea based on the distribution direction.
10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 8 when executed.
11. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Virtual building model generation method and device, processor and electronic device
CN110826136A
Virtual attachment model generation method and device, processor and electronic device
CN111105507A
Three-dimensional virtual scene generation method and device
CN112396688A