CN117392315A - Algorithm for dynamically drawing starlight map based on distributed photovoltaic output - Google Patents
Algorithm for dynamically drawing starlight map based on distributed photovoltaic output Download PDFInfo
- Publication number
- CN117392315A CN117392315A CN202311323292.8A CN202311323292A CN117392315A CN 117392315 A CN117392315 A CN 117392315A CN 202311323292 A CN202311323292 A CN 202311323292A CN 117392315 A CN117392315 A CN 117392315A
- Authority
- CN
- China
- Prior art keywords
- model
- algorithm
- coordinate system
- data
- coordinates
- 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.)
- Granted
Links
- 239000000463 material Substances 0.000 claims abstract description 21
- 238000009877 rendering Methods 0.000 claims abstract description 15
- 238000000034 method Methods 0.000 claims description 17
- 238000013507 mapping Methods 0.000 claims description 14
- 238000006243 chemical reaction Methods 0.000 claims description 12
- 239000005022 packaging material Substances 0.000 claims description 3
- 230000006698 induction Effects 0.000 claims description 2
- 238000012986 modification Methods 0.000 abstract description 3
- 230000004048 modification Effects 0.000 abstract description 3
- 238000010248 power generation Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013079 data visualisation Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
Classifications
-
- 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
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Computer Graphics (AREA)
- Geometry (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention discloses an algorithm for dynamically drawing a starlight map based on distributed photovoltaic output, which belongs to the technical field of three-dimensional modeling and comprises the following steps: step one: obtaining a data creation model object in a specific mode; step two: combining grids and materials of the models in the object pool container in the first step; step three: converting longitude and latitude data and a world coordinate system and a screen coordinate system; step four: and creating and rendering a three-dimensional model according to the transformed coordinate system data. According to the invention, the model can be automatically created and matched to the corresponding position through the steps, and when the modeler modifies the position or model type of the model again, the modeler only needs to modify the configuration file, the local database or the interface to modify the original data, so that the need of secondary modification of the modeler on the map is eliminated.
Description
Technical Field
The invention relates to the technical field of three-dimensional modeling, in particular to an algorithm for dynamically drawing a starlight map based on distributed photovoltaic output.
Background
The main function of the three-dimensional modeling system is to provide three-dimensional modeling environment and tools, and help people realize three-dimensional digital models of objects, in particular to a process of constructing three-dimensional shapes on a computer.
In the data visualization system, when green power such as photovoltaic power generation, thermal power generation, wind power generation, hydroelectric power generation and the like is displayed in a three-dimensional map, a modeler builds a model in 3Dmax or maya and then places the model in the three-dimensional map according to a map example, and the process is not only tedious and long in time consumption, but also requires secondary rework if the example diagram is inaccurate.
Disclosure of Invention
This section is intended to outline some aspects of embodiments of the invention and to briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section as well as in the description summary and in the title of the application, to avoid obscuring the purpose of this section, the description summary and the title of the invention, which should not be used to limit the scope of the invention.
The invention is provided in view of the problems of the existing algorithm for dynamically drawing the starlight map based on the distributed photovoltaic output.
In order to solve the technical problems, the invention provides the following technical scheme:
an algorithm for dynamically drawing a starlight map based on distributed photovoltaic output comprises the following steps:
step one: the method for acquiring the data creation model object comprises the following specific steps:
s1: reading a configuration file, a local database or an interface request mode to obtain Json data fixed by the model;
s2: serializing the acquired data into objects and storing the objects;
s3: creating an object pool container aiming at the stored objects, and storing the models of different levels in the object pool container after induction creation according to model labels, wherein the object calling method of the object pool container comprises the following steps: when a certain object is needed outside, calling the object from the object pool container; judging whether the object exists in the current object pool container, if so, providing the object, and if not, creating a corresponding new object through an object factory and then providing the object; finally, returning the object to the object pool container after each object use for the next direct use;
step two: combining the grid and the material operation of the model in the object pool container in the first step in the Unity engine;
step three: converting longitude and latitude data and a world coordinate system and a screen coordinate system;
step four: and creating and rendering a three-dimensional model according to the transformed coordinate system data.
As a preferred scheme of the algorithm for dynamically drawing the starlight map based on the distributed photovoltaic output, the invention comprises the following steps: the specific method for combining the grid and the material in the second step comprises the following steps:
s1: firstly, stripping the materials on the model and the mapping on the decorative materials, traversing all the materials, and storing mapping information into an array;
s2: creating new materials and giving textures so as to realize the combination of the materials;
s3: and finally, merging grids and packaging materials.
As a preferred scheme of the algorithm for dynamically drawing the starlight map based on the distributed photovoltaic output, the invention comprises the following steps: the specific mode for converting the longitude and latitude data and the world coordinate system and the screen coordinate system in the third step is as follows:
s1: according to the conversion of the acquired longitude and latitude coordinate data and the world coordinate system in the engine, the world coordinate is converted into longitude and latitude coordinates with the origin at the center of the earth, namely (alpha, beta, r) to (x, y, z), and the conversion relation is as follows:
;
correspondingly, the longitude and latitude coordinates are converted into world coordinates, namely (x, y, z) → (alpha, beta, r), and the conversion relation is as follows:
;
s2: according to a mapping formula from screen coordinates to world coordinates, converting the world coordinates into screen coordinates, wherein the screen coordinates are (a, b), the world coordinates are (alpha, beta, R), R is the radius of a sphere, namely the corresponding radius of an earth model under the world coordinate system, and the conversion relationship of the two is:
α=R*Cos(a)*Cos(b)
β=R*Sin(a)*Cos(b)
r=R*Sin(b)。
as a preferred scheme of the algorithm for dynamically drawing the starlight map based on the distributed photovoltaic output, the invention comprises the following steps: in the fourth step, the specific way of creating the three-dimensional model is as follows:
and (3) after the world coordinates of the model in the engine are obtained according to the third step, the corresponding model creation is found from the object pool container in the first step according to the equipment type, and then the creation is completed.
As a preferred scheme of the algorithm for dynamically drawing the starlight map based on the distributed photovoltaic output, the invention comprises the following steps: in the fourth step, the specific way of rendering the three-dimensional model is as follows:
by dynamically adding an LOD component in the Unity engine and setting models with different accuracies for the LOD component, software automatically presents a picture of the clearest layer according to the distance between a camera and an object, and the rendering efficiency is improved;
in the Unity rendering process, the cube texture is an implementation method of environment mapping, which can simulate the environment around an object, so that the object reflects out of the surrounding environment, we introduce commonly used refraction and reflection, and for refraction, refractive rays are calculated according to the law of refraction, namely, n1sina=n2sinb, where n1, n2 are the refractive indexes of two interfaces, a is the incident angle, and b is the refraction angle;
fresnel phenomenon for reflection: when light irradiates the surface of an object, a part of the light is reflected, and a part of the light enters the interior of the object to be refracted or scattered. There is a certain ratio relationship between the reflected light and the incident light: f (V, n) =f0+ (1-F0) (1-dot (v×n))Λ5;
where F (v, n) denotes the intensity of reflected light, v is the line of sight, n is the surface normal, and F0 is a reflection coefficient for controlling the intensity of reflection.
The invention has the beneficial effects that:
according to the invention, the model can be automatically created and matched to the corresponding position through the steps, and when the modeler modifies the position or model type of the model again, the modeler only needs to modify the configuration file, the local database or the interface to modify the original data, so that the need of secondary modification of the modeler on the map is eliminated.
The invention obtains the data in the form of local configuration or interface, is convenient for maintenance after the software is deployed, avoids the tedious steps caused by unpacking due to the adjustment of the position or the number of the models, and saves the time cost.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. Wherein:
FIG. 1 is a schematic flow chart of an algorithm for dynamically drawing a starlight map based on distributed photovoltaic output;
fig. 2 is a schematic diagram of the opposite direction Chi Zhongchuang construction and return in an algorithm for dynamically drawing a starlight map based on distributed photovoltaic output according to the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways other than those described herein, and persons skilled in the art will readily appreciate that the present invention is not limited to the specific embodiments disclosed below.
Further, reference herein to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic can be included in at least one implementation of the invention. The appearances of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments.
Referring to fig. 1-2, for one embodiment of the present invention, an algorithm for dynamically drawing a starlight map based on distributed photovoltaic output is provided, comprising the steps of:
step one: the method for acquiring the data creation model object comprises the following specific steps:
s1: reading a configuration file, a local database or an interface request to obtain fixed Json data;
s2: serializing the acquired data into objects and storing the objects;
s3: creating an object pool container aiming at a stored object, and storing the object pool container after generalizing and creating models of different levels, wherein the mode of creating and returning in the object pool container refers to fig. 2, specifically:
the first step: an external request for an object is fetched from the object pool container.
And a second step of: judging whether the object exists in the current object pool container, if so, providing the object, and if not, creating a corresponding new object through an object factory and then providing the object.
And a third step of: the object is used up and returned to the object pool, so that the next direct use is facilitated;
step two: combining grids and materials of the models in the object pool container in the first step;
s1: firstly, stripping the materials on the model and the mapping on the decorative materials, traversing all the materials, and storing mapping information into an array;
s2: creating new materials and giving textures so as to realize the combination of the materials;
s3: and finally, merging grids and packaging materials.
Step three: converting longitude and latitude data and a world coordinate system and a screen coordinate system;
the specific method is as follows:
s1: according to the conversion of the acquired longitude and latitude coordinate data and the world coordinate system in the engine, the world coordinate is converted into longitude and latitude coordinates with the origin at the center of the earth, namely (alpha, beta, r) to (x, y, z), and the conversion relation is as follows:
;
correspondingly, the longitude and latitude coordinates are converted into world coordinates, namely (x, y, z) → (alpha, beta, r), and the conversion relation is as follows:
;
the latitude and longitude data are converted into relative coordinates with respect to a certain point on the earth, and the latitude and longitude coordinates can be understood as cartesian coordinates with respect to a certain point on the earth.
S2: according to the mapping formula from the screen coordinates to the world coordinates, converting the world coordinates into screen coordinates, and assuming that the world coordinates are (alpha, beta, R), the screen coordinates are (a, b), R is the radius of a sphere, namely the corresponding radius of an earth model under the world coordinate system, and the conversion relationship between the two is:
α=R*Cos(a)*Cos(b)
β=R*Sin(a)*Cos(b)
r=r×sin (b), i.e., screen coordinates are obtained from world coordinates.
Step four: creating and rendering a three-dimensional model according to the transformed coordinate system data;
after the world coordinates of the model in the engine are obtained according to the third step, the creation of the corresponding model can be completed by finding the corresponding model from the object pool container in the first step according to the equipment type, and the LOD component is dynamically added in the Unity engine, the model with different precision is set for the LOD component, the software automatically presents the picture of the clearest layer according to the distance between the camera and a certain object, and the rendering efficiency is improved.
In the Unity rendering process, the cube texture is an implementation method of environment mapping, which can simulate the environment around an object, so that the object reflects out of the surrounding environment, we introduce commonly used refraction and reflection, and for refraction, refractive rays are calculated according to the law of refraction, namely, n1sina=n2sinb, where n1, n2 are the refractive indexes of two interfaces, a is the incident angle, and b is the refraction angle; fresnel phenomenon for reflection: when light irradiates the surface of an object, a part of the light is reflected, and a part of the light enters the interior of the object to be refracted or scattered. There is a certain ratio relationship between the reflected light and the incident light: f (V, n) =f0+ (1-F0) (1-dot (v×n))Λ5;
where F (v, n) denotes the intensity of reflected light, v is the line of sight, n is the surface normal, and F0 is a reflection coefficient for controlling the intensity of reflection.
And an approximate Emprician Fresnel approximation equation thereto:
FEmpricial(v, n) = max(0, min(1, bias + scale * (1- dot(v, n)power)))
bias, scale and power are control terms using fresnel approximation, we can simulate the change between reflected light and refracted/diffuse light at the boundary
It should be noted that: after the three-dimensional model is created, the model can be divided into a plurality of layers, the three-dimensional model is divided into 3 layers, namely a coarse model, a middle model and a fine model, when a camera faces the model, the model can be rendered on a screen, the LOD can automatically display and hide the models of different layers according to the distance between the model and the camera, when the distance is far, the coarse model is displayed, the fine model and the middle model are hidden, the number of coarse model faces is small, the coarse model faces is rough, and the rendering is quick. The similar distance is closer, the fine die is used for hiding the coarse die and the middle die, the fine die has a large number of surfaces, and the exquisite rendering is more laborious. Thereby improving rendering efficiency.
In summary, the method can automatically create the model and match the model to the corresponding position through the steps, and when a modeler modifies the position or the model type of the model again, the modeler only needs to modify the configuration file, the local database or the interface mentioned in the step one to modify the original data. The artist is not required to carry out secondary modification on the map; the data is acquired in a local configuration or interface mode, the software is convenient to maintain after deployment, tedious steps caused by unpacking due to adjustment of the positions or the number of the models are avoided, and time cost is saved.
It should be noted that the above embodiments are only for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present invention may be modified or substituted without departing from the spirit and scope of the technical solution of the present invention, which is intended to be covered in the scope of the claims of the present invention.
Claims (5)
1. An algorithm for dynamically drawing a starlight map based on distributed photovoltaic output is characterized by comprising the following steps of:
step one: the method for acquiring the data creation model object comprises the following specific steps:
s1: reading a configuration file, a local database or an interface request mode to obtain Json data fixed by the model;
s2: serializing the acquired data into objects and storing the objects;
s3: creating an object pool container aiming at the stored objects, and storing the models of different levels in the object pool container after induction creation according to model labels, wherein the object calling method of the object pool container comprises the following steps: when a certain object is needed outside, calling the object from the object pool container; judging whether the object exists in the current object pool container, if so, providing the object, and if not, creating a corresponding new object through an object factory and then providing the object; finally, returning the object to the object pool container after each object use for the next direct use;
step two: combining the grid and the material operation of the model in the object pool container in the first step in the Unity engine;
step three: converting longitude and latitude data and a world coordinate system and a screen coordinate system;
step four: and creating and rendering a three-dimensional model according to the transformed coordinate system data.
2. The algorithm for dynamically drawing a starlight map based on distributed photovoltaic output according to claim 1, wherein the algorithm is characterized in that: the specific method for combining the grid and the material in the second step comprises the following steps:
s1: firstly, stripping the materials on the model and the mapping on the decorative materials, traversing all the materials, and storing mapping information into an array;
s2: creating new materials and giving textures so as to realize the combination of the materials;
s3: and finally, merging grids and packaging materials.
3. The algorithm for dynamically drawing a starlight map based on distributed photovoltaic output according to claim 2, wherein: the specific mode for converting the longitude and latitude data and the world coordinate system and the screen coordinate system in the third step is as follows:
s1: according to the conversion of the acquired longitude and latitude coordinate data and the world coordinate system in the engine, the world coordinate is converted into longitude and latitude coordinates with the origin at the center of the earth, namely (alpha, beta, r) to (x, y, z), and the conversion relation is as follows:
;
correspondingly, the longitude and latitude coordinates are converted into world coordinates, namely (x, y, z) → (alpha, beta, r), and the conversion relation is as follows:
;
s2: according to a mapping formula from screen coordinates to world coordinates, converting the world coordinates into screen coordinates, wherein the screen coordinates are (a, b), the world coordinates are (alpha, beta, R), R is the radius of a sphere, namely the corresponding radius of an earth model under the world coordinate system, and the conversion relationship of the two is:
α=R*Cos(a)*Cos(b)
β=R*Sin(a)*Cos(b)
r=R*Sin(b)。
4. an algorithm for dynamically mapping starlight patterns based on distributed photovoltaic output according to any one of claims 1-3, wherein: in the fourth step, the specific way of creating the three-dimensional model is as follows:
and (3) after the world coordinates of the model in the engine are obtained according to the third step, the corresponding model creation is found from the object pool container in the first step according to the equipment type, and then the creation is completed.
5. The algorithm for dynamically drawing a starlight map based on distributed photovoltaic output according to claim 1, wherein the algorithm is characterized in that: in the fourth step, the specific way of rendering the three-dimensional model is as follows:
by dynamically adding an LOD component in the Unity engine and setting models with different accuracies for the LOD component, software automatically presents a picture of the clearest layer according to the distance between a camera and an object, and the rendering efficiency is improved;
in the Unity rendering process, the cube texture is an implementation method of the environment mapping, and the environment mapping can simulate the environment around the object, so that the object reflects out of the surrounding environment, wherein refraction and reflection of the object are involved, and for refraction, refracted rays are calculated according to a refraction law, namely, n1sina=n2sinb, wherein n1 and n2 are refractive indexes of two interfaces, a is an incident angle, and b is a refraction angle;
fresnel phenomena can occur for reflection: when the light irradiates the surface of the object, a part of the light is reflected, and a part of the light enters the interior of the object to be refracted or scattered; there is a certain ratio relationship between the reflected light and the incident light: f (V, n) =f0+ (1-F0) (1-dot (v×n))Λ5;
where F (v, n) denotes the intensity of reflected light, v is the line of sight, n is the surface normal, and F0 is a reflection coefficient for controlling the intensity of reflection.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311323292.8A CN117392315B (en) | 2023-10-13 | 2023-10-13 | Algorithm for dynamically drawing starlight map based on distributed photovoltaic output |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311323292.8A CN117392315B (en) | 2023-10-13 | 2023-10-13 | Algorithm for dynamically drawing starlight map based on distributed photovoltaic output |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117392315A true CN117392315A (en) | 2024-01-12 |
CN117392315B CN117392315B (en) | 2024-07-05 |
Family
ID=89465944
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311323292.8A Active CN117392315B (en) | 2023-10-13 | 2023-10-13 | Algorithm for dynamically drawing starlight map based on distributed photovoltaic output |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117392315B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20200302683A1 (en) * | 2016-05-30 | 2020-09-24 | Netease (Hangzhou) Network Co.,Ltd. | Global Illumination Calculation Method and Apparatus |
CN115496847A (en) * | 2022-09-19 | 2022-12-20 | 奥格科技股份有限公司 | Method, system and medium for rendering and positioning three-dimensional scene of building information |
CN115690336A (en) * | 2023-01-05 | 2023-02-03 | 中国电子科技集团公司第十五研究所 | Satellite beam coverage area visualization method, server and storage medium |
-
2023
- 2023-10-13 CN CN202311323292.8A patent/CN117392315B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20200302683A1 (en) * | 2016-05-30 | 2020-09-24 | Netease (Hangzhou) Network Co.,Ltd. | Global Illumination Calculation Method and Apparatus |
CN115496847A (en) * | 2022-09-19 | 2022-12-20 | 奥格科技股份有限公司 | Method, system and medium for rendering and positioning three-dimensional scene of building information |
CN115690336A (en) * | 2023-01-05 | 2023-02-03 | 中国电子科技集团公司第十五研究所 | Satellite beam coverage area visualization method, server and storage medium |
Non-Patent Citations (1)
Title |
---|
杨悦;: "面向航天器测控的可视化特效建模与仿真", 系统仿真学报, no. 09, 8 September 2013 (2013-09-08) * |
Also Published As
Publication number | Publication date |
---|---|
CN117392315B (en) | 2024-07-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7181362B2 (en) | Three dimensional tangible interface for interacting with spatial-temporal data using infrared light sources and infrared detectors | |
CN106204745B (en) | Monitoring BIM model rapid loading interaction method and system based on standard atlas management | |
Kaneda et al. | Three dimensional terrain modeling and display for environmental assessment | |
US8665266B2 (en) | Global visualization process terrain database builder | |
CN104330074B (en) | Intelligent surveying and mapping platform and realizing method thereof | |
US11704866B2 (en) | Systems and methods for visualization of building structures | |
Lu et al. | Design and implementation of virtual interactive scene based on unity 3D | |
CN111223191A (en) | Large-scale scene infrared imaging real-time simulation method for airborne enhanced synthetic vision system | |
Iwasaki et al. | An efficient method for rendering underwater optical effects using graphics hardware | |
CN102147927A (en) | Processing method for terrain texture map and processing device | |
Wang et al. | Comparison of daylight simulation methods for reflected sunlight from curtain walls | |
CN117392315B (en) | Algorithm for dynamically drawing starlight map based on distributed photovoltaic output | |
Alkadri et al. | A computational workflow to analyse material properties and solar radiation of existing contexts from attribute information of point cloud data | |
Freniere et al. | Interactive software for optomechanical modeling | |
CN100495113C (en) | Design method of three-dimensional optical lens and lens | |
Yao et al. | Multi‐image based photon tracing for interactive global illumination of dynamic scenes | |
Iwasaki et al. | Efficient rendering of optical effects within water using graphics hardware | |
CN117951426A (en) | City-level building sunshine amount calculating method and system based on CIM platform | |
CN114549431B (en) | Method for estimating reflection attribute of material of object surface from single image | |
CN106096085A (en) | A kind of radiant energy dfensity analogy method of tower-type solar thermal power generating system | |
Ragia et al. | Precise photorealistic visualization for restoration of historic buildings based on tacheometry data | |
CN114387414A (en) | Method and device for generating lunar soil particle model, electronic equipment and medium | |
CN114332406B (en) | Display method for simulating real-time illumination of cultural relic 3D scanning model | |
Xie | Research on application of virtual reality technology in virtual marine environment | |
CN118229906B (en) | Method, system, medium and product for making realistic relief and shading map |
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 |