A method for accurately displaying the current field of view in the eagle-eye window of a three-dimensional map
By calculating the field of view clipping plane of the ECEF three-dimensional Cartesian coordinate system and using pixel shader technology, the complexity of the field of view range display in the three-dimensional map is solved, achieving fast and accurate field of view display, which is suitable for scenes containing poles and special situations.
Patent Information
- Application Number
- CN202110016882.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-07
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2041-01-07
AI Technical Summary
In three-dimensional earth visualization technology, traditional methods are difficult to accurately calculate and quickly display the field of view, especially when it includes poles, plus and minus 180-degree longitude, and part of the sky. The calculation complexity is high and the processing is complicated.
By calculating the field of view clipping plane in the ECEF three-dimensional Cartesian coordinate system, and using a pixel shader to convert the longitude and latitude coordinates into Cartesian coordinates, the position of the clipping plane is determined to output the field of view range, and rectangular drawing and OpenGL or DirectX technology are used to handle various special Condition.
It achieves fast and accurate display of the field of view, reduces CPU calculation complexity, can correctly handle any observation position and angle, and is suitable for real-time applications.
Smart Images

Figure CN112700556B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of three-dimensional earth visualization technology, and more particularly to a method for accurately displaying the current field of view in an eagle-eye window in a three-dimensional map, which can quickly and accurately display the current three-dimensionally observed geographical scope in the eagle-eye window. Furthermore, the present invention can be expanded to application scenarios such as quickly and accurately displaying the geographical scope of satellite observation. Background Art
[0002] In 3D earth visualization technology, it is often necessary to calculate the field of view that can be observed on the earth's surface from any specified observation position and observation direction in space, and display it in a 2D view. The Hawkeye window is one of the use scenarios. The typical traditional method is: first calculate a series of rays based on the 3D view boundary, find the intersection point with the earth's surface, generate a geographic coordinate polygon, and then fill and draw it. It has the following main disadvantages:
[0003] (1) If the observation range includes the Earth's poles, or includes the plus or minus 180 degrees longitude position, or if the observation range includes part of the sky, the observation range will be very complicated in the two-dimensional view. To handle these special cases, complex algorithms are needed to handle multiple special cases.
[0004] (2) The observation range is difficult to calculate accurately. The accurate observation range needs to consider the horizontal and vertical viewing angles, as well as the observation direction, pitch, and roll angles. Traditional methods are very complex to properly handle these parameters.
[0005] (3) When calculating the observation range polygon, a large number of intersection rays need to be emitted. To ensure sufficient precision, an extremely fine subdivision granularity is required, which has a high calculation complexity and requires the CPU to perform a large number of calculations. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a method for accurately displaying the current field of view in an eagle-eye window in a three-dimensional map in view of the above-mentioned defects in the prior art.
[0007] According to the present invention, a method for accurately displaying the current field of view in an eagle-eye window in a three-dimensional map is provided, comprising:
[0008] The first step: calculate the field of view clipping plane in the ECEF three-dimensional Cartesian coordinate system according to the observation position and angle, and submit the calculated field of view clipping plane to the pixel shader;
[0009] Step 2: Draw a rectangle, wherein the texture coordinates of the four corner points of the rectangle are respectively set to the longitude and latitude coordinates of the four corner points of the display range of the two-dimensional view;
[0010] Step 3: In the pixel shader, the longitude and latitude coordinates corresponding to the pixel are converted into ECEF three-dimensional Cartesian coordinates according to the ellipsoid parameters;
[0011] Step 4: In the pixel shader, determine the position between the ECEF three-dimensional Cartesian coordinates and each clipping surface to determine whether it is in the field of view, so as to output the corresponding diagram.
[0012] Preferably, in the fourth step, a corresponding color representing whether it is within the field of view may also be output in the corresponding diagram.
[0013] Preferably, in the second step, during the process of drawing the rectangle, the longitude and latitude coordinates corresponding to each pixel covered by the rectangle are automatically interpolated in the pixel shader.
[0014] Preferably, the second step draws a rectangle using OpenGL.
[0015] Preferably, the second step draws a rectangle using DirectX.
[0016] Preferably, the field of view clipping planes in the ECEF three-dimensional Cartesian coordinate system include five clipping planes, wherein the five clipping planes are an upper clipping plane, a lower clipping plane, a left clipping plane, a right clipping plane and a horizon clipping plane.
[0017] Preferably, in the first step, for the calculation of the upper clipping plane, lower clipping plane, left clipping plane and right clipping plane of the field of view, let the view matrix be V and the projection matrix be M. After the transformation of M and V, the upper clipping plane, lower clipping plane, left clipping plane and right clipping plane in the clipping space are [0,1,0,1], [0,1,0,-1], [1,0,0,1], [1,0,0,-1] respectively. After calculation and sorting, the four clipping planes in the ECEF three-dimensional Cartesian coordinate system are obtained, which are R1+R3, R1-R3, R2+R3 and R2-R3 respectively, where R1, R2 and R3 are four vectors composed of four elements from the first row to the fourth row of the matrix MV respectively.
[0018] Preferably, in the first step, for the calculation of the horizon clipping plane, the horizon clipping plane clips off the ground area blocked by the curvature of the earth. Suppose the observation position is (x, y, z), and the radius of the earth is R, then the horizon line clipping plane is calculated as (x, y, z, -R).
[0019] The present invention can correctly handle special situations such as the field of view including the poles, crossing the positive and negative 180-degree longitudes, and including part of the sky. It can correctly handle any observation position, any horizontal and vertical viewing angles, any observation direction, pitch, and roll angles, and can ensure calculation accuracy and speed, facilitating real-time applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] A more complete understanding of the present invention and its attendant advantages and features will be more readily appreciated by reference to the following detailed description taken in conjunction with the accompanying drawings, in which:
[0021] Figure 1 The flowchart of the method for accurately displaying the current field of view in the eagle-eye window in the three-dimensional map according to the preferred embodiment of the present invention is schematically shown.
[0022] Figure 2 An example of a field of view clipping surface of a method for accurately displaying the current field of view in an eagle-eye window in a three-dimensional map according to a preferred embodiment of the present invention is schematically shown.
[0023] Figure 3 An output example of a method for accurately displaying the current field of view in an eagle-eye window in a three-dimensional map according to a preferred embodiment of the present invention is schematically shown.
[0024] It should be noted that the drawings are used to illustrate the present invention, rather than to limit the present invention. Note that the drawings showing the structures may not be drawn to scale. In addition, in the drawings, the same or similar elements are marked with the same or similar reference numerals. DETAILED DESCRIPTION
[0025] In order to make the contents of the present invention clearer and easier to understand, the contents of the present invention are described in detail below in conjunction with specific embodiments and drawings.
[0026] Figure 1 The flowchart of the method for accurately displaying the current field of view in the eagle-eye window in the three-dimensional map according to the preferred embodiment of the present invention is schematically shown.
[0027] like Figure 1 As shown, the method for accurately displaying the current field of view in the eagle eye window of the three-dimensional map according to the preferred embodiment of the present invention includes:
[0028] The first step S1: calculate the field of view clipping plane in the ECEF (Earth-Centered, Earth-Fixed) three-dimensional Cartesian coordinate system according to the observation position and angle, and submit the calculated field of view clipping plane to the pixel shader;
[0029] For example, mainly, the field of view clipping plane in the ECEF three-dimensional Cartesian coordinate system includes five clipping planes, wherein the five clipping planes are an upper clipping plane, a lower clipping plane, a left clipping plane, a right clipping plane and a horizon clipping plane, as shown in FIG. Figure 2 shown.
[0030] Specifically, for example, the five clipping planes can be calculated as follows:
[0031] (a) For the upper, lower, left and right clipping planes of the field of view. Let the view matrix be V, and the projection matrix be M. After the transformations of M and V, the upper, lower, left and right clipping planes in the clipping space are [0,1,0,1], [0,1,0,-1], [1,0,0,1], [1,0,0,-1] respectively. After calculation and arrangement, the four clipping planes in the ECEF three-dimensional Cartesian coordinate system are R1+R3, R1-R3, R2+R3, R2-R3 respectively, where R1, R2 and R3 are four vectors composed of four elements from the first row to the fourth row of the matrix MV respectively;
[0032] (b) For the horizon clipping plane. The horizon clipping plane can clip the ground area blocked by the curvature of the earth. Let the observation position be (x, y, z) and the radius of the earth be R. Then the horizon clipping plane can be calculated as (x, y, z, -R). The ellipsoid can also be calculated similarly.
[0033] The second step S2: draw a rectangle, wherein the texture coordinates of the four corner points of the rectangle are respectively set to the longitude and latitude coordinates of the four corner points of the two-dimensional view display range; and, in the process of drawing the rectangle, each pixel covered by the rectangle automatically interpolates the longitude and latitude coordinates corresponding to the pixel in the pixel shader; preferably, for example, the second step S2 uses OpenGL to draw a rectangle. Alternatively, for example, the second step S2 uses DirectX to draw a rectangle.
[0034] The third step S3: in the pixel shader, the longitude and latitude coordinates corresponding to the pixel are converted into ECEF three-dimensional Cartesian coordinates according to the ellipsoid parameters;
[0035] Step 4 S4: In the pixel shader, determine the position between the ECEF three-dimensional Cartesian coordinates and each clipping surface to determine whether it is in the field of view, so as to output a corresponding diagram, such as Figure 3 and preferably, in the fourth step S4, a corresponding color representing whether it is within the field of view can also be output in the corresponding diagram.
[0036] It can be seen that the present invention adopts a pixel shader to quickly draw the field of view in real time according to the processing characteristics of the GPU; moreover, the present invention adopts a reverse calculation method to correctly handle the various special situations mentioned above.
[0037] In summary, the present invention has at least the following advantages:
[0038] (1) This method can correctly handle special cases such as the field of view including the poles, crossing the positive and negative 180 degrees of longitude, and including part of the sky, without the need for complex algorithm judgment and special processing;
[0039] (2) The method can correctly handle any observation position, horizontal and vertical viewing angles, and any viewing direction, pitch, and roll angles, as long as the view and projection matrices can be obtained;
[0040] (3) This method can always guarantee the highest calculation accuracy, and the calculation complexity is only related to the size of the two-dimensional view window. When displaying, it is mainly processed by the GPU, and the CPU only needs a very small amount of calculation, which is very conducive to real-time rendering.
[0041] It should be noted that, unless otherwise specified, the terms "first", "second", "third", etc. in the specification are only used to distinguish the various components, elements, steps, etc. in the specification, and are not used to indicate the logical relationship or sequential relationship between the various components, elements, steps, etc.
[0042] It is to be understood that, although the present invention has been disclosed as a preferred embodiment, the above embodiment is not intended to limit the present invention. For any person skilled in the art, without departing from the scope of the technical solution of the present invention, the technical content disclosed above can be used to make many possible changes and modifications to the technical solution of the present invention, or modified into equivalent embodiments of equivalent changes. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of protection of the technical solution of the present invention.
Claims
1. A method for accurately displaying the current field of view in an eagle-eye window in a three-dimensional map, characterized in that include: The first step: calculate the field of view clipping plane in the ECEF three-dimensional Cartesian coordinate system according to the observation position and angle, and submit the calculated field of view clipping plane to the pixel shader; wherein, the field of view clipping plane in the ECEF three-dimensional Cartesian coordinate system includes five clipping planes, wherein the five clipping planes are the upper clipping plane, the lower clipping plane, the left clipping plane, the right clipping plane and the horizon clipping plane; for the calculation of the upper clipping plane, the lower clipping plane, the left clipping plane and the right clipping plane of the field of view, let the view matrix be V, the projection matrix be M, and the upper clipping plane, the lower clipping plane, the left clipping plane and the right clipping plane in the clipping space after the transformation of M and V are [0,1,0 respectively. ,1],[0,1,0,-1],[1,0,0,1],[1,0,0,-1]. After calculation and arrangement, the four clipping planes in the ECEF three-dimensional Cartesian coordinate system are R1+R3, R1-R3, R2+R3, and R2-R3, respectively. R1, R2, and R3 are four vectors composed of four elements from the first row to the fourth row of the matrix MV. For the calculation of the horizon clipping plane, the horizon clipping plane clips off the ground area blocked by the curvature of the earth. Suppose the observation position is (x,y,z), and the radius of the earth is R. Then the ground plane clipping plane is calculated as (x,y,z,-R). Step 2: Draw a rectangle, wherein the texture coordinates of the four corner points of the rectangle are respectively set to the longitude and latitude coordinates of the four corner points of the display range of the two-dimensional view; Step 3: In the pixel shader, the longitude and latitude coordinates corresponding to the pixel are converted into ECEF three-dimensional Cartesian coordinates according to the ellipsoid parameters; Step 4: In the pixel shader, determine the position between the ECEF three-dimensional Cartesian coordinates and each clipping surface to determine whether it is in the field of view, so as to output the corresponding diagram.
2. The method for accurately displaying the current field of view in an eagle-eye window in a three-dimensional map according to claim 1, characterized in that: In the fourth step, a corresponding color representing whether it is within the field of view can also be output in the corresponding diagram.
3. The method for accurately displaying the current field of view in an eagle-eye window in a three-dimensional map according to claim 1 or 2, characterized in that: In the second step, when drawing the rectangle, the latitude and longitude coordinates corresponding to each pixel covered by the rectangle are automatically interpolated in the pixel shader.
4. The method for accurately displaying the current field of view in an eagle-eye window in a three-dimensional map according to claim 1 or 2, characterized in that: The second step uses OpenGL to draw a rectangle.
5. The method for accurately displaying the current field of view in an eagle-eye window in a three-dimensional map according to claim 1 or 2, characterized in that: The second step uses DirectX to draw a rectangle.
