Disclosure of Invention
The main purpose of the present disclosure is to provide a visualization method and apparatus for a three-dimensional model, and a storage medium, which can realize visualization of the three-dimensional model and better meet market demands.
To achieve the above object, a first aspect of the present disclosure provides a method for visualizing a three-dimensional model, including:
acquiring original three-dimensional data;
converting the original three-dimensional data into preliminary data; wherein the preliminary data is a JSON file;
importing the preliminary data into an editor;
editing the preliminary data in the editor to obtain target data;
and calling a visual model engine to perform visual display according to the target data.
Optionally, the invoking a visualization model engine to perform visual display on the target data includes:
constructing a three-dimensional target model according to the target data;
analyzing the three-dimensional target model;
and calling a visual model engine to visually display the analyzed three-dimensional target model.
Optionally, the editing, in the editor, the preliminary data to obtain target data includes:
acquiring a user operation request; the user operation request at least comprises operation parameters, modification operation and deletion operation;
and selecting preliminary data to be edited according to the user operation request and editing the selected preliminary data to obtain the target data.
Optionally, the user operation request further includes asset association operation, and the selecting preliminary data to be edited and editing the selected preliminary data according to the user operation request to obtain the target data includes:
opening an asset association list according to the operating parameters;
selecting a target asset from the asset association list according to the asset association operation;
and associating the target assets.
Optionally, the method further comprises: performing preliminary processing on the target data, specifically including:
precipitating and cleaning the target data;
and structuring the cleaned target data.
Optionally, the performing preliminary processing on the target data further includes:
and extracting and analyzing the target data after the structured processing.
Optionally, the method further includes performing secondary processing on the target data, specifically including:
and carrying out data fusion and twin processing on the analyzed target data.
To achieve the above object, a second aspect of the present disclosure provides an apparatus for visualizing a three-dimensional model, including:
the data acquisition module is used for acquiring original three-dimensional data;
the data conversion module is used for converting the original three-dimensional data into preliminary data; wherein the preliminary data is a JSON file;
the data import module is used for importing the preliminary data into an editor;
the data editing module is used for editing the preliminary data in the editor to obtain target data;
and the visualization module is used for calling a visualization model engine to perform visualization display according to the target data.
To achieve the above object, a third aspect of the present disclosure provides another three-dimensional model visualization apparatus, including:
at least one memory;
at least one processor;
at least one program;
the program is stored in a memory and a processor executes the at least one program to implement the method of the present disclosure as described in the above first aspect.
To achieve the above object, a fourth aspect of the present disclosure proposes a storage medium that is a computer-readable storage medium storing computer-executable instructions for causing a computer to perform:
a method as described in the first aspect above.
According to the visualization method and device for the three-dimensional model and the storage medium, original three-dimensional data are obtained and converted into preliminary data, the preliminary data are imported into an editor, the preliminary data are edited in the editor, target data are obtained, and therefore a visualization model engine can be called to perform visualization display according to the target data. Through the technical scheme provided by the embodiment of the disclosure, the visualization of the three-dimensional model can be realized, and the market demand is met.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the disclosure and are not intended to limit the disclosure.
It should be noted that although functional blocks are partitioned in a schematic diagram of an apparatus and a logical order is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the partitioning of blocks in the apparatus or the order in the flowchart. The terms first, second and the like in the description and in the claims, and the drawings described above, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used herein is for the purpose of describing embodiments of the disclosure only and is not intended to be limiting of the disclosure.
First, several nouns involved in the present disclosure are resolved:
WebGL (Web Graphics Library): the method is a 3D drawing protocol and a drawing technical standard, JavaScript and OpenGL ES 2.0 are allowed to be combined together, and by adding one JavaScript binding of OpenGL ES 2.0, WebGL can provide hardware 3D accelerated rendering for HTML5 Canvas, so that a Web developer can more smoothly display 3D scenes and models in a browser by means of a system display card, and complex navigation and data visualization can be created.
JavaScript (X Window System, also commonly referred to as X11 or X): JavaScript, abbreviated as "JS," is a lightweight, interpreted, or just-in-time programming language with function preference. JavaScript is a scripting language for developing Web pages, and is also used in many non-browser environments, and is based on prototype programming, multi-modal dynamic scripting language, and supports object-oriented, command-oriented, and declarative (e.g., functional programming) styles.
JSON file: json (javascript Object notification) is a lightweight data exchange format that is easy for human reading and writing, and easy for machine parsing and generation. JSON employs a text format that is completely language independent.
Data visualization is a data processing and presentation method, and data can be presented through related technologies such as vision. Data visualization techniques utilize graphics, image processing, computer vision, and user interfaces to interpret data visually through the presentation, modeling, and display of stereo, surface, attributes, and animations. The technical approach covered by data visualization is much broader compared to techniques like stereo modeling.
With the accumulation of visualization technologies and the improvement of visualization requirements of various industries, data visualization gradually changes from two-dimensional visualization to three-dimensional visualization, so that more complex space simulation data is presented. Generally, three-dimensional visualization is mainly used for customization according to customer requirements or limited resource reuse, and the development cost, resource reuse and response speed of the three-dimensional visualization cannot meet the current market requirements.
Based on this, the embodiment of the present disclosure provides a technical scheme of a visualization method for a three-dimensional model, which can realize visualization of the three-dimensional model and meet market demands.
The embodiment of the present disclosure provides a method and an apparatus for visualizing a three-dimensional model, and a storage medium, which are specifically described in the following embodiments, and first, a method for visualizing a three-dimensional model in the embodiment of the present disclosure is described.
The visualization method of the three-dimensional model provided by the embodiment of the disclosure can be applied to a terminal, a server side and a container mechanism. In some embodiments, the terminal may be a smartphone, tablet, laptop, desktop computer, smart watch, or the like; the server side can be configured into an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and cloud servers for providing basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN (content delivery network) and big data and artificial intelligence platforms; but is not limited to the above form.
Fig. 1 is an alternative flowchart of a visualization method of a three-dimensional model provided by an embodiment of the present disclosure, and the method in fig. 1 includessteps 101 to 105.
Step 101, acquiring original three-dimensional data;
102, converting original three-dimensional data into preliminary data; wherein the preliminary data is a JSON file;
step 103, importing the preliminary data into an editor;
104, editing the preliminary data in an editor to obtain target data;
and 105, calling a visualization model engine to perform visualization display on the target data.
Instep 101 of some embodiments, the raw three-dimensional data may include a plurality of different types of business data, such as a character distribution, an attraction distribution, a building distribution, and the like.
Instep 102 of some embodiments, the obtained raw three-dimensional data is converted into preliminary data in JSON file format based on JavaScript. The preliminary data is a related three-dimensional model file, which may be, for example, a three-dimensional building model file. Because data conversion can be performed, the original three-dimensional data compatible with various data protocols and structures can be obtained, and various different types of original three-dimensional data can be obtained.
Specifically, referring to fig. 2, in some embodiments,step 104 comprises:
step 201, obtaining a user operation request; the user operation request at least comprises operation parameters, modification operation and deletion operation;
step 202, selecting preliminary data to be edited according to the user operation request and editing the selected preliminary data to obtain target data.
In a specific application scenario, taking a three-dimensional building model as an example, the operation parameter may be a size parameter, such as a length/width/height parameter of a rectangular parallelepiped, and the operation parameter may also be a color parameter of a display.
Referring to fig. 3, further, the user operation request further includes an asset association operation, and step 202 includes:
step 301, opening an asset association list according to the operation parameters;
step 302, selecting a target asset from an asset association list according to an asset association operation;
step 303, associating the target assets.
Specifically, a corresponding style set may be previously constructed in the editor, so that the preliminary data may be edited according to the corresponding style. The editor is used for receiving the preliminary data input by the user and a user operation request of the user for operating parameters, so that the preliminary data can be edited in the editor to obtain the target data. In other embodiments, the user operation request further comprises at least a new creation operation, an import/export operation, and an asset association operation; in addition, the user operation request at least comprises a custom operation, namely, the user can also customize the operation through an editor, for example, the user can view the three-dimensional model, move the three-dimensional model and the like. In a specific application scenario, the operation interface of the editor may include a plurality of file menus, for example, a new menu, an import menu, an export menu, a download menu, and the like; for example, a menu, a scene and the like can be newly created through a new creation operation to empty the current data; model files needing debugging and modification can be imported or a certain tiny component (such as a computer and the like) can be imported through import/export operation so as to increase the functions of the tiny component, or a certain part of selected model components can be exported; and the user operation request at least comprises a downloading operation, and after the model is modified, the modified complete model file can be downloaded through the downloading operation. Regarding the selection of model components, a corresponding parent node should be selected, taking shredder as an example, in the three-dimensional model, the shredder includes three child nodes, each child node corresponds to a part of the shredder, and the three child nodes constitute a complete shredder, so when a model selects a component, the parent node of the shredder should be selected; in the present embodiment, the attribute type of the parent node is group.
In addition, the user operation request at least comprises an adding operation, namely, the operation interface of the editor also comprises a plurality of adding menus, for example, ambient light, parallel light, hemispherical light, point light source, spotlight and the like can be added through the adding operation, wherein the parallel light can solve the problem of blackness of the operation interface, for example, preliminary data just led into the editor can be displayed on the operation interface, a piece of blackish black can be displayed on the operation interface, and the problem can be solved by selecting the adding of the parallel light. In addition, through the asset association operation, namely, providing a page of the asset association operation on an operation interface of the editor, a user can open a corresponding asset association list through selecting a model component, select a corresponding asset from the asset association list, and confirm the selected asset, thereby realizing the association of the assets; further, the associated assets can also be disassociated, thereby enabling disassociation of the assets.
In some embodiments, the method of visualizing a three-dimensional model further comprises: performing preliminary processing on target data, specifically comprising:
precipitating and cleaning target data;
and structuring the cleaned target data.
Further, the preliminary processing is performed on the target data, and the method further comprises the following steps:
and extracting and analyzing the target data after the structured processing.
Specifically, through the preliminary treatment to the target data, carry out deposit, washing, structurization processing, extraction and analysis to the target data promptly for the target data is more intelligent, accord with three-dimensional visual effect more.
Optionally, the visualization method of the three-dimensional model further includes performing secondary processing on the target data, specifically including:
and carrying out data fusion and twin processing on the analyzed target data.
Specifically, the target data after the data fusion and the twin processing is taken as the target data instep 105. By carrying out data fusion and twin processing on the target data, the target data has the effects and functions in a real scene in a three-dimensional visual scene, so that the digital twin of the three-dimensional visual scene and the real scene can be realized, the space and the time are integrated, and the user experience is improved.
In some embodiments, referring to fig. 4,step 105 includes:
step 401, constructing a three-dimensional target model according to target data;
step 402, analyzing a three-dimensional target model;
and step 403, calling a visualization model engine to perform visualization display on the analyzed three-dimensional target model.
Specifically, the target data after the data fusion and the twin processing is taken as the target data instep 401. Instep 105 of some embodiments, a three-dimensional model is constructed according to target data, the three-dimensional model is analyzed to meet a format required by a visualization model engine, then the visualization model engine is called to visualize the analyzed three-dimensional model, and further, visualization display is performed based on WebGL; more specifically, an HTML + JS interactive program is written through a JavaScript language, and a three. In an application scene, the visual presentation can be performed in a browser.
According to the technical scheme provided by the embodiment of the disclosure, the addition or deletion of the fine components of the three-dimensional model can be performed, and a modeler does not need to be troubled to use special modeling software to reconstruct the model; the cool and dazzling interface is displayed through visual display, and user experience is improved; dynamic editing can be realized, and the edited display interface can be presented in real time; and the association of the assets can be realized, and the visual bound assets are realized.
The embodiment of the present disclosure further provides a device for visualizing a three-dimensional model, which can implement the method for visualizing the three-dimensional model, and the device includes:
the data acquisition module is used for acquiring original three-dimensional data;
the data conversion module is used for converting the original three-dimensional data into preliminary data; wherein the preliminary data is a JSON file;
the data import module is used for importing the preliminary data into the editor;
the data editing module is used for editing the preliminary data in the editor to obtain target data;
and the visualization module is used for calling a visualization model engine to perform visualization display according to the target data.
The embodiment of the present disclosure further provides a visualization apparatus for a three-dimensional model, including:
at least one memory;
at least one processor;
at least one program;
the program is stored in the memory, and the processor executes the at least one program to implement the visualization method of the three-dimensional model described above according to the embodiment of the present disclosure. The electronic device may be any intelligent terminal including a mobile phone, a tablet computer, a Personal Digital Assistant (PDA for short), a Point of Sales (POS for short), a vehicle-mounted computer, and the like.
In some embodiments, the visualization means of the three-dimensional model further comprises an editor. The editor stores a corresponding style set in advance so that the preliminary data can be edited according to the corresponding style. The editor is used for receiving the preliminary data input by the user and a user operation request of the user for operating parameters, so that the preliminary data can be edited in the editor to obtain the target data. The user may also customize the operation through an editor, e.g., may view the three-dimensional model, move the three-dimensional model, etc. In a specific application scenario, the operation interface of the editor may include a plurality of file menus, for example, a new menu, an import menu, an export menu, a download menu, and the like; for example, a menu, a scene and the like can be newly created through a new creation operation to empty the current data; model files needing debugging and modification can be imported or a certain tiny component (such as a computer and the like) can be imported through import/export operation so as to increase the functions of the tiny component, or a certain part of selected model components can be exported; and the user operation request at least comprises a downloading operation, and after the model is modified, the modified complete model file can be downloaded through the downloading operation. Regarding the selection of model components, a corresponding parent node should be selected, taking shredder as an example, in the three-dimensional model, the shredder includes three child nodes, each child node corresponds to a part of the shredder, and the three child nodes constitute a complete shredder, so when a model selects a component, the parent node of the shredder should be selected; in the present embodiment, the attribute type of the parent node is group.
In particular, the editor may provide an operating panel to facilitate editing operations by a user.
Referring to fig. 5, fig. 5 illustrates a hardware structure of a three-dimensional model visualization apparatus according to another embodiment, where the three-dimensional model visualization apparatus includes:
theprocessor 501 may be implemented by a general-purpose CPU (central processing unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits, and is configured to execute a relevant program to implement the technical solution provided by the embodiment of the present disclosure;
thememory 502 may be implemented in a ROM (read only memory), a static memory device, a dynamic memory device, or a RAM (random access memory). Thememory 502 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present disclosure is implemented by software or firmware, the relevant program codes are stored in thememory 502 and called by theprocessor 501 to execute the visualization method of the three-dimensional model of the embodiments of the present disclosure;
an input/output interface 503 for implementing information input and output;
thecommunication interface 504 is used for realizing communication interaction between the device and other devices, and can realize communication in a wired manner (for example, USB, network cable, etc.) or in a wireless manner (for example, mobile network, WIFI, bluetooth, etc.); and
a bus 505 that transfers information between various components of the device (e.g., theprocessor 501, thememory 502, the input/output interface 503, and the communication interface 504);
wherein theprocessor 501, thememory 502, the input/output interface 503 and thecommunication interface 504 are communicatively connected to each other within the device via a bus 505.
The embodiment of the disclosure also provides a visualization platform of the three-dimensional model, and the visualization platform of the three-dimensional model is used for realizing the visualization method of the three-dimensional model. The visualization platform of the three-dimensional model comprises the visualization device of the three-dimensional model. The visualization platform of the three-dimensional model may be deployed at a server.
The embodiment of the disclosure also provides a visualization system of the three-dimensional model, and the visualization platform of the three-dimensional model is used for realizing the visualization method of the three-dimensional model. The visualization platform of the three-dimensional model comprises the visualization system of the three-dimensional model and a server, wherein the visualization platform of the three-dimensional model can be deployed on the server.
The embodiment of the present disclosure also provides a storage medium, which is a computer-readable storage medium, and the computer-readable storage medium stores computer-executable instructions for causing a computer to execute the visualization method of the three-dimensional model.
According to the visualization method of the three-dimensional model, the visualization device of the three-dimensional model and the storage medium, the original three-dimensional data are obtained and converted into the preliminary data, then the preliminary data are imported into the editor, and the preliminary data are edited in the editor to obtain the target data, so that the visualization model engine can be called to perform visualization display according to the target data. Through the technical scheme provided by the embodiment of the disclosure, the visualization of the three-dimensional model can be realized, and the market demand is met. In addition, the embodiment of the disclosure performs visual display based on WebGL, and can perform visual display in a browser. In an actual application scene, the addition or deletion can be carried out on the fine components of the three-dimensional model, and a modeler does not need to be troubled to use special modeling software to reconstruct the model; the display interface is cool and dazzling through visual display, and the user experience is improved; dynamic editing can be realized, and the edited display interface can be presented in real time; and the association of the assets can be realized, and the visual bound assets are realized.
The memory, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The embodiments described in the embodiments of the present disclosure are for more clearly illustrating the technical solutions of the embodiments of the present disclosure, and do not constitute a limitation to the technical solutions provided in the embodiments of the present disclosure, and it is obvious to those skilled in the art that the technical solutions provided in the embodiments of the present disclosure are also applicable to similar technical problems with the evolution of technology and the emergence of new application scenarios.
The above-described embodiments of the apparatus are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may also be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
One of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "first," "second," "third," "fourth," and the like in the description of the disclosure and in the above-described figures, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It is to be understood that in the present disclosure, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in the present disclosure, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing programs, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The preferred embodiments of the present disclosure have been described above with reference to the accompanying drawings, and therefore do not limit the scope of the claims of the embodiments of the present disclosure. Any modifications, equivalents and improvements within the scope and spirit of the embodiments of the present disclosure should be considered within the scope of the claims of the embodiments of the present disclosure by those skilled in the art.