Method and related equipment for three-dimensional display of objects
By using 3D display methods and systems, the problem of limited viewing details in traditional exhibit displays has been solved, enabling comprehensive and adjustable 3D displays and improving the user experience.
Patent Information
- Application Number
- CN202111095021.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-17
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2041-09-17
AI Technical Summary
Traditional exhibit display methods mainly rely on two-dimensional images, which limits the details of observation and makes it difficult to meet the high requirements of time and space, especially for the display of precious cultural relics.
Employing a 3D display method, this system acquires the 3D model and display parameters of the target item, and utilizes terminal devices and servers to achieve 3D display. It supports 3D display code that runs in a browser, provides functions for splitting and merging 3D models, and allows visitors to observe and adjust lighting and scenes from multiple angles.
It enables a comprehensive display of exhibits, allowing visitors to freely view details, adjust lighting and scenes for optimal effects, and utilize disassembly and merging functions to facilitate understanding of the internal structure. It also provides textual explanations, solving the problem of limited viewing options and enhancing the user experience.
Smart Images

Figure CN113742507B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method for displaying objects in three dimensions and related equipment. Background Art
[0002] Cultural relics exhibits have high historical and aesthetic value, and are of great research significance in terms of form, technique, and art history. However, traditional exhibition halls have high requirements for time and space when displaying cultural relics, and it is even more difficult to observe the details of precious cultural relics. The current online exhibits are mainly two-dimensional images, which greatly limits their usability. Summary of the invention
[0003] The present disclosure provides a method for displaying objects in three dimensions and related equipment.
[0004] In a first aspect, the present disclosure provides a method for three-dimensionally displaying an object, comprising:
[0005] Identify target items;
[0006] Obtaining a three-dimensional model and three-dimensional display parameters corresponding to the target object; and
[0007] Based on the three-dimensional model and the three-dimensional display parameters, the target object is displayed in three dimensions.
[0008] In a second aspect of the present disclosure, a terminal device is provided, comprising one or more processors, a memory; and one or more programs, wherein the one or more programs are stored in the memory and executed by the one or more processors, and the program includes instructions for executing the method described in the first aspect.
[0009] In a third aspect of the present disclosure, a system for displaying objects in three dimensions is provided, comprising:
[0010] The terminal device according to the second aspect is configured to: send a three-dimensional display item request of a target item to a server; and
[0011] The server is configured to return the three-dimensional display code of the target object to the terminal device according to the three-dimensional display object request, so that the terminal device runs the three-dimensional display code to display the three-dimensional image of the target object.
[0012] According to a fourth aspect of the present disclosure, a non-volatile computer-readable storage medium containing a computer program is provided. When the computer program is executed by one or more processors, the processors execute the method described in the first aspect.
[0013] In a fifth aspect of the present disclosure, a computer program product is provided, comprising computer program instructions, which, when executed on a computer, cause the computer to execute the method described in the first aspect.
[0014] The method and related equipment for three-dimensional display of objects provided by the present disclosure can better display the details of objects by displaying objects in three dimensions, which is beneficial for visitors to observe objects and provide better user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0016] Figure 1A A schematic diagram showing an exemplary system provided by an embodiment of the present disclosure is shown.
[0017] Figure 1B A schematic diagram of an exemplary venue 400 according to an embodiment of the present disclosure is shown.
[0018] Figure 1C A schematic diagram showing an exemplary interface according to an embodiment of the present disclosure is shown.
[0019] Figure 1D A schematic diagram showing another exemplary interface according to an embodiment of the present disclosure is shown.
[0020] Figure 1E A schematic diagram showing yet another exemplary interface according to an embodiment of the present disclosure is shown.
[0021] Figure 1F A schematic diagram showing another exemplary interface according to an embodiment of the present disclosure is shown.
[0022] Figure 1G A schematic diagram showing yet another exemplary interface according to an embodiment of the present disclosure is shown.
[0023] Figure 2 A flowchart of an exemplary method provided by an embodiment of the present disclosure is shown.
[0024] Figure 3 A schematic diagram of the hardware structure of a more specific terminal device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0025] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0026] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0027] Figure 1A A schematic diagram of an exemplary system 100 provided by an embodiment of the present disclosure is shown.
[0028] like Figure 1A As shown, the system 100 may include a server 200 and a plurality of terminal devices 300a to 300n. The number of the server 200 may be one or more. When the number of the server 200 is more than one, a distributed architecture may be adopted. The terminal devices 300a to 300n may be used to display objects in three dimensions, and may be various types of terminal devices. For example, the terminal device 300a may be a mobile terminal (e.g., a mobile phone), the terminal device 300b may be a personal computer (PC), and the terminal device 300n may be a laptop. The server 200 and the terminal devices 300a to 300n may be connected via a wired network or a wireless network and realize data exchange.
[0029] In some embodiments, the system 100 may be applied to scenes such as museums to display cultural relics exhibited in the museum in three dimensions. The terminal devices 300a-300n may be terminal devices set inside or around the venue for use by visitors.
[0030] Figure 1B A schematic diagram of an exemplary venue 400 according to an embodiment of the present disclosure is shown.
[0031] like Figure 1BAs shown, objects 402 to 420 are displayed in each exhibition hall and the central exhibition hall of the venue 400. For example, a terminal device 300b can be set in the central exhibition hall of the venue 400 for visitors to use, and visitors can view the three-dimensional images of the objects exhibited in the venue 400 and the relevant information of the objects on the terminal device 300b. For another example, the visitor 500 can view the three-dimensional images of the objects exhibited in the venue 400 and the relevant information of the objects by carrying the terminal device 300a. The terminal device 300a, for example, can be the visitor 500's own mobile phone, or it can be an interpreter provided by the venue 400, and so on.
[0032] In some embodiments, the system 100 can be implemented based on Three.js. For example, code for implementing a method for three-dimensionally displaying objects based on Three.js can be written and deployed in the server 200, so that the terminal devices 300a~300n can obtain and load the code from the server 200, and then implement the three-dimensional display of objects through the browser on the terminal devices 300a~300n. The code may include codes for implementing various functions of three-dimensional display and configuration parameters required to implement each function. Three.js is a three-dimensional engine based on WebGL encapsulation. The code for implementing a method for three-dimensionally displaying objects based on Three.js uses JavaScript function libraries or APIs to create and display complex three-dimensional computer graphics in a browser. It can be run directly through a browser without the need to use traditional independent applications or plug-ins, which is more convenient to implement.
[0033] It is understandable that by deploying the code of the method for displaying objects in three dimensions on the server 200, any terminal device can obtain the code from the server 200 by inputting the corresponding address for obtaining the code in the browser, thereby having greater compatibility and a wide range of applications. However, in some scenarios, it may be necessary to deploy the code for a separate terminal device, so the code can be stored locally on the terminal device without obtaining it from the server 200.
[0034] In some embodiments, the server 200 may further include a database in which a three-dimensional model of an object may be stored. For example, when the system 100 is applied to a museum scene, the database may store three-dimensional models of all exhibits exhibited in the museum. The three-dimensional model may be modeled by tools such as three-dimensional modeling software. In some embodiments, the object may be split into a plurality of parts, and then each part may be modeled separately to obtain a three-dimensional sub-model corresponding to each part, thereby obtaining a three-dimensional model of the object. For example, for a porcelain bottle, if it has a bottle body, a bottle cap, a left bottle handle, and a right bottle handle, the four parts may be modeled separately to obtain a sub-model during modeling, and then the four sub-models may be combined into a three-dimensional model of the porcelain bottle. In this way, the object may be split and displayed based on the three-dimensional sub-model during subsequent display, so that visitors may observe more details of the object. The model completed by modeling, for example, may be in obj format.
[0035] After entering the venue 400, visitors can use the terminal device 300b installed in the venue 400 to browse the three-dimensional images and related information of the objects 402-420 exhibited in the venue 400, or use their own mobile phone 300a to browse the three-dimensional images and related information of the objects 402-420 in sequence along the walking route.
[0036] In the initial state, the terminal devices 300a-300n may not display any 3D images of the objects 402-420 exhibited in the venue 400. Visitors may send a 3D display object request of a target object to the server 200 by inputting a corresponding address (e.g., a webpage address) in the browser of the terminal devices 300a-300n.
[0037] The server 200 can return the 3D display code (eg, HTML code) of the target object to the corresponding terminal device according to the 3D display object request, so that the terminal device runs the 3D display code and runs it in the browser, thereby displaying the 3D image of the target object in the browser.
[0038] Depending on the actual deployment of the terminal device and the different settings of the initial state of the terminal device, different initial screens can be displayed in the initial state by entering different addresses.
[0039] For example, if terminal devices are only set up at specific locations in the venue 400 (e.g. Figure 1BThe terminal device 300b is set in the central exhibition hall, and there is no one-to-one correspondence between the terminal device and the exhibits. Therefore, when the terminal device 300b sends a three-dimensional display item request to the server 200 by entering the corresponding address (for example, 3d.museum.com) in the browser in the initial state, the initial screen displayed after the code returned by the server 200 runs in the browser of the terminal device 300b is a schematic diagram of the venue 400. Figure 1C FIG. shows a schematic diagram of an exemplary interface 600 according to an embodiment of the present disclosure. As Figure 1C shown, in this embodiment, the initial screen shows a scene map, and the scene map shows the picture of the venue 400 (this picture can be two-dimensional or three-dimensional). The coordinates and icons of each exhibit 402-420 can be configured in the code returned by the server 200, so that different exhibits are displayed at different positions on the initial screen, as Figure 1C shown.
[0040] In some embodiments, the default address can also be set in the browser as the address for accessing the server 200 to obtain the code for three-dimensional display of items, so that visitors can automatically obtain the code to display the initial screen on the terminal device by starting the browser. In this embodiment, if the visitor needs to further view the three-dimensional picture of the target item, the corresponding target item needs to be selected in the interface 600, and then the corresponding three-dimensional picture is displayed. After the terminal device 300b displays the interface 600, it can monitor whether a target item selection event occurs (for example, the visitor double-clicks on a certain exhibit in the scene map with the mouse). If a target item selection event is monitored, the target item can be determined based on the target item selection event, and then the three-dimensional picture of the target item is displayed. In some embodiments, after the terminal device 300b displays the interface 600, it can also monitor whether a target item click event occurs (for example, the visitor single-clicks on a certain exhibit in the scene map with the mouse). If a target item click event is monitored, the target item can be determined based on the target item click event, and then the relevant information 6002 of the target item (this information can be obtained from the server 200) is displayed in the interface 600, as Figure 1D shown. The style of the pop-up window for displaying the relevant information 6002 can be customized.
[0041] For another example, if the terminal device is in one-to-one correspondence with the exhibits, for example, a terminal device is set beside each exhibit for three-dimensional display of the exhibit. Then, when the terminal device sends a three-dimensional display item request for the target item (exhibit 1) to the server 200 by entering the corresponding address (for example, 3d.museum.com / exhibit 1) in the browser in the initial state, the initial screen displayed after the code returned by the server 200 runs in the browser of the terminal device 300b is a schematic diagram of exhibit 1. Figure 1E A schematic diagram showing an exemplary interface 602 according to an embodiment of the present disclosure. As Figure 1E shown, in this embodiment, the initial screen displays a three-dimensional view of the target item. In some embodiments, the default address in the browser can also be set to the address for accessing the code for three-dimensionally displaying the item on the server 200, so that visitors can automatically obtain the code to display the three-dimensional view of exhibit 1 on the terminal device by starting the browser. It can be understood that in such an embodiment, each terminal device corresponds to an exhibit one by one. Therefore, the default address of the browser in each terminal device will be different due to different exhibits. For example, the default address of the browser of the terminal device corresponding to exhibit 2 can be, for example, 3d.museum.com / exhibit 2.
[0042] In some embodiments, visitor 500 can also use the mobile terminal 300a they carry to display the three-dimensional view of the item. For example, a barcode or QR code and other identifiers can be set on the display case of the target item, and the identifier contains the code address corresponding to the target item (for example, 3d.museum.com / exhibit 1). Visitor 500 uses the mobile terminal 300a to scan the identifier, thereby obtaining the code address and sending a three-dimensional display item request for the target item to the server 200. The server 200 can then determine the target item based on the address information carried in the identifier of the target item and return the code corresponding to the target item to the terminal device 300b.
[0043] For another example, the terminal device 300a can enter the initial screen by entering the address corresponding to the three-dimensional display item (for example, 3d.museum.com) in the browser, then automatically obtain the location information of the terminal device (for example, GPS information or location information determined based on indoor positioning methods (such as Bluetooth, WIFI, etc.)), and then send a three-dimensional display item request carrying the location information to the server 200. The server 200 can then determine the position of the terminal device in the scene map based on the location information, thereby determining the target item based on the position of the terminal device in the scene map and returning the code corresponding to the target item to the terminal device 300a to enable the terminal device 300a to display the three-dimensional view of the target item.
[0044] After the terminal device 300a or 300b obtains the corresponding code, it uses the browser to run the code and starts the three-dimensional display. After determining the target item, the terminal device 300a or 300b can obtain the three-dimensional model corresponding to the target item from the database of the server 200 and perform a three-dimensional display of the target item based on the three-dimensional display parameters preset in the code, as Figure 1E shown.
[0045] In some embodiments, when the method for displaying objects in three dimensions is implemented based on Three.js, the three-dimensional display parameters may include parameters such as renderer, scene, camera, light, etc. An example of a part of the code is shown below.
[0046]
[0047]
[0048] As can be seen from the above examples, the configurable items in the code can include:
[0049] modelUrl: model url, the model type is determined by the suffix, and mainstream model formats such as fbx, obj, and gltf are supported;
[0050] scale: scaling ratio, if not passed, the default value is 1;
[0051] showAxes: whether to display the coordinate axis, not displayed by default;
[0052] pointLightHelper: whether to display auxiliary point light source;
[0053] bgColor: background color, which can be configured according to the page requirements. The default is the background color of the slide show on page p2.
[0054] cameraPosition: camera position, quickly adjust the initial viewing angle;
[0055] isFixed: The viewing angle can be fixed, and the user is not allowed to drag and drop the model. By default, the user can change the viewing angle by himself.
[0056] showIcons: Display icons. Pass in coordinates and icons to display them at the corresponding positions. You can add additional display information, such as clicking an icon to display a pop-up window, which displays device information.
[0057] It is understandable that the above examples are only illustrative, and the required parameters may vary according to actual needs.
[0058] The terminal device 300a or 300b can quickly display the three-dimensional model in the browser page of the terminal device 300a or 300b by passing in basic parameters through the components configured by the code. Among them, except for the model address, the remaining parameters can adopt the default configuration or can be configured by themselves.
[0059] After loading and running the code returned by the server 200, the terminal device 300a or 300b can use OBJLoader to read the 3D model data, use MTLLoader to load the model material, and preset the renderer, scene, camera, light and other parameters. The ambient light parameters can be preset in the scene parameters to ensure that the object can be displayed normally, and the point light source parameters can be preset to simulate the material display effect of the object more realistically. The initial position of the 3D model of the target object can be placed at the center point of the scene.
[0060] Visitors can further operate the three-dimensional displayed objects on the terminal device 300a or 300b.
[0061] In some embodiments, for example, visitors can adjust the angle, size, and position of the three-dimensional model of the object displayed in the interface 602. For example, the OrbitControls camera control can be introduced to zoom, translate, and rotate the scene, so that visitors can adjust the three-dimensional model to a desired angle and position for observation. With the help of the requestAnimationFrame module, the rotation.y parameter of the three-dimensional model can be changed to make the three-dimensional model slowly rotate around the y axis, so that various angles of the three-dimensional model can be displayed.
[0062] In some embodiments, Figure 1E As shown, the terminal device 300a or 300b can display some icons at a specific position of the interface 602 to prompt the visitor to adjust the three-dimensional model by adjusting the icon. Figure 1E As shown, there may be an arc-shaped arrow icon 6022 next to the three-dimensional model of the exhibit to prompt the visitor to adjust the angle of the three-dimensional model by sliding the icon 6022. For another example, there may be a cross-arrow icon 6024 next to the three-dimensional model of the exhibit to prompt the visitor to adjust the position of the three-dimensional model by sliding the icon 6024. For another example, there may be a zoom icon 6026 next to the three-dimensional model of the exhibit to prompt the visitor to adjust the size of the three-dimensional model by sliding the icon 6026. The browser of the terminal device 300a or 300b can monitor whether a sliding adjustment item event for a specific icon occurs to determine whether the visitor has adjusted these icons.
[0063] If the browser of terminal device 300a or 300b detects an event of sliding an object to adjust the object, it can determine the sliding starting point and the sliding end point based on the event, and determine the corresponding camera parameter adjustment amount based on the sliding starting point and the sliding end point, and then adjust the corresponding camera parameters based on the camera parameter adjustment amount to achieve adjustment of the angle, position, and size of the three-dimensional model.
[0064] In some embodiments, for example, a visitor may adjust the lighting of a three-dimensional model of an object displayed in interface 602 .
[0065] In some embodiments, Figure 1E As shown, the terminal device 300a or 300b can display some icons at a specific position of the interface 602 to prompt the visitor to adjust the lighting of the three-dimensional model by adjusting the icons. Figure 1E As shown, there may be a horizontal arrow icon 6028 next to the light of the three-dimensional model of the exhibit to prompt the visitor to adjust the x-axis of the point light source of the three-dimensional model by sliding and adjusting the icon 6028. For another example, there may be a vertical arrow icon 6030 next to the three-dimensional model of the exhibit to prompt the visitor to adjust the y-axis of the point light source of the three-dimensional model by sliding and adjusting the icon 6030. For another example, there may be an oblique arrow icon 6032 next to the three-dimensional model of the exhibit to prompt the visitor to adjust the z-axis of the point light source of the three-dimensional model by sliding and adjusting the icon 6032. For another example, there may be a vertical arrow icon 6034 next to the three-dimensional model of the exhibit to prompt the visitor to adjust the intensity of the point light source of the three-dimensional model by sliding and adjusting the icon 6034. The browser of the terminal device 300a or 300b can monitor whether a sliding adjustment item event for a specific icon occurs to determine whether the visitor has adjusted these icons. The maximum and minimum values corresponding to the arrow icons, and the values increased or decreased each time by dragging, have been preset to adapt to the current scene.
[0066] If the browser of terminal device 300a or 300b detects a sliding light adjustment event, it can determine the corresponding sliding start point and sliding end point based on the sliding light adjustment event, and determine the corresponding light parameter adjustment amount according to the sliding start point and sliding end point, and then adjust the light parameters according to the light parameter adjustment amount to achieve adjustment of the x, y, z axes and intensity of the point light source.
[0067] In some embodiments, taking the operation of the terminal device 300b by the mouse as an example, a class Vector2 representing a two-dimensional vector can be introduced, const mouse = new THREE.Vector2(), to record the coordinates (x, y) of the mouse position relative to the model display area. The value range of the x and y directions can be -1 to +1, and the formula is mouse.x = (<horizontal coordinate of the mouse relative to the visible area> / <width of the visible area>)×2-1, mouse.y = -(<vertical coordinate of the mouse relative to the visible area> / <height of the visible area>)×2+1. By monitoring the mouse movement event, assuming that the page element node corresponding to the obtained display model area is the node corresponding to the icon 6022, its position relative to the browser window is obtained through getBoundingClientRect(). The horizontal coordinate of the mouse position relative to the browser page is subtracted from the horizontal position of the icon 6022 relative to the browser window to obtain the horizontal coordinate of the mouse relative to the visible area. Similarly, the vertical coordinate of the mouse position relative to the browser page is subtracted from the vertical position of the icon 6022 relative to the browser window to obtain the horizontal coordinate of the mouse relative to the visible area. In this way, the sliding start point and the sliding end point of the mouse can be calculated, and then the corresponding parameter adjustment amount can be calculated.
[0068] In some embodiments, the terminal device 300a or 300b can also display text information on a specific part of the three-dimensional model. For example, the terminal device 300a or 300b can determine whether a target object part selection event occurs by monitoring whether a click event (or a mouse move event) occurs on a specific part of the three-dimensional model, and then determine whether the text information of the object part needs to be displayed.
[0069] If the browser of the terminal device 300a or 300b monitors a target object part selection event occurring at a specific part of the three-dimensional model, the target selected part on the target object is determined based on the target object part selection event, and then the corresponding text introduction information is determined based on the target selected part, and finally the text introduction information is displayed at the target selected part. Figure 1F FIG. 6 is a schematic diagram showing another exemplary interface 602 according to an embodiment of the present disclosure. Figure 1F As shown, when the bottle body of the target object is clicked, the interface 602 displays text introduction information 6038 corresponding to the part.
[0070] In some embodiments, taking the mouse operation of the terminal device 300b as an example, when the mouse moves into the area where the specific part of the three-dimensional model of the object is located, the mouse movement event is detected, and then the text introduction information (or text explanation information) of the corresponding part is displayed. In some embodiments, an initially invisible page element named textBox can be set. When the mouse moves into the area where the specific part of the three-dimensional model of the object is located, the text introduction information that should be displayed can be found according to the name of the corresponding three-dimensional sub-model, the textBox is displayed, and the text introduction information is set as the content of the textBox, such as Figure 1F shown.
[0071] In addition, in some embodiments, if the browser of the terminal device 300a or 300b monitors the occurrence of a target object part selection event (or a mouse move event) at a specific part of the three-dimensional model, the part can also be highlighted by highlighting the luminous edge of the part, thereby prompting the visitor to the location of the part of the currently selected object. Taking the terminal device 300b as an example of mouse operation, the object moved by the mouse can be highlighted, which can be achieved by introducing the post-processing channel of Three.js. At the same time, the OutlinePass outline channel can be selected to add a luminous effect to the edge of the selected object. According to the display effect, the intensity, flickering frequency, and luminous color of the edge luminescence can be adjusted.
[0072] In addition, when the mouse moves out, the textBox can be hidden again and the target array of the glow effect can be cleared.
[0073] In some embodiments, the terminal device 300a or 300b can also split and display the three-dimensional model. Figure 1E As shown, the terminal device 300a or 300b can display a split display icon 6036 at a specific position of the interface 602 to prompt the visitor to split and display the three-dimensional model by clicking the icon 6036. The terminal device 300a or 300b can determine whether the visitor has issued a split display instruction for the target object by monitoring whether the icon 6036 is clicked by the mouse.
[0074] If the browser of the terminal device 300a or 300b monitors the event of the icon 6036 being clicked, the multiple parts of the target object can be split and displayed according to the three-dimensional sub-models of the multiple parts of the target object (formed during modeling).
[0075] In the example of using Three.js to implement system 100, when modeling, the mesh of the three-dimensional model can be named according to the name of the object. For example, the prefix "object_n" (n represents the number of the object, which can be a natural number starting from 1 and assigned to each object in turn) is added to refer to a specific object, which is convenient for quickly identifying which parts belong to the three-dimensional model of the object in three.js and participating in the disassembly. At the same time, suffixes such as "_top", "_left", "_right", "_middle", "_bottom", etc. can be added to name the mesh of the three-dimensional sub-model of each part, which is convenient for splitting the three-dimensional model based on the suffix. Figure 1E Taking the porcelain shown in the figure as an example, the above classification meets the basic requirements. For example, the suffixes "_top", "_left", "_right", and "_middle" correspond to the porcelain cover, left handle, right handle, and bottle body respectively. The mesh of all models can be stored by setting the array modelList. When loading the model with OBJLoader, all elements in the scene are recursively traversed. When the name of the element has the prefix "object_n", it is added to the modelList array.
[0076] In some embodiments, two disassembly model solutions can be preset in the system 100, corresponding to porcelain with bottle caps and porcelain without bottle caps. Therefore, when disassembling, the terminal device 300a or 300b can first determine the type of the target object to be disassembled, for example, the disassembly model solution can be distinguished by whether there is a model grid with a "_top" suffix.
[0077] If the target item is of the first type (for example, porcelain with a bottle cap), the target item can be split into multiple parts of a first number (for example, upper, middle, and lower parts); if the target item is of the second type (for example, porcelain without a bottle cap), the target item can be split into multiple parts of a second number (for example, upper and lower parts).
[0078] In some embodiments, the final positions of the parts of the two disassembly solutions are different, based on the standard of achieving the best display effect in the browser model display area. The bottle cap porcelain with the "_top" suffix is equally divided into three parts, upper, middle and lower, in the display center area, while the bottle cap porcelain without the suffix is divided into two parts, upper and lower, and the y value of the final position is adjusted according to the actual display effect.
[0079] It is understandable that if the target item has a third type, such as a bottle cap porcelain with handles on both sides, the handles can also be split, and the split can be completed according to the suffix name. Similarly, the horizontal position of the corresponding model grid can also be adjusted accordingly. Figure 1GA schematic diagram showing a porcelain bottle with a cap and handles on both sides being disassembled into four parts.
[0080] During the splitting process, in order to make the splitting action smoother, a tween animation library TweenJS in JavaScript can be referenced to realize the natural transition of the position changes of each part. The transition is realized by encapsulating the moving function (move). The transition time in the moving function, for example, defaults to 800 milliseconds, that is, it takes 800 milliseconds to move from the current position to the target position. For example, the function parameters can be: the object obj to be moved and the object position representing the coordinates, the format is such as {x:10, y:10, z:10}, indicating that the object is moved to (10,10,10). When the original value is 0, the parameters of the original position coordinates do not need to be passed in, and the default original position coordinates are (0,0,0). For example, if the porcelain cover is moved 5 units upward from (0,0,0), the position parameter passed into the move function of the terminal device 300a or 300b only needs to be {y:5}.
[0081] In some embodiments, in a split model, visitors can further adjust each split part. Figure 1G As shown, the terminal device 300a or 300b can display a corresponding icon at a specific position of the interface 602 to prompt the visitor to adjust the separated parts of the three-dimensional model by sliding the icon.
[0082] Since the split parts occupy a large space of the interface 602, displaying adjustment icons for each part will make the interface 602 too crowded and difficult to arrange a large number of icons. Therefore, in some embodiments, the currently selected part can be determined by monitoring whether a mouse move event occurs in a specific part, and then the corresponding icon is displayed for the part. Figure 1G As shown, assuming that the mouse is currently moved into the bottle body, the terminal device 300a or 300b monitors the event, and then the browser can display an arc arrow icon 6040 for adjusting the angle of the bottle body, a cross arrow icon 6042 for adjusting the position of the bottle body, and a zoom icon 6044 for adjusting the size of the bottle body.
[0083] Further, similar to adjusting the entire three-dimensional model, the terminal device 300a or 300b can adjust the bottle body accordingly by monitoring the sliding event on the icon, which is not described in detail here. Similarly, the left handle, the right handle, and the bottle cap can all be adjusted in this way, which is not described in detail here.
[0084] In some embodiments, a raycaster can be introduced to calculate what object the mouse has moved over in three-dimensional space. The ray is updated by the camera and the mouse position to calculate the focus of the object and the ray. According to the model disassembly step, the model mesh is stored in modelList, so the focus of the object and the ray can be calculated based on the model mesh in modelList.
[0085] In some embodiments, similar to the display of the three-dimensional model as a whole, the split parts may also display text introduction information 6048 when a mouse move event is detected, such as Figure 1G At the same time, the split part can also be highlighted. The specific working principle is similar to that of the overall display of the 3D model, and will not be repeated here.
[0086] In some embodiments, the terminal device 300a or 300b may further combine and display the split 3D models again. Figure 1G As shown, the terminal device 300a or 300b can display a combined display icon 6046 at a specific position of the interface 602 to prompt the visitor to combine and display multiple three-dimensional sub-models by clicking the icon 6046. The terminal device 300a or 300b can determine whether the visitor has issued a combined display instruction for the target object by monitoring whether the icon 6046 is clicked by the mouse.
[0087] If the browser of the terminal device 300a or 300b monitors the event of the icon 6046 being clicked, the multiple parts of the target object can be merged and displayed according to the initial positions of the three-dimensional sub-models (formed during modeling) of the multiple parts of the target object. For example, when merging models, all model grids in modelList can be traversed, and the move function can be called to pass in each element and the initial position before disassembly, such as {x:0, y:0, z:0}, and then the merge is completed. The interface after the merge is referenced Figure 1E or Figure 1F shown.
[0088] It can be seen from the above embodiments that the method and related equipment for three-dimensional display of objects provided by the embodiments of the present disclosure can realize the all-round display of historical relics or precious exhibits. Visitors can view the details of the exhibits from any angle and adjust the lighting, scene, etc. according to their personal preferences to achieve the most suitable viewing effect. At the same time, the disassembly and merging function is provided to facilitate a detailed understanding of the internal structure of the exhibits and the combination of parts. In addition, an overall text explanation is provided, and the corresponding detailed introduction can be displayed by moving the mouse into each component. The method and related equipment for three-dimensional display of objects provided by the embodiments of the present disclosure enable viewers to appreciate and learn about exhibits online.
[0089] The method and related equipment for displaying items in three dimensions provided by the embodiments of the present disclosure display the exhibit model in three dimensions online, and maximize the display of exhibit details by decomposing and merging models and adjusting scenes, thereby solving the problem of exhibitions being limited by time and space and being unable to learn details in depth. Visitors can rotate the model at will to view the details; adjust the position, intensity, and color of the light according to actual needs to achieve the most suitable viewing effect; set two disassembly schemes for model disassembly, and the model can be split for display to facilitate observation of the inside of the exhibit, and the decomposition and merging process has a configurable natural transition; move the mouse to different parts of the model to display their respective explanations.
[0090] The disclosed embodiment also provides a method for displaying objects in three dimensions. Figure 2 FIG. 7 is a flow chart of an exemplary method 700 provided by an embodiment of the present disclosure. The method 700 can be implemented by terminal devices 300a-300n and has the technical effects of the corresponding embodiments of the aforementioned system 100. Figure 2 As shown, the method 700 may include the following steps.
[0091] In step 702, a terminal device (eg, terminal device 300b) may determine a target item.
[0092] In step 704, the terminal device 300b may obtain the three-dimensional model and three-dimensional display parameters corresponding to the target object.
[0093] In step 706, the terminal device 300b may perform a three-dimensional display of the target object based on the three-dimensional model and the three-dimensional display parameters.
[0094] In some embodiments, the method is a method for displaying objects in three dimensions based on Three.js; the three-dimensional display parameters include camera parameters in Three.js, and the method 700 may further include the following steps:
[0095] Monitoring whether a sliding adjustment item event occurs; wherein the sliding adjustment item event includes an event of adjusting the angle, position or size of the target item;
[0096] In response to the occurrence of a sliding adjustment item event, determining a sliding start point and a sliding end point of the sliding adjustment item event, and determining a corresponding camera parameter adjustment amount according to the sliding start point and the sliding end point of the sliding adjustment item event; and
[0097] The camera parameter is adjusted according to the camera parameter adjustment amount.
[0098] In some embodiments, the three-dimensional display parameters also include light parameters in Three.js, and the method 700 may further include the following steps:
[0099] Monitor whether a sliding light adjustment event occurs;
[0100] In response to the occurrence of a sliding light adjustment event, determining a sliding start point and a sliding end point of the sliding light adjustment event, and determining a corresponding light parameter adjustment amount according to the sliding start point and the sliding end point of the sliding light adjustment event; and
[0101] The lighting parameter is adjusted according to the lighting parameter adjustment amount.
[0102] In some embodiments, the target object is divided into multiple parts, the three-dimensional model includes multiple three-dimensional sub-models, and the three-dimensional sub-models correspond to the parts. The method 700 may further include the following steps:
[0103] receiving a split display instruction for the target item; and
[0104] Based on the split display instruction, the multiple parts of the target object are split and displayed according to the three-dimensional sub-models of the multiple parts of the target object.
[0105] In some embodiments, based on the split display instruction, splitting and displaying the multiple parts of the target object according to the three-dimensional sub-models of the multiple parts of the target object further includes:
[0106] determining the type of the target object;
[0107] In response to the type of the target item being a first type, splitting the target item into a first number of multiple parts; or
[0108] In response to the type of the target item being a second type, splitting the target item into a second number of parts;
[0109] Wherein, the first number is greater than the second number.
[0110] In some embodiments, splitting and displaying the target item in multiple parts includes:
[0111] Determining a moving start point and a moving end point of a target portion of the target object; and
[0112] According to the moving starting point and the moving end point, a moving function is called to move the target part, and a transition time is set in the moving function so that the target part moves from the moving starting point to the moving end point at a uniform speed according to the transition time.
[0113] In some embodiments, the method is a method for displaying objects in three dimensions based on Three.js; the three-dimensional display parameters include camera parameters in Three.js, and the method 700 may further include the following steps:
[0114] Monitoring whether a sliding adjustment event of an object part occurs; wherein the sliding adjustment event of an object part includes an event of adjusting the angle, position or size of a target part of the target object;
[0115] In response to the occurrence of a sliding adjustment item portion event, determining a sliding start point and a sliding end point of the sliding adjustment item portion event, and determining a corresponding camera parameter adjustment amount according to the sliding start point and the sliding end point of the sliding adjustment item portion event; and
[0116] The camera parameter is adjusted according to the camera parameter adjustment amount.
[0117] In some embodiments, the method 700 may further include the following steps:
[0118] Monitor whether the target item part selection event occurs;
[0119] In response to a target item part selection event occurring, determining a target selected part on the target item based on the target item part selection event;
[0120] Determining corresponding text introduction information according to the target selected part; and
[0121] The text introduction information is displayed at the target selected part.
[0122] In some embodiments, determining the target item further comprises:
[0123] Receiving a scene map and displaying the scene map;
[0124] Listen for the target item selection event; and
[0125] In response to a target item selection event occurring, the target item is determined based on the target item selection event.
[0126] It should be noted that the above describes some embodiments of the present disclosure. 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 above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying 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.
[0127] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method 700 described in any of the above embodiments when executing the program.
[0128] Figure 3 FIG. 8 is a schematic diagram showing a hardware structure of a more specific terminal device 800 provided in an embodiment of the present disclosure. Figure 3 As shown, the device 800 may include: a processor 802, a memory 804, an input / output interface 806, a communication interface 808 and a bus 810. The processor 802, the memory 804, the input / output interface 806 and the communication interface 808 are connected to each other in communication within the device via the bus 810.
[0129] The processor 802 can 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 used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0130] The memory 804 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 804 can store operating systems and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 804 and called and executed by the processor 802.
[0131] The input / output interface 806 is used to connect the input / output module to realize information input and output. The input / output module can be configured as a component in the device (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0132] The communication interface 808 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0133] The bus 810 comprises a pathway for transmitting information between the various components of the device (eg, the processor 802, the memory 804, the input / output interface 806, and the communication interface 808).
[0134] It should be noted that, although the above device only shows the processor 802, the memory 804, the input / output interface 806, the communication interface 808 and the bus 810, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0135] The electronic device of the above embodiment is used to implement the corresponding method 700 in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0136] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute method 700 described in any of the above embodiments.
[0137] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage 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.
[0138] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the method 700 described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0139] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments, the present disclosure further provides a computer program product, which includes a computer program. In some embodiments, the computer program is executable by one or more processors so that the processors execute the described method 700. Corresponding to the execution subject corresponding to each step in each embodiment of the method 700, the processor that executes the corresponding step may belong to the corresponding execution subject.
[0140] The computer program product of the above embodiment is used to enable the processor to execute the method 700 described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0141] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.
[0142] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present disclosure difficult to understand, the known power / ground connections to the integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure will be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is apparent to those skilled in the art that the embodiments of the present disclosure can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0143] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0144] The embodiments of the present disclosure are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.
Claims
1. A method for displaying an object in three dimensions, comprising: Identify target items; Obtaining a three-dimensional model and three-dimensional display parameters corresponding to the target object; as well as Based on the three-dimensional model and the three-dimensional display parameters, three-dimensionally display the target object; The method is a method for displaying objects in three dimensions based on Three.js; the three-dimensional display parameters include camera parameters in Three.js, and the method further includes: Monitoring whether a sliding adjustment item event occurs; wherein the sliding adjustment item event includes an event of adjusting the angle, position or size of the target item; In response to the occurrence of a sliding adjustment item event, determining a sliding start point and a sliding end point of the sliding adjustment item event, and determining a corresponding camera parameter adjustment amount according to the sliding start point and the sliding end point of the sliding adjustment item event; and adjusting the camera parameter according to the camera parameter adjustment amount; Wherein, the three-dimensional display parameters also include light parameters in Three.js, and the method includes: Monitor whether a sliding light adjustment event occurs; In response to the occurrence of a sliding light adjustment event, determining a sliding start point and a sliding end point of the sliding light adjustment event, and determining a corresponding light parameter adjustment amount according to the sliding start point and the sliding end point of the sliding light adjustment event; and adjusting the lighting parameter according to the lighting parameter adjustment amount; The target object is divided into a plurality of parts, the three-dimensional model includes a plurality of three-dimensional sub-models, and the three-dimensional sub-models correspond to the parts. The method further includes: receiving a split display instruction for the target item; and Based on the split display instruction, split and display the multiple parts of the target object according to the three-dimensional sub-models of the multiple parts of the target object; Wherein, based on the split display instruction, splitting and displaying the multiple parts of the target object according to the three-dimensional sub-models of the multiple parts of the target object further includes: determining the type of the target object; In response to the type of the target item being a first type, splitting the target item into a first number of multiple parts; or In response to the type of the target item being a second type, splitting the target item into a second number of parts; wherein the first number is greater than the second number; The multiple parts of the target object are split and displayed, including: Determining a moving start point and a moving end point of a target portion of the target object; and According to the moving starting point and the moving end point, a moving function is called to move the target part, and a transition time is set in the moving function so that the target part moves from the moving starting point to the moving end point at a uniform speed according to the transition time.
2. The method of claim 1, wherein: The method is a method for displaying objects in three dimensions based on Three.js; The three-dimensional display parameters include camera parameters in Three.js, and the method further includes: Monitoring whether a sliding adjustment event of an object part occurs; wherein the sliding adjustment event of an object part includes an event of adjusting the angle, position or size of a target part of the target object; In response to the occurrence of a sliding adjustment item portion event, determining a sliding start point and a sliding end point of the sliding adjustment item portion event, and determining a corresponding camera parameter adjustment amount according to the sliding start point and the sliding end point of the sliding adjustment item portion event; and The camera parameter is adjusted according to the camera parameter adjustment amount.
3. The method of claim 1, further comprising: Monitor whether the target item part selection event occurs; In response to a target item part selection event occurring, determining a target selected part on the target item based on the target item part selection event; Determine corresponding text introduction information according to the selected target part; as well as The text introduction information is displayed at the target selected part.
4. The method of claim 1, wherein: Determining target items further includes: Receiving a scene map and displaying the scene map; Listen for the target item selection event; and In response to a target item selection event occurring, the target item is determined based on the target item selection event.
5. A terminal device, comprising one or more processors, a memory; and one or more programs, wherein the one or more programs are stored in the memory and executed by the one or more processors, and the program includes instructions for executing the method according to any one of claims 1-4.
6. A system for displaying objects in three dimensions, comprising: The terminal device according to claim 5, configured to: send a three-dimensional display item request of a target item to a server; as well as The server is configured to return the three-dimensional display code of the target object to the terminal device according to the three-dimensional display object request, so that the terminal device runs the three-dimensional display code to display the three-dimensional image of the target object.
7. The system of claim 6, wherein: The terminal device is configured to: scan the identification of the target object; and, based on the identification of the target object, send a three-dimensional display item request of the target object to the server; The server is configured to determine the target object according to the identifier of the target object.
8. The system of claim 6, wherein: The terminal device is configured to: receive positioning information of the terminal device; and send a three-dimensional display item request carrying the positioning information of the terminal device to the server; The server is configured to: determine the position of the terminal device in the scene map according to the positioning information of the terminal device; and determine the target object according to the position of the terminal device in the scene map.
9. A non-volatile computer-readable storage medium containing a computer program, which, when executed by one or more processors, causes the processors to perform the method according to any one of claims 1 to 4.
10. A computer program product, comprising computer program instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 4.
