Element rendering method in three-dimensional model, terminal equipment and storage medium

By rendering three-dimensional models and labeled elements in a three-dimensional scene and adjusting the display status of labeled elements according to the perspective, the problem of unreasonable display of three-dimensional models and labeled elements in certain perspectives is solved, improving user experience and improving performance.

CN119648883APending Publication Date: 2025-03-18ZHEJIANG SUPCON INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411699529.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In 3D visualization projects, the display of 3D models and labeled elements is not reasonable enough in some perspectives, reducing the user experience.

Method used

By rendering the three-dimensional model and labeled elements in a three-dimensional scene, and in response to the viewing angle adjustment operation, the direction information and distance information of the virtual camera to the labeled elements are determined, and the emitted rays detect the collision between the three-dimensional model and the rays, and the display status of the labeled elements is adjusted to avoid occlusion.

Benefits of technology

Ensure that the display of annotated elements and 3D models is more reasonable, improves user experience, and improves performance through optimized calculations only when viewing angles are adjusted.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648883A_ABST
    Figure CN119648883A_ABST
Patent Text Reader

Abstract

The invention provides an element rendering method in a three-dimensional model, terminal equipment and a storage medium, and relates to the technical field of rendering. The method for rendering the elements in the three-dimensional model comprises the following steps: rendering the three-dimensional model and annotation elements of the three-dimensional model in a three-dimensional scene; in response to a view angle adjustment operation of the three-dimensional scene, determining direction information and distance information from the virtual camera to the annotation element according to a first position of the virtual camera and a second position of the annotation element under a target view angle corresponding to the view angle adjustment operation; emitting rays from the first position to the second position according to the direction information and the distance information; and if the three-dimensional model collides with the ray, determining that the labeling element is in a shielded state, and adjusting the display state of the labeling element relative to the three-dimensional model. And if the annotation element is in the shielded state, the display state of the annotation element relative to the three-dimensional model is adjusted, so that the annotation element and the three-dimensional model are displayed more reasonably, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of rendering technology, and in particular to a method for rendering elements in a three-dimensional model, a terminal device, and a storage medium. Background Art

[0002] In 3D visualization project applications, there is generally a need to display the 3D model on the browser page and then mark the specific positions or important areas of the 3D model. The markings are displayed using elements.

[0003] In the related art, in a three-dimensional space, elements used for annotation can be displayed around a three-dimensional model. However, in some viewing angles, the display of the three-dimensional model and the annotation elements is not reasonable, which reduces the user experience. Summary of the invention

[0004] The purpose of this application is to provide a method for rendering elements in a three-dimensional model, a terminal device and a storage medium in order to solve the technical problems existing in the related technology in view of the deficiencies in the above-mentioned prior art.

[0005] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0006] In a first aspect, an embodiment of the present application provides a method for rendering elements in a three-dimensional model, comprising:

[0007] Rendering a three-dimensional model and annotated elements of the three-dimensional model in a three-dimensional scene;

[0008] In response to the perspective adjustment operation of the three-dimensional scene, according to the first position of the virtual camera and the second position of the annotated element at a target perspective corresponding to the perspective adjustment operation, determine the direction information and distance information from the virtual camera to the annotated element;

[0009] emitting a ray from the first position to the second position according to the direction information and the distance information;

[0010] If the three-dimensional model collides with the ray, it is determined that the annotation element is in an obstructed state, and the display state of the annotation element relative to the three-dimensional model is adjusted.

[0011] Optionally, the adjusting the display status of the annotation element relative to the three-dimensional model includes:

[0012] hiding the display of the annotation element;

[0013] Alternatively, the display transparency of the annotation element is reduced, and the position of the annotation element in the three-dimensional scene is adjusted.

[0014] Optionally, the number of the three-dimensional models and the number of the annotation elements are both multiple;

[0015] After responding to the perspective adjustment operation of the three-dimensional scene and determining the direction information and distance information from the virtual camera to the annotated element according to the first position of the virtual camera and the second position of the annotated element at a target perspective corresponding to the perspective adjustment operation, the method further includes:

[0016] Sorting the annotation elements according to the distance information corresponding to the annotation elements to obtain a sorting result;

[0017] According to the sorting result, each of the marked elements is added to a preset array;

[0018] Determine, according to the length of the preset array and the order of each of the annotation elements in the sorting result, a target display level of each of the annotation elements, wherein the target display level is used to indicate a front-to-back position relationship of the annotation element in the line of sight of the virtual camera in the three-dimensional scene;

[0019] The display level of each of the annotation elements in the three-dimensional scene is updated to a target display level.

[0020] Optionally, the rendering of the three-dimensional model in the three-dimensional scene and the annotation elements corresponding to the three-dimensional model in the three-dimensional model include:

[0021] Rendering the three-dimensional model in the three-dimensional scene;

[0022] Calculating the normalized device space coordinates of the annotation element according to the preset three-dimensional coordinates of the annotation element in the three-dimensional scene and the attribute information of the virtual camera;

[0023] The normalized device space coordinates are mapped to a viewport coordinate system, and the annotation elements are rendered in the three-dimensional scene.

[0024] Optionally, calculating the normalized device space coordinates of the annotation element according to the preset three-dimensional coordinates of the annotation element in the three-dimensional scene and the attribute information of the virtual camera includes:

[0025] Determining homogeneous coordinates of the annotation element according to preset three-dimensional coordinates of the annotation element in the three-dimensional scene;

[0026] Calculate the coordinates of the annotation element in the homogeneous clipping space according to the homogeneous coordinates, the view matrix and the projection matrix of the virtual camera;

[0027] The normalized device space coordinates are calculated according to the coordinates in the homogeneous clipping space.

[0028] Optionally, mapping the normalized device space coordinates into a viewport coordinate system and rendering the annotation element in the three-dimensional scene includes:

[0029] Calculating the target viewport coordinates of the annotation element in the viewport coordinate system according to the normalized device space coordinates and a preset viewport size;

[0030] Determine the initial viewport coordinates of the annotation element in the viewport coordinate system;

[0031] According to the initial viewport coordinates, the annotation element is set at a position corresponding to the target viewport coordinates in the viewport coordinate system, and the annotation element is rendered in the three-dimensional scene.

[0032] Optionally, determining the initial viewport coordinates of the annotation element in the viewport coordinate system includes:

[0033] Setting the center point of the annotation element at the origin of the viewport coordinate system;

[0034] The position of the center point of the annotation element in the viewport coordinate system is used as the initial viewport coordinate of the annotation element in the viewport coordinate system.

[0035] Optionally, the method further comprises:

[0036] Determining whether the normalized device space coordinates exceed a preset range;

[0037] If it exceeds the preset range, the annotation element is hidden in the three-dimensional scene.

[0038] In a second aspect, an embodiment of the present application further provides a terminal device, comprising: a memory and a processor, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, the method for rendering elements in a three-dimensional model as described in any one of the first aspects above is implemented.

[0039] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is read and executed, the method for rendering elements in a three-dimensional model as described in any one of the first aspects above is implemented.

[0040] In a fourth aspect, an embodiment of the present application further provides a device for rendering elements in a three-dimensional model, including:

[0041] A rendering module, used for rendering the three-dimensional model and the annotated elements of the three-dimensional model in the three-dimensional scene;

[0042] A first determination module is used to respond to the perspective adjustment operation of the three-dimensional scene, and determine the direction information and distance information from the virtual camera to the annotated element according to the first position of the virtual camera and the second position of the annotated element under the target perspective corresponding to the perspective adjustment operation;

[0043] A transmitting module, configured to transmit a ray from the first position to the second position according to the direction information and the distance information;

[0044] The adjustment module is used to determine that the annotation element is in an obstructed state if the three-dimensional model collides with the ray, and adjust the display state of the annotation element relative to the three-dimensional model.

[0045] Optionally, the adjustment module is specifically configured to hide the display of the annotation element; or to reduce the display transparency of the annotation element and adjust the position of the annotation element in the three-dimensional scene.

[0046] Optionally, the number of the three-dimensional models and the number of the annotation elements are both plural; and the device further comprises:

[0047] A sorting module, used to sort the annotation elements according to the distance information corresponding to the annotation elements to obtain a sorting result;

[0048] An adding module, used for adding each of the marked elements to a preset array according to the sorting result;

[0049] A second determination module, configured to determine a target display level of each of the annotation elements according to the length of the preset array and the order of each of the annotation elements in the sorting result, wherein the target display level is used to indicate a front-to-back position relationship of the annotation element in the line of sight direction of the virtual camera in the three-dimensional scene;

[0050] An updating module is used to update the display level of each of the annotation elements in the three-dimensional scene to a target display level.

[0051] Optionally, the rendering module is specifically used to render the three-dimensional model in the three-dimensional scene; calculate the normalized device space coordinates of the annotation element according to the preset three-dimensional coordinates of the annotation element in the three-dimensional scene and the attribute information of the virtual camera; map the normalized device space coordinates in the viewport coordinate system, and render the annotation element in the three-dimensional scene.

[0052] Optionally, the rendering module is specifically used to determine the homogeneous coordinates of the annotation element according to the preset three-dimensional coordinates of the annotation element in the three-dimensional scene; calculate the coordinates of the annotation element in the homogeneous clipping space according to the homogeneous coordinates, the view matrix and the projection matrix of the virtual camera; and calculate the normalized device space coordinates according to the coordinates in the homogeneous clipping space.

[0053] Optionally, the rendering module is specifically used to calculate the target viewport coordinates of the annotation element in the viewport coordinate system based on the normalized device space coordinates and a preset viewport size; determine the initial viewport coordinates of the annotation element in the viewport coordinate system; set the annotation element at a position corresponding to the target viewport coordinates in the viewport coordinate system based on the initial viewport coordinates, and render the annotation element in the three-dimensional scene.

[0054] Optionally, the rendering module is specifically used to set the center point of the annotation element at the origin of the viewport coordinate system; and use the position of the center point of the annotation element in the viewport coordinate system as the initial viewport coordinate of the annotation element in the viewport coordinate system.

[0055] Optionally, the device further comprises:

[0056] A determination module, used to determine whether the normalized device space coordinates exceed a preset range;

[0057] A hiding module is used to hide the annotation element in the three-dimensional scene if it exceeds the preset range.

[0058] The beneficial effects of the present application are as follows: the present application embodiment provides a method for rendering elements in a three-dimensional model, the method may include: rendering a three-dimensional model and annotated elements of the three-dimensional model in a three-dimensional scene; responding to a perspective adjustment operation of the three-dimensional scene, determining direction information and distance information from the virtual camera to the annotated element according to the first position of the virtual camera and the second position of the annotated element under the target perspective corresponding to the perspective adjustment operation; emitting a ray from the first position to the second position according to the direction information and the distance information; if the three-dimensional model collides with the ray, determining that the annotated element is in an obscured state, and adjusting the display state of the annotated element relative to the three-dimensional model. When the perspective of the three-dimensional scene is adjusted, based on the direction information and the distance information between the virtual camera and the annotated element, a ray is emitted from the position of the virtual camera to the position of the annotated element, so as to determine whether the annotated element is obscured by the three-dimensional model, and if the annotated element is in an obscured state, adjusting the display state of the annotated element relative to the three-dimensional model, so that the display of the annotated element and the three-dimensional model is more reasonable, and the user experience is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0060] Figure 1 A schematic diagram of a method for rendering elements in a three-dimensional model provided in an embodiment of the present application Figure 1 ;

[0061] Figure 2 A schematic diagram of a method for rendering elements in a three-dimensional model provided in an embodiment of the present application Figure 2 ;

[0062] Figure 3 A schematic diagram of displaying a three-dimensional scene provided in an embodiment of the present application;

[0063] Figure 4 A schematic diagram of a method for rendering elements in a three-dimensional model provided in an embodiment of the present application Figure 3 ;

[0064] Figure 5 A schematic diagram of a method for rendering elements in a three-dimensional model provided in an embodiment of the present application Figure 4 ;

[0065] Figure 6 A schematic diagram of a method for rendering elements in a three-dimensional model provided in an embodiment of the present application Figure 5 ;

[0066] Figure 7 A schematic diagram of a viewport coordinate system provided in an embodiment of the present application;

[0067] Figure 8 A schematic diagram of an NDC space XY plane coordinate system provided in an embodiment of the present application;

[0068] Fig. 9 A schematic diagram of a method for rendering elements in a three-dimensional model provided in an embodiment of the present application Figure 6 ;

[0069] Fig.10a A schematic diagram of the position relationship between a viewport coordinate system and annotation elements provided in an embodiment of the present application Figure 1 ;

[0070] Fig.10b A schematic diagram of the position relationship between a viewport coordinate system and annotation elements provided in an embodiment of the present application Figure 2 ;

[0071] Fig.10c A schematic diagram of the position relationship between a viewport coordinate system and annotation elements provided in an embodiment of the present application Figure 3 ;

[0072] Fig.11 A schematic diagram of a method for rendering elements in a three-dimensional model provided in an embodiment of the present application Figure 7 ;

[0073] Fig.12 A schematic diagram of the structure of a device for rendering elements in a three-dimensional model provided in an embodiment of the present application;

[0074] Fig.13 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0075] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.

[0076] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0077] In the description of the present application, it should be noted that if the terms "upper", "lower", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the drawings, or is the orientation or position relationship in which the product of the application is usually placed when used. It is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application.

[0078] In addition, the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0079] It should be noted that, in the absence of conflict, the features in the embodiments of the present application may be combined with each other.

[0080] An embodiment of the present application provides a method for rendering elements in a three-dimensional model, which is applied to a terminal device, and the terminal device can be any one of the following: a computer, a laptop, a tablet computer, a smart phone, etc.

[0081] The following is an explanation of a method for rendering elements in a three-dimensional model provided in an embodiment of the present application.

[0082] Figure 1 A schematic diagram of a method for rendering elements in a three-dimensional model provided in an embodiment of the present application Figure 1 ,like Figure 1 As shown, the method may include:

[0083] S101: Rendering a three-dimensional model and annotation elements of the three-dimensional model in a three-dimensional scene.

[0084] The 3D model and the annotation elements of the 3D model have corresponding 3D coordinates in the 3D scene. During the initial rendering, the positional relationship between the 3D model and the annotation elements of the 3D model indicated by the 3D coordinates is not considered, and the annotation elements are displayed in front of the 3D model, that is, the annotation elements visually block the 3D model.

[0085] It should be noted that there is a spatial relationship between the annotation elements and the 3D model, which ensures that as the virtual camera's perspective moves, the annotation elements can still maintain the correct positional relationship with the 3D model. This avoids the problem that after the virtual camera's perspective moves, the 3D model moves with the virtual camera's perspective, while the annotation elements remain in their original positions, resulting in an incorrect positional relationship between the annotation elements and the 3D model.

[0086] Optionally, the annotation element of the three-dimensional model can be a DIV element, wherein DIV is an html (Hypertext Markup Language) element, used to create a block-level element, and is a general container that can contain text, images, and any type of html content.

[0087] S102, responding to a perspective adjustment operation of a three-dimensional scene, determining direction information and distance information from the virtual camera to the annotated element according to a first position of the virtual camera and a second position of the annotated element under a target perspective corresponding to the perspective adjustment operation.

[0088] In the embodiment of the present application, in response to the perspective adjustment operation of the three-dimensional scene, the position and / or orientation of the virtual camera in the three-dimensional scene changes, thereby achieving the adjustment of the perspective, and the adjusted perspective is the target perspective. The first position of the virtual camera under the target perspective refers to the three-dimensional coordinates of the virtual camera in the three-dimensional scene under the target perspective; the second position of the annotated element under the target perspective refers to the three-dimensional coordinates of the annotated element in the three-dimensional scene under the target perspective.

[0089] In some embodiments, direction information and distance information are calculated from the three-dimensional coordinates of the virtual camera in the three-dimensional scene from the target perspective to the three-dimensional coordinates of the annotated element in the three-dimensional scene from the target perspective, wherein the direction information needs to be normalized to obtain normalized direction information.

[0090] In addition, the distance information may be recorded as distance, and the normalized direction information may be recorded as direction.

[0091] S103: emitting rays from the first position to the second position according to the direction information and the distance information.

[0092] The purpose of emitting rays from the first position to the second position is to determine the positional relationship between the three-dimensional model and the annotation element.

[0093] It is worth noting that, from the first position of the virtual camera in the three-dimensional scene from the target perspective, along the direction corresponding to the direction information, a ray with a length equal to the distance corresponding to the distance information is emitted to the second position of the marked element in the three-dimensional scene from the target perspective.

[0094] In practical applications, since the annotation elements have three-dimensional coordinates, it is possible to detect whether a collision occurs between the three-dimensional model and the annotation elements through ray detection. When the viewing angle of the three-dimensional scene changes, that is, when the virtual camera moves or rotates, rays can be emitted for detection.

[0095] S104: If the three-dimensional model collides with the ray, it is determined that the annotation element is in an obscured state, and the display state of the annotation element relative to the three-dimensional model is adjusted.

[0096] In the embodiment of the present application, after the above-mentioned process of S103, it can be determined whether a collision occurs between the three-dimensional model and the ray; if the three-dimensional model collides with the ray, it means that the three-dimensional coordinates of the annotation element and the three-dimensional model indicate that the three-dimensional model actually blocks the annotation element. However, usually when the three-dimensional model and the annotation element are initially rendered in the above-mentioned S101, regardless of the positional relationship between the three-dimensional model and the three-dimensional coordinates of the annotation element of the three-dimensional model, the annotation element is displayed in front of the three-dimensional model. In this way, in the case where the three-dimensional model actually blocks the annotation element, an unreasonable display problem will occur, and it is necessary to adjust the display status of the annotation element relative to the three-dimensional model.

[0097] Among them, in view of the situation where the three-dimensional model actually obscures the annotation element, the annotation element is displayed in front of the three-dimensional model during the initial rendering. The display status of the annotation element relative to the three-dimensional model is adjusted here in order to reduce the annotation element from obstructing the three-dimensional model during display.

[0098] In addition, if the 3D model does not collide with the ray, it means that the 3D model does not obstruct the annotation element. In other words, it is correct to display the annotation element in front of the 3D model during the initial rendering. In this case, there is no need to adjust the display status of the annotation element relative to the 3D model.

[0099] In summary, the embodiment of the present application provides a method for rendering elements in a three-dimensional model, which may include: rendering a three-dimensional model and annotated elements of the three-dimensional model in a three-dimensional scene; responding to a perspective adjustment operation of the three-dimensional scene, determining direction information and distance information from the virtual camera to the annotated element according to the first position of the virtual camera and the second position of the annotated element under the target perspective corresponding to the perspective adjustment operation; emitting a ray from the first position to the second position according to the direction information and the distance information; if the three-dimensional model collides with the ray, determining that the annotated element is in an obscured state, and adjusting the display state of the annotated element relative to the three-dimensional model. When the perspective of the three-dimensional scene is adjusted, based on the direction information and the distance information between the virtual camera and the annotated element, a ray is emitted from the position of the virtual camera to the position of the annotated element, so as to determine whether the annotated element is obscured by the three-dimensional model. If the annotated element is in an obscured state, the display state of the annotated element relative to the three-dimensional model is adjusted, so that the display of the annotated element and the three-dimensional model is more reasonable, and the user experience is improved.

[0100] Moreover, the calculations from S102 to S104 are only performed when the viewing angle is adjusted, that is, when the position or orientation of the virtual camera changes, without the need to refresh all the time, which can improve performance.

[0101] Optionally, the process of adjusting the display status of the annotation element relative to the three-dimensional model in S104 may include:

[0102] Hide the display of annotation elements; or, reduce the display transparency of annotation elements.

[0103] Among them, hiding the display of annotation elements so that only the three-dimensional model is displayed can avoid the situation where the three-dimensional model actually blocks the annotation elements, while the annotation elements are displayed in front of the three-dimensional model during preliminary rendering, causing unreasonable display problems.

[0104] In addition, during the initial rendering, the annotation element is displayed in front of the 3D model, and the 3D coordinates of the annotation element and the 3D model indicate that the 3D model actually blocks the annotation element. In view of this unreasonable display, the display transparency of the annotation element can be reduced to reduce the blocking of the 3D model by the annotation element. Moreover, this can realize the distinguishing display of the annotation element and other annotation elements. Other annotation elements refer to elements that are not actually blocked by the 3D model, making the display of the 3D model and the annotation element more reasonable.

[0105] It should be noted that only the display transparency of the annotation element is reduced, and the display position of the annotation element remains unchanged, that is, the annotation element can still be displayed in front of the three-dimensional model. When the user observes the annotation element with reduced transparency, he can confirm that the annotation element is actually located behind the three-dimensional model.

[0106] Optionally, the number of the three-dimensional models and the number of the annotation elements are both plural.

[0107] In an embodiment of the present application, multiple three-dimensional models can be set in a three-dimensional scene according to actual needs, and each three-dimensional model has a corresponding annotation element, so the number of annotation elements is also multiple.

[0108] Figure 2 A schematic diagram of a method for rendering elements in a three-dimensional model provided in an embodiment of the present application Figure 2 ,like Figure 2 As shown, in the above S102, in response to the perspective adjustment operation of the three-dimensional scene, after determining the direction information and distance information from the virtual camera to the annotated element according to the first position of the virtual camera and the second position of the annotated element under the target perspective corresponding to the perspective adjustment operation, the method may further include:

[0109] S201 , sorting the annotation elements according to the distance information corresponding to the annotation elements to obtain a sorting result.

[0110] In some implementations, the annotation elements are sorted from small to large according to the distance values ​​indicated by the distance information corresponding to each annotation element to obtain a sorting result.

[0111] S202: Add each marked element to a preset array according to the sorting result.

[0112] It should be noted that the preset array can be represented as Div Elements. Based on the order of the multiple annotation elements indicated in the sorting result, each annotation element is sequentially added to the preset array.

[0113] S203 : Determine a target display level of each annotation element according to the length of the preset array and the order of each annotation element in the sorting result.

[0114] S204: Update the display level of each annotation element in the three-dimensional scene to the target display level.

[0115] The target display level is used to indicate the front-to-back position relationship of the annotation element in the line of sight of the virtual camera in the three-dimensional scene.

[0116] In the embodiment of the present application, the preset array is traversed in a loop, and the target display level of the currently traversed annotation element is determined according to the length of the preset array and the order of the currently traversed annotation element in the sorting result. When the traversal of each annotation element is completed, the target display level of each annotation element can be obtained.

[0117] In addition, the current display level of each target element can be the same, and the current display level of each annotation element in the three-dimensional scene can be updated to the target display level. Based on the target display level of each annotation element, the attribute value of the display style of each annotation element can be determined, and each annotation element is displayed according to the attribute value of the display style of each annotation element.

[0118] In some implementations, the length of the preset array is recorded as MaxOrder, the length of the sorted preset array is traversed in a loop, the order of the annotation elements in the sorted result is recorded as Index, the annotation elements are recorded as Div Element, and then the z Index attribute (i.e., the attribute value of the display style) is set for the style of each annotation element to ensure that each annotation element can be covered and displayed in order of distance from the virtual camera from near to far. The z Index attribute value of each annotation element style is:

[0119] Div Element.style.z Index=Max Order-Index

[0120] The closer the distance between the annotation element and the virtual camera is, the larger the z Index value of the annotation element is.

[0121] In summary, the embodiment of the present application can realize that each annotation element can be displayed in a covering manner according to the distance from the virtual camera from near to far. That is, the annotation element close to the virtual camera will cover the annotation element far from the virtual camera, which makes the display between the annotation elements more reasonable.

[0122] Figure 3 A schematic diagram of a three-dimensional scene display provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the 3D scene includes multiple 3D models and the annotation elements corresponding to each 3D model. The multiple 3D models include: 3D model a, 3D model b, 3D model c, and 3D model d; the annotation element a corresponding to the 3D model a can display residential house 2, the annotation element b corresponding to the 3D model b can display residential house 1, the annotation element c corresponding to the 3D model c can display a factory building, and the annotation element d corresponding to the 3D model d can display a service center.

[0123] Among them, the distance between the annotation element a and the virtual camera is closer than the distance between the annotation element b and the virtual camera, so the annotation element a blocks the annotation element b.

[0124] In addition, because the 3D model c blocks the annotation element c in this viewing angle, the annotation element c is displayed in front of the 3D model c, reducing the transparency of the annotation element c. Figure 3 The display style of annotation element c is different from that of annotation element a, annotation element b, and annotation element d.

[0125] Optionally, Figure 4 A schematic diagram of a method for rendering elements in a three-dimensional model provided in an embodiment of the present application Figure 3 ,like Figure 4 As shown, the process of rendering the three-dimensional model and the annotation elements corresponding to the three-dimensional model in the three-dimensional scene in S101 may include:

[0126] S301: Rendering a three-dimensional model in a three-dimensional scene.

[0127] At least one three-dimensional model may be rendered in the three-dimensional scene, and each three-dimensional model has corresponding three-dimensional coordinates in the three-dimensional scene.

[0128] S302: Calculate the normalized device space coordinates of the annotation element according to the preset three-dimensional coordinates of the annotation element in the three-dimensional scene and the attribute information of the virtual camera.

[0129] The attribute information of the virtual camera includes: the view matrix and projection matrix of the virtual camera.

[0130] In some embodiments, a three-dimensional coordinate can be defined for the annotation element as its three-dimensional coordinate in the three-dimensional scene, that is, the world coordinate in the three-dimensional space; based on the preset three-dimensional coordinates of the annotation element in the three-dimensional scene, the view matrix and the projection matrix of the virtual camera, the coordinates of the annotation element in the NDC (Normalized Device Coordinates) space, that is, the normalized device space coordinates of the annotation element, are calculated.

[0131] S303: Map the normalized device space coordinates to the viewport coordinate system, and render the annotation elements in the three-dimensional scene.

[0132] It should be noted that by mapping the normalized device space coordinates to the viewport coordinate system, it is possible to set the annotation elements in the viewport, and then render the annotation elements with preset three-dimensional coordinates in the three-dimensional scene. In this way, there is a spatial relationship between the annotation elements and the three-dimensional model in the three-dimensional scene, which can ensure that as the viewing angle of the virtual camera moves, the annotation elements can still maintain the correct positional relationship with the three-dimensional model.

[0133] In 3D visualization project applications, there is generally a need to display the 3D model on the browser page and then dot or bubble the specific position or important area of ​​the model. The dot or bubble display is displayed using annotation elements. Since the rendering of the 3D model needs to be performed in a three-dimensional space, and the annotation rendering is performed in a two-dimensional plane space, the two are in different dimensions. Therefore, in the related technology, when rendering the model and the annotation element, the two are simply combined without an actual spatial relationship. Once the perspective moves, the 3D model can move with the perspective, and the annotation element still maintains its original position, which makes the positional relationship between the 3D model and the annotation element wrong.

[0134] The above process from S301 to S303 can make the annotation element have three-dimensional coordinates in the three-dimensional scene, so that there is a spatial relationship between the two, which can ensure that as the viewing angle of the virtual camera moves, the annotation element can still maintain a correct positional relationship with the three-dimensional model.

[0135] Optionally, Figure 5 A schematic diagram of a method for rendering elements in a three-dimensional model provided in an embodiment of the present application Figure 4 ,like Figure 5 As shown, the process of calculating the normalized device space coordinates of the annotation element according to the preset three-dimensional coordinates of the annotation element in the three-dimensional scene and the attribute information of the virtual camera in the above S302 may include:

[0136] S401 : Determine homogeneous coordinates of the annotation element according to preset three-dimensional coordinates of the annotation element in the three-dimensional scene.

[0137] In the embodiment of the present application, since the view matrix and projection matrix of the virtual camera are both 4*4 matrices, the preset three-dimensional coordinates of the annotation element in the three-dimensional scene are 1*3. In order to facilitate the calculation between the preset three-dimensional coordinates, the view matrix and projection matrix of the virtual camera, it is necessary to add one column to the preset three-dimensional coordinates of the annotation element in the three-dimensional scene to form the homogeneous coordinates of the annotation element.

[0138] The preset three-dimensional coordinates of the annotation element in the three-dimensional scene can be expressed as P(x, y, z), and the homogeneous coordinates of the annotation element can be expressed as P h (x h ,y h , z h , 1).

[0139] S402: Calculate the coordinates of the annotation element in the homogeneous clipping space according to the homogeneous coordinates, the view matrix and the projection matrix of the virtual camera.

[0140] In some implementations, the homogeneous coordinates of the annotation element are successively multiplied by the view matrix and the projection matrix of the virtual camera to obtain the coordinates of the annotation element in the homogeneous clipping space. The whole process can be expressed as: clip =M proj ×M view ×P h =(x c ,y c , z c , w c ).

[0141] Among them, P h Represents the homogeneous coordinates of the annotation element, M proj Represents the projection matrix of the virtual camera, M view Represents the view matrix of the virtual camera, P clip Represents the coordinates of the dimension element in the homogeneous clipping space.

[0142] S403: Calculate normalized device space coordinates according to the coordinates in the homogeneous clipping space.

[0143] It is worth noting that perspective division is performed on the coordinates in the sub-clipping space to transform the view frustum into a cubic space whose coordinates range from [-1, -1, -1] to [1, 1, 1], obtaining the coordinates in the NDC space, that is, the normalized device space coordinates.

[0144] Among them, the initial coordinates in the NDC space, that is, the initial normalized device space coordinates can be expressed as: P ndc =(x c / w c ,y c / w c , z c / w c , 1). Since only the x, y, and z components of the coordinate are needed, the final coordinates of the annotation element in the NDC space, that is, the normalized device space coordinates, can be expressed as: P ndc =(x ndc ,y ndc , z ndc ), where x ndc ,y ndc The a component represents the coordinates on the XY plane of the NDC space, and the z component represents the depth information.

[0145] Optionally, Figure 6 A schematic diagram of a method for rendering elements in a three-dimensional model provided in an embodiment of the present application Figure 5 ,like Figure 6 As shown, the process of mapping the normalized device space coordinates to the viewport coordinate system and rendering the annotation elements in the three-dimensional scene in S303 may include:

[0146] S501: Calculate the target viewport coordinates of the marked element in the viewport coordinate system according to the normalized device space coordinates and the preset viewport size.

[0147] In an embodiment of the present application, in order to correctly display the annotation elements in the visualization page, it is necessary to convert the normalized device space coordinates of the annotation elements into target viewport coordinates, so that the annotation elements can be correctly displayed in the visualization page of the browser based on the target viewport coordinates of the annotation elements.

[0148] Figure 7 A schematic diagram of a viewport coordinate system provided in an embodiment of the present application, such as Figure 7 As shown, the origin of the coordinates in the viewport coordinate system is in the upper left corner, the origin to the right along the x-axis is the positive value of the x-axis, and the origin downward along the y-axis is the positive value of the y-axis, where w is the width of the viewport and h is the height of the viewport. Figure 8 A schematic diagram of an NDC space XY plane coordinate system provided in an embodiment of the present application, such as Figure 8 As shown, the origin of the NDC space XY plane coordinate system is in the middle position, the origin to the right along the x-axis is the positive value of the x-axis, and the origin upward along the y-axis is the positive value of the y-axis.

[0149] In some implementations, the target viewport coordinates of the marked element in the viewport coordinate system are calculated based on the normalized device space coordinates and the preset viewport width and viewport height. The target viewport coordinates can be expressed as x viewport ,y viewport .

[0150] in, x ndc ,yndc Represents normalized device space coordinates, w represents the preset viewport width, and h represents the preset viewport height.

[0151] S502: Determine the initial viewport coordinates of the annotation element in the viewport coordinate system.

[0152] In practical applications, the initial viewport coordinates of the annotation element in the viewport coordinate system are the origin of the viewport coordinate system. Specifically, the center point of the annotation element is set at the origin of the viewport coordinate system, wherein the center point of the annotation element is the origin of the annotation element in the annotation element coordinate system. The annotation element coordinate system is the coordinate system corresponding to the annotation element itself.

[0153] S503: according to the initial viewport coordinates, set the annotation element at a position corresponding to the target viewport coordinates in the viewport coordinate system, and render the annotation element in the three-dimensional scene.

[0154] In the embodiment of the present application, the center point of the annotation element is moved from the initial viewport coordinates to the position corresponding to the target viewport coordinates in the viewport coordinate system, and then the annotation element can be set to the position corresponding to the target viewport coordinates in the viewport coordinate system, so that the annotation element can be presented in the viewport. The annotation element with the preset three-dimensional coordinates is added to the three-dimensional scene and rendered, so that the annotation element is presented in the three-dimensional scene.

[0155] Optionally, Fig. 9 A schematic diagram of a method for rendering elements in a three-dimensional model provided in an embodiment of the present application Figure 6 ,like Fig. 9 As shown, the process of determining the initial viewport coordinates of the annotation element in the viewport coordinate system in the above S502 may include:

[0156] S601. Set the center point of the annotation element at the origin of the viewport coordinate system.

[0157] S602: Taking the position of the center point of the annotation element in the viewport coordinate system as the initial viewport coordinate of the annotation element in the viewport coordinate system.

[0158] Among them, the center point of the annotation element is the coordinate origin of the annotation element coordinate system, and is also the coordinate origin of the viewport coordinate system.

[0159] It should be noted that the coordinate origin of the annotation element coordinate system and the coordinate origin of the viewport coordinate system are always in a coincidence state. The coordinate origin of the annotation element coordinate system is initially at the upper left corner of the annotation element. It is necessary to set the coordinate origin of the annotation element coordinate system from the upper left corner of the annotation element to the center point of the annotation element to obtain the initial viewport coordinates of the annotation element in the viewport coordinate system.

[0160] Fig.10aA schematic diagram of the position relationship between a viewport coordinate system and annotation elements provided in an embodiment of the present application Figure 1 ,like Fig.10a As shown, the origin of the viewport coordinate system coincides with the upper left corner of the annotation element, and the upper left corner of the annotation element is the coordinate origin of the annotation element coordinate system. Fig.10b A schematic diagram of the position relationship between a viewport coordinate system and annotation elements provided in an embodiment of the present application Figure 2 ,like Fig.10b As shown in the figure, the origin of the viewport coordinate system coincides with the center point of the annotation element, and the center point of the annotation element is the origin of the coordinate system of the annotation element. Figure 10a to Figure 10b The coordinate origin of the annotation element coordinate system is set from the upper left corner of the annotation element to the center point of the annotation element.

[0161] Fig.10c A schematic diagram of the position relationship between a viewport coordinate system and annotation elements provided in an embodiment of the present application Figure 3 ,like Fig.10c As shown, it can be Fig.10b The annotation element at the coordinate origin of the viewport coordinate system is moved to the position corresponding to the target viewport coordinates in the viewport coordinate system.

[0162] In some implementations, assuming that the variable name of the annotation element is divElement, the above x viewport The variable name is x, and the above y viewport If the variable name is y, the transform style (a technique used to change the shape, position or angle of an element) of the marked element is: divElement.style.transform = `translate(-50%,-50%)translate(${x}px,${y}px)`.

[0163] Among them, translate(-50%,-50%) is to set the coordinate origin of the annotation element from the upper left corner of the annotation element to the center point of the annotation element, that is, to obtain the initial viewport coordinates of the annotation element in the viewport coordinate system. translate(${x}px,${y}px) is to set the annotation element to the position corresponding to the target viewport coordinates in the viewport.

[0164] It should be noted that this can also be achieved by setting other style attributes Fig.10c To achieve the effect in , it is most convenient to use the transform style.

[0165] Fig.11 A schematic diagram of a method for rendering elements in a three-dimensional model provided in an embodiment of the present application Figure 7 ,like Fig.11 As shown, the method may also include:

[0166] S701: Determine whether the normalized device space coordinates exceed a preset range.

[0167] S702: If the area exceeds a preset range, the annotation element is hidden in the three-dimensional scene.

[0168] In an embodiment of the present application, the value range of the z component in the NDC space is -1 to 1, so it is necessary to determine whether the normalized device space coordinates of the annotation element in the NDC space exceed this range. If so, the annotation element needs to be hidden in the three-dimensional scene.

[0169] In summary, the method for rendering elements in a three-dimensional model provided by the embodiment of the present application, when the viewing angle of the three-dimensional scene is adjusted, based on the direction information and distance information between the virtual camera and the annotated element, a ray is sent from the position of the virtual camera to the position of the annotated element, so as to determine whether the annotated element is blocked by the three-dimensional model. If the annotated element is in an blocked state, the display state of the annotated element relative to the three-dimensional model is adjusted, so that the display of the annotated element and the three-dimensional model is more reasonable, and the user experience is improved. Moreover, there is no need to perform refresh calculations all the time, which can improve performance.

[0170] In addition, a spatial relationship is established between the annotation elements and the three-dimensional model, thereby ensuring that the annotation elements can still maintain a correct positional relationship with the three-dimensional model as the virtual camera moves.

[0171] The following describes a device for rendering elements in a three-dimensional model, a terminal device, a storage medium, etc., used to execute the method for rendering elements in a three-dimensional model provided in this application. The specific implementation process and technical effects thereof can be found in the relevant contents of the method for rendering elements in a three-dimensional model, which will not be described in detail below.

[0172] Fig.12 A schematic diagram of the structure of an element rendering device in a three-dimensional model provided in an embodiment of the present application, such as Fig.12 As shown, the device may include:

[0173] A rendering module 101, used for rendering a three-dimensional model and annotated elements of the three-dimensional model in a three-dimensional scene;

[0174] A first determination module 102 is used to respond to the perspective adjustment operation of the three-dimensional scene, and determine the direction information and distance information from the virtual camera to the annotated element according to the first position of the virtual camera and the second position of the annotated element under the target perspective corresponding to the perspective adjustment operation;

[0175] A transmitting module 103, configured to transmit a ray from the first position to the second position according to the direction information and the distance information;

[0176] The adjustment module 104 is configured to determine that the annotation element is in an obstructed state if the three-dimensional model collides with the ray, and adjust the display state of the annotation element relative to the three-dimensional model.

[0177] Optionally, the adjustment module 104 is specifically configured to hide the display of the annotation element; or to reduce the display transparency of the annotation element and adjust the position of the annotation element in the three-dimensional scene.

[0178] Optionally, the number of the three-dimensional models and the number of the annotation elements are both plural; and the device further comprises:

[0179] A sorting module, used to sort the annotation elements according to the distance information corresponding to the annotation elements to obtain a sorting result;

[0180] An adding module, used for adding each of the marked elements to a preset array according to the sorting result;

[0181] A second determination module, configured to determine a target display level of each of the annotation elements according to the length of the preset array and the order of each of the annotation elements in the sorting result, wherein the target display level is used to indicate a front-to-back position relationship of the annotation element in the line of sight of the virtual camera in the three-dimensional scene;

[0182] An updating module is used to update the display level of each of the annotation elements in the three-dimensional scene to a target display level.

[0183] Optionally, the rendering module 101 is specifically used to render the three-dimensional model in the three-dimensional scene; calculate the normalized device space coordinates of the annotation element according to the preset three-dimensional coordinates of the annotation element in the three-dimensional scene and the attribute information of the virtual camera; map the normalized device space coordinates in the viewport coordinate system, and render the annotation element in the three-dimensional scene.

[0184] Optionally, the rendering module 101 is specifically used to determine the homogeneous coordinates of the annotation element according to the preset three-dimensional coordinates of the annotation element in the three-dimensional scene; calculate the coordinates of the annotation element in the homogeneous clipping space according to the homogeneous coordinates, the view matrix and the projection matrix of the virtual camera; and calculate the normalized device space coordinates according to the coordinates in the homogeneous clipping space.

[0185] Optionally, the rendering module 101 is specifically used to calculate the target viewport coordinates of the annotation element in the viewport coordinate system according to the normalized device space coordinates and a preset viewport size; determine the initial viewport coordinates of the annotation element in the viewport coordinate system; set the annotation element at a position corresponding to the target viewport coordinates in the viewport coordinate system according to the initial viewport coordinates, and render the annotation element in the three-dimensional scene.

[0186] Optionally, the rendering module 101 is specifically used to set the center point of the annotation element at the origin of the viewport coordinate system; and use the position of the center point of the annotation element in the viewport coordinate system as the initial viewport coordinate of the annotation element in the viewport coordinate system.

[0187] Optionally, the device further comprises:

[0188] A judging module, used to judge whether the normalized device space coordinate exceeds a preset range;

[0189] A hiding module is used to hide the annotation element in the three-dimensional scene if it exceeds the preset range.

[0190] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0191] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0192] Fig.13 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application is shown in FIG. Fig.13 As shown, the terminal device includes: a processor 201 and a memory 202.

[0193] The memory 202 is used to store programs, and the processor 201 calls the programs stored in the memory 202 to execute the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.

[0194] Optionally, the present application also provides a program product, such as a computer-readable storage medium, including a program, which is used to execute the above method embodiment when executed by a processor.

[0195] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0196] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0197] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0198] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.

[0199] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for rendering elements in a three-dimensional model, characterized in that: include: Rendering a three-dimensional model and annotated elements of the three-dimensional model in a three-dimensional scene; In response to the perspective adjustment operation of the three-dimensional scene, according to the first position of the virtual camera and the second position of the annotated element at a target perspective corresponding to the perspective adjustment operation, determine the direction information and distance information from the virtual camera to the annotated element; emitting a ray from the first position to the second position according to the direction information and the distance information; If the three-dimensional model collides with the ray, it is determined that the annotation element is in an obscured state, and the display state of the annotation element relative to the three-dimensional model is adjusted.

2. The method according to claim 1, characterized in that The adjusting the display status of the annotation element relative to the three-dimensional model includes: hiding the display of the annotation element; Alternatively, the display transparency of the annotation element is reduced.

3. The method according to claim 1, characterized in that The number of the three-dimensional models and the number of the annotation elements are both multiple; After responding to the perspective adjustment operation of the three-dimensional scene and determining the direction information and distance information from the virtual camera to the annotated element according to the first position of the virtual camera and the second position of the annotated element at a target perspective corresponding to the perspective adjustment operation, the method further includes: Sorting the annotation elements according to the distance information corresponding to the annotation elements to obtain a sorting result; According to the sorting result, each of the marked elements is added to a preset array; Determine, according to the length of the preset array and the order of each of the annotation elements in the sorting result, a target display level of each of the annotation elements, wherein the target display level is used to indicate a front-to-back position relationship of the annotation element in the line of sight of the virtual camera in the three-dimensional scene; The display level of each of the annotation elements in the three-dimensional scene is updated to a target display level.

4. The method according to claim 1, characterized in that: The rendering of the three-dimensional model in the three-dimensional scene and the annotation elements corresponding to the three-dimensional model in the three-dimensional model include: Rendering the three-dimensional model in the three-dimensional scene; Calculating the normalized device space coordinates of the annotation element according to the preset three-dimensional coordinates of the annotation element in the three-dimensional scene and the attribute information of the virtual camera; The normalized device space coordinates are mapped into a viewport coordinate system, and the annotation elements are rendered in the three-dimensional scene.

5. The method according to claim 4, characterized in that The calculating the normalized device space coordinates of the annotation element according to the preset three-dimensional coordinates of the annotation element in the three-dimensional scene and the attribute information of the virtual camera includes: Determining homogeneous coordinates of the annotation element according to preset three-dimensional coordinates of the annotation element in the three-dimensional scene; Calculate the coordinates of the annotation element in the homogeneous clipping space according to the homogeneous coordinates, the view matrix and the projection matrix of the virtual camera; The normalized device space coordinates are calculated according to the coordinates in the homogeneous clipping space.

6. The method according to claim 4, characterized in that The mapping the normalized device space coordinates into a viewport coordinate system and rendering the annotation elements in the three-dimensional scene includes: Calculating the target viewport coordinates of the annotation element in the viewport coordinate system according to the normalized device space coordinates and a preset viewport size; Determine the initial viewport coordinates of the annotation element in the viewport coordinate system; According to the initial viewport coordinates, the annotation element is set at a position corresponding to the target viewport coordinates in the viewport coordinate system, and the annotation element is rendered in the three-dimensional scene.

7. The method according to claim 4, characterized in that The determining the initial viewport coordinates of the annotation element in the viewport coordinate system includes: Setting the center point of the annotation element at the origin of the viewport coordinate system; The position of the center point of the annotation element in the viewport coordinate system is used as the initial viewport coordinate of the annotation element in the viewport coordinate system.

8. The method according to claim 4, characterized in that The method further comprises: Determining whether the normalized device space coordinates exceed a preset range; If it exceeds the preset range, the annotation element is hidden in the three-dimensional scene.

9. A terminal device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, the method for rendering elements in a three-dimensional model as described in any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is read and executed, the method for rendering elements in a three-dimensional model as described in any one of claims 1 to 8 is implemented.