Disclosure of Invention
Aiming at the problems in the prior art, the application provides a three-dimensional ray drawing method and a three-dimensional ray drawing device, which can break through the limitation of traditional straight line drawing and realize the real track expression considering the earth curvature.
In order to solve at least one of the problems, the application provides the following technical scheme:
In a first aspect, the present application provides a three-dimensional ray rendering method, including:
receiving a plurality of groups of point location data, wherein each group of point location data comprises a starting point coordinate, an end point coordinate, a starting point name and an end point name, converting the starting point coordinate and the end point coordinate from a geographic coordinate system to a projection coordinate system, calculating the earth surface distance and azimuth angle between the starting point coordinate and the end point coordinate, determining the number of control points based on the earth surface distance, generating a plurality of candidate control points on a midrange line of a two-point connecting line, calculating an offset coefficient of each candidate control point by combining the azimuth angle, and taking the offset candidate control points as curve control points;
Performing curvature correction on the curve control points, calculating influence parameters of earth curvature on ray tracks based on a curved surface projection model, performing fusion correction on the influence parameters and space coordinates of the curve control points, constructing a Bezier curve parameter model, generating a plurality of path points on the basis of the Bezier curve parameter model, restoring the path point coordinates from a projection coordinate system to a geographic coordinate system, and combining the restored path point coordinates, the starting point coordinates and the ending point coordinates according to a space position sequence to form a point set sequence;
Loading the point set sequence in a three-dimensional coordinate system, carrying out coordinate transformation compensation on the point set sequence, establishing a mapping relation between a geodetic coordinate system and a display coordinate system, projecting the compensated point set sequence to a spherical space, carrying out curve fitting on the projected point set sequence based on preset rendering parameters to generate a three-dimensional space curve with curvature correction, combining the three-dimensional space curve with the starting point name and the end point name to form ray display data, and rendering the three-dimensional space curve on a three-dimensional map based on the ray display data.
Further, the receiving a plurality of sets of point location data, each set of point location data including a start point coordinate, an end point coordinate, a start point name, and an end point name, converting the start point coordinate and the end point coordinate from a geographic coordinate system to a projection coordinate system, and calculating a surface distance and an azimuth angle between the start point coordinate and the end point coordinate, including:
Reading a data stream containing point location information from a data interface, analyzing a start point coordinate, an end point coordinate, a start point name and an end point name of point location data extracted from the data stream, carrying out validity check on the start point coordinate and the end point coordinate, establishing an index list of the point location data, and organizing and storing checked data according to a preset format;
Converting the starting point coordinate and the end point coordinate from a WGS84 geographic coordinate system to an ink card bracket projection coordinate system, calculating the space coordinate values of the starting point coordinate and the end point coordinate on a projection plane according to a projection transformation matrix, calculating the surface distance between the starting point coordinate and the end point coordinate by adopting a spherical distance formula, and calculating the azimuth angles of the starting point coordinate and the end point coordinate based on the projected coordinate values.
Further, the determining the number of the control points based on the surface distance, generating a plurality of candidate control points on a midchord line of a two-point line, calculating an offset coefficient of each candidate control point by combining the azimuth angle, and taking the offset candidate control points as curve control points, including:
Establishing a mapping relation between the ray length and the number of control points, substituting the earth surface distance into the mapping relation, calculating the number of the control points, calculating a perpendicular bisector equation of a two-point connecting line according to the spatial positions of the starting point coordinates and the end point coordinates, generating a plurality of candidate control points on the perpendicular bisector according to preset intervals, and calculating the vertical distance from each candidate control point to the connecting line;
And establishing a control point offset model according to the azimuth angle, substituting the space coordinates of the candidate control points into the control point offset model to calculate reference offset values of all the control points, carrying out weight adjustment on the reference offset values based on the vertical distance to obtain offset coefficients, and multiplying the offset coefficients with the space coordinates of the candidate control points to obtain offset control point coordinates.
Further, the curvature correction is performed on the curve control point, an influence parameter of the earth curvature on the ray track is calculated based on a curved surface projection model, the influence parameter and the space coordinates of the curve control point are fused and corrected, and a Bezier curve parameter model is constructed, which comprises:
Calculating a curvature radius according to the parameters of the earth ellipsoid, projecting the curve control point to a reference ellipsoid, calculating the earth principal curvature and geodesic curvature of the curve control point on the ellipsoid based on an earth measurement model, constructing an earth curvature influence factor calculation model, and substituting the earth principal curvature and geodesic curvature into the earth curvature influence factor calculation model to obtain influence parameters;
And carrying out normalization processing on the space coordinates of the curve control points, carrying out weighted combination on the influence parameters and the normalized space coordinates to obtain correction coefficients, correcting the space coordinates of the curve control points according to the correction coefficients, and substituting the corrected coordinates of the control points into a quadratic Bezier curve equation to construct a curve parameter model.
Further, generating a plurality of path points on the basis of the bezier curve parameter model, restoring the path point coordinates from a projection coordinate system to a geographic coordinate system, and combining the restored path point coordinates with the starting point coordinates and the ending point coordinates according to a spatial position sequence to form a point set sequence, wherein the method comprises the following steps:
Uniformly sampling the Bezier curve parameter model in a section [0,1], calculating parameter equation values corresponding to all sampling points, substituting the parameter equation values into the Bezier curve parameter model to obtain space coordinates of path points, and carrying out numerical correction on the space coordinates of the path points to eliminate calculation errors;
restoring the path point coordinates from a mercator projection coordinate system to a WGS84 geographic coordinate system, calculating longitude and latitude and elevation values of the path point coordinates, sequencing the starting point coordinates, the restored path point coordinates and the end point coordinates according to a spatial position relation, constructing a point set sequence based on a preset data structure, and storing the sequencing result.
Further, the loading the point set sequence in the three-dimensional coordinate system, performing coordinate transformation compensation on the point set sequence, establishing a mapping relation between the geodetic coordinate system and the display coordinate system, and projecting the compensated point set sequence to the spherical space, including:
Initializing display parameters of a three-dimensional coordinate system, loading coordinate data of the point set sequence into a coordinate system buffer area, calculating a coordinate transformation matrix according to a display view angle, performing geometric transformation on the point set sequence based on the coordinate transformation matrix to obtain compensated coordinate values, and performing normalization processing on the compensated coordinate values;
And constructing a conversion equation from a geodetic coordinate system to a display coordinate system, substituting the geodetic coordinate of the point set sequence into the conversion equation to calculate the display coordinate, establishing a spherical projection relation according to an ellipsoidal model of the earth, and projecting the compensated point set sequence to a reference spherical space based on the spherical projection relation.
Further, the curve fitting is performed on the projected point set sequence based on preset rendering parameters, a three-dimensional space curve with curvature correction is generated, the three-dimensional space curve, the starting point name and the end point name are combined to form ray display data, and the three-dimensional space curve is rendered on a three-dimensional map based on the ray display data, and the method comprises the following steps:
Loading material parameters and illumination parameters of curve rendering, performing cubic spline interpolation on a projected point set sequence, calculating tangent vectors and curvatures of interpolation nodes, constructing geometric description of a three-dimensional curve based on the tangent vectors and the curvatures, converting the geometric description into vertex data and index data, and performing normal calculation on the vertex data to obtain a three-dimensional space curve;
And combining the geometric data of the three-dimensional space curve, the starting point name and the ending point name into a ray display data structure, carrying out illumination calculation and depth test on the ray display data according to preset rendering pipeline configuration, and drawing the three-dimensional space curve to a rendering buffer zone of a three-dimensional map based on the rendering pipeline.
In a second aspect, the present application provides a three-dimensional ray drawing apparatus comprising:
The data processing module is used for receiving a plurality of groups of point location data, each group of point location data comprises a starting point coordinate, an end point coordinate, a starting point name and an end point name, the starting point coordinate and the end point coordinate are converted from a geographic coordinate system to a projection coordinate system, the earth surface distance and azimuth angle between the starting point coordinate and the end point coordinate are calculated, the number of control points is determined based on the earth surface distance, a plurality of candidate control points are generated on a middle vertical line of a two-point connecting line, the offset coefficient of each candidate control point is calculated by combining with the azimuth angle, and the offset candidate control points are used as curve control points;
The coordinate determining module is used for carrying out curvature correction on the curve control points, calculating influence parameters of the earth curvature on ray tracks based on a curved surface projection model, carrying out fusion correction on the influence parameters and space coordinates of the curve control points, constructing a Bezier curve parameter model, generating a plurality of path points on the basis of the Bezier curve parameter model, restoring the path point coordinates from a projection coordinate system to a geographic coordinate system, and combining the restored path point coordinates, the starting point coordinates and the ending point coordinates according to a space position sequence to form a point set sequence;
The ray drawing module is used for loading the point set sequence in a three-dimensional coordinate system, carrying out coordinate transformation compensation on the point set sequence, establishing a mapping relation between a geodetic coordinate system and a display coordinate system, projecting the compensated point set sequence to a spherical space, carrying out curve fitting on the projected point set sequence based on preset rendering parameters, generating a three-dimensional space curve with curvature correction, combining the three-dimensional space curve with the starting point name and the end point name to form ray display data, and rendering the three-dimensional space curve on a three-dimensional map based on the ray display data.
In a third aspect, the present application provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the three-dimensional ray rendering method when executing the program.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the three-dimensional ray tracing method.
In a fifth aspect, the application provides a computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the three-dimensional ray tracing method.
According to the technical scheme, the three-dimensional ray drawing method and the three-dimensional ray drawing device are provided, and curve control points are dynamically generated by combining azimuth angles and earth surface distances through accurate conversion of a geographic coordinate system and a projection coordinate system. The curvature correction mechanism based on the curved surface projection model is innovatively designed, the influence of the earth curvature on the ray track is considered, and smooth space track generation is realized through the Bezier curve parameter model. The system adopts coordinate transformation compensation and spherical projection technology to establish accurate mapping of a geodetic coordinate system and a display coordinate system, ensures accurate rendering of a three-dimensional space curve under different scales and visual angles, and provides a high-precision technical scheme for geographic information visualization. The method breaks through the limitation of traditional straight line drawing, and realizes the expression of the real track considering the earth curvature.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The technical scheme of the application obtains, stores, uses, processes and the like the data, which all meet the relevant regulations of national laws and regulations.
In consideration of the problems existing in the prior art, the application provides a three-dimensional ray drawing method and device, which dynamically generate curve control points by combining azimuth angles and earth surface distances through accurate conversion of a geographic coordinate system and a projection coordinate system. The curvature correction mechanism based on the curved surface projection model is innovatively designed, the influence of the earth curvature on the ray track is considered, and smooth space track generation is realized through the Bezier curve parameter model. The system adopts coordinate transformation compensation and spherical projection technology to establish accurate mapping of a geodetic coordinate system and a display coordinate system, ensures accurate rendering of a three-dimensional space curve under different scales and visual angles, and provides a high-precision technical scheme for geographic information visualization. The method breaks through the limitation of traditional straight line drawing, and realizes the expression of the real track considering the earth curvature.
In order to break through the limitation of traditional straight line drawing and realize the real track expression considering the earth curvature, the application provides an embodiment of a three-dimensional ray drawing method, and referring to fig. 1, the three-dimensional ray drawing method specifically comprises the following contents:
Step S101, receiving a plurality of groups of point location data, wherein each group of point location data comprises a starting point coordinate, an end point coordinate, a starting point name and an end point name, converting the starting point coordinate and the end point coordinate from a geographic coordinate system to a projection coordinate system, calculating the earth surface distance and azimuth angle between the starting point coordinate and the end point coordinate, determining the number of control points based on the earth surface distance, generating a plurality of candidate control points on a middle vertical line of a two-point connecting line, calculating an offset coefficient of each candidate control point by combining with the azimuth angle, and taking the offset candidate control points as curve control points;
Optionally, the embodiment adopts a multi-level data parsing mechanism in the point data processing. The interface layer receives input data flow through the asynchronous buffer queue and supports high concurrency processing of batch data. The parser firstly extracts the data packet header, verifies the protocol version number and the data format identifier, and then parses the point location data according to a preset field mapping table. For the necessary fields, including start point coordinates, end point coordinates, start point name and end point name, strict type checking and boundary verification are employed. For example, the longitude value is limited to the range of [ -180, 180], the latitude value is limited to the range of [ -90, 90], and the coordinate precision is supported to six bits after the decimal point.
The embodiment realizes a high-precision coordinate system conversion engine. In the process of converting a WGS84 geographical coordinate system into an ink-card-holder projection coordinate system, an ellipsoid parameter table comprising a long half shaft, a short half shaft, a first eccentricity and a second eccentricity is firstly loaded. The conversion calculation adopts a step strategy, firstly converts the geographic coordinates into Cartesian space rectangular coordinates, and then carries out projection transformation. When processing high latitude areas, the deformation is reduced by using a horizontal axis ink-card support projection. The projection parameters are dynamically optimized according to the target area, so that the projection deformation is ensured to be in a controllable range. In the coordinate conversion process, double-precision floating point number operation is adopted, and accumulated errors are processed through an error compensation model.
The present embodiment designs an accurate geodetic calculation module. The earth surface distance calculation is based on an improved Vincenty algorithm, firstly, the earth is approximately an ellipsoid of revolution, and the geodesic length is obtained through iterative calculation. And setting a convergence threshold value in the iterative process, so as to ensure the calculation accuracy. For special cases where the pole or date change line is crossed, singular points are avoided by segmentation calculations. The azimuth calculation adopts a main azimuth formula of the earth, and the influence of the curvature and projection deformation of the earth is considered. In the calculation process, the convergence and efficiency of iteration are ensured through self-adaptive step control.
The embodiment builds a dynamic control point configuration system. The control point number determination is based on a multi-factor assessment model, taking into account ray length, curvature change and display scale. The model adopts piecewise function mapping, and for short-distance rays (less than 1000 km), a control point is arranged at intervals of fixed distance, for medium-distance rays, the distance between the control points increases along with the distance, and for transoceanic rays, additional control points are added at key positions to better represent the earth curvature. And a smoothing factor is introduced in the quantity calculation process, so that the quantity of control points is prevented from being suddenly changed near a critical value.
The embodiment realizes an efficient perpendicular bisector generating algorithm. Firstly, obtaining a direction vector of a connecting line through vector calculation, and obtaining a direction vector of a perpendicular bisector through orthogonal transformation. The generation of the candidate control points adopts a self-adaptive sampling strategy, the sampling interval is in direct proportion to the length of the rays, and the uniform distribution of the control points is ensured. In order to avoid numerical calculation errors, a Kelemer rule is adopted to solve a perpendicular bisector equation, and calculation stability is ensured through matrix condition number analysis. In the generation process, the point location query is accelerated through the spatial index structure.
The present embodiment builds a complex control point offset calculation framework. The offset model divides the 360 degree azimuth space into a plurality of sectors based on azimuth characteristics, each sector employing an independent offset calculation rule. The offset coefficient is determined by a combination of a reference offset value, which is related to the ray length and azimuth angle, and a weight factor, which considers the vertical distance of the control point to the link. In the polar region, the offset calculation is optimized by polar transformation. The whole offset process is processed in parallel through tensor operation, so that the calculation efficiency is improved.
The embodiment realizes the smooth transition of the ray track through the accurate calculation of the curve control points. The space distribution of the control points fully considers the influence of the curvature of the earth, and ensures that the generated space curve has good geometric characteristics and visual effects. The scheme improves the processing efficiency through a multi-level optimization strategy while ensuring the calculation precision, and provides reliable basic data for subsequent curve fitting and rendering.
S102, curvature correction is carried out on the curve control points, influence parameters of the earth curvature on ray tracks are calculated based on a curved surface projection model, fusion correction is carried out on the influence parameters and space coordinates of the curve control points, a Bezier curve parameter model is constructed, a plurality of path points are generated on the basis of the Bezier curve parameter model, the path point coordinates are restored from a projection coordinate system to a geographic coordinate system, and the restored path point coordinates, the starting point coordinates and the ending point coordinates are combined according to a space position sequence to form a point set sequence;
optionally, the present embodiment implements an accurate curvature correction mechanism in the curve control point processing. The correction process firstly establishes an earth ellipsoid parameter model which comprises a long half shaft, a short half shaft, a flat rate and other reference parameters. For each control point, calculating local curvature characteristics through a Gaussian curvature formula, and considering the geometric characteristics of the geodesic on the ellipsoid. The correction algorithm adopts an iteration mode, and the control point position is updated through the weighted combination of the normal curvature and the geodetic curvature each time until the curvature change amount is smaller than a preset threshold value.
The embodiment builds a complete curved projection model. The model is based on Riemann geometry theory, and the earth surface is regarded as a two-dimensional manifold to be embedded into a three-dimensional Euclidean space. By establishing a local coordinate system, a first basic form and a second basic form near each control point are calculated. In the calculation process of the influence parameters, the comprehensive influence of the Gaussian curvature and the average curvature on the ray track is considered. Curvature continuity is ensured by segmentation processing and smooth transitions for long distance rays across multiple projection belts.
The embodiment designs a self-adaptive coordinate fusion algorithm. And converting the curvature influence parameters into a space transformation matrix, and fusing the space transformation matrix with the control point coordinates through tensor operation. The fusion process adopts a weighted average strategy, and the weight coefficient is dynamically adjusted according to the position and the curvature of the control point. To deal with numerical sensitivity, regularization terms are introduced to control fusion strength. The corrected control point coordinates are optimized through a least square method, and uniformity and smoothness of spatial distribution are ensured.
The embodiment realizes a high-order Bezier curve parameterization method. Based on the corrected control points, an n-order Bezier curve model is constructed, wherein n is adaptively determined according to the number of the control points. The parameterization process adopts a Decastetter algorithm, and the calculation efficiency is improved through recursion subdivision. In the curve parameter optimization process, tension parameters are introduced to adjust the curve shape, so that the generated track is ensured to be in line with the curvature characteristic of the earth, and the visual effect is good.
The present embodiment builds an accurate way point generation mechanism. And (3) carrying out self-adaptive sampling in a Bezier curve parameter interval, wherein the sampling density is in direct proportion to the curve curvature. For the region with the sharp curvature change, the track precision is improved by increasing the sampling point number. Tangential continuity constraint is applied in the sampling process to ensure smooth transition between adjacent segments. The generated path points are optimized through cubic spline interpolation, and possible jitter is eliminated.
The present embodiment employs a strict numerical processing strategy in coordinate system conversion. When the coordinate system is restored to the WGS84 geographical coordinate system from the cutterhead projection coordinate system, an inverse projection transformation matrix is constructed first. In the transformation process, the nonlinear characteristic of projection deformation is considered, and the restoring precision is improved by an iteration method. For coordinate restoration in high latitude areas, improved polar transformation is adopted to avoid singular points. The accuracy of the restored coordinates is verified through ellipsoidal fitting.
The embodiment realizes an efficient point set sequence organization mechanism. Firstly, a spatial index structure is established to support quick position inquiry and sequencing. During the sequence organization, the relative position of the points is determined by azimuth and accumulated distance. For densely distributed path points, clustering analysis is adopted for screening, so that redundancy is avoided. The final point set sequence verifies its continuity and integrity through spatial topological relationships.
The embodiment realizes the ray track generation conforming to the curvature characteristics of the earth through complex curvature correction and parametric modeling. The scheme fully considers the geometric characteristics of the earth surface, and ensures the accuracy and visual effect of the track through multi-level optimization. The whole processing flow adopts a parallel computing architecture, so that the processing efficiency is obviously improved while the computing precision is ensured, and reliable technical support is provided for large-scale ray drawing.
Step S103, loading the point set sequence in a three-dimensional coordinate system, carrying out coordinate transformation compensation on the point set sequence, establishing a mapping relation between a geodetic coordinate system and a display coordinate system, projecting the compensated point set sequence to a spherical space, carrying out curve fitting on the projected point set sequence based on preset rendering parameters to generate a three-dimensional space curve with curvature correction, combining the three-dimensional space curve with the starting point name and the end point name to form ray display data, and rendering the three-dimensional space curve on a three-dimensional map based on the ray display data.
Optionally, in this embodiment, a hierarchical coordinate processing mechanism is used in three-dimensional space construction. Firstly, initializing OpenGL rendering contexts, and configuring viewport parameters and a projection matrix. The point set sequence loading process adopts a Vertex Buffer Object (VBO) technology to transmit coordinate data to the graphic memory in batches. In order to improve the rendering efficiency, a dynamic level detail (LOD) mechanism is realized, and the point set density is dynamically adjusted according to the viewpoint distance.
The embodiment realizes an accurate coordinate transformation compensation algorithm. The compensation process first builds a world coordinate system transformation matrix, taking into account the combined effects of scaling, rotation and translation transformations. And aiming at projection deformation caused by different latitudes, carrying out local compensation through self-adaptive grid division. The compensation coefficient is optimized through a least square method, so that consistency of spatial relationship before and after transformation is ensured. For rays that span multiple projection belts, a piecewise compensation strategy is employed to achieve a smooth transition at the boundary.
The present embodiment designs a complex coordinate system mapping framework. And quaternion interpolation is adopted for conversion from the geodetic coordinate system to the display coordinate system, so that the problem of universal joint locking is avoided. The mapping relationship is represented by an affine transformation matrix, and supports dynamic view angle adjustment. To deal with the special case of polar regions, a seamless transition from polar to Cartesian coordinates is achieved. An error compensation mechanism is introduced in the mapping process, and the projection accuracy is ensured through feedback control.
This embodiment builds a high precision spherical projection engine. The compensated sequence of point sets is mapped to a reference ellipsoid based on an improved spherical mercator projection algorithm. The projection process considers the earth's flatness effect, and the projection deformation is optimized through ellipsoidal parameters. For a wide range of rays, a segmented projection strategy is employed, with each tile using optimal projection parameters. The projection results verify their continuity by surface fitting.
The embodiment realizes an adaptive curve fitting mechanism. Based on the projected point set, a modified NURBS (non-uniform rational B-spline) algorithm was used for curve fitting. The control point weights are dynamically adjusted through curvature analysis, so that sufficient fitting accuracy is ensured to be maintained in a high curvature area. The distribution of the node vectors is optimized through tangential continuity constraint, and abrupt change of the fitted curve is avoided. The whole fitting process is solved through iteration until the residual error meets the convergence condition.
The embodiment builds a complete rendering parameter configuration system. The material parameters include diffuse reflection color, specular reflection coefficient and transparency, supporting a distance-based gradient effect. The illumination model employs improved Phong coloration, taking into account the combined effects of ambient light, diffuse reflected light, and specular reflected light. The rendering pipeline is configured with multi-sampling antialiasing (MSAA), which improves the display quality of the curve edges.
The embodiment designs an efficient ray display data organization structure. And packaging the geometric data of the three-dimensional space curve and the starting and ending point marking information into a unified data structure. The labeling position is optimized through an avoidance algorithm, so that the characters are prevented from overlapping. The data structure supports attribute animation, and the dynamic rendering effect of rays is realized. The rendering process adopts an instantiation technology, so that the batch drawing efficiency is improved.
The embodiment realizes a professional map rendering engine. And the data loading is optimized through a multi-level caching mechanism, so that the real-time rendering of the large-scale rays is supported. The depth test ensures the correct shielding relation between the ray and the terrain, and the semitransparent mixing realizes the penetrating effect of the ray. The rendering engine supports multi-view switching, including orthographic projection and perspective projection, meeting different viewing requirements.
The embodiment realizes the real visual representation of rays through accurate coordinate processing and high-quality rendering technology. The scheme ensures the geographic precision and improves the visual effect through multi-level optimization. The whole rendering process adopts the characteristic of modern graphic API, maintains higher rendering frame rate while supporting large-scale data, and provides reliable technical support for three-dimensional map application.
From the above description, the three-dimensional ray drawing method provided by the embodiment of the application can dynamically generate the curve control point by precisely converting the geographic coordinate system and the projection coordinate system and combining the azimuth angle and the earth surface distance. The curvature correction mechanism based on the curved surface projection model is innovatively designed, the influence of the earth curvature on the ray track is considered, and smooth space track generation is realized through the Bezier curve parameter model. The system adopts coordinate transformation compensation and spherical projection technology to establish accurate mapping of a geodetic coordinate system and a display coordinate system, ensures accurate rendering of a three-dimensional space curve under different scales and visual angles, and provides a high-precision technical scheme for geographic information visualization. The method breaks through the limitation of traditional straight line drawing, and realizes the expression of the real track considering the earth curvature.
In an embodiment of the three-dimensional ray tracing method of the present application, referring to fig. 2, the following may be further specifically included:
Step S201, reading a data stream containing point location information from a data interface, analyzing a start point coordinate, an end point coordinate, a start point name and an end point name of point location data extracted from the data stream, carrying out validity check on the start point coordinate and the end point coordinate, establishing an index list of the point location data, and organizing and storing checked data according to a preset format;
step S202, converting the starting point coordinate and the end point coordinate from a WGS84 geographic coordinate system to an ink card bracket projection coordinate system, calculating the space coordinate values of the starting point coordinate and the end point coordinate on a projection plane according to a projection transformation matrix, calculating the surface distance between the starting point coordinate and the end point coordinate by adopting a spherical distance formula, and calculating the azimuth angles of the starting point coordinate and the end point coordinate based on the projected coordinate values.
Optionally, the present embodiment employs a multithreaded asynchronous read mechanism at the data interface layer. By establishing an independent data reading thread pool, the receiving and the buffering of the high concurrency data stream are realized. The data flow uses a double buffer queue structure to ensure that no data loss occurs under high load conditions. The interface supports a plurality of data formats including binary stream, JSON, XML, etc., and format conversion is performed through a unified adapter interface. For large-scale data transmission, a data compression and breakpoint continuous transmission mechanism is realized.
The present embodiment designs a powerful data parsing engine. The analysis process firstly identifies key fields in the data stream through a lexical analyzer, and extracts basic elements of point location information. For character strings with different coding formats, the automatic coding recognition and conversion functions are realized. The coordinate data analysis adopts high-precision floating point number processing, and enough valid bit numbers after decimal points are reserved. The name field ensures multilingual support through Unicode standardization processing.
The embodiment realizes a strict data verification framework. The coordinate validity check includes a range check and a format verification, the longitude is limited to be within the range of-180, and the latitude is limited to be within the range of-90, 90. For coordinates near special points, such as poles and date change lines, special processing rules are employed. The abnormal data found in the verification process is recorded through an error log system, and detailed diagnosis information is generated.
The present embodiment builds an efficient data indexing mechanism. And the point location data is organized by adopting a B+ tree structure, so that quick space inquiry and range retrieval are supported. The design of index keys takes into account the principle of spatial locality, and the data of adjacent regions are stored in close physical locations. In order to improve the retrieval efficiency, a multi-level caching mechanism is realized, and frequently accessed data is kept in a memory.
The embodiment realizes an accurate coordinate system conversion algorithm. In the process of converting the WGS84 geographical coordinate system into the ink-card-holder projection coordinate system, standard ellipsoid parameters are loaded first. The conversion calculation adopts a Gaussian-Kelvin projection model, and the influence of the earth's flatness is considered. For different projection bands, the central meridian is dynamically selected, so that the minimum projection deformation is ensured. The coordinate conversion process is processed in parallel through matrix operation, so that the calculation efficiency is improved.
The present embodiment contemplates a complete projective transformation framework. In the construction of the projective transformation matrix, the scaling factor, the rotation angle and the translation vector are considered. The matrix elements are optimized through a least square method, so that the projection deformation is ensured to be uniformly distributed. For a large area, a banded projection strategy is adopted, and smooth transition is realized at the boundary between bands. The projection results verify their accuracy by inverse transformation.
The embodiment constructs a professional ranging algorithm system. The spherical distance calculation adopts an improved Vincenty formula, and the irregularity of the ellipsoid of the earth is considered. In the calculation process, the accuracy is improved by an iteration method, and the convergence condition is dynamically adjusted according to the actual application requirement. For distance calculation across polar regions, a segmentation calculation strategy is adopted to avoid singular points.
The embodiment realizes an accurate azimuth calculation method. Based on the projected coordinate values, an initial azimuth angle is calculated using a four-quadrant arctangent function. The azimuth calculation takes the influence of projection deformation into consideration, and the correction is performed through a spherical triangle formula. For long distance rays, the azimuth angle changes of the starting point and the end point are calculated for subsequent curve control point generation.
The embodiment provides reliable basic data for subsequent ray generation through strict data processing and accurate coordinate transformation. The scheme ensures the data integrity and accuracy and improves the processing efficiency through multi-level optimization. The whole data processing flow adopts a modularized design, has good expansibility and maintainability, and can adapt to the data processing requirements of different scales and types.
In an embodiment of the three-dimensional ray tracing method of the present application, referring to fig. 3, the following may be further specifically included:
Step 301, establishing a mapping relation between the ray length and the number of control points, substituting the earth surface distance into the mapping relation, calculating to obtain the number of the control points, calculating a perpendicular bisector equation of a two-point connecting line according to the spatial positions of the starting point coordinate and the end point coordinate, generating a plurality of candidate control points on the perpendicular bisector according to preset intervals, and calculating the vertical distance from each candidate control point to the connecting line;
And S302, establishing a control point offset model according to the azimuth angle, substituting the spatial coordinates of the candidate control points into the control point offset model to calculate reference offset values of all the control points, carrying out weight adjustment on the reference offset values based on the vertical distance to obtain offset coefficients, and multiplying the offset coefficients with the spatial coordinates of the candidate control points to obtain offset control point coordinates.
Optionally, the present embodiment implements an adaptive mapping mechanism in the ray control strategy. The mapping relation is constructed by a piecewise function, and different control point densities are adopted for different distance ranges. For short-distance rays (less than 1000 km), linear mapping is adopted to ensure basic curve smoothness, for medium-distance rays, the number of control points is increased along with the logarithm of the distance, the precision and the calculation cost are balanced, and for remote rays, additional control points are additionally arranged at key positions, so that the earth curvature effect is better represented. The mapping function realizes smooth transition through spline interpolation, and abrupt change at critical points is avoided.
The present embodiment designs an accurate perpendicular bisector calculation frame. Firstly, a vertical direction vector is obtained through vector cross multiplication, and a parameterized linear equation is constructed by combining a connecting line midpoint. To deal with the numerical accuracy problem, the linear equation set is solved by adopting the Kramer rule, and the calculation stability is ensured through matrix condition number analysis. On the projection plane, the direction of the perpendicular bisector is ensured to be exactly perpendicular to the direction of the connecting line by affine transformation.
The embodiment realizes an efficient candidate point generation algorithm. The preset interval is determined by a self-adaptive sampling strategy, and the sampling density and the length of the rays are in inverse proportion, so that the control points are uniformly distributed. The generating process adopts vector operation parallel processing, and the computing efficiency is improved. For each candidate point, the exact vertical distance to the line is calculated by the projection theorem as a reference parameter for the subsequent offset calculation.
The present embodiment builds a complex azimuth processing model. The 360-degree azimuth space is divided into a plurality of sectors, and each sector adopts independent offset calculation rules. The model considers the influence of the rotation direction of the earth and the main ocean current direction, so that the generated ray track is more in line with the natural law. The sector boundary is smoothly transited through a weight function, so that track abrupt change caused by azimuth change is avoided.
The embodiment realizes a dynamic control point offset mechanism. The reference offset value is calculated by adopting nonlinear mapping, and the comprehensive influence of azimuth angle, geographic position and ray length is considered. For control points of the polar region, the offset calculation is optimized by polar transformation. The offset model realizes parallel processing through tensor operation, and improves the calculation efficiency.
The present embodiment designs an accurate weight adjustment algorithm. The weighting function is constructed based on vertical distance, and a Gaussian distribution characteristic is adopted to ensure smooth transition. The relative positions of control points are considered in the adjustment process, the weight of the control points close to the starting point is smaller, the weight of the control points in the middle section is larger, and natural radian change is formed. Regularization term is introduced in the weight calculation process, so that track distortion caused by extreme values is avoided.
The present embodiment constructs a stable coordinate transformation frame. The offset calculation adopts a local coordinate system, and the control point is projected to a tangential plane for processing. The coordinate transformation matrix is constructed through quaternion interpolation, so that the problem of universal joint locking is avoided. The influence of projection deformation is considered in the transformation process, and the precision is ensured through error compensation.
The embodiment realizes an efficient parallel computing architecture. The batch operation of the control point coordinates adopts SIMD instruction set optimization, and the processing efficiency is obviously improved. The data structure design supports vectorization operation, and memory access overhead is reduced. In the calculation process, load balance is realized through task decomposition, and the method is suitable for data processing requirements of different scales.
According to the embodiment, natural transition of the ray track is realized through accurate control point generation and offset calculation. The scheme ensures geometric accuracy and improves visual effect through multi-level optimization. The whole processing flow adopts a modularized design, has good expansibility and maintainability, and provides reliable control point data for subsequent curve fitting. The processing result fully considers the geographic characteristics and the natural law, and the generated ray track not only accords with a mathematical model, but also has good visual expressive force.
In an embodiment of the three-dimensional ray tracing method of the present application, referring to fig. 4, the following may be further specifically included:
S401, calculating a curvature radius according to an earth ellipsoid parameter, projecting the curve control point to a reference ellipsoid, calculating the earth principal curvature and geodesic curvature of the curve control point on the ellipsoid based on an earth measurement model, constructing an earth curvature influence factor calculation model, and substituting the earth principal curvature and the geodesic curvature into the earth curvature influence factor calculation model to obtain an influence parameter;
And step S402, carrying out normalization processing on the space coordinates of the curve control points, carrying out weighted combination on the influence parameters and the normalized space coordinates to obtain correction coefficients, correcting the space coordinates of the curve control points according to the correction coefficients, and substituting the corrected coordinates of the control points into a quadratic Bezier curve equation to construct a curve parameter model.
Optionally, the present embodiment enables accurate ellipsoid parameter calculation in curvature processing. Local curvature characteristics were calculated by meldean curvature based on WGS84 standard ellipsoid parameters, including major half-axis, minor half-axis and flatness. For different latitudes, dynamically calculating the curvature radius of the unitary mortise circle and the curvature radius of the meridian circle, and ensuring the accuracy of curvature calculation. In the parameter calculation process, the earth irregularity is considered, and the accuracy is improved through an iteration method.
The embodiment designs a professional ellipsoidal projection mechanism. The control point projection adopts an improved Gaussian projection algorithm, and a local tangential plane coordinate system is firstly established. The projection process considers the geometrical characteristics of the ellipsoid and optimizes the projection deformation through tangent point selection. For a control point sequence crossing a plurality of projection belts, seamless spliced projection conversion is realized, and projection continuity is ensured.
The present embodiment implements a complex geodetic computing framework. The calculation of the principal curvature of the earth is based on Riemann geometry theory, taking into account a first basic form and a second basic form of the curved surface. The geodesic curvature is calculated by the kristolon sign and reflects the geometric characteristics of the shortest path on the curved surface. The curvature calculation process adopts a tensor analysis method, and supports high-precision numerical calculation.
The present embodiment builds a complete curvature influence model. The influence factor calculation takes into account the combined effects of principal curvature, geodesic curvature and local azimuth. The model adopts a nonlinear mapping function, so that reasonable change trend of the influence parameters along with curvature change is ensured. For special regions, such as near poles, the computational accuracy is optimized by polar transformation.
The embodiment realizes efficient coordinate normalization processing. The normalization process firstly calculates the gravity center and scale parameters of the control point sequence, and coordinate standardization is realized through translation and scaling transformation. The process takes into account the numerical stability and ensures the reliability of the transformation by condition number analysis. The normalization result verifies the correctness of the normalization result through reverse transformation.
The present embodiment designs an accurate weighted combination algorithm. The weight coefficient is determined by an adaptive method, and the spatial distribution and curvature characteristics of the control points are considered. Tensor operation is adopted in the combination process, and parallel processing is supported to improve efficiency. And a smoothing factor is introduced in the weight adjustment process, so that discontinuity caused by local mutation is avoided.
The present embodiment builds a reliable coordinate correction mechanism. The correction coefficients are applied to the control point coordinates by matrix transformation, ensuring the maintenance of the spatial relationship. The correction process takes into account the local coordinate system changes and optimizes the transformation accuracy by means of a jacobian matrix. For densely distributed control points, curvature-based adaptive adjustment is achieved.
The embodiment realizes the high-order Bezier curve parameterization. Based on the corrected control points, a quadratic Bezier curve equation is constructed, and parameterized expression and geometric operation are supported. The parameter model is optimized through a Decastetter algorithm, so that smoothness and continuity of the curve are ensured. Tension parameters are considered in the curve generation process, and the shape of the curve can be adjusted to adapt to different scene requirements.
The embodiment realizes curve generation conforming to the curvature characteristics of the earth through accurate curvature calculation and control point correction. The scheme ensures geometric accuracy and improves calculation efficiency through multi-level optimization. The whole processing flow adopts modern calculation geometric theory, and has strict mathematical foundation and good practicability. The processing result fully considers the geometric characteristics of the earth surface, and the generated curve meets the geodetic standard and has good visual effect. The scheme provides reliable mathematical models and geometric data for subsequent three-dimensional visualization.
In an embodiment of the three-dimensional ray tracing method of the present application, referring to fig. 5, the following may be further specifically included:
Step S501, uniformly sampling the Bezier curve parameter model in a section [0,1], calculating parameter equation values corresponding to all sampling points, substituting the parameter equation values into the Bezier curve parameter model to obtain space coordinates of path points, and carrying out numerical correction on the space coordinates of the path points to eliminate calculation errors;
And S502, restoring the path point coordinates from a mercator projection coordinate system to a WGS84 geographic coordinate system, calculating longitude and latitude and elevation values of the path point coordinates, sequencing the starting point coordinates, the restored path point coordinates and the ending point coordinates according to a spatial position relation, constructing a point set sequence based on a preset data structure, and storing the sequencing result.
Optionally, the embodiment implements an adaptive parameter partitioning mechanism in the bezier curve sampling. The sampling process firstly determines the optimal sampling interval through curve arc length analysis, and increases the sampling density for the area with severe curvature change. The parameter space division adopts a non-uniform distribution strategy, so that more accurate curve expression is ensured in a key area. The generation process of the sampling points is accelerated through parallel calculation, and the processing efficiency is improved.
The present embodiment designs an accurate parametric equation solution framework. The equation solution adopts an improved Newton-Lawson iteration method, and the convergence rate is improved through dynamic step adjustment. And jacobian matrix correction is introduced in the solving process, so that the stability of numerical calculation is ensured. And for special parameter values, the Taylor expansion approximation calculation is adopted, so that the problem of singular points is avoided.
The present embodiment implements a complex coordinate calculation mechanism. And high-precision floating point operation is adopted in the space coordinate calculation process, and enough valid bit numbers are reserved. And the coordinate calculation result is verified through geometric constraint, so that the continuity and smoothness of the point sequence are ensured. For the approach points close to the control point, the local precision is improved through interpolation optimization.
The present embodiment builds a complete error correction system. Firstly, identifying abnormal values through residual error analysis, and eliminating random errors by adopting a local regression method. The correction process considers the correlation between the coordinate components and optimizes the correction parameters by covariance analysis. For the system error, dynamic correction based on Kalman filtering is realized.
The embodiment realizes a high-precision coordinate system restoration algorithm. When the coordinate system is restored to the WGS84 geographical coordinate system from the cutterhead projection coordinate system, an accurate inverse projection transformation matrix is constructed first. The recovery process adopts an iterative method, and ensures the conversion accuracy by controlling the residual error. For coordinate restoration in high latitude areas, a polar coordinate compensation mechanism is realized.
The embodiment designs a professional longitude and latitude calculation framework. The longitude and latitude values are calculated through an ellipsoidal parameter model, and the influence of the earth flatness is considered. The calculation of the elevation value is based on the earth ellipsoid, and the accuracy is improved by the correction of the ground level. And verifying the accuracy of the result through ellipsoidal fitting in the coordinate conversion process.
The present embodiment builds an efficient spatial ordering mechanism. Based on the relative position relation of the path points, an improved rapid ordering algorithm is adopted to realize sequence rearrangement. The ordering process considers the spatial continuity constraint, and ensures that the generated point set sequence accords with the actual path characteristics. For densely distributed approach points, the spatial distribution is optimized by cluster analysis.
The embodiment realizes reliable data structure design. The point set sequence is stored by adopting a double linked list structure, and high-efficiency inserting and deleting operations are supported. The data structure contains location information and attribute data to facilitate subsequent rendering and analysis. The storage process realizes data compression and index optimization, and memory occupation is reduced.
The embodiment realizes the accurate sampling and the recovery of the Bezier curve through accurate parameter calculation and coordinate conversion. The scheme ensures geometric accuracy and improves calculation efficiency through multi-level optimization. The whole processing flow adopts modern numerical calculation theory, and has strict mathematical foundation and good practicability.
This embodiment presents unique technical advantages in terms of coordinate system conversion and spatial ordering. Through accurate back projection transformation and spatial relation analysis, the accuracy and the continuity of the point set sequence are ensured. The scheme provides high-quality basic data for subsequent three-dimensional visualization and supports ray rendering and space analysis under complex scenes. The processing result fully considers the special requirements of the geographic information system, thereby ensuring the accuracy of data and providing good calculation performance.
In an embodiment of the three-dimensional ray tracing method of the present application, referring to fig. 6, the following may be further specifically included:
step S601, initializing display parameters of a three-dimensional coordinate system, loading coordinate data of the point set sequence into a coordinate system buffer zone, calculating a coordinate transformation matrix according to a display view angle, performing geometric transformation on the point set sequence based on the coordinate transformation matrix to obtain compensated coordinate values, and performing normalization processing on the compensated coordinate values;
Step S602, constructing a conversion equation from a geodetic coordinate system to a display coordinate system, substituting the geodetic coordinate of the point set sequence into the conversion equation to calculate the display coordinate, establishing a spherical projection relationship according to an ellipsoidal model of the earth, and projecting the compensated point set sequence to a reference spherical space based on the spherical projection relationship.
Optionally, the embodiment realizes complete configuration of display parameters during initialization of the three-dimensional scene. The display parameters comprise key elements such as a view angle, a near-far clipping plane, a projection type and the like, and the key elements are uniformly scheduled through a scene manager. In the parameter configuration process, the resolution and performance characteristics of the device are considered, and the rendering quality is dynamically optimized. For high-resolution display equipment, multi-sampling anti-aliasing is automatically started, and the edge display effect is improved.
The embodiment designs an efficient coordinate data caching mechanism. The buffer zone adopts a multi-level structure, comprises a vertex buffer object and an index buffer object, and supports the rapid access of a large-scale point set. The data loading process is optimized through asynchronous transmission, and main thread blocking is reduced. The buffer management realizes dynamic memory allocation and self-adaptive adjustment according to the data scale.
The embodiment realizes accurate view angle transformation calculation. In the construction process of the transformation matrix, an observation coordinate system is firstly determined through the viewpoint position and the target point. The matrix calculation considers the internal parameters and the external parameters of the camera, and smooth visual angle transition is realized through quaternion interpolation. For a wide range of scenes, view cone clipping optimization is achieved.
This embodiment builds a complex geometric transformation framework. The transformation process first performs a model view transformation and then maps the three-dimensional scene to a two-dimensional plane through a projective transformation. The transformation calculation adopts matrix stack management and supports nested transformation operation. For dynamic scenes, incremental updating of the transformation matrix is achieved.
The embodiment realizes professional coordinate normalization processing. The normalization process takes into account scene dimensions and display range, mapping coordinates to a standardized device coordinate system by affine transformation. In the processing process, the precision is ensured through error analysis, and a special processing strategy is adopted for boundary conditions.
The present embodiment designs an accurate coordinate system conversion equation. The transformation equation is based on the earth reference system, taking into account the base differences and projection distortions between the different coordinate systems. The equation solving adopts an iteration method, and the conversion accuracy is ensured through residual error control. For special areas, local parameter correction is achieved.
The present embodiment builds a complete spherical projection frame. The projection relation is based on a standard ellipsoid model, and coordinate mapping is realized through a Gaussian projection principle. The projection process takes into account the effects of the earth's curvature and reduces distortion by banded projection. For polar region projection, a stereoscopic projection mode is adopted to optimize the display effect.
The embodiment realizes efficient construction of the reference sphere. The spherical space adopts triangular grid discretization, and the grid density is dynamically adjusted according to the display requirement. The space division adopts a quadtree structure and supports multi-level detail level control. For complex terrain areas, grid subdivision optimization is achieved.
The embodiment realizes the accurate visualization of the point set sequence through the display parameter configuration and the coordinate transformation. According to the scheme, the display effect is guaranteed, and meanwhile, the rendering efficiency is improved through multi-level optimization. The whole treatment process adopts modern graphics theory, and has strict mathematical foundation and good practicability.
This embodiment presents unique technical advantages in terms of coordinate system conversion and spherical projection. Accurate expression of the spatial relationship is ensured through accurate coordinate mapping and projective transformation. The scheme provides a reliable display basis for the three-dimensional visualization system and supports interactive operation and space analysis under complex scenes. The processing result fully considers the professional requirements of the geographic information system, not only ensures the accuracy of the spatial data, but also provides smooth interaction experience.
In an embodiment of the three-dimensional ray tracing method of the present application, referring to fig. 7, the following may be further specifically included:
Step S701, loading material parameters and illumination parameters of curve rendering, performing cubic spline interpolation on a projected point set sequence, calculating tangent vectors and curvatures of interpolation nodes, constructing geometric description of a three-dimensional curve based on the tangent vectors and the curvatures, converting the geometric description into vertex data and index data, and performing normal calculation on the vertex data to obtain a three-dimensional space curve;
Step S702, combining the geometric data of the three-dimensional space curve, the starting point name and the ending point name into a ray display data structure, carrying out illumination calculation and depth test on the ray display data according to preset rendering pipeline configuration, and drawing the three-dimensional space curve to a rendering buffer zone of a three-dimensional map based on the rendering pipeline.
Optionally, the embodiment implements a complex parameter configuration mechanism in the material system. The material parameters comprise physical characteristics such as diffuse reflection coefficient, specular reflection coefficient, transparency and the like, and are uniformly scheduled through a material manager. The illumination parameter configuration supports a multi-light source model comprising ambient light, parallel light and point light sources, and realizes reality rendering based on physics. And for illumination changes in different time periods, dynamically adjusting illumination parameters, and enhancing visual sense realism.
The present embodiment designs an accurate spline interpolation algorithm. The cubic spline interpolation adopts a natural boundary condition to ensure the second-order continuity of the curve at the node. The interpolation process is constructed by piecewise cubic polynomials, and the coefficients for each segment are obtained by solving a system of linear equations. For dense sampling points, tension parameter adjustment and curve shape control are realized.
The embodiment realizes an efficient tangent calculation framework. The tangential vector is calculated through the first derivative of the spline function, and the accuracy is improved by adopting a center difference method. The curvature calculation is based on the change rate of the tangent vector, and the geometric characteristic of the space curve is deduced through a Freey inner formula. For high curvature areas, increasing the sampling density optimizes the display effect.
The present embodiment builds a complete geometry description system. The geometric description comprises attribute data such as vertex positions, tangential vectors, normal vectors and the like, and is organized in a structured format. The data conversion process is accelerated through parallel computation, and real-time processing of a large-scale curve is supported. The geometry data organization considers the GPU rendering architecture and optimizes the memory access mode.
The present embodiment implements a specialized normal vector calculation mechanism. The vector calculation is based on tangential vector and curvature distribution, and consistency of vector field is ensured through the orthogonalization of the gram-schmitt. The calculation process considers curve torsion characteristics, and a local coordinate system is built through a Lei Nabiao. For the singular point, interpolation smoothing processing is adopted.
This embodiment designs an efficient organization of data structures. The ray display data structure adopts hierarchical design and comprises geometric data, material properties and labeling information. The data organization supports dynamic update, and incremental rendering optimization is realized. Structural design takes into account data compression and fast access requirements.
The present embodiment builds a specialized rendering pipeline framework. Rendering configurations support advanced features such as multisampling antialiasing, depth testing, transparency blending, etc. The illumination calculation adopts a delayed rendering technology, and separates geometric processing and illumination processing stages. The depth test realizes the correct shielding relation through a Z-buffer algorithm.
The embodiment realizes efficient buffer management. The rendering buffer adopts a multi-buffer mechanism to support asynchronous rendering and vertical synchronization. The buffer area allocation considers the memory management, and realizes the dynamic scheduling of resources. For large-scale scenes, block rendering optimization is achieved.
According to the embodiment, through material rendering and illumination calculation, ray realism display is achieved. The scheme ensures the visual effect and improves the rendering performance through multi-level optimization. The whole processing flow adopts the modern graphic rendering theory, and has strict mathematical foundation and good practicability.
The present embodiment exhibits unique technical advantages in terms of geometry processing and rendering optimization. Through accurate curve construction and efficient rendering pipeline, smoothness and realism of ray display are ensured. The scheme provides a professional rendering engine for the three-dimensional visualization system and supports real-time display and interactive operation under complex scenes. The processing result fully considers the professional requirements of the geographic information system, not only ensures the accuracy of the spatial data, but also provides excellent visual expressive force. Through optimization of depth test and illumination calculation, the natural display effect of rays on the earth surface is realized, and visual expression of spatial relationship is enhanced.
In order to break through the limitation of the traditional straight line drawing and realize the real track expression considering the earth curvature, the application provides an embodiment of a three-dimensional ray drawing device for realizing all or part of the contents of the three-dimensional ray drawing method, and referring to fig. 8, the three-dimensional ray drawing device specifically comprises the following contents:
The data processing module 10 is configured to receive multiple sets of point location data, where each set of point location data includes a start point coordinate, an end point coordinate, a start point name and an end point name, convert the start point coordinate and the end point coordinate from a geographic coordinate system to a projection coordinate system, calculate a surface distance and an azimuth angle between the start point coordinate and the end point coordinate, determine the number of control points based on the surface distance, generate multiple candidate control points on a middle vertical line of a two-point connection line, calculate an offset coefficient of each candidate control point in combination with the azimuth angle, and use the offset candidate control points as curve control points;
the coordinate determining module 20 is configured to perform curvature correction on the curve control point, calculate an influence parameter of the earth curvature on the ray track based on a curved surface projection model, perform fusion correction on the influence parameter and a spatial coordinate of the curve control point, construct a bezier curve parameter model, generate a plurality of path points on the basis of the bezier curve parameter model, restore the path point coordinate from a projection coordinate system to a geographic coordinate system, and combine the restored path point coordinate with the start point coordinate and the end point coordinate according to a spatial position sequence to form a point set sequence;
The ray drawing module 30 is configured to load the point set sequence in a three-dimensional coordinate system, perform coordinate transformation compensation on the point set sequence, establish a mapping relationship between a geodetic coordinate system and a display coordinate system, project the compensated point set sequence to a spherical space, perform curve fitting on the projected point set sequence based on preset rendering parameters, generate a three-dimensional space curve with curvature correction, combine the three-dimensional space curve with the starting point name and the end point name to form ray display data, and render the three-dimensional space curve on a three-dimensional map based on the ray display data.
From the above description, the three-dimensional ray drawing device provided by the embodiment of the application can dynamically generate the curve control point by precisely converting the geographic coordinate system and the projection coordinate system and combining the azimuth angle and the earth surface distance. The curvature correction mechanism based on the curved surface projection model is innovatively designed, the influence of the earth curvature on the ray track is considered, and smooth space track generation is realized through the Bezier curve parameter model. The system adopts coordinate transformation compensation and spherical projection technology to establish accurate mapping of a geodetic coordinate system and a display coordinate system, ensures accurate rendering of a three-dimensional space curve under different scales and visual angles, and provides a high-precision technical scheme for geographic information visualization. The method breaks through the limitation of traditional straight line drawing, and realizes the expression of the real track considering the earth curvature.
In order to break through the limitation of traditional straight line drawing and realize the real track expression considering the earth curvature, the application provides an embodiment of an electronic device for realizing all or part of contents in the three-dimensional ray drawing method, wherein the electronic device specifically comprises the following contents:
The system comprises a processor (processor), a memory (memory), a communication interface (Communications Interface) and a bus, wherein the processor, the memory and the communication interface are in communication with each other through the bus, the communication interface is used for realizing information transmission between a three-dimensional ray drawing device and related equipment such as a core service system, a user terminal and a related database, and the logic controller can be a desktop computer, a tablet computer, a mobile terminal and the like, and the embodiment is not limited to the above. In this embodiment, the logic controller may refer to an embodiment of the three-dimensional ray drawing method and an embodiment of the three-dimensional ray drawing apparatus in the embodiments, and the contents thereof are incorporated herein, and the repetition is omitted.
It is understood that the user terminal may include a smart phone, a tablet electronic device, a network set top box, a portable computer, a desktop computer, a Personal Digital Assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Wherein, intelligent wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In practical applications, part of the three-dimensional ray drawing method may be performed on the electronic device side as described above, or all operations may be performed in the client device. Specifically, the selection may be made according to the processing capability of the client device, and restrictions of the use scenario of the user. The application is not limited in this regard. If all operations are performed in the client device, the client device may further include a processor.
The client device may have a communication module (i.e. a communication unit) and may be connected to a remote server in a communication manner, so as to implement data transmission with the server. The server may include a server on the side of the task scheduling center, and in other implementations may include a server of an intermediate platform, such as a server of a third party server platform having a communication link with the task scheduling center server. The server may include a single computer device, a server cluster formed by a plurality of servers, or a server structure of a distributed device.
Fig. 9 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 9, the electronic device 9600 can include a central processor 9100 and a memory 9140, the memory 9140 being coupled to the central processor 9100. It is noted that this fig. 9 is exemplary, and that other types of structures may be used in addition to or in place of the structures to implement telecommunications functions or other functions.
In one embodiment, the three-dimensional ray tracing method functionality may be integrated into the central processor 9100. The central processor 9100 may be configured to perform the following control:
Step S101, receiving a plurality of groups of point location data, wherein each group of point location data comprises a starting point coordinate, an end point coordinate, a starting point name and an end point name, converting the starting point coordinate and the end point coordinate from a geographic coordinate system to a projection coordinate system, calculating the earth surface distance and azimuth angle between the starting point coordinate and the end point coordinate, determining the number of control points based on the earth surface distance, generating a plurality of candidate control points on a middle vertical line of a two-point connecting line, calculating an offset coefficient of each candidate control point by combining with the azimuth angle, and taking the offset candidate control points as curve control points;
S102, curvature correction is carried out on the curve control points, influence parameters of the earth curvature on ray tracks are calculated based on a curved surface projection model, fusion correction is carried out on the influence parameters and space coordinates of the curve control points, a Bezier curve parameter model is constructed, a plurality of path points are generated on the basis of the Bezier curve parameter model, the path point coordinates are restored from a projection coordinate system to a geographic coordinate system, and the restored path point coordinates, the starting point coordinates and the ending point coordinates are combined according to a space position sequence to form a point set sequence;
step S103, loading the point set sequence in a three-dimensional coordinate system, carrying out coordinate transformation compensation on the point set sequence, establishing a mapping relation between a geodetic coordinate system and a display coordinate system, projecting the compensated point set sequence to a spherical space, carrying out curve fitting on the projected point set sequence based on preset rendering parameters to generate a three-dimensional space curve with curvature correction, combining the three-dimensional space curve with the starting point name and the end point name to form ray display data, and rendering the three-dimensional space curve on a three-dimensional map based on the ray display data.
From the above description, the electronic device provided by the embodiment of the application dynamically generates the curve control point by precisely converting the geographic coordinate system and the projection coordinate system and combining the azimuth angle and the earth surface distance. The curvature correction mechanism based on the curved surface projection model is innovatively designed, the influence of the earth curvature on the ray track is considered, and smooth space track generation is realized through the Bezier curve parameter model. The system adopts coordinate transformation compensation and spherical projection technology to establish accurate mapping of a geodetic coordinate system and a display coordinate system, ensures accurate rendering of a three-dimensional space curve under different scales and visual angles, and provides a high-precision technical scheme for geographic information visualization. The method breaks through the limitation of traditional straight line drawing, and realizes the expression of the real track considering the earth curvature.
In another embodiment, the three-dimensional ray drawing apparatus may be configured separately from the central processing unit 9100, for example, the three-dimensional ray drawing apparatus may be configured as a chip connected to the central processing unit 9100, and the three-dimensional ray drawing method functions are realized by control of the central processing unit.
As shown in fig. 9, the electronic device 9600 may further include a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 does not necessarily include all the components shown in fig. 9, and furthermore, the electronic device 9600 may include components not shown in fig. 9, to which reference is made in the prior art.
As shown in fig. 9, the central processor 9100, sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, which central processor 9100 receives inputs and controls the operation of the various components of the electronic device 9600.
The memory 9140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information about failure may be stored, and a program for executing the information may be stored. And the central processor 9100 can execute the program stored in the memory 9140 to realize information storage or processing, and the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, but not limited to, an LCD display.
The memory 9140 may be a solid state memory such as Read Only Memory (ROM), random Access Memory (RAM), SIM card, etc. But also a memory which holds information even when powered down, can be selectively erased and provided with further data, an example of which is sometimes referred to as EPROM or the like. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 storing application programs and function programs or a flow for executing operations of the electronic device 9600 by the central processor 9100.
The memory 9140 may also include a data store 9143, the data store 9143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, address book applications, etc.).
The communication module 9110 is a transmitter/receiver that transmits and receives signals via the antenna 9111. The communication module 9110 (transmitter/receiver) is coupled to the central processor 9100 to provide input signals and receive output signals, as in the case of conventional mobile communication terminals.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, etc., may be provided in the same electronic device. The communication module 9110 (transmitter/receiver) is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and to receive audio input from the microphone 9132 to implement usual telecommunications functions. The audio processor 9130 can include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100 so that sound can be recorded locally through the microphone 9132 and sound stored locally can be played through the speaker 9131.
An embodiment of the present application also provides a computer-readable storage medium capable of implementing all steps in the three-dimensional ray drawing method in which the execution subject is a server or a client in the above embodiment, the computer-readable storage medium storing thereon a computer program which, when executed by a processor, implements all steps in the three-dimensional ray drawing method in which the execution subject is a server or a client in the above embodiment, for example, the processor implements the following steps when executing the computer program:
Step S101, receiving a plurality of groups of point location data, wherein each group of point location data comprises a starting point coordinate, an end point coordinate, a starting point name and an end point name, converting the starting point coordinate and the end point coordinate from a geographic coordinate system to a projection coordinate system, calculating the earth surface distance and azimuth angle between the starting point coordinate and the end point coordinate, determining the number of control points based on the earth surface distance, generating a plurality of candidate control points on a middle vertical line of a two-point connecting line, calculating an offset coefficient of each candidate control point by combining with the azimuth angle, and taking the offset candidate control points as curve control points;
S102, curvature correction is carried out on the curve control points, influence parameters of the earth curvature on ray tracks are calculated based on a curved surface projection model, fusion correction is carried out on the influence parameters and space coordinates of the curve control points, a Bezier curve parameter model is constructed, a plurality of path points are generated on the basis of the Bezier curve parameter model, the path point coordinates are restored from a projection coordinate system to a geographic coordinate system, and the restored path point coordinates, the starting point coordinates and the ending point coordinates are combined according to a space position sequence to form a point set sequence;
step S103, loading the point set sequence in a three-dimensional coordinate system, carrying out coordinate transformation compensation on the point set sequence, establishing a mapping relation between a geodetic coordinate system and a display coordinate system, projecting the compensated point set sequence to a spherical space, carrying out curve fitting on the projected point set sequence based on preset rendering parameters to generate a three-dimensional space curve with curvature correction, combining the three-dimensional space curve with the starting point name and the end point name to form ray display data, and rendering the three-dimensional space curve on a three-dimensional map based on the ray display data.
As can be seen from the above description, the computer readable storage medium provided by the embodiments of the present application dynamically generates the curve control point by precisely converting the geographic coordinate system and the projection coordinate system, and combining the azimuth angle and the earth surface distance. The curvature correction mechanism based on the curved surface projection model is innovatively designed, the influence of the earth curvature on the ray track is considered, and smooth space track generation is realized through the Bezier curve parameter model. The system adopts coordinate transformation compensation and spherical projection technology to establish accurate mapping of a geodetic coordinate system and a display coordinate system, ensures accurate rendering of a three-dimensional space curve under different scales and visual angles, and provides a high-precision technical scheme for geographic information visualization. The method breaks through the limitation of traditional straight line drawing, and realizes the expression of the real track considering the earth curvature.
The embodiments of the present application also provide a computer program product capable of implementing all the steps in the three-dimensional ray drawing method in which the execution subject is a server or a client in the above embodiments, and the computer program/instructions implement the steps of the three-dimensional ray drawing method when executed by a processor, for example, the computer program/instructions implement the steps of:
Step S101, receiving a plurality of groups of point location data, wherein each group of point location data comprises a starting point coordinate, an end point coordinate, a starting point name and an end point name, converting the starting point coordinate and the end point coordinate from a geographic coordinate system to a projection coordinate system, calculating the earth surface distance and azimuth angle between the starting point coordinate and the end point coordinate, determining the number of control points based on the earth surface distance, generating a plurality of candidate control points on a middle vertical line of a two-point connecting line, calculating an offset coefficient of each candidate control point by combining with the azimuth angle, and taking the offset candidate control points as curve control points;
S102, curvature correction is carried out on the curve control points, influence parameters of the earth curvature on ray tracks are calculated based on a curved surface projection model, fusion correction is carried out on the influence parameters and space coordinates of the curve control points, a Bezier curve parameter model is constructed, a plurality of path points are generated on the basis of the Bezier curve parameter model, the path point coordinates are restored from a projection coordinate system to a geographic coordinate system, and the restored path point coordinates, the starting point coordinates and the ending point coordinates are combined according to a space position sequence to form a point set sequence;
step S103, loading the point set sequence in a three-dimensional coordinate system, carrying out coordinate transformation compensation on the point set sequence, establishing a mapping relation between a geodetic coordinate system and a display coordinate system, projecting the compensated point set sequence to a spherical space, carrying out curve fitting on the projected point set sequence based on preset rendering parameters to generate a three-dimensional space curve with curvature correction, combining the three-dimensional space curve with the starting point name and the end point name to form ray display data, and rendering the three-dimensional space curve on a three-dimensional map based on the ray display data.
From the above description, it can be seen that the computer program product provided by the embodiments of the present application dynamically generates curve control points by precisely converting a geographic coordinate system and a projection coordinate system, and combining an azimuth angle and a surface distance. The curvature correction mechanism based on the curved surface projection model is innovatively designed, the influence of the earth curvature on the ray track is considered, and smooth space track generation is realized through the Bezier curve parameter model. The system adopts coordinate transformation compensation and spherical projection technology to establish accurate mapping of a geodetic coordinate system and a display coordinate system, ensures accurate rendering of a three-dimensional space curve under different scales and visual angles, and provides a high-precision technical scheme for geographic information visualization. The method breaks through the limitation of traditional straight line drawing, and realizes the expression of the real track considering the earth curvature.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the principles and embodiments of the present invention have been described in detail in the foregoing application of the principles and embodiments of the present invention, the above examples are provided for the purpose of aiding in the understanding of the principles and concepts of the present invention and may be varied in many ways by those of ordinary skill in the art in light of the teachings of the present invention, and the above descriptions should not be construed as limiting the invention.