CN115423917B - Real-time drawing method and system for global three-dimensional wind field - Google Patents
Real-time drawing method and system for global three-dimensional wind field Download PDFInfo
- Publication number
- CN115423917B CN115423917B CN202210981598.1A CN202210981598A CN115423917B CN 115423917 B CN115423917 B CN 115423917B CN 202210981598 A CN202210981598 A CN 202210981598A CN 115423917 B CN115423917 B CN 115423917B
- Authority
- CN
- China
- Prior art keywords
- wind field
- speed
- vertex
- acquiring
- global
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/005—General purpose rendering architectures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/04—Texture mapping
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
- G06T17/20—Finite element generation, e.g. wire-frame surface description, tesselation
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A90/00—Technologies having an indirect contribution to adaptation to climate change
- Y02A90/10—Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Graphics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Geometry (AREA)
- Software Systems (AREA)
- Processing Or Creating Images (AREA)
- Image Generation (AREA)
Abstract
The invention discloses a real-time intelligent drawing method and a system for a global three-dimensional wind field, which belong to the technical field of computer image rendering, wherein the method comprises the following steps: acquiring discrete wind field data and storing the discrete wind field data into a wind field speed diagram; collecting vector data and a speed map from a wind field speed map; acquiring a wind field speed diagram of a position where a vertex in a spherical crown grid model with the radius of the earth equator is located, acquiring a vector model from the wind field speed diagram through vector data to obtain a wind field speed, designating the color of the vertex according to the speed mapping diagram, calculating the position of the next vertex according to the vector data, and repeating the processes of acquiring the wind field speed diagram and calculating the position of the next vertex until the wind field speed or the number of generated vertices reach a preset target; drawing the generated vertexes into curves according to the generation sequence, then, transmitting the curves into a fragment shader, and setting transparency values of fragments according to the transmission time and texture coordinates of the vertexes; and setting the display state of the spherical cap grid model according to the height relation between the camera and the earth surface.
Description
Technical Field
The invention relates to a global three-dimensional wind field real-time drawing method and system, and belongs to the technical field of computer image rendering.
Background
The three-dimensional virtual simulation technology is widely applied to the fields of digital earth, digital cities, digital waterbasins and the like, and wind field rendering is an important part in a three-dimensional simulation system; at present, most wind field drawing is performed by superposing a last frame of wind field diagram of RTT (rendering to texture) on an image of currently rendered particles so as to display wind field data; after the camera moves, the method reduces user experience and influences the visual effect because the previous frame of image has overlarge difference and needs to be emptied and restarted to be overlapped; and the methods cannot be used for drawing three-dimensional wind fields, cannot be displayed in three-dimensional digital earth, weakens immersion sense, and cannot be used in three-dimensional virtual simulation fields such as three-dimensional digital earth.
Disclosure of Invention
The invention aims to provide a global three-dimensional wind field real-time drawing method and system, which realize real-time intelligent drawing of a three-dimensional wind field and improve the visual effect.
In order to achieve the above purpose, the invention is realized by adopting the following technical scheme:
in a first aspect, the present invention provides a global three-dimensional wind field real-time drawing method, including:
acquiring discrete wind field data and storing the discrete wind field data into a wind field speed diagram;
collecting vector data and a speed map from a wind field speed map;
acquiring a wind field speed diagram of a position where a vertex in a spherical crown grid model with the radius of the earth equator is positioned, acquiring a vector model from the wind field speed diagram through vector data to obtain a wind field speed, designating the color of the vertex according to the speed mapping diagram, calculating the position of the next vertex according to the vector data, and repeating the processes of acquiring the wind field speed diagram and calculating the position of the next vertex until the wind field speed or the number of generated vertices reach a preset target;
drawing the generated vertexes into curves according to the generation sequence, then, transmitting the curves into a fragment shader, and dynamically setting transparency values of fragments according to the transmission time and texture coordinates of the vertexes;
and setting the display state of the spherical cap grid model according to the height relation between the camera and the earth surface to obtain the global three-dimensional wind field.
With reference to the first aspect, further, storing the discrete wind field data in a wind field speed map specifically includes:
and performing spatial mapping on UVW components of the wind field speed map corresponding to the longitude and latitude height read from the original netcfg file, wherein (0, 0) of the UVW components are mapped by (lower left) points corresponding to the longitude and latitude height, (1, 1) of the UVW components are mapped by (upper right) points corresponding to the longitude and latitude height, and wind speed information corresponding to the longitude and latitude height of each point is stored in an RGB channel of the wind field speed map.
With reference to the first aspect, further, the spherical cap mesh model is pre-constructed by the following method:
according to the space position of the OPENGL camera in the world coordinate, acquiring the theodolite of the sphere where the OPENGL camera is located as a center point position, and creating a spherical cap grid model by taking the radius of the earth equator as the radius, wherein 128 x 128 vertexes are uniformly distributed.
With reference to the first aspect, further, the speed map includes a 1-dimensional color map and a numerical value map.
With reference to the first aspect, further, the wind field speed reaches a preset target, specifically includes: the wind field speed is less than 0.01.
With reference to the first aspect, further, the number of generated vertices reaches a preset target, and specifically includes: the number of vertices generated exceeds 10.
With reference to the first aspect, further, dynamically setting a transparency value of the primitive according to the incoming time and texture coordinates of the vertex specifically includes:
and multiplying the texture coordinates of the input time plus the vertex by the transparency value of the texture to obtain the transparency value of the fragment, and setting the transparency of the fragment according to the transparency value of the fragment.
In combination with the first aspect, further, a plurality of spherical cap grid models are pre-built, and display states of different spherical cap grid models are set to be displayed or hidden according to the height relation between the camera and the earth surface, so that multi-detail level display is realized.
In a second aspect, the present invention further provides a global three-dimensional wind field real-time drawing system, including:
and a data acquisition module: the method comprises the steps of acquiring discrete wind field data and storing the discrete wind field data into a wind field speed diagram;
and a data acquisition module: the wind power generation system is used for collecting vector data and a speed map from a wind field speed map;
and the vertex generation module is used for: acquiring a wind field speed diagram of the position of the vertex in the spherical crown grid model with the radius of the earth equator, acquiring a vector model from the wind field speed diagram through vector data to obtain a wind field speed, designating the color of the vertex according to the speed map, calculating the position of the next vertex according to the vector data, and repeating the processes of acquiring the wind field speed diagram and calculating the position of the next vertex until the wind field speed or the number of generated vertices reaches a preset target;
transparency setting module: the vertex generation method comprises the steps of drawing generated vertexes into curves according to a generation sequence, then, transmitting the curves into a fragment shader, and dynamically setting transparency values of fragments according to the transmission time and texture coordinates of the vertexes;
a display state setting module: the method is used for setting the display state of the spherical cap grid model according to the height relation between the camera and the earth surface to obtain the global three-dimensional wind field.
Compared with the prior art, the invention has the following beneficial effects:
according to the real-time drawing method and system for the global three-dimensional wind field, provided by the invention, the display state of the spherical cap grid model is set through the height relation between the camera and the earth surface, so that the display of multiple detail levels is realized, the effect of seamless transition from space to ground is achieved, the transition is smooth, the effect of observing the global three-dimensional wind field from various angles is realized, and the display of the global wind field is improved to be three-dimensional; the drawing method disclosed by the scheme of the invention is independent of the real-time position of the camera, so that the global wind field rendering when the camera moves is realized; the transparency value of the fragment is dynamically set according to the incoming time and the texture coordinates of the vertex, the transparency value of the fragment is dynamically changed, the flow smear effect of the wind field is realized, and the visual effect is improved.
Drawings
Fig. 1 is a flowchart of a global three-dimensional wind field real-time drawing method provided by an embodiment of the invention.
Description of the embodiments
The present invention will be further described with reference to the accompanying drawings, and the following examples are only for more clearly illustrating the technical aspects of the present invention, and are not to be construed as limiting the scope of the present invention.
Examples
As shown in fig. 1, the method for real-time drawing of a global three-dimensional wind field provided by the embodiment of the invention includes:
s1, acquiring discrete wind field data and storing the discrete wind field data into a wind field speed diagram.
The method comprises the steps of reading discrete wind field data from an original netcfg file, wherein the discrete wind field data comprise longitude and latitude heights, and storing the discrete wind field data into a wind field speed diagram (three-dimensional texture).
And performing spatial mapping on UVW components of the wind field speed map corresponding to the longitude and latitude height read from the original netcfg file, wherein (0, 0) of the UVW components are mapped by (lower left) points corresponding to the longitude and latitude height, (1, 1) of the UVW components are mapped by (upper right) points corresponding to the longitude and latitude height, and wind speed information corresponding to the longitude and latitude height of each point is stored in an RGB channel of the wind field speed map.
S2, collecting vector data and a speed map from the wind field speed map.
A speed map (1-dimensional color and numerical map) is predefined and stored in the wind farm speed map, and vector data (UVW) is obtained from the wind farm speed map.
S3, acquiring a wind field speed diagram of the position of the vertex in the spherical cap grid model with the radius of the earth equator, acquiring a vector model from the wind field speed diagram through vector data to obtain the wind field speed, designating the color of the vertex according to the speed map, calculating the position of the next vertex according to the vector data, and repeating the processes of acquiring the wind field speed diagram and calculating the position of the next vertex until the wind field speed or the number of generated vertices reaches a preset target.
According to the space position of the OPENGL camera in the world coordinate, acquiring the theodolite of the sphere where the OPENGL camera is located as a center point position, and taking the radius of the earth equator as a radius, pre-creating a spherical cap grid model, wherein the vertices with 128 x 128 (number of rows and columns) are uniformly distributed.
The method includes the steps of collecting a wind field speed diagram of positions of vertexes of 128 x 128 (number of rows and columns) in a geometric shader, acquiring vector modes from the wind field speed diagram as wind field speeds through vector data (UVW) collected in the step S2, designating colors of the vertexes according to a speed map (1-dimensional color and numerical map) collected in the step S2, and calculating positions of the next vertexes according to the vector data (UVW).
And repeating the steps of acquiring the wind field velocity map of the position of the acquired vertex and calculating the position of the next vertex until the number of the generated vertices exceeds 10 or the wind field velocity is less than 0.01, stopping calculation, and ending the operation in the geometric shader.
And S4, drawing the generated vertexes into curves according to the generation sequence, then, transmitting the curves into a fragment shader, and dynamically setting transparency values of fragments according to the transmission time and texture coordinates of the vertexes.
And (3) drawing the vertexes generated in the step (S3) into a curve according to the generation sequence, and transmitting the curve into a fragment shader.
In the fragment shader, the transparency value of the fragment is obtained by multiplying the input time (dynamic value) of the curve and the texture coordinates (static value) of the vertex by the transparency value of the texture, and the transparency value of the fragment can be dynamically changed by setting the transparency of the fragment according to the transparency value of the fragment, so that the flow and smear effect of the wind field can be realized.
And S5, setting the display state of the spherical cap grid model according to the height relation between the camera and the earth surface to obtain the global three-dimensional wind field.
The method comprises the steps of controlling a display level in real time, generating three layers of low, medium and high-level spherical crown grid models to scene renderable nodes in advance according to the earth range, setting the display states of different spherical crown grid models to be displayed or hidden according to the height relation between a camera and the earth surface, and obtaining a final real-time global three-dimensional wind field so as to realize multi-detail level display and achieve the effect of seamless transition from space to ground.
Examples
The embodiment of the invention provides a global three-dimensional wind field real-time drawing system, which comprises:
and a data acquisition module: the method comprises the steps of acquiring discrete wind field data and storing the discrete wind field data into a wind field speed diagram;
and a data acquisition module: the wind power generation system is used for collecting vector data and a speed map from a wind field speed map;
and the vertex generation module is used for: acquiring a wind field speed diagram of the position of the vertex in the spherical crown grid model with the radius of the earth equator, acquiring a vector model from the wind field speed diagram through vector data to obtain a wind field speed, designating the color of the vertex according to the speed map, calculating the position of the next vertex according to the vector data, and repeating the processes of acquiring the wind field speed diagram and calculating the position of the next vertex until the wind field speed or the number of generated vertices reaches a preset target;
transparency setting module: the vertex generation method comprises the steps of drawing generated vertexes into curves according to a generation sequence, then, transmitting the curves into a fragment shader, and dynamically setting transparency values of fragments according to the transmission time and texture coordinates of the vertexes;
a display state setting module: the method is used for setting the display state of the spherical cap grid model according to the height relation between the camera and the earth surface to obtain the global three-dimensional wind field.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application 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 application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. 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.
The foregoing is merely a preferred embodiment of the present invention, and it should be noted that modifications and variations could be made by those skilled in the art without departing from the technical principles of the present invention, and such modifications and variations should also be regarded as being within the scope of the invention.
Claims (9)
1. The real-time drawing method of the global three-dimensional wind field is characterized by comprising the following steps of:
acquiring discrete wind field data and storing the discrete wind field data into a wind field speed diagram;
collecting vector data and a speed map from a wind field speed map;
acquiring a wind field speed diagram of the position of the vertex in a spherical cap grid model with the radius of the earth equator, which is constructed in advance, in a geometric shader, acquiring a vector model from the wind field speed diagram through vector data to obtain a wind field speed, designating the color of the vertex according to the speed map, calculating the position of the next vertex according to the vector data, and repeating the processes of acquiring the wind field speed diagram and calculating the position of the next vertex in the geometric shader until the wind field speed or the number of generated vertices reaches a preset target;
drawing vertexes generated by the geometric shader into curves according to the generation sequence, then, transmitting the curves into the fragment shader, and dynamically setting transparency values of fragments according to the transmission time and texture coordinates of the vertexes;
and setting the display state of the spherical cap grid model according to the height relation between the camera and the earth surface to obtain the global three-dimensional wind field.
2. The global three-dimensional wind field real-time drawing method according to claim 1, wherein the step of storing the discrete wind field data in a wind field speed map specifically comprises the steps of:
and performing spatial mapping on UVW components of the wind field speed map corresponding to the longitude and latitude height read from the original netcfg file, wherein (0, 0) of the UVW components are mapped by (lower left) points corresponding to the longitude and latitude height, (1, 1) of the UVW components are mapped by (upper right) points corresponding to the longitude and latitude height, and wind speed information corresponding to the longitude and latitude height of each point is stored in an RGB channel of the wind field speed map.
3. The global three-dimensional wind field real-time drawing method according to claim 1, wherein the spherical cap grid model is pre-constructed by the following method:
according to the space position of the OPENGL camera in the world coordinate, acquiring the theodolite of the sphere where the OPENGL camera is located as a center point position, and creating a spherical cap grid model by taking the radius of the earth equator as the radius, wherein 128 x 128 vertexes are uniformly distributed.
4. The method for real-time drawing of a global three-dimensional wind field according to claim 1, wherein the velocity map comprises a 1-dimensional color map and a numerical map.
5. The global three-dimensional wind field real-time drawing method according to claim 1, wherein the wind field speed reaches a preset target, specifically comprising: the wind field speed is less than 0.01.
6. The global three-dimensional wind field real-time drawing method according to claim 1, wherein the number of generated vertexes reaches a preset target, specifically comprising: the number of vertices generated exceeds 10.
7. The global three-dimensional wind field real-time drawing method according to claim 1, wherein the transparency value of the primitive is dynamically set according to the incoming time and the texture coordinates of the vertex, specifically comprising:
and multiplying the texture coordinates of the input time plus the vertex by the transparency value of the texture to obtain the transparency value of the fragment, and setting the transparency of the fragment according to the transparency value of the fragment.
8. The method for real-time drawing a global three-dimensional wind field according to claim 1, wherein a plurality of spherical cap grid models are pre-constructed, and the display states of different spherical cap grid models are set to be displayed or hidden according to the height relation between a camera and the earth surface so as to realize multi-detail level display.
9. A global three-dimensional wind park real-time mapping system, comprising:
and a data acquisition module: the method comprises the steps of acquiring discrete wind field data and storing the discrete wind field data into a wind field speed diagram;
and a data acquisition module: the wind power generation system is used for collecting vector data and a speed map from a wind field speed map;
and the vertex generation module is used for: the method comprises the steps of acquiring a wind field speed diagram of the position of a vertex in a spherical cap grid model with the radius of the earth equator, which is constructed in advance, in a geometric shader, acquiring vector models from the wind field speed diagram through vector data to obtain the vector models as wind field speeds, designating the color of the vertex according to a speed map, calculating the position of the next vertex according to the vector data, and repeating the processes of acquiring the wind field speed diagram and calculating the position of the next vertex in the geometric shader until the wind field speed or the number of generated vertices reach a preset target;
transparency setting module: the vertex generation method comprises the steps of drawing vertexes generated in a geometric shader into curves according to a generation sequence, then, transmitting the curves into a fragment shader, and dynamically setting transparency values of fragments according to the transmission time and texture coordinates of the vertexes;
a display state setting module: the method is used for setting the display state of the spherical cap grid model according to the height relation between the camera and the earth surface to obtain the global three-dimensional wind field.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210981598.1A CN115423917B (en) | 2022-08-16 | 2022-08-16 | Real-time drawing method and system for global three-dimensional wind field |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210981598.1A CN115423917B (en) | 2022-08-16 | 2022-08-16 | Real-time drawing method and system for global three-dimensional wind field |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115423917A CN115423917A (en) | 2022-12-02 |
CN115423917B true CN115423917B (en) | 2023-07-21 |
Family
ID=84198369
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210981598.1A Active CN115423917B (en) | 2022-08-16 | 2022-08-16 | Real-time drawing method and system for global three-dimensional wind field |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115423917B (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107170044B (en) * | 2017-05-09 | 2019-09-13 | 福州大学 | A kind of dynamic and visual method of the wind based on dimensional topography |
CN110378988A (en) * | 2019-05-22 | 2019-10-25 | 国家气象信息中心 | A kind of Typhoon Analysis method of three-dimensional visualization |
CN112634393B (en) * | 2020-12-31 | 2023-09-05 | 中国科学院空天信息创新研究院 | Real-time self-adaptive visualization method for near-space atmospheric wind field based on Web |
CN112991509A (en) * | 2021-04-13 | 2021-06-18 | 深圳市万向信息科技有限公司 | WebGL-based three-dimensional wind field inversion method, system, device and storage medium |
-
2022
- 2022-08-16 CN CN202210981598.1A patent/CN115423917B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN115423917A (en) | 2022-12-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102768765B (en) | Real-time soft shadow rendering method for point light sources | |
CN113034656B (en) | Rendering method, device and equipment for illumination information in game scene | |
CN111476877B (en) | Shadow rendering method and device, electronic equipment and storage medium | |
CN104915986A (en) | Physical three-dimensional model automatic modeling method | |
CN113034657B (en) | Rendering method, device and equipment for illumination information in game scene | |
CN114820990B (en) | Digital twin-based river basin flood control visualization method and system | |
CN113593051A (en) | Live-action visualization method, dam visualization method and computer equipment | |
CN103700134A (en) | Three-dimensional vector model real-time shadow deferred shading method based on controllable texture baking | |
CN112233214B (en) | Snow scene rendering method, device and equipment for large scene and storage medium | |
CN110400366B (en) | Real-time flood disaster visualization simulation method based on OpenGL | |
CN108230430B (en) | Cloud layer mask image processing method and device | |
Bao et al. | Realistic real-time rendering for large-scale forest scenes | |
CN115423917B (en) | Real-time drawing method and system for global three-dimensional wind field | |
CN117218273A (en) | Image rendering method and device | |
CN115953541A (en) | Quad-tree LOD terrain generation method, device, equipment and storage medium | |
CN106780693B (en) | Method and system for selecting object in three-dimensional scene through drawing mode | |
CN111275806A (en) | Parallelization real-time rendering system and method based on points | |
CN114119836A (en) | Rendering method, rendering device, electronic equipment and readable storage medium | |
CN112002019A (en) | Method for simulating character shadow based on MR mixed reality | |
CN115035231A (en) | Shadow baking method, shadow baking device, electronic apparatus, and storage medium | |
Hempe et al. | Generation and rendering of interactive ground vegetation for real-time testing and validation of computer vision algorithms | |
CN114627258B (en) | Method and system for isomorphic modeling of gravity field catamaran spheres | |
CN117611781B (en) | Flattening method and device for live-action three-dimensional model | |
CN112802165B (en) | Game scene snow rendering method, device and medium | |
CN117392358B (en) | Collision detection method, collision detection device, computer device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |