Method, device, equipment and storage medium for generating three-dimensional ancient building model
By acquiring and splicing module information in the three-dimensional asset library, complex ancient Chinese building models are generated, which solves the problems of low generation efficiency and large storage space of ancient building models in the existing technology, and realizes efficient generation of ancient building models and saves storage. Space effect.
Patent Information
- Application Number
- CN202311426470.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-27
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2043-10-27
AI Technical Summary
Existing architectural model building software is difficult to effectively generate complex ancient Chinese architectural models. This is mainly due to the diverse and low repetition rate of ancient architectural components, resulting in excessive storage of module models in the asset library and the lack of effective programmatic generation solutions.
By obtaining matching module information in the preset three-dimensional asset library, using module tags (such as type, age, function, size, etc.) for retrieval and splicing, complex ancient building models are generated to avoid directly storing module models. Save storage space and set building rules for ancient buildings through module information.
It realizes the generation of complex structural ancient building models, saves the storage space of the asset library, improves the generation efficiency and user experience, and provides a convenient operation method.
Smart Images

Figure CN117726778B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of three-dimensional graphics processing technology, and in particular, to a method, device, equipment and storage medium for generating a three-dimensional ancient building model. Background Art
[0002] The current architectural model building software is usually used to build modern architectural models. Since the parts of modern buildings have a high repetition rate and the building rules are relatively simple, it is usually adopted to set up module models in the asset library and directly call the module models to build the architectural model.
[0003] However, for ancient Chinese buildings, due to the variety of building components, low repetition rate, and complex construction rules, the above method will result in too much storage of module models in the asset library. There is no effective and universal solution for the programmatic generation of ancient Chinese buildings in the current building model building software. Summary of the invention
[0004] In view of this, one or more embodiments of the present specification provide a method, device, equipment and storage medium for generating a three-dimensional ancient building model.
[0005] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:
[0006] According to a first aspect of one or more embodiments of this specification, a method for generating a three-dimensional ancient building model is proposed, comprising:
[0007] Get the generation requirements of at least one ancient building module;
[0008] According to the generation requirement, matching module information is obtained from a preset three-dimensional asset library, wherein the module information is construction information of a module obtained by splicing a plurality of three-dimensional component models, and the three-dimensional asset library includes a plurality of three-dimensional component models;
[0009] splicing the three-dimensional component models in the three-dimensional asset library according to the module information to obtain a module model;
[0010] A three-dimensional ancient building model is obtained by generating a module model according to the generation requirements of the at least one ancient building group.
[0011] In some embodiments, the three-dimensional asset library includes module tags;
[0012] The step of obtaining matching module information from a preset three-dimensional asset library according to the generation requirement includes:
[0013] Performing natural language understanding on text content corresponding to the generation requirement to obtain a module label contained in the generation requirement, wherein the module label at least includes a module type label;
[0014] The three-dimensional asset library is searched according to the module tag to determine a module matching the module tag, and module information corresponding to the module is obtained.
[0015] In some embodiments, the module label further includes at least one of a year label, a function label, a style label, and a size label.
[0016] In some embodiments, the module tag is set with a priority;
[0017] The searching in the three-dimensional asset library according to the module tag to determine the module matching the module tag includes:
[0018] If no matching module is found according to the module tags, one or more module tags with the lowest priority are removed and the search is performed again.
[0019] In some embodiments, the three-dimensional component model includes a scalable model; the method further includes:
[0020] When a first size indicated by a size tag in the generation requirement is different from a second size indicated by a size tag of the matched module, determining size transformation information according to the first size and the second size;
[0021] According to the size transformation information, the size-changeable model in the module is transformed to obtain a transformed module model.
[0022] In some embodiments, the size-changeable model includes a plurality of unit blocks; and the size-changeable model in the module is size-changed according to the size-change information, comprising:
[0023] According to the size transformation information, the unit block is copied to increase the size; or,
[0024] The unit block is deleted according to the size transformation information to achieve size reduction.
[0025] In some embodiments, the module information further includes a repetition parameter, and the method further includes:
[0026] The module model is copied according to the value indicated by the repetition parameter, and the copied results are spliced;
[0027] The module model is updated according to the splicing result.
[0028] In some embodiments, the module information includes component information and splicing rules constituting the module;
[0029] The step of splicing the three-dimensional component models in the three-dimensional asset library according to the module information to obtain the module model includes:
[0030] Obtaining a three-dimensional component model corresponding to the module from the three-dimensional asset library according to the component information;
[0031] The three-dimensional component models are spliced according to the splicing rules to obtain the module model.
[0032] In some embodiments, the module information further includes a repetition parameter, and the method further includes:
[0033] The module model is copied according to the value indicated by the repetition parameter, and the copied results are spliced;
[0034] The module model is updated according to the splicing result.
[0035] In some embodiments, the 3D component model in the 3D asset library has a component tag, and the component tag includes a material tag. When the generation requirement includes material information, the method further includes:
[0036] According to the target material indicated by the material information, the material of the target component in the module model is set or transformed, wherein the target component is a component having a material tag indicating the target material in the three-dimensional asset library.
[0037] According to a second aspect of one or more embodiments of this specification, a device for generating a three-dimensional ancient building model is provided, comprising:
[0038] A generation unit, used for obtaining a generation requirement of at least one ancient building module;
[0039] A matching unit, configured to obtain matching module information from a preset three-dimensional asset library according to the generation requirement, wherein the module information is construction information of a module obtained by splicing a plurality of three-dimensional component models, and the three-dimensional asset library includes a plurality of three-dimensional component models;
[0040] A splicing unit, used for splicing the three-dimensional component models in the three-dimensional asset library according to the module information to obtain a module model;
[0041] The obtaining unit is used to obtain a three-dimensional ancient building model according to the module model generated according to the generation requirements of at least one ancient building group.
[0042] In some embodiments, the three-dimensional asset library includes module tags;
[0043] The matching unit is specifically used for:
[0044] Performing natural language understanding on text content corresponding to the generation requirement to obtain a module label contained in the generation requirement, wherein the module label at least includes a module type label;
[0045] The three-dimensional asset library is searched according to the module tag to determine a module matching the module tag, and module information corresponding to the module is obtained.
[0046] In some embodiments, the module label further includes at least one of a year label, a function label, a style label, and a size label.
[0047] In some embodiments, the module tag is set with a priority;
[0048] The matching unit is specifically used for:
[0049] If no matching module is found according to the module tags, one or more module tags with the lowest priority are removed and the search is performed again.
[0050] In some embodiments, the apparatus further comprises a pattern matching unit, configured to:
[0051] According to the module type indicated by the type tag, acquiring the style information included in the generation requirement;
[0052] Among the modules matching the module tag, a module matching the style information is acquired according to the style information.
[0053] In some embodiments, the three-dimensional component model includes a size-variable model; the apparatus further includes a size-changing unit for:
[0054] When a first size indicated by a size tag in the generation requirement is different from a second size indicated by a size tag of the matched module, determining size transformation information according to the first size and the second size;
[0055] According to the size transformation information, the size-changeable model in the module is transformed to obtain a transformed module model.
[0056] In some embodiments, the size-variable model includes a plurality of unit blocks; the size setting unit is specifically used to:
[0057] According to the size transformation information, the unit block is copied to increase the size; or,
[0058] The unit block is deleted according to the size transformation information to achieve size reduction.
[0059] In some embodiments, the module information includes component information and splicing rules constituting the module.
[0060] The splicing unit is specifically used for:
[0061] Obtaining a three-dimensional component model corresponding to the module from the three-dimensional asset library according to the component information;
[0062] The three-dimensional component models are spliced according to the splicing rules to obtain the module model.
[0063] In some embodiments, the module information further includes a repetition parameter, and the device further includes a repetition unit for:
[0064] The module model is copied according to the value indicated by the repetition parameter, and the copied results are spliced;
[0065] The module model is updated according to the splicing result.
[0066] In some embodiments, the three-dimensional component model in the three-dimensional asset library has a component tag, and the component tag includes a material tag. When the generation requirement includes material information, the device further includes a material setting unit for:
[0067] According to the target material indicated by the material information, the material of the target component in the module model is set or transformed, wherein the target component is a component having a material tag indicating the target material in the three-dimensional asset library.
[0068] According to a third aspect of one or more embodiments of this specification, an electronic device is provided, including:
[0069] processor;
[0070] a memory for storing processor-executable instructions;
[0071] The processor implements the method proposed in one or more embodiments of this specification by running the executable instructions.
[0072] According to a fourth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method provided in one or more embodiments of the present specification are implemented.
[0073] In the embodiment of the present specification, a three-dimensional asset library containing multiple three-dimensional component models is pre-set, and the three-dimensional asset library contains module information of multiple modules that can be obtained by splicing multiple three-dimensional component models. According to the input generation requirements of the ancient building model, the matching module information can be obtained in the three-dimensional asset library, and the three-dimensional component model corresponding to the module is spliced according to the module information to obtain the module model, and the three-dimensional ancient building model is obtained according to the module model generated according to each generation requirement. By storing the module information of the module composed of the three-dimensional component model and the three-dimensional component model in the three-dimensional asset library instead of directly storing the three-dimensional module model, the storage space of the asset library is saved, and by setting the construction rules applicable to the ancient building in the module information, the generation of the ancient building model with complex structure can be realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 It is a flow chart of a method for generating a three-dimensional ancient building model provided by an exemplary embodiment;
[0075] Figure 2 is a schematic diagram of generating a module model proposed by an exemplary embodiment;
[0076] Figure 3 is a schematic diagram of an exemplary building roof module;
[0077] Figure 4 It is a block diagram of a device for generating a three-dimensional ancient building model provided by an exemplary embodiment;
[0078] Figure 5 It is a schematic structural diagram of an electronic device provided by an exemplary embodiment. DETAILED DESCRIPTION
[0079] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0080] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0081] One or more embodiments of this specification provide a method for generating a three-dimensional ancient building model, which can be executed by an electronic device such as a terminal device or a server. The terminal device can be a fixed terminal or a mobile terminal, such as a mobile phone, a tablet computer, a game console, a desktop computer, an advertising machine, an all-in-one machine, a vehicle-mounted terminal, etc. The server includes a local server or a cloud server, etc. The method can be implemented by a processor calling a computer-readable instruction stored in a memory. In one example, it can be executed by software or an application program set in an electronic device. The three-dimensional ancient building model generated based on the method described in the embodiment can be applied to a variety of application scenarios including virtual shooting, games, etc. For example, in a virtual shooting scene, a display screen can be rendered on the screen based on the three-dimensional ancient building model as a shooting background, and it can be shot together with the foreground in the real world to obtain the required shooting picture.
[0082] Figure 1 It is a flow chart of a method for generating a three-dimensional ancient building model shown in an exemplary embodiment of this specification. The method includes steps 101-104.
[0083] In step 101, the generation requirement of at least one ancient building module is obtained.
[0084] Since the ancient building model is composed of many building components, it is undoubtedly a huge project to build the entire ancient building model by components one by one, and it requires the user to have a deep understanding of ancient buildings. Therefore, in the disclosed embodiment, the ancient building module is used as the basis for generating the ancient building model. The ancient building module is composed of multiple ancient building components and has certain functions of the ancient building, such as building roofs, building facades, brackets, railings, bases, walls, corridors, roads, etc.
[0085] The user can input generation requirements through the software or application that executes the method for generating the three-dimensional ancient building model, and the generation requirements are used to request the generation of one or more modules for constructing the three-dimensional ancient building model.
[0086] For example, a user can input multiple generation requirements, which are used to generate a building roof module, a building module, and a base module, so as to use these generated modules to build an ancient building model.
[0087] In the disclosed embodiment, the received generation requirement may be a generation requirement option selected by operating on the interactive interface of the software or application, and the ancient building module to be generated may be determined by the user's selection operation; or it may be a generation requirement in the form of voice or text input by the user, and the ancient building module to be generated may be determined by performing natural language understanding on the text content of the generation requirement. In the case of receiving a generation requirement in the form of voice, the voice content may be firstly recognized to obtain the corresponding text content, and then the recognized text content may be processed; and in the case of receiving a generation requirement in the form of text, the text content may be directly processed.
[0088] In step 102, according to the generation requirement, matching module information is obtained from a preset three-dimensional asset library.
[0089] In the embodiment of the present disclosure, a three-dimensional asset library is pre-set. In the three-dimensional asset library, a plurality of three-dimensional component models are stored. Each three-dimensional component model corresponds to a component, which is a basic unit constituting an ancient building module, such as a column, a guardrail, a floor, and the like.
[0090] In some embodiments, a component may be configured as a smallest unit that cannot be further divided.
[0091] The three-dimensional asset library also stores the construction information of the module (also referred to as module information). The construction information is used to indicate which components the module is composed of and the construction rules for obtaining the module model through these components.
[0092] It should be noted that the 3D asset library does not store the 3D model of the module itself, but stores the construction information of the module that can be constructed by different 3D components.
[0093] For example, the three-dimensional asset library includes module information of corridor module A, which indicates that corridor module A is composed of the following components in the three-dimensional asset library: column a, guardrail a, floor a, ceiling a, and indicates the construction rules of these components connected to obtain corridor module A; and includes module information of corridor module B, which indicates that corridor module B is composed of the following components in the three-dimensional asset library: column b, guardrail b, floor b, ceiling b, and indicates the construction rules of these components connected to obtain corridor module B. Assuming that according to the generation requirements, it is determined that the module that needs to be adjusted is corridor module A, the module information of corridor module A can be obtained as the matching module information.
[0094] In step 103, the three-dimensional component models in the three-dimensional asset library are spliced according to the module information to obtain a module model.
[0095] According to the module information, it can be determined which three-dimensional component models in the three-dimensional asset library the module is constructed by, so that these three-dimensional component models can be called from the three-dimensional asset library and spliced according to the construction rules indicated by the module information to obtain the module model corresponding to the received generation requirement.
[0096] In step 104, a three-dimensional ancient building model is obtained according to the module model generated according to the generation requirement of the at least one ancient building group.
[0097] For each received generation requirement, the module model corresponding to the generation requirement can be obtained by executing steps 102 to 103. After these module models are obtained, they can be spliced and assembled to obtain a three-dimensional ancient building model.
[0098] In the embodiment of the present specification, a three-dimensional asset library containing multiple three-dimensional component models is pre-set, and the three-dimensional asset library contains module information of multiple modules that can be obtained by splicing multiple three-dimensional component models. According to the input generation requirements of the ancient building model, the matching module information can be obtained in the three-dimensional asset library, and the three-dimensional component model corresponding to the module is spliced according to the module information to obtain the module model, and the three-dimensional ancient building model is obtained according to the module model generated according to each generation requirement. By storing the module information of the module composed of the three-dimensional component model and the three-dimensional component model in the three-dimensional asset library instead of directly storing the three-dimensional module model, the storage space of the asset library is saved, and by setting the construction rules applicable to the ancient building in the module information, the generation of the ancient building model with complex structure can be realized.
[0099] In the disclosed embodiment, a module label can be set for each module that can be constituted by each three-dimensional component model. The label can be used to indicate the type, age, function, style, size, etc. of the module, that is, the module label can include the type label, age label, function label, style label, size label, material label, etc. of the module. Among them, the type label is used to indicate the type of the module, such as a building top module, a corridor module, etc.; the age label is used to indicate which age the module belongs to, such as the Tang Dynasty, Ming and Qing Dynasties, the Republic of China, modern times, etc., and there is no limit to the age; the function label is used to indicate the purpose of the building to which the module belongs, such as the building is an official residence, a residential building, a palace, a street, a martial arts field, etc.; the style label includes realism, animation, cartoon, game, etc.; the size label is used to indicate the size information of the module, such as width information, length information, height information, etc.
[0100] Taking the above-mentioned corridor module A and corridor module B as an example, the module label is explained.
[0101] The label of corridor module A may be, for example:
[0102] Type: Corridor;
[0103] Era: Tang and Song Dynasties
[0104] Function: Official residence;
[0105] Style: Realistic;
[0106] Size: 1 meter.
[0107] The label of corridor module B may be, for example:
[0108] Type: Corridor;
[0109] Era: Qing Dynasty
[0110] Function: Official residence;
[0111] Style: Game;
[0112] Size: 3 meters.
[0113] In some embodiments, after obtaining the text content corresponding to the generation requirement, the module label contained in the generation requirement can be obtained by parsing the text content through natural language understanding; and the module label is searched in the three-dimensional asset library to determine the module matching the module label, and the module information corresponding to the module is obtained.
[0114] Among them, the module tags included in the generation requirements include at least the module type tag. That is, the required module is retrieved in the three-dimensional asset library at least according to the module type. In the case where multiple tags are parsed from the generation requirements, for example, the type tag, the age tag, the function tag, and the length tag are parsed at the same time, the three-dimensional asset library can be searched according to these tags together to obtain module information matching all the tags.
[0115] In one example, a priority may be set for each module tag. If no matching module is found according to the module tag, that is, when the search result is empty, one or more module tags with the lowest priority may be removed and searched again to obtain module information matching the remaining tags.
[0116] For example, when the text content corresponding to the received generation requirement is "generate a 7-meter long corridor in the Tang and Song Dynasty style", by parsing the text content, the tags corresponding to the generation requirement can be obtained, including: type tag: corridor; era tag: Tang and Song Dynasty, function tag: residence, length tag: 7 meters. Search in the 3D asset library according to the type tag and era tag. If no corridor module that meets the requirement is matched, the length tag with the lowest priority is discarded, and the remaining tags are searched together to obtain the module information of the corridor module A that meets the requirement.
[0117] When there are multiple modules retrieved, you can determine the output module by any of the following methods:
[0118] Randomly output one of the modules that meet the search requirements;
[0119] The specified module is output by default;
[0120] Set priorities for modules and determine the output modules according to the priority levels;
[0121] Determine the output module based on the user's historical preferences.
[0122] For example, when the text content corresponding to the received generation requirement is "generate a corridor in an official residence", by parsing the text content, the tags corresponding to the generation requirement can be obtained, including: type tag: corridor; function tag: official residence. According to the type tag and function tag, the three-dimensional asset library is searched, and the corridor modules that meet the requirements include corridor module A and corridor module B, then the module information of corridor module A or corridor module B can be randomly output as the matching module information.
[0123] In the disclosed embodiment, the text content of the generation requirement is parsed to obtain one or more module tags contained therein, so as to match the corresponding module information in the three-dimensional asset library, thereby generating a corresponding three-dimensional module model. This method is convenient and fast, easy for users to operate, and has a good user experience.
[0124] In some embodiments, the style information included in the generation requirement may be obtained according to the module type indicated by the type tag; and among the modules matching the module tag, the module matching the style information may be obtained according to the style information.
[0125] For example, when the type tag indicates a building roof, the style information that defines the style of the building roof in the text content corresponding to the generation requirement can be obtained to obtain a building roof of a specified style from the three-dimensional asset library. Assuming that the text content corresponding to the generation requirement is "Generate a single-eaved hip roof", the type tag contained in the generation requirement is first extracted: building roof, and the matching module is determined from the three-dimensional asset library based on the tag; further, it can be determined that the style of the roof is a single-eaved hip roof, and then the roof module with the style of a single-eaved hip roof can be obtained from the modules matched by the tag as the final matching building roof.
[0126] By combining style information to further determine the matching modules, a module model that better meets user requirements can be output.
[0127] In some embodiments, the module information includes component information and splicing rules constituting the module. The component information can be used to indicate information about the three-dimensional component models contained in the module, such as the names or numbers of these three-dimensional component models in the three-dimensional asset library; the splicing rules are used to indicate the connection relationship and position relationship between these three-dimensional component models, that is, to explain how these three-dimensional component models are constructed to generate the module model.
[0128] After obtaining the module information matched in the 3D asset library according to the generation requirements input by the user, the 3D component model constituting the module can be obtained from the 3D asset library according to the component information, and these 3D component models can be spliced according to the splicing rules in the module information to obtain the module model.
[0129] In some embodiments, the module information also includes the number of layers of the module. When the module model includes multiple layers, different splicing rules can be set for each layer, so that module models with various structures can be built through the three-dimensional component models in the three-dimensional asset library to meet the needs of building complex ancient building models.
[0130] Since some 3D module models contain repeated units, for example, a corridor module usually includes several repeated corridor units, the repetition parameter can be set in the module information. After the module unit is constructed according to the splicing rule, the module unit can be copied according to the repetition parameter, and the copied results can be spliced to obtain the final module model.
[0131] The value of the repetition parameter can be a default number in the module information or a number set by the user as needed. When the generation requirement includes the size information of the three-dimensional module model, the value of the repetition parameter can be determined based on the relationship between the size information and the size information of the module unit.
[0132] In this way, modular models including multiple repeating units can be quickly spliced and built.
[0133] The following still takes the text content of the production requirement "generate a 7-meter official residence corridor in the Tang and Song Dynasty styles" as an example to illustrate the generation method of the module model proposed in the embodiment of the present disclosure.
[0134] First, natural language understanding is performed on the text content to obtain the labels contained in the generated requirements: type label: corridor; era label: Tang and Song dynasties; function label: official residence, length label: 7 meters.
[0135] As described above, since no module that meets the requirements is obtained by searching in combination with the type, age, function, and length tags, the length tag with the lowest priority is discarded, and the module information of the corridor module that meets the requirements is obtained by searching in the three-dimensional asset library according to the type tag, age tag, and function tag. The module information includes the component information of the three-dimensional component models that constitute the corridor module and the splicing rules between these three-dimensional component models. In this example, the module information indicates that the three-dimensional component models that constitute the corridor module include columns, guardrails, ceilings, and floors.
[0136] Next, the 3D component models constituting the corridor module are obtained from the 3D asset library according to the component information indicated by the module information. Figure 2 shown.
[0137] After the three-dimensional component models are obtained, these three-dimensional component models are spliced according to the splicing rules in the module information to obtain the corridor unit.
[0138] After that, the repetition parameter indicated by the module information is obtained. In this example, since the size of the corridor module obtained by the generation requirement is 7 meters, and the size label of the matched corridor module indicates a size of 1 meter, that is, the size of the obtained corridor unit is 1 meter, then the repetition parameter can be determined to be 6. By copying 6 identical corridor units and splicing them, the final corridor module is obtained, such as Figure 2 shown.
[0139] In some embodiments, the 3D component models in the 3D asset library can be divided into models with variable sizes and models with fixed sizes, wherein the size of the models with variable sizes can be changed according to user settings, while the size of the models with fixed sizes is fixed and default.
[0140] After the three-dimensional component models in the three-dimensional asset library are spliced according to the module information to obtain the module model, when the first size indicated by the size tag in the generation requirement is different from the second size indicated by the size tag of the matched module, size transformation information is determined according to the first size and the second size, and the size-variable model in the module is transformed according to the size transformation information to obtain a transformed module model having a size that meets the size indicated by the generation requirement.
[0141] See also Figure 3The schematic diagram of the building roof module shown in the figure includes the following components: top_center, top_side, center, center_side, center_corner, and corner. Among them, the top_side, center_side, and center_side are models with variable sizes, while the top_side, center_corner, and corner are models with fixed sizes.
[0142] When the module size shown in the generation requirements is different from the original size of the module, after determining the size transformation information, the size of the upper side, middle part, and mid-side part of the module, which are size-changeable models, is changed, while the size of the upper side, middle transfer part, and corner part, which are fixed-size models, remains unchanged, thereby obtaining a module model that meets the size indicated by the generation requirements.
[0143] In the embodiment of the present disclosure, the resizable model may include a plurality of unit blocks, and the size change is achieved by copying and deleting the unit blocks.
[0144] Specifically, according to the size transformation information, the unit block is copied to increase the size; or, according to the size transformation information, the unit block is deleted to reduce the size.
[0145] Still Figure 3 Take the building roof module shown as an example, in which the upper middle part, the upper side part, and the middle part all include multiple unit blocks. When the module size indicated in the generation requirements is larger than the original size, the size of these components can be increased by copying the unit blocks in the upper middle part, the upper side part, and the middle part; conversely, when the module size indicated in the generation requirements is smaller than the original size, the size of these components can be reduced by deleting the unit blocks in the upper middle part, the upper side part, and the middle part. In the above manner, the size transformation of the building roof module can be achieved to obtain a module model of the size indicated by the generation requirements.
[0146] In some embodiments, the 3D component models in the 3D asset library have component labels. That is, two levels of labels can be set for the 3D asset library. The first level of labels is the module label, which is set for each module that can be composed of each 3D component model; the second level of labels is the 3D component model label, which is set for each 3D component model stored in the 3D asset library. The label can be used to indicate the storage path, precision, number of faces, material, etc. of the component.
[0147] When the parsing result of the generation requirement includes a material tag, the material of the target component in the module model can be set or transformed according to the target material indicated by the material tag, wherein the target component is a component in the three-dimensional asset library having a material tag indicating the target material.
[0148] Taking the text content of the generation requirement "Generate a 7-meter corridor with a log structure and Tang and Song Dynasty style" as an example, the generation requirement includes a material tag, which indicates that the material of the corridor is wood. If the components that make up the corridor - pillars, guardrails, ceilings, and floors - all have models with material tags indicating wood in the 3D asset library, then all components of the corridor module can be set to wood, thus realizing the setting or transformation of the overall material of the corridor module.
[0149] If a part of the module does not have a model with the material tag, the material setting or transformation will not be performed on this part. For example, if the ceiling does not have a wood tag in the model in the 3D asset library, and other parts have a wood tag, the parts other than the ceiling will be set to wood. For the ceiling, the default material setting for the part in the 3D asset library will be retained.
[0150] Through the above method, the module model of the required material can be generated by adding the material requirements in the generation requirements.
[0151] See also Figure 4 , Figure 4 1 is a block diagram of a device for generating a three-dimensional ancient building provided by an exemplary embodiment, the device comprising:
[0152] A generating unit 401 is used to obtain a generating requirement of at least one ancient building module;
[0153] A matching unit 402 is used to obtain matching module information from a preset three-dimensional asset library according to the generation requirement, wherein the module information is construction information of a module obtained by splicing multiple three-dimensional component models, and the three-dimensional asset library contains multiple three-dimensional component models;
[0154] A splicing unit 403 is used to splice the three-dimensional component models in the three-dimensional asset library according to the module information to obtain a module model;
[0155] The obtaining unit 404 is used to obtain a three-dimensional ancient building model according to the module model generated according to the generation requirements of at least one ancient building group.
[0156] In some embodiments, the three-dimensional asset library includes module tags;
[0157] The matching unit is specifically used for:
[0158] Performing natural language understanding on text content corresponding to the generation requirement to obtain a module label contained in the generation requirement, wherein the module label at least includes a module type label;
[0159] The three-dimensional asset library is searched according to the module tag to determine a module matching the module tag, and module information corresponding to the module is obtained.
[0160] In some embodiments, the module label further includes at least one of a year label, a function label, a style label, and a size label.
[0161] In some embodiments, the module tag is set with a priority;
[0162] The matching unit is specifically used for:
[0163] If no matching module is found according to the module tags, one or more module tags with the lowest priority are removed and the search is performed again.
[0164] In some embodiments, the apparatus further comprises a pattern matching unit, configured to:
[0165] According to the module type indicated by the type tag, acquiring the style information included in the generation requirement;
[0166] Among the modules matching the module tag, a module matching the style information is acquired according to the style information.
[0167] In some embodiments, the three-dimensional component model includes a size-variable model; the apparatus further includes a size-changing unit for:
[0168] When a first size indicated by a size tag in the generation requirement is different from a second size indicated by a size tag of the matched module, determining size transformation information according to the first size and the second size;
[0169] According to the size transformation information, the size-changeable model in the module is transformed to obtain a transformed module model.
[0170] In some embodiments, the size-variable model includes a plurality of unit blocks; the size setting unit is specifically used to:
[0171] According to the size transformation information, the unit block is copied to increase the size; or,
[0172] The unit block is deleted according to the size transformation information to achieve size reduction.
[0173] In some embodiments, the module information includes component information and splicing rules constituting the module.
[0174] The splicing unit is specifically used for:
[0175] Obtaining a three-dimensional component model corresponding to the module from the three-dimensional asset library according to the component information;
[0176] The three-dimensional component models are spliced according to the splicing rules to obtain the module model.
[0177] In some embodiments, the module information further includes a repetition parameter, and the device further includes a repetition unit for:
[0178] The module model is copied according to the value indicated by the repetition parameter, and the copied results are spliced;
[0179] The module model is updated according to the splicing result.
[0180] In some embodiments, the three-dimensional component model in the three-dimensional asset library has a component tag, and the component tag includes a material tag. When the generation requirement includes material information, the device further includes a material setting unit for:
[0181] According to the target material indicated by the material information, the material of the target component in the module model is set or transformed, wherein the target component is a component having a material tag indicating the target material in the three-dimensional asset library.
[0182] Figure 5 is a schematic structural diagram of an electronic device provided by an exemplary embodiment. Figure 5 At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510, and may also include hardware required for other services. One or more embodiments of this specification may be implemented based on software, such as the processor 502 reading the corresponding computer program from the non-volatile memory 510 into the memory 508 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0183] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0184] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0185] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0186] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0187] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0188] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0189] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0190] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0191] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.
Claims
1. A method for generating a three-dimensional ancient building model, include: Get the generation requirements of at least one ancient building module; According to the generation requirement, matching module information is obtained in a preset three-dimensional asset library, wherein the module information is construction information of a module obtained by splicing a plurality of three-dimensional component models, and the three-dimensional asset library includes a plurality of three-dimensional component models; the three-dimensional asset library includes a module tag; splicing the three-dimensional component models in the three-dimensional asset library according to the module information to obtain a module model; Obtaining a three-dimensional ancient building model according to the module model generated according to the generation requirements of the at least one ancient building group; in, The step of obtaining matching module information from a preset three-dimensional asset library according to the generation requirement includes: Performing natural language understanding on text content corresponding to the generation requirement to obtain a module label contained in the generation requirement, wherein the module label at least includes a module type label; The three-dimensional asset library is searched according to the module tag to determine a module matching the module tag, and module information corresponding to the module is obtained.
2. According to the method of claim 1, the module label further includes at least one of a year label, a function label, a style label, and a size label.
3. According to the method of claim 2, the module tag is set with a priority; searching the three-dimensional asset library according to the module tag to determine a module matching the module tag, include: If no matching module is found according to the module tags, one or more module tags with the lowest priority are removed and the search is performed again.
4. The method according to any one of claims 1 to 3, further comprising: include: According to the module type indicated by the type tag, acquiring the style information included in the generation requirement; Among the modules matching the module tag, a module matching the style information is acquired according to the style information.
5. The method according to any one of claims 1 to 3, wherein the three-dimensional component model comprises a size-variable model; include: When a first size indicated by a size tag in the generation requirement is different from a second size indicated by a size tag of the matched module, determining size transformation information according to the first size and the second size; According to the size transformation information, the size-changeable model in the module is transformed to obtain a transformed module model.
6. The method according to claim 5, wherein the size-changeable model comprises a plurality of unit blocks; and the size-changeable model in the module is changed in size according to the size-change information. include: According to the size transformation information, the unit block is copied to increase the size; or, The unit block is deleted according to the size transformation information to achieve size reduction.
7. The method according to claim 1, wherein the module information includes component information and splicing rules constituting the module; The three-dimensional component models in the three-dimensional asset library are spliced according to the module information to obtain a module model, include: Obtaining a three-dimensional component model corresponding to the module from the three-dimensional asset library according to the component information; The three-dimensional component models are spliced according to the splicing rules to obtain the module model.
8. The method according to claim 7, wherein the module information further comprises a repeat parameter, and the method further comprises include: The module model is copied according to the value indicated by the repetition parameter, and the copied results are spliced; The module model is updated according to the splicing result.
9. The method according to claim 1, wherein the 3D component model in the 3D asset library has a component tag, and the component tag includes a material tag. In the case where the generation requirement includes material information, the method further include: According to the target material indicated by the material information, the material of the target component in the module model is set or transformed, wherein the target component is a component having a material tag indicating the target material in the three-dimensional asset library.
10. A device for generating a three-dimensional ancient building model, include: A generation unit, used for obtaining a generation requirement of at least one ancient building module; A matching unit, configured to obtain matching module information from a preset three-dimensional asset library according to the generation requirement, wherein the module information is construction information of a module obtained by splicing a plurality of three-dimensional component models, and the three-dimensional asset library includes a plurality of three-dimensional component models; the three-dimensional asset library includes a module tag; A splicing unit, used for splicing the three-dimensional component models in the three-dimensional asset library according to the module information to obtain a module model; An obtaining unit, used for obtaining a three-dimensional ancient building model according to a module model generated according to a generation requirement of at least one ancient building group; in, The matching unit is specifically used for: Performing natural language understanding on text content corresponding to the generation requirement to obtain a module label contained in the generation requirement, wherein the module label at least includes a module type label; The three-dimensional asset library is searched according to the module tag to determine a module matching the module tag, and module information corresponding to the module is obtained.
11. An electronic device, include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 9 by running the executable instructions.
12. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 9.
