Display method of real-size three-dimensional model and mobile terminal
By constructing an axisymmetric bounding box and acquiring screen information, the problem of inconsistent actual size caused by differences in the display screen size of mobile terminals was solved, enabling the display of a 3D model of the actual size on different terminals, making it easier for users to choose.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-22
- Publication Date
- 2026-03-24
AI Technical Summary
Because mobile device screens vary in size, the same item may appear different sizes on different screens, making it difficult for users to visually determine the true size of the item and affecting their selection.
Construct an axisymmetric bounding box for the 3D model, acquire screen information, determine the preset position points of the 3D model based on the screen pixel length and screen information, and perform scaling to display its true size in the projection coordinate system.
It enables the display of 3D models of the same real size on different mobile devices, making it easier for users to choose.
Smart Images

Figure CN115797003B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of 3D model display technology, and in particular to a method for displaying a life-size 3D model and a mobile terminal thereof. Background Technology
[0002] With the increasing popularity of online shopping and paperless displays, mobile devices, such as smartphones, will play a crucial role. For example, merchants need to display views of items for sale from various angles on mobile devices. However, the market offers a wide variety of mobile device models, each with different screen sizes. Therefore, even a simple image will appear different sizes on different mobile devices. This results in the same item appearing at different sizes on different screens, making it difficult for users to visually determine the item's true size and causing inconvenience in their selection. Summary of the Invention
[0003] To address the problems existing in the prior art, this invention provides a method for displaying a true-size 3D model, applied to a mobile terminal. The mobile terminal is pre-configured with a 3D model of the object to be displayed, constructed according to its true size and placed in a model coordinate system. The display method includes:
[0004] Step S1: The mobile terminal constructs the axisymmetric bounding box of the three-dimensional model and processes it to obtain the side length of the axisymmetric bounding box in the model coordinate system.
[0005] Step S2: The mobile terminal obtains its own screen information and processes it according to the screen information and each side length to obtain the screen pixel length occupied by each side length.
[0006] Step S3: The mobile terminal places the 3D model with the axisymmetric bounding box at a preset position in the camera coordinate system facing the camera viewpoint, and determines the target position coordinates of the two-dimensional projection point of the preset position point on the axisymmetric bounding box corresponding to the actual size of the 3D model in the projection coordinate system corresponding to the camera coordinate system according to the screen pixel length and the screen information.
[0007] Step S4: The mobile terminal scales the 3D model with the axisymmetric bounding box so that the coordinates of the two-dimensional coordinates of the preset position point of the 3D model with the axisymmetric bounding box in the projection coordinate system are the target position coordinates, indicating that the 3D model in the projection coordinate system is the true size, and then displays the 3D model in the projection coordinate system.
[0008] Preferably, the side length of the axisymmetric bounding box in the model coordinate system includes length, width, and height, and step S1 includes:
[0009] Step S11, the mobile terminal constructs the axisymmetric bounding box of the three-dimensional model;
[0010] Step S12: The mobile terminal traverses the vertex coordinates of each vertex of the three-dimensional model in the model coordinate system, and respectively counts the maximum and minimum values of the X-axis coordinate, Y-axis coordinate and Z-axis coordinate values of each vertex coordinate.
[0011] Step S13: The maximum value of the X-axis coordinate minus the minimum value of the X-axis coordinate is used as the length of the axisymmetric bounding box; the maximum value of the Y-axis coordinate minus the minimum value of the Y-axis coordinate is used as the width of the axisymmetric bounding box; and the maximum value of the Z-axis coordinate minus the minimum value of the Z-axis coordinate is used as the height of the axisymmetric bounding box.
[0012] Preferably, the screen information includes the resolution of the mobile terminal's screen diagonal and the length of the screen diagonal; then in step S2, the screen pixel length is obtained according to the following formula:
[0013] needpx = length / 2.54 * dp / di
[0014] Wherein, needpx represents the screen pixel length, length represents the side length, dp represents the screen diagonal resolution, and di represents the screen diagonal length.
[0015] Preferably, in step S3, the preset position is on the main axis ray of the camera viewpoint, and the area to be displayed of the three-dimensional model is directly opposite the camera viewpoint.
[0016] Preferably, step S4 includes:
[0017] Step S41: The mobile terminal generates error position coordinates with a preset error between the target position coordinates and the target position coordinates, and generates a first ray emitted from the camera viewpoint to the target position coordinates and a second ray emitted from the camera viewpoint to the error position coordinates based on the target position coordinates and the error position coordinates, respectively.
[0018] Step S42, the mobile terminal determines whether both the first ray and the second ray have missed the axisymmetric bounding box:
[0019] If so, the three-dimensional model with the axisymmetric bounding box is enlarged by a first preset factor, and then the process returns to step S42;
[0020] If not, proceed to step S43;
[0021] Step S43, the mobile terminal determines whether both the first ray and the second ray hit the axisymmetric bounding box:
[0022] If so, the three-dimensional model with the axisymmetric bounding box is reduced by a second preset factor, and then the process returns to step S42;
[0023] If not, proceed to step S44;
[0024] In step S44, the mobile terminal determines that the coordinates of the two-dimensional coordinates of the preset position point of the three-dimensional model with the axisymmetric bounding box in the projection coordinate system are the target position coordinates, and the three-dimensional model in the projection coordinate system is the actual size, and then displays the three-dimensional model in the projection coordinate system.
[0025] Preferably, the preset position point is the lower left corner of the axisymmetric bounding box;
[0026] The target position coordinates are (-needpx / width, 0), and the error position coordinates are (-needpx / width-z, 0), where z > 0;
[0027] Wherein, needpx represents the screen pixel length, width represents the actual pixel width of the mobile terminal included in the screen information, and z represents the preset error;
[0028] In step S44, when the first ray hits the axisymmetric bounding box and the second ray does not hit the axisymmetric bounding box, the mobile terminal determines that the coordinates of the two-dimensional coordinates of the preset position point of the three-dimensional model with the axisymmetric bounding box on the projection coordinate system are the target position coordinates, and the three-dimensional model in the projection coordinate system is the actual size. Then, the three-dimensional model in the projection coordinate system is displayed.
[0029] The present invention also provides a mobile terminal that displays a three-dimensional model of the actual size of an object to be displayed using the above-described display method, the mobile terminal comprising:
[0030] Storage module, used to save a pre-configured three-dimensional model of the object to be displayed in the model coordinate system, constructed according to the actual size of the object to be displayed;
[0031] A construction module, connected to the storage module, is used to construct the axisymmetric bounding box of the three-dimensional model and process it to obtain the side length of the axisymmetric bounding box in the model coordinate system;
[0032] The side length conversion module, connected to the construction module, is used to obtain its own screen information and process the screen information and each side length to obtain the screen pixel length occupied by each side length.
[0033] The target position determination module, connected to the side length conversion module, is used to place the three-dimensional model with the axisymmetric bounding box at a preset position in the camera coordinate system facing the camera viewpoint, and determine the target position coordinates of the two-dimensional projection point of the preset position point on the axisymmetric bounding box corresponding to the actual size of the three-dimensional model in the projection coordinate system corresponding to the camera coordinate system according to the screen pixel length and the screen information.
[0034] The scaling and display module is connected to the side length conversion module and the target position determination module, respectively. It is used to scale the three-dimensional model with the axisymmetric bounding box so that the coordinates of the two-dimensional coordinates of the preset position point of the three-dimensional model with the axisymmetric bounding box in the projection coordinate system are the target position coordinates, indicating that the three-dimensional model in the projection coordinate system is the true size, and then the three-dimensional model in the projection coordinate system is displayed.
[0035] Preferably, the screen information includes the resolution of the mobile terminal's screen diagonal and the length of the screen diagonal; then the side length conversion module obtains the screen pixel length according to the following formula:
[0036] needpx = length / 2.54 * dp / di
[0037] Wherein, needpx represents the screen pixel length, length represents the side length, dp represents the screen diagonal resolution, and di represents the screen diagonal length.
[0038] Preferably, the scaling and display module includes:
[0039] A ray generation unit is used to generate error position coordinates with a preset error between the target position coordinates and the target position coordinates, and to generate a first ray emitted from the camera viewpoint to the target position coordinates and a second ray emitted from the camera viewpoint to the error position coordinates based on the target position coordinates and the error position coordinates, respectively.
[0040] A scaling control unit, connected to the ray generation unit, is used to enlarge the 3D model with the axisymmetric bounding box by a first preset factor when it is determined that neither the first ray nor the second ray hits the axisymmetric bounding box, and to reduce the 3D model with the axisymmetric bounding box by a second preset factor when it is determined that only one of the first ray and the second ray hits the axisymmetric bounding box, until a display signal is generated.
[0041] The model display unit, connected to the scaling control unit, is used to determine, based on the display signal, the coordinates of the two-dimensional coordinates of the preset position point of the three-dimensional model with the axisymmetric bounding box in the projection coordinate system are the target position coordinates, and the three-dimensional model in the projection coordinate system is the actual size, and then displays the three-dimensional model in the projection coordinate system.
[0042] Preferably, the preset position point is the lower left corner of the axisymmetric bounding box;
[0043] The target position coordinates are (-needpx / width, 0), and the error position coordinates are (-needpx / width-z, 0), where z > 0;
[0044] Wherein, needpx represents the screen pixel length, width represents the actual pixel width of the mobile terminal included in the screen information, and z represents the preset error;
[0045] The scaling control unit generates the display signal when it determines that the first ray hits the axisymmetric bounding box and the second ray does not hit the axisymmetric bounding box.
[0046] The above technical solution has the following advantages or beneficial effects: by constructing a three-dimensional model based on the actual size of the object to be displayed, and by having the mobile terminal read its own screen information, the actual size is converted into screen pixel length. Then, based on the actual size corresponding to the three-dimensional model, the size is adjusted according to the screen size of different mobile terminals, so that the three-dimensional model with the same actual size can be presented on different mobile terminals, so that users can view it and make it convenient for users to choose. Attached Figure Description
[0047] Figure 1 A flowchart illustrating a method for displaying a real-size 3D model is shown in a preferred embodiment of the present invention.
[0048] Figure 2 This is a schematic diagram of a sub-process of step S1 in a preferred embodiment of the present invention.
[0049] Figure 3 This is a schematic diagram of a sub-process of step S4 in a preferred embodiment of the present invention;
[0050] Figure 4 This is a schematic diagram of the structural principle of a mobile terminal in a preferred embodiment of the present invention. Detailed Implementation
[0051] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. The present invention is not limited to this embodiment; other embodiments that conform to the spirit of the present invention may also fall within the scope of the present invention.
[0052] In a preferred embodiment of the present invention, based on the above-mentioned problems existing in the prior art, a method for displaying a real-size 3D model is provided, applied to a mobile terminal, wherein the mobile terminal is pre-configured with a 3D model of the object to be displayed in a model coordinate system, constructed according to the real size of the object to be displayed; such as Figure 1 As shown, the display methods include:
[0053] Step S1: The mobile terminal constructs the axisymmetric bounding box of the 3D model and processes it to obtain the side length of the axisymmetric bounding box in the model coordinate system.
[0054] Step S2: The mobile terminal obtains its own screen information and processes it according to the screen information and the length of each side to obtain the screen pixel length occupied by each side.
[0055] Step S3: The mobile terminal places the 3D model with an axisymmetric bounding box at a preset position in the camera coordinate system facing the camera viewpoint, and determines the target position coordinates of the two-dimensional projection point of the preset position point on the axisymmetric bounding box corresponding to the real size 3D model in the projection coordinate system corresponding to the camera coordinate system based on the screen pixel length and screen information.
[0056] Step S4: The mobile terminal scales the 3D model with an axisymmetric bounding box so that the coordinates of the preset position point of the 3D model with the axisymmetric bounding box in the two-dimensional coordinates of the projection coordinate system are the target position coordinates, indicating that the 3D model in the projection coordinate system is the real size, and then displays the 3D model in the projection coordinate system.
[0057] Specifically, considering that the objects to be displayed are usually irregular objects, such as rings, necklaces, and earrings when this technical solution is applied to the field of jewelry model display, the corresponding objects to be displayed include, but are not limited to, rings, necklaces, and earrings. To facilitate subsequent size conversion and scaling of the 3D model, this embodiment introduces an axisymmetric bounding box as an intermediate tool. It can be understood that since the axisymmetric bounding box is the smallest hexahedron containing the 3D model with its sides parallel to the coordinate axes of the model's coordinate system, subsequent conversion of the side lengths of the axisymmetric bounding box is equivalent to conversion of the corresponding dimensions of the 3D model, and scaling the axisymmetric bounding box is equivalent to synchronous scaling of the 3D model. This facilitates operation and enables compatibility with objects of different shapes, making this technical solution applicable to the display of full-size 3D models of various irregular objects, thus having a wide range of applications.
[0058] More specifically, after constructing the axisymmetric bounding box of the 3D model, the side lengths of the axisymmetric bounding box in the model coordinate system can be calculated. In a preferred embodiment of the present invention, the side lengths of the axisymmetric bounding box in the model coordinate system include length, width, and height, such as... Figure 2 As shown, step S1 includes:
[0059] Step S11: The mobile terminal constructs the axisymmetric bounding box of the 3D model;
[0060] Step S12: The mobile terminal traverses the vertex coordinates of each vertex of the 3D model in the model coordinate system, and counts the maximum and minimum values of the X-axis coordinate, Y-axis coordinate and Z-axis coordinate values of each vertex.
[0061] Step S13: Subtract the minimum value from the maximum value of the X-axis coordinate to obtain the length of the axisymmetric bounding box; subtract the minimum value from the maximum value of the Y-axis coordinate to obtain the width of the axisymmetric bounding box; and subtract the minimum value from the maximum value of the Z-axis coordinate to obtain the height of the axisymmetric bounding box.
[0062] It's understandable that the length, width, and height of the aforementioned axisymmetric bounding box correspond to the actual dimensions of the 3D model. To display these actual dimensions on a mobile terminal's screen, the length, width, and height need to be converted into pixel representations based on the screen size. This means processing the screen information of the mobile terminal to obtain the screen pixel lengths occupied by the aforementioned length, width, and height. To display the actual dimensions of the 3D model on the mobile terminal's screen, it's necessary to know the size of the 3D model on the screen. This size is equivalent to the actual size of the object in reality. The key is to ensure that the model's dimensions match its actual size during the modeling process.
[0063] In a preferred embodiment of the present invention, the screen information includes the resolution and length of the screen diagonal of the mobile terminal; then in step S2, the screen pixel length is obtained according to the following formula:
[0064] needpx = length / 2.54 * dp / di
[0065] Here, needpx represents the screen pixel length, length represents the side length, dp represents the screen diagonal resolution, and di represents the screen diagonal length.
[0066] Specifically, in this embodiment, based on the above formula, the unit (cm) of the side length of the axisymmetric bounding box corresponding to the three-dimensional model is converted to the actual screen unit (pixel) of the mobile terminal, that is, the screen information is automatically mapped to the three-dimensional model.
[0067] Considering that the image displayed on a mobile terminal screen in three-dimensional space can actually correspond to an object called a camera in three-dimensional space, which doesn't actually exist but is merely a concept. Displaying a 3D model on a mobile terminal can be understood as the camera projecting what it "sees" in three-dimensional space onto the mobile terminal screen. Based on this, in this embodiment, the 3D model is placed at a preset position corresponding to the camera, allowing the camera to "see" it, and then the camera maps the image it "sees" onto the mobile terminal screen, thus achieving the display of the 3D model. Further simplifying, the camera can be equated to the mobile terminal screen. Since the 3D model can be converted into corresponding pixels, we can know the proportion of the 3D model on the mobile terminal screen, which is ultimately equivalent to knowing the proportion of the 3D model in the camera. In this way, all problems can be processed in three-dimensional space. Further abstracting, the 3D model is placed at a preset position, preferably on the principal axis ray of the camera's viewpoint, with the area to be displayed of the 3D model facing the camera's viewpoint. Then, the image captured by the camera is treated as a two-dimensional coordinate system with a center point of (0, 0) and a value range of (-1, 1). Then, based on the screen pixel length and screen information, we can determine the target position coordinates of the 2D projection point of the preset position point on the axisymmetric bounding box corresponding to the true size of the 3D model under ideal conditions in the projection coordinate system corresponding to the camera coordinate system. The above ideal condition can be understood as the state in which the 3D model displays its true size, that is, the state we need to ultimately present.
[0068] To convert the 3D model into the aforementioned ideal state, in a preferred embodiment of the present invention, such as... Figure 3 As shown, step S4 includes:
[0069] Step S41: The mobile terminal generates error position coordinates with a preset error between the target position coordinates and the target position coordinates, and generates a first ray emitted from the camera viewpoint to the target position coordinates and a second ray emitted from the camera viewpoint to the error position coordinates based on the target position coordinates and the error position coordinates, respectively.
[0070] Step S42, the mobile terminal determines whether both the first ray and the second ray have missed the axisymmetric bounding box:
[0071] If so, the 3D model with the axisymmetric bounding box is enlarged by a first preset factor, and then the process returns to step S42;
[0072] If not, proceed to step S43;
[0073] Step S43: The mobile terminal determines whether both the first ray and the second ray hit the axisymmetric bounding box.
[0074] If so, the 3D model with the axisymmetric bounding box is reduced by a second preset factor, and then the process returns to step S42.
[0075] If not, proceed to step S44;
[0076] In step S44, the mobile terminal determines that the coordinates of the preset position point of the 3D model with the axisymmetric bounding box in the two-dimensional coordinates of the projected coordinate system are the target position coordinates, and the 3D model in the projected coordinate system is the actual size. Then, the 3D model in the projected coordinate system is displayed.
[0077] In a preferred embodiment of the present invention, the preset position point is the lower left corner of the axisymmetric bounding box;
[0078] The target position coordinates are (-needpx / width, 0), and the error position coordinates are (-needpx / width-z, 0), where z > 0;
[0079] Where needpx represents the screen pixel length, width represents the actual pixel width of the mobile terminal included in the screen information, and z represents the preset error;
[0080] In step S44, when the first ray hits the axisymmetric bounding box and the second ray does not hit the axisymmetric bounding box, the mobile terminal determines that the coordinates of the preset position point of the 3D model with the axisymmetric bounding box in the two-dimensional coordinates of the projection coordinate system are the target position coordinates, and the 3D model in the projection coordinate system is the real size. Then the 3D model in the projection coordinate system is displayed.
[0081] Specifically, in this embodiment, the aforementioned screen pixel length can be understood as the pixel equivalent of the actual size of the x-axis of the axisymmetric bounding box under ideal conditions. Since the target position coordinates of the lower left corner of the axisymmetric bounding box corresponding to the 3D model are fixed, the 3D model can only be scaled accordingly. Scale it until a ray emitted from the camera viewpoint to the screen position (-needpx / width,0) hits exactly the lower left corner of the axisymmetric bounding box of the 3D model. Then, the 3D model in the current projection coordinate system is considered to be of the actual size, and it can then be displayed.
[0082] More specifically, two rays emanating from the camera's viewpoint are needed: the first ray and the second ray. The coordinates of the two rays in the projection coordinate system are (-needpx / width, 0) and (-needpx / width-z, 0), respectively, where z > 0. Here, the value of z (z > 0) is the error, used to help determine whether the ray hits the lower left corner of the axisymmetric bounding box corresponding to the 3D model.
[0083] Since the preset position point is the lower left corner of the axisymmetric bounding box, its right side is the axisymmetric bounding box, and its left side is outside the coverage area of the axisymmetric bounding box, and z>0, this indicates that the error position coordinates are to the left of the target position coordinates. Based on this, a loop mechanism can be set up to adjust the scaling of the 3D model towards the ideal situation, specifically:
[0084] When the first and second rays do not hit the axisymmetric bounding box, it means that the lower left corner of the 3D model is to the right of the target position coordinates and the error position coordinates. The 3D model needs to be enlarged by a certain factor so that the lower left corner point moves to the left in the projected coordinate system so that it is located between the target position coordinates and the error position coordinates.
[0085] When the first and second rays hit the axisymmetric bounding box, it means that the lower left corner of the 3D model has moved too far to the left, or even to the left of the position coordinate error. Therefore, the 3D model needs to be reduced by a certain factor so that the lower left corner moves to the right in the projected coordinate system.
[0086] When the first ray hits the axisymmetric bounding box but the second ray does not, it means that the lower left corner point is located between the target position coordinates and the error position coordinates in the projected coordinate system. This indicates that the 3D model has reached the above ideal state under a certain error, and can then be displayed.
[0087] It is understandable that the preset position point is not limited to the lower left corner point; you only need to adjust the target position coordinates and the error position coordinates accordingly.
[0088] This invention also provides a mobile terminal that uses the above-described display method to display a three-dimensional model of the actual size of the object to be displayed, such as... Figure 4As shown, the mobile terminal includes:
[0089] Storage module 1 is used to save a pre-configured 3D model of the object to be displayed in the model coordinate system, constructed according to the actual size of the object to be displayed.
[0090] Module 2 is connected to storage module 1 and is used to construct the axisymmetric bounding box of the 3D model and process it to obtain the side length of the axisymmetric bounding box in the model coordinate system.
[0091] Side length conversion module 3, connected to construction module 2, is used to obtain its own screen information and process the screen information and each side length to obtain the screen pixel length occupied by each side length.
[0092] The target position determination module 4 is connected to the side length conversion module 3. It is used to place the 3D model with the axisymmetric bounding box at a preset position in the camera coordinate system facing the camera viewpoint, and determine the target position coordinates of the two-dimensional projection point of the preset position point on the axisymmetric bounding box corresponding to the real size 3D model in the projection coordinate system corresponding to the camera coordinate system according to the screen pixel length and screen information.
[0093] The scaling and display module 5 is connected to the side length conversion module 3 and the target position determination module 4, respectively. It is used to scale the 3D model with an axisymmetric bounding box so that the coordinates of the preset position point of the 3D model with the axisymmetric bounding box in the two-dimensional coordinates of the projection coordinate system are the target position coordinates, indicating that the 3D model in the projection coordinate system is the real size. Then the 3D model in the projection coordinate system is displayed.
[0094] In a preferred embodiment of the present invention, the screen information includes the resolution and length of the screen diagonal of the mobile terminal; then the side length conversion module processes the data according to the following formula to obtain the screen pixel length:
[0095] needpx = length / 2.54 * dp / di
[0096] Here, needpx represents the screen pixel length, length represents the side length, dp represents the screen diagonal resolution, and di represents the screen diagonal length.
[0097] In a preferred embodiment of the present invention, the scaling and display module 5 includes:
[0098] The ray generation unit 51 is used to generate error position coordinates with a preset error between the target position coordinates and the target position coordinates, and to generate a first ray emitted from the camera viewpoint to the target position coordinates and a second ray emitted from the camera viewpoint to the error position coordinates based on the target position coordinates and the error position coordinates, respectively.
[0099] The scaling control unit 52 is connected to the ray generation unit 51. When it is determined that neither the first ray nor the second ray hits the axisymmetric bounding box, the 3D model with the axisymmetric bounding box is enlarged by a first preset factor. When it is determined that both the first ray and the second ray hit the axisymmetric bounding box, the 3D model with the axisymmetric bounding box is reduced by a second preset factor until it is determined that only one of the first ray and the second ray hits the axisymmetric bounding box, and a display signal is generated.
[0100] The model display unit 53 is connected to the scaling control unit 52. It is used to determine the coordinates of the two-dimensional coordinates of the preset position point of the three-dimensional model with the axisymmetric bounding box in the projection coordinate system according to the display signal. The three-dimensional model in the projection coordinate system is the real size, and then the three-dimensional model in the projection coordinate system is displayed.
[0101] In a preferred embodiment of the present invention, the preset position point is the lower left corner of the axisymmetric bounding box;
[0102] The target position coordinates are (-needpx / width, 0), and the error position coordinates are (-needpx / width-z, 0), where z > 0;
[0103] Where needpx represents the screen pixel length, width represents the actual pixel width of the mobile terminal included in the screen information, and z represents the preset error;
[0104] The scaling control unit 52 generates a display signal when it determines that the first ray hits the axisymmetric bounding box and the second ray does not hit the axisymmetric bounding box.
[0105] The above description is merely a preferred embodiment of the present invention and does not limit the implementation and protection scope of the present invention. Those skilled in the art should realize that any equivalent substitutions and obvious changes made using the content of this specification and illustrations should be included within the protection scope of the present invention.
Claims
1. A method for displaying a true-size 3D model, characterized in that, Applied to a mobile terminal, wherein the mobile terminal is pre-configured with a 3D model of the object to be displayed in a model coordinate system, constructed according to the actual size of the object to be displayed; then the display method includes: Step S1: The mobile terminal constructs the axisymmetric bounding box of the three-dimensional model and processes it to obtain the side length of the axisymmetric bounding box in the model coordinate system. Step S2: The mobile terminal obtains its own screen information and processes it according to the screen information and each side length to obtain the screen pixel length occupied by each side length. Step S3: The mobile terminal places the 3D model with the axisymmetric bounding box at a preset position in the camera coordinate system facing the camera viewpoint, and determines the target position coordinates of the two-dimensional projection point of the preset position point on the axisymmetric bounding box corresponding to the actual size of the 3D model in the projection coordinate system corresponding to the camera coordinate system according to the screen pixel length and the screen information. Step S4: The mobile terminal scales the 3D model with the axisymmetric bounding box so that the coordinates of the two-dimensional coordinates of the preset position point of the 3D model with the axisymmetric bounding box in the projection coordinate system are the target position coordinates, indicating that the 3D model in the projection coordinate system is the true size, and then displays the 3D model in the projection coordinate system. The screen information includes the resolution of the mobile terminal's screen diagonal and the length of the screen diagonal; therefore, in step S2, the screen pixel length is obtained according to the following formula: ; in, Used to represent the screen pixel length Used to represent the side length, Used to indicate the resolution of the screen diagonal. Used to indicate the length of the screen's diagonal.
2. The display method according to claim 1, characterized in that, The side length of the axisymmetric bounding box in the model coordinate system includes length, width, and height. Step S1 includes: Step S11, the mobile terminal constructs the axisymmetric bounding box of the three-dimensional model; Step S12: The mobile terminal traverses the vertex coordinates of each vertex of the three-dimensional model in the model coordinate system, and respectively counts the maximum and minimum values of the X-axis coordinate, Y-axis coordinate and Z-axis coordinate values of each vertex coordinate. Step S13: The maximum value of the X-axis coordinate minus the minimum value of the X-axis coordinate is used as the length of the axisymmetric bounding box; the maximum value of the Y-axis coordinate minus the minimum value of the Y-axis coordinate is used as the width of the axisymmetric bounding box; and the maximum value of the Z-axis coordinate minus the minimum value of the Z-axis coordinate is used as the height of the axisymmetric bounding box.
3. The display method according to claim 1, characterized in that, In step S3, the preset position is on the main axis ray of the camera viewpoint, and the area to be displayed of the three-dimensional model is directly opposite the camera viewpoint.
4. The display method according to claim 1, characterized in that, Step S4 includes: Step S41: The mobile terminal generates error position coordinates with a preset error between the target position coordinates and the target position coordinates, and generates a first ray emitted from the camera viewpoint to the target position coordinates and a second ray emitted from the camera viewpoint to the error position coordinates based on the target position coordinates and the error position coordinates, respectively. Step S42, the mobile terminal determines whether both the first ray and the second ray have missed the axisymmetric bounding box: If so, the three-dimensional model with the axisymmetric bounding box is enlarged by a first preset factor, and then the process returns to step S42; If not, proceed to step S43; Step S43, the mobile terminal determines whether both the first ray and the second ray hit the axisymmetric bounding box: If so, the three-dimensional model with the axisymmetric bounding box is reduced by a second preset factor, and then the process returns to step S42; If not, proceed to step S44; In step S44, the mobile terminal determines that the coordinates of the two-dimensional coordinates of the preset position point of the three-dimensional model with the axisymmetric bounding box in the projection coordinate system are the target position coordinates, and the three-dimensional model in the projection coordinate system is the actual size, and then displays the three-dimensional model in the projection coordinate system.
5. The display method according to claim 4, characterized in that, The preset position point is the lower left corner of the axisymmetric bounding box; The target location coordinates are: The coordinates of the error location are ; in, Used to represent the screen pixel length Used to represent the actual pixel width of the mobile terminal included in the screen information. Used to represent the preset error; In step S44, when the first ray hits the axisymmetric bounding box and the second ray does not hit the axisymmetric bounding box, the mobile terminal determines that the coordinates of the two-dimensional coordinates of the preset position point of the three-dimensional model with the axisymmetric bounding box on the projection coordinate system are the target position coordinates, and the three-dimensional model in the projection coordinate system is the actual size. Then, the three-dimensional model in the projection coordinate system is displayed.
6. A mobile terminal, characterized in that, The mobile terminal displays a three-dimensional model of the actual size of the object to be displayed using the display method described in any one of claims 1-5, wherein the mobile terminal comprises: Storage module, used to save a pre-configured three-dimensional model of the object to be displayed in the model coordinate system, constructed according to the actual size of the object to be displayed; A construction module, connected to the storage module, is used to construct the axisymmetric bounding box of the three-dimensional model and process it to obtain the side length of the axisymmetric bounding box in the model coordinate system; The side length conversion module, connected to the construction module, is used to obtain its own screen information and process the screen information and each side length to obtain the screen pixel length occupied by each side length. The target position determination module, connected to the side length conversion module, is used to place the three-dimensional model with the axisymmetric bounding box at a preset position in the camera coordinate system facing the camera viewpoint, and determine the target position coordinates of the two-dimensional projection point of the preset position point on the axisymmetric bounding box corresponding to the actual size of the three-dimensional model in the projection coordinate system corresponding to the camera coordinate system according to the screen pixel length and the screen information. The scaling and display module is connected to the side length conversion module and the target position determination module, respectively. It is used to scale the three-dimensional model with the axisymmetric bounding box so that the coordinates of the two-dimensional coordinates of the preset position point of the three-dimensional model with the axisymmetric bounding box in the projection coordinate system are the target position coordinates, indicating that the three-dimensional model in the projection coordinate system is the true size, and then the three-dimensional model in the projection coordinate system is displayed.
7. The mobile terminal according to claim 6, characterized in that, The screen information includes the resolution of the mobile terminal's screen diagonal and the length of the screen diagonal; then the side length conversion module processes the data according to the following formula to obtain the screen pixel length: ; in, Used to represent the screen pixel length Used to represent the side length, Used to indicate the resolution of the screen diagonal. Used to indicate the length of the screen's diagonal.
8. The mobile terminal according to claim 6, characterized in that, The scaling and display module includes: A ray generation unit is used to generate error position coordinates with a preset error between the target position coordinates and the target position coordinates, and to generate a first ray emitted from the camera viewpoint to the target position coordinates and a second ray emitted from the camera viewpoint to the error position coordinates based on the target position coordinates and the error position coordinates, respectively. A scaling control unit, connected to the ray generation unit, is used to enlarge the 3D model with the axisymmetric bounding box by a first preset factor when it is determined that neither the first ray nor the second ray hits the axisymmetric bounding box, and to reduce the 3D model with the axisymmetric bounding box by a second preset factor when it is determined that only one of the first ray and the second ray hits the axisymmetric bounding box, until a display signal is generated. The model display unit, connected to the scaling control unit, is used to determine, based on the display signal, the coordinates of the two-dimensional coordinates of the preset position point of the three-dimensional model with the axisymmetric bounding box in the projection coordinate system are the target position coordinates, and the three-dimensional model in the projection coordinate system is the actual size, and then displays the three-dimensional model in the projection coordinate system.
9. The mobile terminal according to claim 8, characterized in that, The preset position point is the lower left corner of the axisymmetric bounding box; The target location coordinates are: The coordinates of the error location are ; in, Used to represent the screen pixel length Used to represent the actual pixel width of the mobile terminal included in the screen information. Used to represent the preset error; The scaling control unit generates the display signal when it determines that the first ray hits the axisymmetric bounding box and the second ray does not hit the axisymmetric bounding box.
Citation Information
Patent Citations
Model size control algorithm under AR
CN108777000A
Three-dimensional image rendering method, device and equipment and readable storage medium
CN111476876A