Three-dimensional real-time simulation method, device, equipment and storage medium based on meteorological environment

By acquiring meteorological data and generating three-dimensional textures, using the cell shader to render the intersection range, the problem of insufficient real-time data rendering and multi-angle rendering capabilities in the prior art is solved, and efficient three-dimensional rendering of meteorological data is achieved.

CN118608669BActive Publication Date: 2025-01-07XIAMEN TIANWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411042098.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2025-01-07
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

Existing meteorological simulation technologies are difficult to support real-time filtering rendering of data and visual rendering capabilities of horizontal and vertical profiles, especially in complex meteorological environments.

Method used

By obtaining meteorological data, creating two-dimensional textures and preprocessing, generating three-dimensional textures, using the cel colorizer to generate the viewpoint range of intersections between rays and meteorological data of the vertex, and traversing the intersection range for volume rendering, real-time rendering of data and Multi-angle visualization.

Benefits of technology

It effectively solves the problems of real-time filtering and multi-angle visual rendering of data, and improves the rendering ability of meteorological data in three-dimensional scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118608669B_ABST
    Figure CN118608669B_ABST
Patent Text Reader

Abstract

The present invention provides a three-dimensional real-time simulation method, device, equipment and storage medium based on a meteorological environment. The method first obtains meteorological data, creates a two-dimensional texture according to the meteorological data, then preprocesses the two-dimensional texture, stores the preprocessed two-dimensional texture in a first array and a second array, and generates a three-dimensional texture of the meteorological data based on the first array and the second array. Then, the three-dimensional texture of the meteorological data is input into a fragment shader to obtain vertex positions and viewpoint positions, and a ray from the viewpoint to the vertex is generated based on the vertex position and the viewpoint position, and an intersection range of the ray from the viewpoint to the vertex and the three-dimensional space of the meteorological data is generated in the fragment shader; finally, the hierarchical points of the intersection range of the three-dimensional space of the meteorological data are traversed, and the three-dimensional space of the meteorological data is volume rendered, thereby solving the problem that the prior art is difficult to support real-time filtering and rendering of data and visual rendering capabilities of horizontal and vertical sections.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of meteorological simulation, and in particular to a three-dimensional real-time simulation method, device, equipment and storage medium based on meteorological environment. Background Art

[0002] The three-dimensional real-time simulation technology of meteorological environment is of great significance in meteorological research and forecasting. Based on the results of numerical weather forecast, the application of virtual reality technology can simulate and display the future atmospheric environment, and realize multi-dimensional perspective and all-round observation. This provides a new technical means for meteorological service guarantee such as disaster prevention and mitigation, atmospheric environment simulation and forecasting, and command and simulation of major events.

[0003] As WebGL technology continues to mature, the demand for 3D visualization in web applications is also growing. However, 3D spatial interpolation rendering can usually only be performed in a certain horizontal direction. Realizing the rendering of meteorological data at different heights in a 3D scene has become a key challenge in the application of WebGL technology.

[0004] Since the information of meteorological elements is complex and changeable, and the impacts in different geomorphic environments are also different, the existing meteorological simulation technology mainly relies on heat maps and shader programs to achieve three-dimensional spatial interpolation rendering of meteorological elements. Heat maps achieve three-dimensional spatial interpolation rendering by converting the data of meteorological elements into colors; shader programs achieve complex three-dimensional spatial interpolation rendering effects by writing codes. The disadvantage of the existing technology is that the implementation logic is relatively complex, and it is difficult to support real-time filtering and rendering of data and visual rendering capabilities of horizontal and vertical sections.

[0005] In view of this, this application is filed. Summary of the invention

[0006] The present invention discloses a three-dimensional real-time simulation method, device, equipment and storage medium based on meteorological environment, aiming to solve the problem that the prior art is difficult to support real-time filtering and rendering of data and visual rendering of horizontal and vertical sections.

[0007] The first embodiment of the present invention provides a three-dimensional real-time simulation method based on a meteorological environment, comprising:

[0008] Acquire meteorological data, and create a two-dimensional texture according to the meteorological data, wherein the two-dimensional texture is used to store a mapping relationship from numerical values ​​to colors;

[0009] Preprocessing the two-dimensional texture, storing the preprocessed two-dimensional texture in a first array and a second array, and generating a three-dimensional texture of the meteorological data based on the first array and the second array, specifically: normalizing the two-dimensional texture data so that the range of the two-dimensional texture data is between 0 and 255, wherein the two-dimensional texture data includes an angle array, a horizontal split array, and a depth split array, creating the first array for storing the integer part of the normalized data, and creating the second array for storing the decimal part of the normalized data; creating a first three-dimensional texture for passing into the first array, creating a second three-dimensional texture for passing into the second array, and generating the three-dimensional texture of the meteorological data according to the first three-dimensional texture and the second three-dimensional texture;

[0010] Input the three-dimensional texture of the meteorological data into a fragment shader to obtain vertex positions and viewpoint positions, generate viewpoint-to-vertex rays based on the vertex positions and viewpoint positions, and generate an intersection range of the viewpoint-to-vertex rays and the three-dimensional space of the meteorological data in the fragment shader;

[0011] The layered points within the intersection range of the three-dimensional space of the meteorological data are traversed, and volume rendering is performed on the three-dimensional space of the meteorological data.

[0012] Preferably, the acquiring of meteorological data and the creation of a two-dimensional texture according to the meteorological data are specifically:

[0013] Configure the minimum and maximum values ​​of the meteorological data, and specify the scale and color in the legend color array;

[0014] Calculate the linear gradient color band according to the proportion and color in the specified legend color array, and calculate the color value corresponding to the data value according to the minimum value and the maximum value;

[0015] A two-dimensional texture is created based on the linear gradient color bands and the color values.

[0016] Preferably, the expression for generating the ray from the viewpoint to the vertex based on the vertex position and the viewpoint position is:

[0017] vDirection=position-vOrigin

[0018] Among them, position is the vertex position, vOrigin is the viewpoint position, and vDirection is the ray from the viewpoint to the vertex.

[0019] Preferably, the intersection range of the ray of the viewpoint to the vertex generated in the fragment shader and the three-dimensional space of the meteorological data is specifically:

[0020] The hitBox function is called, and the inverse ray method is used to calculate the intersection range of the ray from the viewpoint to the vertex and the three-dimensional space of the meteorological data. The intersection range includes: the minimum and maximum boundaries of the cube, the inverse of the ray direction, and the intersection parameters of the ray and the boundary.

[0021] Preferably, before traversing the hierarchical points in the intersection range of the three-dimensional space of the meteorological data and performing volume rendering on the three-dimensional space of the meteorological data, the method further includes:

[0022] Convert the coordinates of the three-dimensional texture into actual height values, and traverse the depth split array to determine the depth interval where the height value is located;

[0023] The relative position of the height value in the depth interval is calculated, and the z coordinate of the three-dimensional texture is returned.

[0024] Preferably, traversing the hierarchical points of the intersection range of the three-dimensional space of the meteorological data and performing volume rendering on the three-dimensional space of the meteorological data is specifically as follows:

[0025] Determine the starting point and end point of the ray from the viewpoint to the vertex, calculate the layering step length and initialize the color;

[0026] Traverse the layering points between the starting point and the end point, calculate the coordinates of each layering point and convert them into the z coordinate of the real texture;

[0027] Get the corresponding color from the texture according to the z coordinate of the real texture, and call the color mixing algorithm to mix the current color with the newly sampled color.

[0028] The second embodiment of the present invention provides a three-dimensional real-time simulation device based on a meteorological environment, comprising:

[0029] A two-dimensional texture creation unit, used to obtain meteorological data, and create a two-dimensional texture according to the meteorological data, wherein the two-dimensional texture is used to store a mapping relationship from a numerical value to a color;

[0030] A three-dimensional texture generation unit, used for preprocessing the two-dimensional texture, storing the preprocessed two-dimensional texture in a first array and a second array, and generating a three-dimensional texture of the meteorological data based on the first array and the second array, specifically used for: normalizing the two-dimensional texture data so that the range of the two-dimensional texture data is between 0 and 255, wherein the two-dimensional texture data includes an angle array, a horizontal split array, and a depth split array, creating the first array for storing the integer part of the normalized data, and creating the second array for storing the decimal part of the normalized data; creating a first three-dimensional texture for passing into the first array, creating a second three-dimensional texture for passing into the second array, and generating the three-dimensional texture of the meteorological data according to the first three-dimensional texture and the second three-dimensional texture;

[0031] An intersection range generating unit, used for inputting the three-dimensional texture of the meteorological data into a fragment shader to obtain vertex positions and viewpoint positions, generating viewpoint-to-vertex rays based on the vertex positions and viewpoint positions, and generating an intersection range of the viewpoint-to-vertex rays and the three-dimensional space of the meteorological data in the fragment shader;

[0032] The volume rendering unit is used to traverse the layer points in the intersection range of the three-dimensional space of the meteorological data and perform volume rendering on the three-dimensional space of the meteorological data.

[0033] The third embodiment of the present invention provides a three-dimensional real-time simulation device based on a meteorological environment, comprising a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement a three-dimensional real-time simulation method based on a meteorological environment as described in any one of the above.

[0034] The fourth embodiment of the present invention provides a computer-readable storage medium, characterized in that a computer program is stored therein, and the computer program can be executed by a processor of a device where the computer-readable storage medium is located to implement a three-dimensional real-time simulation method based on a meteorological environment as described in any one of the above items.

[0035] A three-dimensional real-time simulation method, device, equipment and storage medium based on a meteorological environment provided by the present invention first obtains meteorological data, creates a two-dimensional texture according to the meteorological data, then preprocesses the two-dimensional texture, stores the preprocessed two-dimensional texture in a first array and a second array, and generates a three-dimensional texture of the meteorological data based on the first array and the second array. Then, the three-dimensional texture of the meteorological data is input into a fragment shader to obtain vertex positions and viewpoint positions, generates rays from the viewpoint to the vertex based on the vertex positions and the viewpoint positions, and generates an intersection range of the rays from the viewpoint to the vertex and the three-dimensional space of the meteorological data in the fragment shader; finally, traverses the layered points of the intersection range of the three-dimensional space of the meteorological data, and performs volume rendering on the three-dimensional space of the meteorological data, which solves the problem that the prior art is difficult to support real-time filtering and rendering of data and visualization rendering capabilities of horizontal and vertical sections. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a flow chart of a three-dimensional real-time simulation method based on meteorological environment provided by the first embodiment of the present invention;

[0037] Figure 2 It is a schematic diagram of a three-dimensional space circumscribed cube provided by the present invention;

[0038] Figure 3 It is a schematic diagram of the three-dimensional spatial range of meteorological data provided by the present invention;

[0039] Figure 4 A schematic diagram of modules of a three-dimensional real-time simulation device based on meteorological environment provided by the second embodiment of the present invention. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0042] It should be clear that the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0044] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0045] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0046] The "first\second" mentioned in the embodiments is only to distinguish similar objects, and does not represent a specific order for the objects. It is understandable that the "first\second" can be interchanged with the specific order or sequence where permitted. It should be understood that the objects distinguished by "first\second" can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.

[0047] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0048] The present invention discloses a three-dimensional real-time simulation method, device, equipment and storage medium based on meteorological environment, aiming to solve the problem that the prior art is difficult to support real-time filtering and rendering of data and visual rendering of horizontal and vertical sections.

[0049] See also Figure 1 The first embodiment of the present invention provides a three-dimensional real-time simulation method based on a meteorological environment, which can be executed by a three-dimensional real-time simulation device based on a meteorological environment (hereinafter referred to as a simulation device), and in particular, executed by one or more processors in the simulation device to at least implement the following steps:

[0050] S101, acquiring meteorological data, and creating a two-dimensional texture according to the meteorological data, wherein the two-dimensional texture is used to store a mapping relationship from numerical values ​​to colors;

[0051] In this embodiment, the simulation device can be a terminal with data processing capabilities such as a server, workstation, desktop computer, laptop computer, etc. The simulation device can be installed with a corresponding operating system and application software, and the functions required by this embodiment can be implemented through the combination of the operating system and application software.

[0052] It should be noted that meteorological data usually exists in numerical form. In order to visualize this data in three-dimensional space, the numerical values ​​need to be mapped to colors. This can be done by setting a legend to define the colors corresponding to different numerical ranges and generate a two-dimensional texture containing these color mapping relationships.

[0053] Specifically, in this embodiment, the minimum and maximum values ​​of the meteorological data can be configured, and the proportion and color in the legend color array can be specified;

[0054] Calculate the linear gradient color band according to the proportion and color in the specified legend color array, and calculate the color value corresponding to the data value according to the minimum value and the maximum value;

[0055] A two-dimensional texture is created based on the linear gradient color bands and the color values.

[0056] More specifically, you can specify the minimum value (minValue) and maximum value (maxValue), as well as the legend color (legendColor). This parameter is an array, and each element in the array is in the form of [value, color]. Among them, value is the percentage between 0 and 1, and color is the corresponding color value. Next, calculate the color band (color gradient band) according to the value in the legendColor array. Then calculate the sound loss value and its corresponding color value according to minValue and maxValue. Finally, create a canvas (canvas), the width can be set to 256, the height can be set to 1, get the 2D rendering context (ctx) of the canvas, create a linear gradient (linearGradient), and set the starting point and end point to (0,0) and (256,0) respectively. Traverse the legendColor array, for each [value, color] element, call linearGradient.addColorStop(s,color), add color at the corresponding percentage position, and clear the canvas. Set the fill style to linear gradient. Fill the canvas. Pass the canvas into the two-dimensional legend texture to generate a two-dimensional texture instance.

[0057] S102, preprocessing the two-dimensional texture, storing the preprocessed two-dimensional texture in a first array and a second array, and generating a three-dimensional texture of the meteorological data based on the first array and the second array, wherein the first array is used to store an integer part and the second array is used to store a decimal part;

[0058] Specifically, in this embodiment, the two-dimensional texture data is normalized so that the range of the two-dimensional texture data is between 0 and 255, wherein the two-dimensional texture data includes an angle array, a horizontal split array, and a depth split array;

[0059] The first array is created to store the integer part of the normalized data, and the second array is created to store the decimal part of the normalized data;

[0060] A first three-dimensional texture is created for inputting into the first array, a second three-dimensional texture is created for inputting into the second array, and a three-dimensional texture of the meteorological data is generated according to the first three-dimensional texture and the second three-dimensional texture.

[0061] It should be noted that, in this embodiment, the three-dimensional meteorological data is a set of two-dimensional values ​​corresponding to each horizontal angle, wherein the number of angles is recorded as rCount, the number of horizontal splits is recorded as xCount, and the number of depth splits is recorded as yCount.

[0062] Create two integer arrays dataint and datasmall of length rCount*xCount*yCount and type Uint8Array. Among them, dataint is used to store the integer part of the 3D sound field data. Datasmall is used to store the decimal part of the 3D sound field data (retain two decimal places).

[0063] Traverse all angles, levels and depths, and extract the sound field data (vSounds[r][y][x]) of each position. If the data is empty (null or undefined), set it to 740. If the data value exceeds the maximum value max, set it to max. Normalize the sound field data to between 0 and 255 (V=V(a,x,y) / max*255). Store the integer part of the normalized value in the dataint array. Store the decimal part of the normalized value (keep two decimal places) in the datasmall array. Create two three-dimensional textures textureint and texturesmall of the Texture3D type. Pass the dataint and datasmall arrays into textureint and texturesmall respectively to implement three-dimensional texture instantiation.

[0064] S103, inputting the three-dimensional texture of the meteorological data into a fragment shader to obtain vertex positions and viewpoint positions, generating viewpoint-to-vertex rays based on the vertex positions and viewpoint positions, and generating an intersection range of the viewpoint-to-vertex rays and the three-dimensional space of the meteorological data in the fragment shader;

[0065] Please combine Figure 2 In this embodiment, the circumscribed cube can be calculated from the three-dimensional space coordinates, including the center point coordinates, depth and width, Z=H; further, the cube can be set to a unit cube geometryBox with a length, width and height of 1, and then scaled in the x, y, and z directions according to the length, width and height, and translated in position, that is:

[0066] geometryBox.scale=[Width,Height,Z];geometryBox.position=P1(x,y,z);

[0067] In the vertex shader, the position of the vertex is obtained through the built-in variable position, the position of the viewpoint is obtained, recorded as vOrigin, and the direction of the ray from the viewpoint (vOrigin) to the vertex (position) is calculated. The calculation formula is: vDirection=position-vOrigin, vDirection is the ray from the viewpoint to the vertex. It should be understood that vDirection is a vector, which represents the direction from the viewpoint to the vertex.

[0068] Furthermore, please combine Figure 3 , pass textureint and texturesmall to the fragment shader in the GPU. geometryBox is a unit cube with a length, width and height of 1, representing the three-dimensional space range of the meteorological data to be rendered. Use the vOrigin (viewpoint position) and vDirection (ray direction from viewpoint to vertex) calculated in the vertex shader to calculate the intersection range of the ray and the unit cube. The range of the unit cube is from (-0.5,-0.5,-0.5) to (0.5,0.5,0.5).

[0069] Specifically, in this embodiment, the hitBox function is called, and the inverse ray method is used to calculate the intersection range of the ray of the viewpoint vertex and the three-dimensional space of the meteorological data. The intersection range includes: the minimum and maximum boundaries of the cube, the inverse of the ray direction, and the intersection parameters of the ray and the boundary.

[0070] S104, traversing the layered points within the intersection range of the three-dimensional space of the meteorological data, and performing volume rendering on the three-dimensional space of the meteorological data.

[0071] In a possible embodiment of the present invention, before volume rendering is performed, in order to correctly map the meteorological data during the rendering process, the z coordinate of the meteorological data needs to be converted into the corresponding texture z coordinate. The conversion process may include: converting the input standardized z coordinate into an actual height value. This is achieved by linearly transforming the z value to the height range of the meteorological data (minimum height to maximum height). Next, the length of the depth array is obtained. Among them, the depth array contains different depth values ​​of the meteorological data, which is used to divide the distribution of the meteorological data in height. Initialize an index variable and a temporary index variable. The index variable is used to record which depth interval the height of the meteorological data is in, and the temporary index variable is used to record the relative position of the height in the interval. Traverse the depth array from the maximum depth to the minimum depth to find the depth interval where the height of the meteorological data is located. If a depth value is found so that the height of the meteorological data is greater than the depth value, the relative position of the height in the depth interval is calculated, and the index of the interval is recorded. If a suitable depth interval is still not found after traversing all depth values, the index is set to the maximum depth interval. Finally, the corresponding texture z coordinate is calculated according to the found depth interval and relative position. This texture z coordinate is the corresponding position of the meteorological data z coordinate in the three-dimensional texture space.

[0072] Specifically, in this embodiment, the starting point and the end point of the ray from the viewpoint to the vertex are determined, and the layering step is calculated and the color is initialized;

[0073] Traverse the layering points between the starting point and the end point, calculate the coordinates of each layering point and convert them into the z coordinate of the real texture;

[0074] Get the corresponding color from the texture according to the z coordinate of the real texture, and call the color mixing algorithm to mix the current color with the newly sampled color.

[0075] More specifically: use bounds.x as the starting point and bounds.y as the end point. The starting point coordinate p is calculated as vOrigin+bounds.x*normalize(vDirection), which is the viewpoint position plus the ray direction unit vector multiplied by the starting point distance. Calculate the step size delta, which represents the distance between each layer point. The formula is: floatdelta=(bounds.y-bounds.x) / N, where N is the number of layers; initialize a color vector color to all zeros, representing the initial color, and traverse from bounds.x to bounds.y, increasing the step size delta each time. Calculate the coordinates of the current layer point newP, convert newP.z to the z coordinate of the real texture, obtain the integer and decimal parts of the corresponding position in the texture through the functions sample1 and sample2, and integrate the integer and decimal parts into the final value. If the alpha channel of the current color is greater than or equal to 1.0, stop traversal, otherwise, obtain the corresponding color c1 from the texture according to the sampled value. Use the color mixing algorithm to mix the current color color and the newly sampled color c1.

[0076] See also Figure 4 The second embodiment of the present invention provides a three-dimensional real-time simulation device based on a meteorological environment, comprising:

[0077] A two-dimensional texture creation unit 201 is used to obtain meteorological data and create a two-dimensional texture according to the meteorological data, wherein the two-dimensional texture is used to store a mapping relationship from a numerical value to a color;

[0078] A three-dimensional texture generating unit 202 is used to preprocess the two-dimensional texture, store the preprocessed two-dimensional texture in a first array and a second array, and generate a three-dimensional texture of the meteorological data based on the first array and the second array, wherein the first array is used to store an integer part and the second array is used to store a decimal part;

[0079] The intersection range generating unit 203 is used to input the three-dimensional texture of the meteorological data into a fragment shader to obtain vertex positions and viewpoint positions, generate viewpoint-to-vertex rays based on the vertex positions and viewpoint positions, and generate an intersection range of the viewpoint-to-vertex rays and the three-dimensional space of the meteorological data in the fragment shader;

[0080] The volume rendering unit 204 is used to traverse the layer points in the intersection range of the three-dimensional space of the meteorological data and perform volume rendering on the three-dimensional space of the meteorological data.

[0081] The third embodiment of the present invention provides a three-dimensional real-time simulation device based on a meteorological environment, comprising a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement a three-dimensional real-time simulation method based on a meteorological environment as described in any one of the above.

[0082] The fourth embodiment of the present invention provides a computer-readable storage medium, characterized in that a computer program is stored therein, and the computer program can be executed by a processor of a device where the computer-readable storage medium is located to implement a three-dimensional real-time simulation method based on a meteorological environment as described in any one of the above items.

[0083] A three-dimensional real-time simulation method, device, equipment and storage medium based on a meteorological environment provided by the present invention first obtains meteorological data, creates a two-dimensional texture according to the meteorological data, then preprocesses the two-dimensional texture, stores the preprocessed two-dimensional texture in a first array and a second array, and generates a three-dimensional texture of the meteorological data based on the first array and the second array. Then, the three-dimensional texture of the meteorological data is input into a fragment shader to obtain vertex positions and viewpoint positions, generates rays from the viewpoint to the vertex based on the vertex positions and the viewpoint positions, and generates an intersection range of the rays from the viewpoint to the vertex and the three-dimensional space of the meteorological data in the fragment shader; finally, traverses the layered points of the intersection range of the three-dimensional space of the meteorological data, and performs volume rendering on the three-dimensional space of the meteorological data, which solves the problem that the prior art is difficult to support real-time filtering and rendering of data and visualization rendering capabilities of horizontal and vertical sections.

[0084] Exemplarily, the computer program described in the third embodiment and the fourth embodiment of the present invention can be divided into one or more modules, and the one or more modules are stored in the memory and executed by the processor to complete the present invention. The one or more modules can be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program in the device for implementing a three-dimensional real-time simulation based on a meteorological environment. For example, the device described in the second embodiment of the present invention.

[0085] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the three-dimensional real-time simulation method based on meteorological environment, and uses various interfaces and lines to connect the various parts of the three-dimensional real-time simulation method based on meteorological environment.

[0086] The memory can be used to store the computer program and / or module, and the processor realizes various functions of a three-dimensional real-time simulation method based on a meteorological environment by running or executing the computer program and / or module stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, a text conversion function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, text message data, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0087] Wherein, if the implemented module is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0088] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.

[0089] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A three-dimensional real-time simulation method based on meteorological environment, characterized in that: include: Acquire meteorological data, and create a two-dimensional texture according to the meteorological data, wherein the two-dimensional texture is used to store a mapping relationship from numerical values ​​to colors; Preprocessing the two-dimensional texture, storing the preprocessed two-dimensional texture in a first array and a second array, and generating a three-dimensional texture of the meteorological data based on the first array and the second array, specifically: normalizing the two-dimensional texture data so that the range of the two-dimensional texture data is between 0 and 255, wherein the two-dimensional texture data includes an angle array, a horizontal split array, and a depth split array, creating the first array for storing the integer part of the normalized data, and creating the second array for storing the decimal part of the normalized data; creating a first three-dimensional texture for passing into the first array, creating a second three-dimensional texture for passing into the second array, and generating the three-dimensional texture of the meteorological data according to the first three-dimensional texture and the second three-dimensional texture; Input the three-dimensional texture of the meteorological data into a fragment shader to obtain vertex positions and viewpoint positions, generate viewpoint-to-vertex rays based on the vertex positions and viewpoint positions, and generate the intersection range of the viewpoint-to-vertex rays and the three-dimensional space of the meteorological data in the fragment shader, specifically: call the hitBox function, and use the inverse ray method to calculate the intersection range of the viewpoint-to-vertex rays and the three-dimensional space of the meteorological data, the intersection range includes: the minimum and maximum boundaries of the cube, the inverse of the ray direction, and the intersection parameters of the ray and the boundary; convert the coordinates of the three-dimensional texture into actual height values, traverse the depth split array to determine the depth interval where the height value is located, calculate the relative position of the height value in the depth interval, and return the z coordinate of the three-dimensional texture; Traverse the layered points in the intersection range of the three-dimensional space of the meteorological data, and perform volume rendering on the three-dimensional space of the meteorological data, specifically: determine the starting point and end point of the ray of the viewpoint to the vertex, and calculate the layering step and initialize the color; traverse the layered points between the starting point and the end point, calculate the coordinates of each layered point and convert it into the z coordinate of the three-dimensional texture; obtain the corresponding color from the texture according to the z coordinate of the three-dimensional texture, and call the color mixing algorithm to mix the current color and the newly sampled color.

2. A three-dimensional real-time simulation method based on meteorological environment according to claim 1, characterized in that: The obtaining of meteorological data and the creation of a two-dimensional texture according to the meteorological data are specifically as follows: Configure the minimum and maximum values ​​of the meteorological data, and specify the scale and color in the legend color array; Calculate the linear gradient color band according to the proportion and color in the specified legend color array, and calculate the color value corresponding to the data value according to the minimum value and the maximum value; A two-dimensional texture is created based on the linear gradient color bands and the color values.

3. A three-dimensional real-time simulation method based on meteorological environment according to claim 1, characterized in that: The expression for generating the ray from the viewpoint to the vertex based on the vertex position and the viewpoint position is: vDirection=position-vOrigin Among them, position is the vertex position, vOrigin is the viewpoint position, and vDirection is the ray from the viewpoint to the vertex.

4. A three-dimensional real-time simulation device based on meteorological environment, characterized in that: include: A two-dimensional texture creation unit, used to obtain meteorological data, and create a two-dimensional texture according to the meteorological data, wherein the two-dimensional texture is used to store a mapping relationship from a numerical value to a color; A three-dimensional texture generation unit, used for preprocessing the two-dimensional texture, storing the preprocessed two-dimensional texture in a first array and a second array, and generating a three-dimensional texture of the meteorological data based on the first array and the second array, specifically used for: normalizing the two-dimensional texture data so that the range of the two-dimensional texture data is between 0 and 255, wherein the two-dimensional texture data includes an angle array, a horizontal split array, and a depth split array, creating the first array for storing the integer part of the normalized data, and creating the second array for storing the decimal part of the normalized data; creating a first three-dimensional texture for passing into the first array, creating a second three-dimensional texture for passing into the second array, and generating the three-dimensional texture of the meteorological data according to the first three-dimensional texture and the second three-dimensional texture; An intersection range generating unit is used to input the three-dimensional texture of the meteorological data into a fragment shader to obtain vertex positions and viewpoint positions, generate viewpoint-to-vertex rays based on the vertex positions and viewpoint positions, and generate an intersection range between the viewpoint-to-vertex rays and the three-dimensional space of the meteorological data in the fragment shader, specifically used to: call the hitBox function, and use the inverse ray method to calculate the intersection range between the viewpoint-to-vertex rays and the three-dimensional space of the meteorological data, the intersection range includes: the minimum and maximum boundaries of the cube, the inverse of the ray direction, and the intersection parameters of the ray and the boundary, convert the coordinates of the three-dimensional texture into actual height values, traverse the depth split array to determine the depth interval where the height value is located, calculate the relative position of the height value in the depth interval, and return the z coordinate of the three-dimensional texture; A volume rendering unit is used to traverse the layered points in the intersection range of the three-dimensional space of the meteorological data and perform volume rendering on the three-dimensional space of the meteorological data. Specifically, it is used to: determine the starting point and end point of the ray of the viewpoint to the vertex, calculate the layering step and initialize the color; traverse the layered points between the starting point and the end point, calculate the coordinates of each layered point and convert them into the z coordinate of the three-dimensional texture; obtain the corresponding color from the texture according to the z coordinate of the three-dimensional texture, and call the color mixing algorithm to mix the current color and the newly sampled color.

5. A three-dimensional real-time simulation device based on meteorological environment, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement a three-dimensional real-time simulation method based on a meteorological environment as described in any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that: A computer program is stored, and the computer program can be executed by a processor of the device where the computer-readable storage medium is located to implement a three-dimensional real-time simulation method based on a meteorological environment as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Three-dimensional analogue simulation method realized based on big data of radio waves and meteorological nephograms

    CN117152334A