Real-time three-dimensional visual domain analysis method, device and equipment based on mobile terminal

By building the camera matrix and perspective matrix on mobile devices, performing frame buffer rendering and depth information processing, and combining three-dimensional tile data sources, the problem of difficulty in processing large-scale DEM data by mobile devices is solved, real-time and fast three-dimensional capability Sight analysis effect.

CN118657899BActive Publication Date: 2024-11-15NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411153609.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-11-15
Estimated Expiration
2044-08-21

AI Technical Summary

Technical Problem

The existing visual domain analysis methods are difficult to process large-scale DEM data on mobile devices, resulting in limited visual domain analysis effects and cannot meet the needs of high precision and high resolution.

Method used

Using a real-time three-dimensional visual field analysis method based on mobile terminals, by creating a texture array that is consistent with the pixel size of the mobile terminal device, building a camera matrix and perspective matrix, performing frame buffer rendering and depth information processing, and combining three-dimensional tile data sources to achieve different Depth information rendering and visibility judgment from perspective.

Benefits of technology

Real-time rapid analysis of the three-dimensional visual field on mobile devices is realized, which reduces storage and calculation pressure, improves analysis effect, and can generate visual results in real time for changes in the visual area.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657899B_ABST
    Figure CN118657899B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device and equipment for real-time three-dimensional visual domain analysis based on a mobile terminal. The method includes: creating a texture array; constructing a shadow matrix and a browsing perspective matrix; rendering three-dimensional vertex coordinates according to the shadow matrix and the browsing perspective matrix respectively, storing the depth information obtained by rendering based on the shadow matrix into the texture array to obtain a depth texture, and reading the depth projection coordinates obtained by rendering based on the browsing perspective matrix from the depth texture to obtain a nonlinear shadow depth; calculating the linear shadow depth based on the nonlinear shadow depth and the distance between the near and far clipping planes of the area to be observed, and calculating the linear browsing depth based on the distance between the depth projection coordinates and the near and far clipping planes of the area to be observed; and judging the visibility of the current observation area by comparing the normalized shadow depth with the normalized browsing depth. The present application can realize real-time and rapid analysis of the three-dimensional visual domain of a mobile terminal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of visual domain analysis, and in particular to a real-time three-dimensional visual domain analysis method, device and equipment based on a mobile terminal. Background Art

[0002] Visibility refers to the surface area that can be seen from one or more observation points. Visibility analysis is one of the important functions of geographic information systems. Visibility analysis has important application value in navigation, aviation, etc., such as setting up radar stations, TV stations, road selection, laying communication lines, etc.; sometimes it is also possible to analyze invisible areas, such as when low-altitude reconnaissance aircraft are flying, they should try their best to avoid being captured by radar, and the aircraft should choose to fly in the radar blind area.

[0003] Most existing viewshed analysis methods are implemented on DEM (digital elevation model) data. DEM data usually contains terrain elevation information, and the accuracy and resolution of elevation information will affect the accuracy of viewshed analysis. On mobile devices, due to the limitations of storage and computing resources, it is difficult to process large-scale DEM data, which limits the effectiveness of viewshed analysis. Summary of the invention

[0004] Based on this, it is necessary to provide a real-time three-dimensional visual domain analysis method, device and equipment based on a mobile terminal to address the above technical problems.

[0005] A real-time three-dimensional visual domain analysis method based on a mobile terminal, the method comprising:

[0006] Create a texture array that matches the pixel size of the current mobile device;

[0007] Construct the camera matrix and perspective matrix of the area to be observed and the current observation area respectively, multiply the camera matrix of the area to be observed with the perspective matrix to obtain the shadow matrix, and multiply the camera matrix of the current observation area with the perspective matrix to obtain the browsing perspective matrix;

[0008] Load and read the three-dimensional vertex coordinates in the three-dimensional tile data source, bind the three-dimensional vertex coordinates to the frame buffer for rendering according to the shadow matrix, and after unbinding the frame buffer, store the depth information obtained by rendering based on the shadow matrix into the texture array to obtain the depth texture;

[0009] In the fragment shader of the current mobile device, the three-dimensional vertex coordinates are rendered according to the browsing view matrix, and the nonlinear shadow depth is obtained by reading the depth projection coordinates obtained by rendering based on the browsing view matrix from the depth texture; wherein, when the browsing view matrix renders the three-dimensional vertex coordinates, the frame buffer is not bound;

[0010] The linear shadow depth is calculated based on the nonlinear shadow depth and the distance between the near and far clipping planes of the area to be observed, and the linear browsing depth is calculated based on the depth projection coordinates and the distance between the near and far clipping planes of the area to be observed. The linear shadow depth and the linear browsing depth are normalized respectively, and the visibility of the current observation area is judged by comparing the normalized shadow depth with the normalized browsing depth.

[0011] In one embodiment, the camera matrix is ​​constructed by the observation point coordinates, the target point coordinates and the upward vector of the observation plane in the observation area; the perspective matrix is ​​constructed by the distances of the far and near clipping planes, the far clipping plane width, the far clipping plane height and the longitudinal angle of observation in the observation area.

[0012] In one embodiment, the camera matrix is ​​constructed by the observation point coordinates, the target point coordinates and the upward vector of the observation plane of the observation area, including:

[0013] Get the observation point coordinates, target point coordinates and upward vector of the observation plane in the observation area;

[0014] The observation point coordinates are subtracted from the target point coordinates and then normalized to obtain the front vector of the camera, which is expressed as ;

[0015] After taking the negative value of the front vector, the negative front vector is cross-multiplied with the upward vector of the observation plane, and the cross-multiplication result is normalized to obtain the side vector of the camera, which is expressed as ;

[0016] After cross-producting the side vector and the negative front vector and normalizing them, we get the top vector of the camera, which is expressed as ;

[0017] The camera matrix is ​​constructed based on the camera's front vector, side vector, and top vector, expressed as

[0018] ;

[0019] Among them, the subscript x , y, z Respectively represent vector x Quantity and y Quantity and z Component, P represents the coordinates of the observation point.

[0020] In one embodiment, the perspective matrix is ​​constructed by the distances of the near and far clipping planes of the observation area, the width of the far clipping plane, the height of the far clipping plane, and the vertical angle of observation, including:

[0021] Get the distance between the near and far clipping planes of the observation area, the width and height of the far clipping plane, and the vertical angle of observation;

[0022] Divide the far clipping plane width by the far clipping plane height to get the aspect ratio;

[0023] The reciprocal of the tangent of half the observed longitudinal angle is recorded as Q , and Q The ratio of the aspect ratio is recorded as A ;

[0024] The ratio of the sum of the near clipping plane distance and the far clipping plane distance to the difference between the two is recorded as B , and the ratio of twice the product of the near clipping plane distance and the far clipping plane distance to the difference between the two is recorded as C ;

[0025] According to the parameters Q , A , B , C The perspective matrix is ​​constructed and expressed as

[0026] .

[0027] In one embodiment, rendering the three-dimensional vertex coordinates by binding a frame buffer according to a shadow matrix, and storing depth information obtained by rendering based on the shadow matrix into a texture array after unbinding the frame buffer to obtain a depth texture, including:

[0028] Read the three-dimensional vertex coordinates as S , and expand the three-dimensional vertex coordinates to obtain the expanded vertex coordinates, expressed as ;

[0029] The expanded vertex coordinates are bound to the frame buffer for rendering according to the shadow matrix. During the rendering process, the shadow matrix is ​​multiplied by the expanded vertex coordinates to obtain the first fragment position in the light space, which is expressed as FP 1;

[0030] According to the first fragment position in the light space FP 1 Calculate the depth of the fragment in the light space. The calculation formula is expressed as ;in, express FP 1 of z Quantity, express FP 1 of w Quantity, w Represents the 4th component of the vector;

[0031] The depth of the fragment in the light space is used as the depth information obtained based on the shadow matrix rendering, and after unbinding the frame buffer, the depth information obtained based on the shadow matrix rendering is automatically stored in the texture array to obtain the depth texture.

[0032] In one of the embodiments, in a fragment shader of the current mobile terminal device, three-dimensional vertex coordinates are rendered according to a browsing view matrix, and nonlinear shadow depth is obtained by reading from a depth texture the depth projection coordinates obtained by rendering based on the browsing view matrix, including:

[0033] In the fragment shader of the current mobile device, the expanded vertex coordinates are calculated according to the viewing angle matrix Rendering is performed. During the rendering process, the browsing perspective matrix is ​​multiplied by the expanded vertex coordinates to obtain the second fragment position in the light space, which is expressed as FP 2;

[0034] Calculate the depth projection coordinates of the fragment in the light space according to the second fragment position in the light space CP 1, expressed as ;in, express FP 2 of x , y , z Quantity, express FP 2 of w Quantity, w Represents the 4th component of the vector;

[0035] Project the depth coordinates CP 1 is converted to the range of 0 to 1, and the depth projection coordinates after the coordinate range conversion are obtained CP 2, expressed as ;

[0036] Will CP 2 as the depth projection coordinates obtained by rendering based on the browsing perspective matrix, and according to CP 2 Read from the depth texture to get the nonlinear shadow depth.

[0037] In one embodiment, the linear shadow depth is calculated based on the nonlinear shadow depth and the distance between the near and far clipping planes of the area to be observed, and the linear browsing depth is calculated based on the depth projection coordinates and the distance between the near and far clipping planes of the area to be observed, including:

[0038] The linear shadow depth is calculated based on the nonlinear shadow depth and the distance between the near and far clipping planes of the area to be observed. linearizeDepth 1, expressed as

[0039] linearizeDepth1 = (2.0 × near clipping plane distance × far clipping plane distance) / (far clipping plane distance + near clipping plane distance - Z1 × (far clipping plane distance - near clipping plane distance));

[0040] Where Z1= nonLinearDepth ×2.0-1.0 means converting the nonlinear shadow depth to the range of -1 to 1; nonLinearDepth is the nonlinear shadow depth;

[0041] Depth projection coordinates after conversion according to coordinate range CP 2 Calculate the distance from the near and far clipping planes of the area to be observed to obtain the linear browsing depth linearizeDepth 2, expressed as

[0042] linearizeDepth 2 = (2.0 × near clipping plane distance × far clipping plane distance) / (far clipping plane distance + near clipping plane distance - Z2 × (far clipping plane distance - near clipping plane distance));

[0043] Where Z2= CP 2.z×2.0-1.0 means CP 2. z is converted to the range of -1 to 1; CP 2.z represents CP 2 of z Quantity.

[0044] In one embodiment, the linear shadow depth and the linear browsing depth are normalized respectively, and the visibility of the current observation area is determined by comparing the normalized shadow depth and the normalized browsing depth, including:

[0045] Normalize the linear shadow depth and linear browsing depth respectively to get the normalized shadow depth closestDepth 1 and normalized browsing depth closestDepth 2, respectively expressed as

[0046] closestDepth 1=( linearizeDepth 1-near clipping plane distance) / (far clipping plane distance-near clipping plane distance);

[0047] closestDepth 2=( linearizeDepth 2-near clipping plane distance) / (far clipping plane distance-near clipping plane distance);

[0048] like closestDepth 2> closestDepth 1. Determine whether the current observation area is not visible; otherwise, determine whether the current observation area is visible.

[0049] A real-time three-dimensional visual domain analysis device based on a mobile terminal, the device comprising:

[0050] Texture array creation module, used to create a texture array consistent with the pixel size of the current mobile device;

[0051] A matrix construction module is used to construct the camera matrix and perspective matrix of the area to be observed and the current observation area respectively, multiply the camera matrix of the area to be observed with the perspective matrix to obtain the shadow matrix, and multiply the camera matrix of the current observation area with the perspective matrix to obtain the browsing perspective matrix;

[0052] A shadow matrix rendering module is used to load and read the three-dimensional vertex coordinates in the three-dimensional tile data source, bind the three-dimensional vertex coordinates to the frame buffer for rendering according to the shadow matrix, and store the depth information obtained based on the shadow matrix rendering into the texture array after unbinding the frame buffer to obtain a depth texture;

[0053] A browsing view matrix rendering module is used to render three-dimensional vertex coordinates according to the browsing view matrix in the fragment shader of the current mobile terminal device, and obtain nonlinear shadow depth by reading the depth projection coordinates obtained by rendering based on the browsing view matrix from the depth texture; wherein, when the browsing view matrix renders the three-dimensional vertex coordinates, the frame buffer is not bound;

[0054] The visibility judgment module is used to calculate the linear shadow depth based on the nonlinear shadow depth and the distance between the near and far clipping planes of the area to be observed, and to calculate the linear browsing depth based on the depth projection coordinates and the distance between the near and far clipping planes of the area to be observed. The linear shadow depth and the linear browsing depth are normalized respectively, and the visibility of the current observation area is judged by comparing the normalized shadow depth with the normalized browsing depth.

[0055] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0056] Create a texture array that matches the pixel size of the current mobile device;

[0057] Construct the camera matrix and perspective matrix of the area to be observed and the current observation area respectively, multiply the camera matrix of the area to be observed with the perspective matrix to obtain the shadow matrix, and multiply the camera matrix of the current observation area with the perspective matrix to obtain the browsing perspective matrix;

[0058] Load and read the three-dimensional vertex coordinates in the three-dimensional tile data source, bind the three-dimensional vertex coordinates to the frame buffer for rendering according to the shadow matrix, and after unbinding the frame buffer, store the depth information obtained by rendering based on the shadow matrix into the texture array to obtain the depth texture;

[0059] In the fragment shader of the current mobile device, the three-dimensional vertex coordinates are rendered according to the browsing view matrix, and the nonlinear shadow depth is obtained by reading the depth projection coordinates obtained by rendering based on the browsing view matrix from the depth texture; wherein, when the browsing view matrix renders the three-dimensional vertex coordinates, the frame buffer is not bound;

[0060] The linear shadow depth is calculated based on the nonlinear shadow depth and the distance between the near and far clipping planes of the area to be observed, and the linear browsing depth is calculated based on the depth projection coordinates and the distance between the near and far clipping planes of the area to be observed. The linear shadow depth and the linear browsing depth are normalized respectively, and the visibility of the current observation area is judged by comparing the normalized shadow depth with the normalized browsing depth.

[0061] The above-mentioned mobile-based real-time three-dimensional visual domain analysis method, device and equipment have the following technical effects compared with the prior art:

[0062] 1. This application loads 3D tile data for analysis, and loads data of different resolutions at different levels of 3D tiles for rendering and analysis, which reduces the storage and computing pressure of mobile devices and improves the effect of 3D visual field analysis on mobile devices.

[0063] 2. This application constructs a shadow matrix of the area to be observed and a browsing perspective matrix of the current observation area for rendering to obtain depth information at different perspectives, and combines the mobile graphics hardware to compare the depth sizes at different perspectives for visibility judgment. This allows real-time generation of visual results based on changes in the visible area, and enables real-time and rapid analysis of the three-dimensional visual domain on the mobile terminal. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 1 is a flow chart of a real-time three-dimensional visual domain analysis method based on a mobile terminal in one embodiment;

[0065] Figure 2 Schematic diagram of the overall architecture of a real-time three-dimensional visual domain analysis method based on a mobile terminal in one embodiment;

[0066] Figure 3 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0067] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0068] In one embodiment,Figure 1 and Figure 2 As shown, a real-time three-dimensional visual area analysis method based on a mobile terminal is provided, comprising the following steps:

[0069] Step S1, create a texture array that is consistent with the pixel size of the current mobile device.

[0070] Step S2, construct the camera matrix and perspective matrix of the area to be observed and the current observation area respectively, multiply the camera matrix of the area to be observed with the perspective matrix to obtain the shadow matrix, and multiply the camera matrix of the current observation area with the perspective matrix to obtain the browsing viewing angle matrix.

[0071] The camera matrix is ​​constructed by the observation point coordinates, target point coordinates and upward vector of the observation plane in the observation area. The construction process includes:

[0072] Get the observation point coordinates, target point coordinates and upward vector of the observation plane in the observation area;

[0073] The observation point coordinates are subtracted from the target point coordinates and then normalized to obtain the front vector of the camera, which is expressed as ;

[0074] After taking the negative value of the front vector, the negative front vector is cross-multiplied with the upward vector of the observation plane, and the cross-multiplication result is normalized to obtain the side vector of the camera, which is expressed as ;

[0075] After cross-producting the side vector and the negative front vector and normalizing them, we get the top vector of the camera, expressed as ;

[0076] The camera matrix is ​​constructed based on the camera's front vector, side vector, and top vector, expressed as

[0077] ;

[0078] Among them, the subscript x , y, z Respectively represent vector x Quantity and y Quantity and z Component, P represents the coordinates of the observation point.

[0079] The perspective matrix is ​​constructed by the distance between the near and far clipping planes of the observation area, the width of the far clipping plane, the height of the far clipping plane, and the vertical angle of observation. The construction process includes:

[0080] Get the distance between the near and far clipping planes of the observation area, the width and height of the far clipping plane, and the vertical angle of observation;

[0081] Divide the far clipping plane width by the far clipping plane height to get the aspect ratio;

[0082] The reciprocal of the tangent of half the observed longitudinal angle is recorded as Q , and Q The ratio of the aspect ratio is recorded as A ;

[0083] The ratio of the sum of the near clipping plane distance and the far clipping plane distance to the difference between the two is recorded as B , and the ratio of twice the product of the near clipping plane distance and the far clipping plane distance to the difference between the two is recorded as C ;

[0084] According to the parameters Q , A , B , C The perspective matrix is ​​constructed and expressed as

[0085] .

[0086] Step S3, load and read the three-dimensional vertex coordinates in the three-dimensional tile data source, bind the three-dimensional vertex coordinates to the frame buffer for rendering according to the shadow matrix, and after unbinding the frame buffer, store the depth information obtained based on the shadow matrix rendering into the texture array to obtain a depth texture.

[0087] Specifically, step S3 includes:

[0088] Read the three-dimensional vertex coordinates as S , and expand the three-dimensional vertex coordinates to obtain the expanded vertex coordinates, expressed as ;

[0089] The expanded vertex coordinates are bound to the frame buffer for rendering according to the shadow matrix. During the rendering process, the shadow matrix is ​​multiplied by the expanded vertex coordinates to obtain the first fragment position in the light space, which is expressed as FP 1;

[0090] According to the first fragment position in the light space FP 1 Calculate the depth of the fragment in the light space. The calculation formula is expressed as ;in, express FP 1 of z Quantity, express FP 1 of w Quantity, w Represents the 4th component of the vector;

[0091] The depth of the fragment in the light space is used as the depth information obtained based on the shadow matrix rendering, and after unbinding the frame buffer, the depth information obtained based on the shadow matrix rendering is automatically stored in the texture array to obtain the depth texture.

[0092] Step S4, in the fragment shader of the current mobile device, the three-dimensional vertex coordinates are rendered according to the browsing view matrix, and the nonlinear shadow depth is obtained by reading the depth projection coordinates obtained by rendering based on the browsing view matrix from the depth texture; wherein, when the browsing view matrix renders the three-dimensional vertex coordinates, the frame buffer is not bound.

[0093] Specifically, step S4 includes:

[0094] In the fragment shader of the current mobile device, the expanded vertex coordinates are calculated according to the viewing angle matrix Rendering is performed. During the rendering process, the browsing perspective matrix is ​​multiplied by the expanded vertex coordinates to obtain the second fragment position in the light space, which is expressed as FP 2;

[0095] Calculate the depth projection coordinates of the fragment in the light space according to the second fragment position in the light space CP 1, expressed as ;in, express FP 2 of x , y , z Quantity, express FP 2 of w Quantity, w Represents the 4th component of the vector;

[0096] Project the depth coordinates CP 1 is converted to the range of 0 to 1, and the depth projection coordinates after the coordinate range conversion are obtained CP 2, expressed as ; The coordinate conversion is due to the fact that the horizontal and vertical coordinates of the depth texture input in the fragment shader range from 0 to 1;

[0097] Will CP 2 as the depth projection coordinates obtained by rendering based on the browsing perspective matrix, and according to CP 2 Read from the depth texture to get the nonlinear shadow depth.

[0098] Step S5, the linear shadow depth is calculated based on the nonlinear shadow depth and the distance between the near and far clipping planes of the area to be observed, and the linear browsing depth is calculated based on the depth projection coordinates and the distance between the near and far clipping planes of the area to be observed, and the linear shadow depth and the linear browsing depth are normalized respectively, and the visibility of the current observation area is judged by comparing the normalized shadow depth with the normalized browsing depth.

[0099] Specifically, step S5 includes:

[0100] The linear shadow depth is calculated based on the nonlinear shadow depth and the distance between the near and far clipping planes of the area to be observed. linearizeDepth 1, expressed as

[0101] linearizeDepth 1 = (2.0 × near clipping plane distance × far clipping plane distance) / (far clipping plane distance + near clipping plane distance - Z1 × (far clipping plane distance - near clipping plane distance));

[0102] Where Z1= nonLinearDepth ×2.0-1.0 means converting the nonlinear shadow depth to the range of -1 to 1; nonLinearDepth is the nonlinear shadow depth;

[0103] Depth projection coordinates after conversion according to coordinate range CP 2 Calculate the distance from the near and far clipping planes of the area to be observed to obtain the linear browsing depth linearizeDepth 2, expressed as

[0104] linearizeDepth 2 = (2.0 × near clipping plane distance × far clipping plane distance) / (far clipping plane distance + near clipping plane distance - Z2 × (far clipping plane distance - near clipping plane distance));

[0105] Where Z2= CP 2.z×2.0-1.0 means CP 2. z is converted to the range of -1 to 1; CP 2.z represents CP 2 of z Quantity;

[0106] Normalize the linear shadow depth and linear browsing depth respectively to get the normalized shadow depth closestDepth 1 and normalized browsing depth closestDepth 2, respectively expressed as

[0107] closestDepth 1=( linearizeDepth 1-near clipping plane distance) / (far clipping plane distance-near clipping plane distance);

[0108] closestDepth 2=( linearizeDepth 2-near clipping plane distance) / (far clipping plane distance-near clipping plane distance);

[0109] like closestDepth 2> closestDepth 1. Determine whether the current observation area is not visible; otherwise, determine whether the current observation area is visible.

[0110] In one embodiment, a real-time three-dimensional visual domain analysis device based on a mobile terminal is provided, comprising:

[0111] Texture array creation module, used to create a texture array consistent with the pixel size of the current mobile device;

[0112] A matrix construction module is used to construct the camera matrix and perspective matrix of the area to be observed and the current observation area respectively, multiply the camera matrix of the area to be observed with the perspective matrix to obtain the shadow matrix, and multiply the camera matrix of the current observation area with the perspective matrix to obtain the browsing perspective matrix;

[0113] A shadow matrix rendering module is used to load and read the three-dimensional vertex coordinates in the three-dimensional tile data source, bind the three-dimensional vertex coordinates to the frame buffer for rendering according to the shadow matrix, and store the depth information obtained based on the shadow matrix rendering into the texture array after unbinding the frame buffer to obtain a depth texture;

[0114] A browsing view matrix rendering module is used to render three-dimensional vertex coordinates according to the browsing view matrix in the fragment shader of the current mobile terminal device, and obtain nonlinear shadow depth by reading the depth projection coordinates obtained by rendering based on the browsing view matrix from the depth texture; wherein, when the browsing view matrix renders the three-dimensional vertex coordinates, the frame buffer is not bound;

[0115] The visibility judgment module is used to calculate the linear shadow depth based on the nonlinear shadow depth and the distance between the near and far clipping planes of the area to be observed, and to calculate the linear browsing depth based on the depth projection coordinates and the distance between the near and far clipping planes of the area to be observed. The linear shadow depth and the linear browsing depth are normalized respectively, and the visibility of the current observation area is judged by comparing the normalized shadow depth with the normalized browsing depth.

[0116] For the specific definition of the real-time three-dimensional visual field analysis device based on the mobile terminal, please refer to the definition of the real-time three-dimensional visual field analysis method based on the mobile terminal above, which will not be repeated here. Each module in the above-mentioned real-time three-dimensional visual field analysis device based on the mobile terminal can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0117] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a real-time three-dimensional visual domain analysis method based on a mobile terminal is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0118] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0119] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0120] Create a texture array that matches the pixel size of the current mobile device;

[0121] Construct the camera matrix and perspective matrix of the area to be observed and the current observation area respectively, multiply the camera matrix of the area to be observed with the perspective matrix to obtain the shadow matrix, and multiply the camera matrix of the current observation area with the perspective matrix to obtain the browsing perspective matrix;

[0122] Load and read the three-dimensional vertex coordinates in the three-dimensional tile data source, bind the three-dimensional vertex coordinates to the frame buffer for rendering according to the shadow matrix, and after unbinding the frame buffer, store the depth information obtained by rendering based on the shadow matrix into the texture array to obtain the depth texture;

[0123] In the fragment shader of the current mobile device, the three-dimensional vertex coordinates are rendered according to the browsing view matrix, and the nonlinear shadow depth is obtained by reading the depth projection coordinates obtained by rendering based on the browsing view matrix from the depth texture; wherein, when the browsing view matrix renders the three-dimensional vertex coordinates, the frame buffer is not bound;

[0124] The linear shadow depth is calculated based on the nonlinear shadow depth and the distance between the near and far clipping planes of the area to be observed, and the linear browsing depth is calculated based on the depth projection coordinates and the distance between the near and far clipping planes of the area to be observed. The linear shadow depth and the linear browsing depth are normalized respectively, and the visibility of the current observation area is judged by comparing the normalized shadow depth with the normalized browsing depth.

[0125] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0126] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A real-time 3D visual domain analysis method based on mobile terminals. It is characterized in that The method comprises: Create a texture array that matches the pixel size of the current mobile device; Constructing the camera matrix and perspective matrix of the area to be observed and the current observation area respectively, multiplying the camera matrix of the area to be observed with the perspective matrix to obtain a shadow matrix, and multiplying the camera matrix of the current observation area with the perspective matrix to obtain a browsing viewing angle matrix; Load and read the three-dimensional vertex coordinates in the three-dimensional tile data source, bind the three-dimensional vertex coordinates to the frame buffer for rendering according to the shadow matrix, and after unbinding the frame buffer, store the depth information obtained based on the shadow matrix rendering into the texture array to obtain a depth texture; In the fragment shader of the current mobile terminal device, the three-dimensional vertex coordinates are rendered according to the browsing view matrix, and the nonlinear shadow depth is obtained by reading the depth projection coordinates obtained by rendering based on the browsing view matrix from the depth texture; wherein, when the browsing view matrix renders the three-dimensional vertex coordinates, a frame buffer is not bound; The linear shadow depth is calculated based on the nonlinear shadow depth and the distance between the near and far clipping planes of the area to be observed, and the linear browsing depth is calculated based on the depth projection coordinates and the distance between the near and far clipping planes of the area to be observed, and the linear shadow depth and the linear browsing depth are normalized respectively, and the visibility of the current observation area is judged by comparing the normalized shadow depth with the normalized browsing depth; The linear shadow depth is obtained by calculating the distance between the nonlinear shadow depth and the near and far clipping planes of the area to be observed, and the linear browsing depth is obtained by calculating the distance between the depth projection coordinates and the near and far clipping planes of the area to be observed, including: The linear shadow depth is calculated based on the nonlinear shadow depth and the distance between the near and far clipping planes of the area to be observed. linearizeDepth 1, expressed as linearizeDepth 1 = (2.0 × near clipping plane distance × far clipping plane distance) / (far clipping plane distance + near clipping plane distance - Z1 × (far clipping plane distance - near clipping plane distance)); Where Z1= nonLinearDepth ×2.0-1.0 means converting the nonlinear shadow depth to the range of -1 to 1; nonLinearDepth is the nonlinear shadow depth; Depth projection coordinates after conversion according to coordinate range CP 2 Calculate the distance from the near and far clipping planes of the area to be observed to obtain the linear browsing depth linearizeDepth 2, expressed as linearizeDepth 2 = (2.0 × near clipping plane distance × far clipping plane distance) / (far clipping plane distance + near clipping plane distance - Z2 × (far clipping plane distance - near clipping plane distance)); Where Z2= CP 2.z×2.0-1.0 means CP 2. z is converted to the range of -1 to 1; CP 2.z represents CP 2 of z Quantity.

2. According to the mobile terminal-based real-time three-dimensional visual domain analysis method of claim 1, It is characterized in that The camera matrix is ​​constructed by the observation point coordinates, target point coordinates and upward vector of the observation plane in the observation area; the perspective matrix is ​​constructed by the distance between the near and far clipping planes, the far clipping plane width, the far clipping plane height and the longitudinal angle of observation in the observation area.

3. According to claim 2, a real-time three-dimensional visual domain analysis method based on a mobile terminal, It is characterized in that The camera matrix is ​​constructed by the observation point coordinates, target point coordinates and the upward vector of the observation plane in the observation area, including: Get the observation point coordinates, target point coordinates and upward vector of the observation plane in the observation area; The observation point coordinates are subtracted from the target point coordinates and then normalized to obtain the front vector of the camera, which is expressed as ; After taking a negative value for the front vector, a cross product is performed on the negative front vector and the upward vector of the observation plane, and the cross product result is normalized to obtain the side vector of the camera, which is expressed as ; The side vector is cross-multiplied with the negative front vector and then normalized to obtain the top vector of the camera, which is expressed as ; The camera matrix is ​​constructed based on the camera's front vector, side vector, and top vector, expressed as ; Among them, the subscript x , y, z Respectively represent vector x Quantity and y Quantity and z Component, P represents the coordinates of the observation point.

4. According to claim 2, a real-time three-dimensional visual domain analysis method based on a mobile terminal, It is characterized in that The perspective matrix is ​​constructed by the distances of the near and far clipping planes of the observation area, the width of the far clipping plane, the height of the far clipping plane, and the size of the longitudinal angle of observation, including: Get the distance between the near and far clipping planes of the observation area, the width and height of the far clipping plane, and the vertical angle of observation; Divide the far clipping plane width by the far clipping plane height to get the aspect ratio; The reciprocal of the tangent of half the observed longitudinal angle is recorded as Q , and Q The ratio of the aspect ratio is recorded as A ; The ratio of the sum of the near clipping plane distance and the far clipping plane distance to the difference between the two is recorded as B , and the ratio of twice the product of the near clipping plane distance and the far clipping plane distance to the difference between the two is recorded as C ; According to the parameters Q , A , B , C The perspective matrix is ​​constructed and expressed as 。 5. According to the mobile terminal-based real-time three-dimensional visual domain analysis method of claim 1, It is characterized in that The three-dimensional vertex coordinates are bound to a frame buffer for rendering according to the shadow matrix, and after unbinding the frame buffer, the depth information obtained by rendering based on the shadow matrix is ​​stored in the texture array to obtain a depth texture, including: Read the three-dimensional vertex coordinates as S , and the three-dimensional vertex coordinates are expanded to obtain the expanded vertex coordinates, which are expressed as ; The expanded vertex coordinates are bound to the frame buffer for rendering according to the shadow matrix. During the rendering process, the shadow matrix is ​​multiplied by the expanded vertex coordinates to obtain the first fragment position in the light space, which is expressed as FP 1; According to the first fragment position in the light space FP 1 Calculate the depth of the fragment in the light space. The calculation formula is expressed as ;in, express FP 1 of z Quantity, express FP 1 of w Quantity, w Represents the 4th component of the vector; The depth of the fragment in the light space is used as the depth information obtained based on the shadow matrix rendering, and after unbinding the frame buffer, the depth information obtained based on the shadow matrix rendering is automatically stored in the texture array to obtain the depth texture.

6. The method for real-time three-dimensional visual domain analysis based on a mobile terminal according to claim 1, It is characterized in that In the fragment shader of the current mobile terminal device, the three-dimensional vertex coordinates are rendered according to the browsing view matrix, and the nonlinear shadow depth is obtained by reading the depth projection coordinates obtained by rendering based on the browsing view matrix from the depth texture, including: In the fragment shader of the current mobile device, the expanded vertex coordinates are calculated according to the browsing perspective matrix. Rendering is performed. During the rendering process, the browsing perspective matrix is ​​multiplied by the vertex coordinates after dimension expansion to obtain the second fragment position in the light space, which is expressed as FP 2; The depth projection coordinates of the fragment in the light space are obtained by calculating the second fragment position in the light space. CP 1, expressed as ;in, express FP 2 of x , y , z Quantity, express FP 2 of w Quantity, w Represents the 4th component of the vector; The depth projection coordinates CP 1 is converted to the range of 0 to 1, and the depth projection coordinates after the coordinate range conversion are obtained CP 2, expressed as ; The CP 2 as the depth projection coordinates obtained by rendering based on the browsing perspective matrix, and according to the CP 2 Read the nonlinear shadow depth from the depth texture.

7. The method for real-time three-dimensional visual domain analysis based on a mobile terminal according to claim 1, It is characterized in that Normalizing the linear shadow depth and the linear browsing depth respectively, and judging the visibility of the current observation area by comparing the normalized shadow depth and the normalized browsing depth, including: The linear shadow depth and the linear browsing depth are normalized to obtain a normalized shadow depth. closestDepth 1 and normalized browsing depth closestDepth 2, respectively expressed as closestDepth 1=( linearizeDepth 1-near clipping plane distance) / (far clipping plane distance-near clipping plane distance); closestDepth 2=( linearizeDepth 2-near clipping plane distance) / (far clipping plane distance-near clipping plane distance); like closestDepth 2> closestDepth 1. Determine whether the current observation area is not visible; otherwise, determine whether the current observation area is visible.

8. A real-time three-dimensional visual domain analysis device based on a mobile terminal, It is characterized in that The device comprises: Texture array creation module, used to create a texture array consistent with the pixel size of the current mobile device; A matrix construction module, used to construct the camera matrix and perspective matrix of the area to be observed and the current observation area respectively, multiply the camera matrix of the area to be observed with the perspective matrix to obtain a shadow matrix, and multiply the camera matrix of the current observation area with the perspective matrix to obtain a browsing viewing angle matrix; A shadow matrix rendering module is used to load and read the three-dimensional vertex coordinates in the three-dimensional tile data source, bind the three-dimensional vertex coordinates to the frame buffer for rendering according to the shadow matrix, and store the depth information obtained based on the shadow matrix rendering into the texture array after unbinding the frame buffer to obtain a depth texture; A browsing view matrix rendering module is used to render the three-dimensional vertex coordinates according to the browsing view matrix in the fragment shader of the current mobile terminal device, and obtain the nonlinear shadow depth by reading the depth projection coordinates obtained by rendering based on the browsing view matrix from the depth texture; wherein, when the browsing view matrix renders the three-dimensional vertex coordinates, the frame buffer is not bound; A visibility judgment module is used to calculate the linear shadow depth according to the nonlinear shadow depth and the distance between the near and far clipping planes of the area to be observed, and to calculate the linear browsing depth according to the depth projection coordinates and the distance between the near and far clipping planes of the area to be observed, and to normalize the linear shadow depth and the linear browsing depth respectively, and to judge the visibility of the current observation area by comparing the normalized shadow depth with the normalized browsing depth; The linear shadow depth is obtained by calculating the distance between the nonlinear shadow depth and the near and far clipping planes of the area to be observed, and the linear browsing depth is obtained by calculating the distance between the depth projection coordinates and the near and far clipping planes of the area to be observed, including: The linear shadow depth is calculated based on the nonlinear shadow depth and the distance between the near and far clipping planes of the area to be observed. linearizeDepth 1, expressed as linearizeDepth 1 = (2.0 × near clipping plane distance × far clipping plane distance) / (far clipping plane distance + near clipping plane distance - Z1 × (far clipping plane distance - near clipping plane distance)); Where Z1= nonLinearDepth ×2.0-1.0 means converting the nonlinear shadow depth to the range of -1 to 1; nonLinearDepth is the nonlinear shadow depth; Depth projection coordinates after conversion according to coordinate range CP 2 Calculate the distance from the near and far clipping planes of the area to be observed to obtain the linear browsing depth linearizeDepth 2, expressed as linearizeDepth 2 = (2.0 × near clipping plane distance × far clipping plane distance) / (far clipping plane distance + near clipping plane distance - Z2 × (far clipping plane distance - near clipping plane distance)); Where Z2= CP 2.z×2.0-1.0 means CP 2. z is converted to the range of -1 to 1; CP 2.z represents CP 2 of z Quantity.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of a real-time three-dimensional visual area analysis method based on a mobile terminal are implemented as described in any one of claims 1 to 7.