Three-dimensional model display method, device, electronic equipment and storage medium
By splicing multiple three-dimensional model files into one target model file and preprocessing, the problems of low display efficiency and high maintenance cost in the prior art are solved, and efficient three-dimensional model display and maintenance are achieved.
Patent Information
- Application Number
- CN202010307570.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-17
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2040-04-17
AI Technical Summary
The prior art requires parsing and rendering multiple model files one by one when displaying three-dimensional models. The process is cumbersome and time-consuming, and the three-dimensional model update and maintenance cost is high.
By receiving all model files of the target three-dimensional model for stitching, a target model file is generated, and the model file is pre-processed, including node deletion, texture picture compression and path modification, a target model file corresponding to the target three-dimensional model is generated, only The target model file needs to be parsed to display the three-dimensional model.
Improves the efficiency of three-dimensional model display, simplifies the update and maintenance process, and reduces maintenance costs.
Smart Images

Figure CN112950792B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer display technology, and in particular to a method, device, electronic device and storage medium for displaying a three-dimensional model. Background Art
[0002] With the rapid development of three-dimensional technology, three-dimensional modeling has also been widely used in all walks of life. In the field of real estate services, in order to meet the customer's intuitive viewing needs, a three-dimensional model of the house type is usually built in advance, and then the three-dimensional model is displayed to the customer through an APP, so as to meet the customer's intuitive viewing needs. Because multiple model files are generated when a three-dimensional model is built using a three-dimensional model making software, a three-dimensional model is constructed by combining multiple model files. When using these three-dimensional models in the prior art, they are usually displayed through software programs. At this time, all model files need to be parsed one by one, and then associated and rendered. The process is cumbersome, time-consuming, and inefficient. In addition, when updating and maintaining the three-dimensional model, all model files of the three-dimensional model need to be maintained, and the maintenance cost is high. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a method, device, electronic device and storage medium for displaying a three-dimensional model, which can improve the efficiency of three-dimensional model display and facilitate the subsequent updating and maintenance of the three-dimensional model.
[0004] A first aspect of an embodiment of the present application provides a method for displaying a three-dimensional model, the method comprising:
[0005] Receive all model files of the target 3D model;
[0006] Splicing all model files of the target three-dimensional model to generate a target model file corresponding to the target three-dimensional model;
[0007] The target model file is output to a display device, so that the display device displays the target three-dimensional model according to the target model file.
[0008] In combination with the first aspect, in a first possible implementation manner of the first aspect, before the step of splicing all model files of the target three-dimensional model to generate a target model file corresponding to the target three-dimensional model, the method further includes:
[0009] All model files of the target three-dimensional model are preprocessed, wherein the preprocessing includes one or more of node deletion processing, texture image compression processing, and texture image path modification processing.
[0010] In combination with the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, when preprocessing all model files of the target three-dimensional model, the step of node deletion processing further includes:
[0011] Traversing the model file according to the node name, identifying the location information of the redundant nodes in the model file, wherein the redundant nodes include camera nodes and lighting nodes;
[0012] The redundant nodes in the model file are deleted according to the position information of the redundant nodes.
[0013] In combination with the first possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, when preprocessing all model files of the target three-dimensional model, the step of compressing the texture image further includes:
[0014] Get the texture image corresponding to each model file from the preset storage space;
[0015] By uniformly compressing the texture images corresponding to each model file, the file format of the texture images is compressed from the tga format to the pvrtc format.
[0016] In combination with the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, after the step of uniformly compressing the texture images corresponding to each model file and compressing the texture images from the TGA format to the PVRTC format, the method further includes:
[0017] Traversing each model file of the target three-dimensional model respectively, identifying a texture path corresponding to the model file, wherein the texture path is used to obtain a texture image;
[0018] By performing path modification processing on each of the texture paths, the texture image format suffix contained in the texture path is modified from the tga format to the pvrtc format.
[0019] A second aspect of an embodiment of the present application provides a three-dimensional model display device, the three-dimensional model display device comprising:
[0020] A receiving module, used for receiving all model files of a target three-dimensional model;
[0021] A splicing module, used for sending all model files of the target three-dimensional model to a preset integrated development tool for splicing processing, and generating a target model file corresponding to the target three-dimensional model;
[0022] The display module is used to output the target model file to a display device so that the display device displays the target three-dimensional model according to the target model file.
[0023] In conjunction with the second aspect, in a first possible implementation manner of the second aspect, the three-dimensional model display device further includes:
[0024] A preprocessing module is used to preprocess all model files of the target three-dimensional model, wherein the preprocessing includes one or more of node deletion processing, texture image compression processing and texture image path modification processing.
[0025] In combination with the second aspect, in a second possible implementation manner of the second aspect, when preprocessing all model files of the target three-dimensional model, the three-dimensional model display device further includes:
[0026] An identification module, used for traversing the model file according to the node name, and identifying the location information of the redundant nodes in the model file, wherein the redundant nodes include camera nodes and lighting nodes;
[0027] The deletion module is used to delete the redundant nodes in the model file according to the position information of the redundant nodes.
[0028] A third aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the three-dimensional model display method as described in any one of the first aspects are implemented.
[0029] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the three-dimensional model display method as described in any one of the first aspects are implemented.
[0030] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0031] The present application receives all model files of a target three-dimensional model and splices all model files of the target three-dimensional model to generate a target model file corresponding to the target three-dimensional model. Furthermore, the target model file is output to a display device, and the display device displays the target three-dimensional model according to the target model file. The above method splices all model files of the target three-dimensional model into a target model file corresponding to the target three-dimensional model. The display device can display the target three-dimensional model by parsing a target model file, which is highly efficient. Moreover, when updating and maintaining the target three-dimensional model at a later stage, only one target model file needs to be updated and maintained, which is convenient for updating and maintaining the three-dimensional model. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0033] Figure 1 A schematic diagram of a basic method flow of a three-dimensional model display method provided in an embodiment of the present application;
[0034] Figure 2 A flow chart of a method for deleting redundant nodes from a model file in a method for displaying a three-dimensional model provided in an embodiment of the present application;
[0035] Figure 3 A flow chart of a method for compressing texture images of model files in a method for displaying a three-dimensional model provided in an embodiment of the present application;
[0036] Figure 4 A flow chart of a method for modifying the texture image path of a model file in a method for displaying a three-dimensional model provided in an embodiment of the present application;
[0037] Figure 5 A schematic diagram of the structure of a three-dimensional model display device provided in an embodiment of the present application;
[0038] Figure 6 Another structural schematic diagram of a three-dimensional model display device provided in an embodiment of the present application;
[0039] Figure 7 A schematic diagram of an electronic device for implementing a method for displaying a three-dimensional model provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0041] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0042] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0043] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0044] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0045] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0046] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.
[0047] The embodiment of the present application aims to form one model file by splicing multiple model files of a three-dimensional model, so that the user only needs to operate on one model file when using the three-dimensional model. The operation is efficient and it is convenient for the user to update and maintain the three-dimensional model.
[0048] In some embodiments of this application, please refer to Figure 1 , Figure 1 A basic method flow chart of a three-dimensional model display method provided in an embodiment of the present application is as follows:
[0049] In step S101, all model files of a target three-dimensional model are received.
[0050] In this embodiment, the production process of the target three-dimensional model is completed by three-dimensional model production software, such as 3D max (3D Studio Max), a three-dimensional animation rendering and production software based on a PC system. During this production process, the three-dimensional model production software will generate multiple model files for the target three-dimensional model, such as dae model files. Among them, the number of model files is determined by the producer according to the complexity of the three-dimensional model structure. All model files of the target three-dimensional model can be exported from the three-dimensional model production software. In this embodiment, by establishing a communication and data transmission channel with a device installed with the three-dimensional model production software, all model files of the target three-dimensional model exported from the three-dimensional model production software can be received.
[0051] In step S102, all model files of the target three-dimensional model are spliced to generate a target model file corresponding to the target three-dimensional model.
[0052] In this embodiment, in order to enable the three-dimensional model to be displayed on the display device, an integrated development environment is pre-set, such as Xcode, which is an integrated development tool with a unified user interface design, and its coding, testing, and debugging can all be completed in a simple window. In this embodiment, after receiving all model files of the target three-dimensional model exported from the three-dimensional model making software, based on the preset integrated development environment, all model files are written one by one into a newly created model file to achieve splicing, thereby splicing and synthesizing a newly created target model file corresponding to the target three-dimensional model, and the target model file contains all the features of the target three-dimensional model.
[0053] In step S103, the target model file is output to the display device, so that the display device displays the target three-dimensional model according to the target model file.
[0054] In this embodiment, after the target model file is spliced by Xcode, the format of the target model file is converted into SCN format and output to the display device in SCN format. After the display device obtains the target model file in SCN format, it only needs to parse the target model file in SCN format to obtain a complete target 3D model, and display the target 3D model on the display device.
[0055] The three-dimensional model display method provided in the above embodiment splices all model files of the target three-dimensional model into a target model file corresponding to the target three-dimensional model. The display device can display the target three-dimensional model by parsing one target model file, which is efficient. Moreover, when the target three-dimensional model is updated and maintained later, only one target model file needs to be updated and maintained, which is convenient for updating and maintaining the three-dimensional model.
[0056] In some embodiments of the present application, before the splicing process is performed, all model files of the target three-dimensional model need to be preprocessed, wherein the preprocessing includes one or more of node deletion, texture image compression, and texture image path modification. In this embodiment, by performing node deletion on all model files, each model file ultimately retains only model nodes. In the model file, the model node records the geometric data that characterizes the model, including the model's vertices, normals, texture coordinate data, etc. By writing the model files that only retain the model nodes one by one into a newly created model file for splicing, a newly created target model file corresponding to the target three-dimensional model can be synthesized, so that the target model file contains all the features of the target three-dimensional model. In this embodiment, by compressing and modifying the texture image of each model file, the memory loaded by the target three-dimensional model in the display device can be reduced.
[0057] In some embodiments of this application, please refer to Figure 2 , Figure 2 A flow chart of a method for deleting redundant nodes from a model file in a method for displaying a three-dimensional model provided in an embodiment of the present application. Details are as follows:
[0058] In step S201, the model file is traversed according to the node name to identify the location information of the redundant nodes in the model file, wherein the redundant nodes include camera nodes and lighting nodes;
[0059] In step S202, redundant nodes in the model file are deleted according to the position information of the redundant nodes.
[0060] In this embodiment, for all model files of the target three-dimensional model exported from the three-dimensional model making software, each model file has a corresponding model node, a camera node and an illumination node, wherein the model node records the geometric data such as the vertices, normals, and texture coordinates of the model contained in the model file, the camera node records the camera position and angle data of the model file observing the model; the illumination node records the illumination data of the model file giving the model light and shadow information. In this embodiment, the model file for splicing processing only needs to retain the model node, so the camera node and the illumination node in each model file are redundant nodes. Therefore, in this embodiment, before splicing all model files of the target three-dimensional model, all nodes in the model file can be traversed according to the node name for each model file, and the position information of the redundant nodes such as the camera node and the illumination node in the model file can be identified, and then the redundant nodes such as the camera node and the illumination node are deleted from the model file according to the position information, so that the model file only retains the model node. Thus, it is possible to avoid the presence of multiple camera positions and angle data for observing the target 3D model and multiple illumination data for expressing the light and shadow information of the target 3D model in the spliced target model file, thereby preventing the display effect of the target 3D model from being affected. For the target 3D model, a unique camera node and illumination node can be configured for the target model file after the target model files are spliced and synthesized, that is, the target model file is given unique camera position and angle data for observing the target 3D model and unique illumination data for expressing the light and shadow information of the target 3D model, so as to achieve unified camera and illumination processing for the target 3D model.
[0061] In some embodiments of this application, please refer to Figure 3 , Figure 3 A flow chart of a method for compressing texture images of model files in a method for displaying a three-dimensional model provided in an embodiment of the present application. Details are as follows:
[0062] In step S301, a texture image corresponding to each model file is obtained from a preset storage space;
[0063] In step S302, the texture images corresponding to each model file are compressed uniformly to compress the file format of the texture images from the tga format to the pvrtc format.
[0064] In this embodiment, for the three-dimensional model exported from the three-dimensional model making software, the model file and texture image of the three-dimensional model are stored separately and independently, and all texture images are stored in a separate preset storage space. Moreover, the texture image is saved in TGA format, with an alpha channel, and supports compression. In this embodiment, based on each model file received, the texture image corresponding to each model file can be obtained from the storage space according to the texture path corresponding to the model file and the texture image. Then, the texture image corresponding to each model file is uniformly compressed through a script to achieve compression of the file format of the texture image from TGA format to PVRTC format. Therefore, by compressing the texture image, it is possible to reduce the memory required for loading the target three-dimensional model in the display device end when the display device end displays the target three-dimensional model.
[0065] In some embodiments of this application, please refer to Figure 4 , Figure 4 A flow chart of a method for modifying the texture image path of a model file in a method for displaying a three-dimensional model provided in an embodiment of the present application. Details are as follows:
[0066] In step S401, each model file of the target three-dimensional model is traversed respectively to identify a texture path corresponding to the model file, wherein the texture path is used to obtain a texture image;
[0067] In step S402, by performing path modification processing on each texture path, the texture picture format suffix contained in the texture path is modified from the tga format to the pvrtc format.
[0068] In this embodiment, in the process of realizing model display, there is a corresponding texture path between the model file and the texture picture, and the texture picture corresponding to the model file can be obtained from the storage space according to the texture path. Since the texture path contains the format suffix information of the texture picture, after the file format of the texture picture is compressed from the TGA format to the PVRTC format, it is also necessary to modify the path of the texture path corresponding to the model file and the texture picture, so that the subsequent target three-dimensional model can smoothly obtain the corresponding texture picture when it is displayed. Specifically, in this embodiment, each model file of the target three-dimensional model is traversed respectively, and for each model file, the texture path corresponding to the model file is identified. Wherein, the texture path is used to obtain the texture picture, and the texture path contains the format suffix information of the texture picture. In this embodiment, the texture picture name can be positioned to determine the position of the format suffix information of the texture picture in the texture path, so that the information data representing the format suffix of the texture picture in the texture path is correspondingly modified from the TGA format to the PVRTC format according to the position determined by the positioning, thereby realizing the modification of the texture path used for obtaining the texture picture of each model file.
[0069] It is understandable that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0070] In some embodiments of this application, please refer to Figure 5 , Figure 5 A schematic diagram of the structure of a three-dimensional model display device provided in an embodiment of the present application is described in detail as follows:
[0071] In this embodiment, the display device of the three-dimensional model includes: a receiving module 501, a splicing module 502, and a display module 503. The receiving module 501 is used to receive all model files of the target three-dimensional model. The splicing module 502 is used to splice all model files of the target three-dimensional model to generate a target model file corresponding to the target three-dimensional model. The display module 503 is used to output the target model file to the display device end, so that the display device end displays the target three-dimensional model according to the target model file.
[0072] In some embodiments of the present application, the display device of the three-dimensional model further includes a preprocessing module. The preprocessing module is used to preprocess all model files of the target three-dimensional model, wherein the preprocessing includes one or more of node deletion processing, texture image compression processing, and texture image path modification processing.
[0073] In some embodiments of this application, please refer to Figure 6 , Figure 6 Another structural schematic diagram of the three-dimensional model display device provided in the embodiment of the present application. Figure 6 As shown, when all model files of the target three-dimensional model are preprocessed, the display device of the three-dimensional model further includes: an identification module 601 and a deletion module 602. The identification module 601 is used to traverse the model file according to the node name, and identify the location information of the redundant nodes in the model file, wherein the redundant nodes include camera nodes and lighting nodes. The deletion module 602 is used to delete the redundant nodes in the model file according to the location information of the redundant nodes.
[0074] The three-dimensional model display device corresponds one to one with the three-dimensional model display method described above, and will not be described in detail here.
[0075] In some embodiments of this application, please refer to Figure 7 , Figure 7 A schematic diagram of an electronic device for implementing a three-dimensional model display method provided in an embodiment of the present application. Figure 7 As shown, the electronic device 7 of this embodiment includes: a processor 71, a memory 72, and a computer program 73 stored in the memory 72 and executable on the processor 71, such as a three-dimensional model display program. When the processor 71 executes the computer program 72, the steps in the above-mentioned three-dimensional model display method embodiments are implemented. Alternatively, when the processor 71 executes the computer program 73, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0076] Exemplarily, the computer program 73 may be divided into one or more modules / units, which are stored in the memory 72 and executed by the processor 71 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 73 in the electronic device 7. For example, the computer program 73 may be divided into:
[0077] A receiving module, used for receiving all model files of a target three-dimensional model;
[0078] A splicing module, used for sending all model files of the target three-dimensional model to a preset integrated development tool for splicing processing, and generating a target model file corresponding to the target three-dimensional model;
[0079] The display module is used to output the target model file to a display device so that the display device displays the target three-dimensional model according to the target model file.
[0080] The electronic device may include, but is not limited to, a processor 71 and a memory 72. Those skilled in the art will appreciate that Figure 7 It is only an example of the electronic device 7 and does not constitute a limitation of the electronic device 7. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0081] The processor 71 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0082] The memory 72 may be an internal storage unit of the electronic device 7, such as a hard disk or memory of the electronic device 7. The memory 72 may also be an external storage device of the electronic device 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 7. Further, the memory 72 may also include both an internal storage unit and an external storage device of the electronic device 7. The memory 72 is used to store the computer program and other programs and data required by the electronic device. The memory 72 may also be used to temporarily store data that has been output or is to be output.
[0083] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0084] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0085] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0086] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0087] If the integrated module / 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 present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0088] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0089] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0090] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as 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 devices or units, which can be electrical, mechanical or other forms.
[0091] 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.
[0092] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for displaying a three-dimensional model, characterized in that: include: Receive all model files of the target 3D model; Based on a preset integrated development environment, all model files are written one by one into a newly created model file to achieve splicing, thereby synthesizing a newly created target model file corresponding to the target three-dimensional model, wherein the target model file contains all features of the target three-dimensional model; Outputting the target model file to a display device, so that the display device displays the target three-dimensional model according to the target model file; Wherein, before the step of splicing all model files of the target three-dimensional model to generate a target model file corresponding to the target three-dimensional model, the step further includes: Preprocessing all model files of the target three-dimensional model, wherein the preprocessing includes one or more of node deletion processing, texture image compression processing, and texture image path modification processing; When preprocessing all model files of the target three-dimensional model, the node deletion step further includes: traversing the model files according to the node names to identify the location information of the redundant nodes in the model files, wherein the redundant nodes include camera nodes and lighting nodes; Deleting the redundant nodes in the model file according to the position information of the redundant nodes; The step of compressing the texture image further includes: Get the texture image corresponding to each model file from the preset storage space; By uniformly compressing the texture images corresponding to each model file, the file format of the texture images is compressed from the tga format to the pvrtc format.
2. The method for displaying a three-dimensional model according to claim 1, characterized in that: After the step of uniformly compressing the texture images corresponding to each model file and compressing the file format of the texture images from the TGA format to the PVRTC format, the method further includes: Traversing each model file of the target three-dimensional model respectively, identifying a texture path corresponding to the model file, wherein the texture path is used to obtain a texture image; By performing path modification processing on each of the texture paths, the texture image format suffix contained in the texture path is modified from the tga format to the pvrtc format.
3. A three-dimensional model display device, characterized in that: The display device of the three-dimensional model comprises: A receiving module, used for receiving all model files of a target three-dimensional model; A splicing module, used for writing all model files one by one into a newly created model file to realize splicing based on a preset integrated development environment, and synthesizing a newly created target model file corresponding to the target three-dimensional model, wherein the target model file contains all features of the target three-dimensional model; A display module, used for outputting the target model file to a display device end, so that the display device end displays the target three-dimensional model according to the target model file; The display device of the three-dimensional model also includes: A preprocessing module, used for preprocessing all model files of the target three-dimensional model, wherein the preprocessing includes one or more of node deletion processing, texture image compression processing and texture image path modification processing; When preprocessing all model files of the target three-dimensional model, the display device of the three-dimensional model further includes: An identification module, used for traversing the model file according to the node name, and identifying the location information of the redundant nodes in the model file, wherein the redundant nodes include camera nodes and lighting nodes; A deletion module, used for deleting redundant nodes in the model file according to the position information of the redundant nodes; The texture image compression process includes: obtaining the texture image corresponding to each model file from a preset storage space; and compressing the file format of the texture image from the TGA format to the PVRTC format by uniformly compressing the texture images corresponding to each model file.
4. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the three-dimensional model display method according to any one of claims 1 to 2 are implemented.
5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the three-dimensional model display method according to any one of claims 1 to 2 are implemented.
