Announcement

Collapse
No announcement yet.

Astronomy Plugin

Collapse
X
  • Time
  • Show
Clear All
new posts

    [RELEASED] Astronomy Plugin

    Im finishing up the Astronomy plugin, which provides a blueprint interface to do many kids of astronomical calculations. For example, you can calculate star and planet positions from any point and time on earth or model the solar system.The astronomy plugin The plugin has over 30 advanced astronomical functions accessible through blueprints, and can use three kinds of planet ephemeris: JPL Low precision formulas, VSOP87, and high-precision NASA ephemeris files.
    Last edited by dingtech; 06-20-2018, 09:20 PM.

    #2
    20 June 2018: Now available on the marketplace!
    https://www.unrealengine.com/marketp...tronomy-plugin

    Documentation: https://drive.google.com/open?id=1UT...esjzs0b1--I22c

    Youtube overview and quick start: https://www.youtube.com/watch?v=OQPbqlKxTjM


    Features:
    • Star, sun and moon locations for any latitude and longitude and time
    • Calculate the sun and moon location with very high accuracy
    • StarManager blueprint to assist with placing stars
    • Double level precision available
    • Designed to easily integrate with your Sun, star, or moon blueprints and materials, low quality example blueprints provided.
    • Import NASA bsp files to model comets, spacecraft, planets, etc
    Code Modules:
    • AstroLib – RunTime – Core astronomy function library
    • AstroLibEditor – Editor – Used to allow Star placement in Editor mode
    • DoubleModule – Runtime – Used to provide an interface for double variables into Unreal Engine
    Number of Blueprints: 3 Quick Start Blueprints (Sun, Moon, and Planets), 1 Star Manager blueprint (helps with star placement), and one moon example material

    Supported Development Platforms: Win32, Win64
    Supported Target Build Platforms: Win32, Win64

    Documentation is included in the Blueprint Docs folder. Each function has through commenting using the Unreal comment system.

    Important/Additional Notes:

    The core of the plugin is a static blueprint library of over 30 astronomical functions. The plugin is designed to integrate with your blueprints and artwork, the star and planet blueprints that come with the plugin are low quality and intended for demonstration purposes. It is not recommended to use a SkyBox if you are placing star and planet actors – those objects will be in from of any skybox that your scene uses, so the stars and planets will appear in front of any clouds.

    This plugin will only work with windows.

    The Astronomy plugin uses a right hand coordinate system as most astronomy coordinate system are right handed. When needing to get an Unreal world coordinate, it is recommended to invert the Y axis. Some functions return this automatically as described in function documentation. The main functions that do not do this automatically are functions that directly return ephemeris data (like GetPlanetState).

    Core function List:
    CalculateStarPosition - Returns the celestial position of a star (or any object outside the solar system) in various coordinate systems

    CalculatePlanetPosition - Returns the celestial position of a planet in various coordinate systems

    PlanetDirectionFromEarth - Returns the direction towards a planet from earth surface

    GetEarthRotator - Returns a rotator (Left hand coordinate system to be compatible with Unreal) representing the earths rotation.

    GetPlanetState - Returns a velocity and position vector of the selected planet, using the active ephemeris object.

    Other functions:

    GetNumberOfLeapSeconds – Number of leap seconds added to UTCTime

    GetJulianDate – Gets a julian date from a calander date

    GetCalendarDate – Gets calendar date from a julian date

    GetTTJulianDatefromUTC – Gets terrestrial time (aka ephemeris time) in julian date format

    GetUT1JulianDatefromUTC - Returns the approximate (within 0.5 seconds) UT1 time in Julian Date format

    GetCoordsTypeName - Returns the name of the type of coordinate returned by Star or Planet position, based on observer location type and
    coord system selections. (examples are Topocentric place, astronomic place, etc)

    CalculateSideRealTime – Calculates sidereal time.

    TerrestrialToCelestial - rotates a vector from the terrestrial (ITRS) to the celestial (GCRS) system.

    CelestialToTerrestrial - rotates a vector from the celestial (GCRS) system to the terrestrial (ITRS)

    TopocentricToHorizon - Transforms topocentric right ascension and declination to zenith distance and azimuth. (I.e. gets the azimuth and
    elevation from a celestial position)

    AzElToRectangular - Transforms Azimuth and elevation to cartesian rectangular coordinates (left hand rule for Unreal compatibility)

    RectangularToAzEl- Transforms cartesian rectangular coordinates to Azimuth and elevation

    TransformCoordSystem - Transforms an object for a change of epoch and/or equator and equinox.

    HipparcosToJ2000 - convert Hipparcos catalog data at epoch J1991.25 to epoch J2000.0.

    PrecessionShift - Precesses equatorial rectangular coordinates from one epoch to another.

    ConvertSphericalToEclipticLatLong - Convert right ascension and declination to ecliptic longitude and latitude.

    EquationOfOrigins - Computes the true right ascension of the celestial intermediate origin (CIO) at a given TT Julian date.

    EarthRotationAngle - This function returns the value of the Earth Rotation Angle (theta) for a given UTC Julian date.

    SetCelestialPoleOffsets - This function specifies celestial pole offsets for very high - precision applications.

    GetEarthTiltParameters - computes various quantities related to the orientation of the Earth’s rotation axis

    ConvertToEcliptical - Converts an equatorial position vector to an ecliptic position vector

    ConvertToEquatorial - Converts an ecliptic position vector to an equatorial position vector.

    SphericalCoordsToVector - Converts a Right Ascenstion and a declination to a vector. (equatorial spherical coordinates to a vector (equatorial
    rectangular coordinates)

    GetPlanetToEarthRadiusRatio - Returns the ratio of a planet's radius compared to earth.

    GetKMFromAU - Returns a FDoubleVector that is in AU units in KM

    GetAzElInDegrees - Returns the azimuth (0-360 degrees) and elevation from a world direction vector.
    Last edited by dingtech; 06-21-2018, 09:02 PM.

    Comment


      #3
      This looks like a pretty cool plugin

      Got a question - How much will this cost?

      Comment


        #4
        It is now available on the marketplace for 59.99.

        Comment


          #5
          Enjoying this plugin, but I have a question - how do you set the north direction? For example for an accurate sun study in 3dsmax, you have the compass icon which dictates the north direction in relation to the buildings etc.
          Alex
          Director
          Spectra Studios Ltd

          Comment


            #6
            Originally posted by spectra View Post
            Enjoying this plugin, but I have a question - how do you set the north direction? For example for an accurate sun study in 3dsmax, you have the compass icon which dictates the north direction in relation to the buildings etc.
            I will add a feature to change the north direction for the 4.21 update.

            In the meantime, if you are just using the included Sun, moon, and planet blueprints, you can add this yourself pretty easily. Basically its just adding a rotation around the (0,0,1) axis.
            1. Change the BP_EarthViewObject blueprint to add a float variable called North Adjustment, and make it instance editable.
            2. In the BP_EarthViewObject GetObjectLocation function, add a RotateVectorAroundAxis node using 0,0,1 as the axis, the North Adjustment variable as the Angle Deg, and the output of the calculate planet direction function (after it has been multiplied by distance) as the vector. (Screenshot 1)
            3. For the Moon, in the UpdateLightingFunction, you will need to do something similar as shown in the screenshot.
            4. Also for the Moon, add a rotation in the SetLocation function (screenshot 3). This keeps the lighting on the correct side of the moon.
            Modifying StarManager to do this for Stars is going to involve some more complicated code changes, so that will have to wait until 4.21.

            Comment


              #7
              Hello there, I'm currently experimenting with your plugin and the example project, which brought up a couple of questions which I'd like to talk through one post at a time if you don't mind. I'm just starting to tinker with astronomy, so please excuse anything dumb that I may write btw.
              First of all, could you please elaborate a bit what UUToAU does exactly for each SolarSystemBody? I do understand the concept behind it and also know what an AU is, but I'm not sure right now what it is influencing exactly.
              For example, in the SolarSystem example map, I've set all size multipliers to 1 (but for the sun) and all UUToAUs to 10k in hope of getting distances and sizes that relate to reality (ephemeris: JPLDE, central body: solar system bary, plane: ecliptical) . But the moon for example disappears inside the earth then. So do I understand something wrong here?

              Comment


                #8
                Originally posted by HaBe2305 View Post
                Hello there, I'm currently experimenting with your plugin and the example project, which brought up a couple of questions which I'd like to talk through one post at a time if you don't mind. I'm just starting to tinker with astronomy, so please excuse anything dumb that I may write btw.
                First of all, could you please elaborate a bit what UUToAU does exactly for each SolarSystemBody? I do understand the concept behind it and also know what an AU is, but I'm not sure right now what it is influencing exactly.
                For example, in the SolarSystem example map, I've set all size multipliers to 1 (but for the sun) and all UUToAUs to 10k in hope of getting distances and sizes that relate to reality (ephemeris: JPLDE, central body: solar system bary, plane: ecliptical) . But the moon for example disappears inside the earth then. So do I understand something wrong here?
                Hi, thanks for purchasing the plugin.

                UUToAU and the planet size multiplier are both ways to scale the solar system so that it can fit inside the gaming engine (here is a link that shows how the solar system would look if it was drawn to scale: https://www.space.com/30610-scale-of...ing-video.html). So to make the solar system visible and useable in a game engine, some scaling of planets and distances needs to be done.

                UUToAU describes how many Unreal Units (UU) make up one AU. The reason the moon disappears into the earth is because the moon location in this example project is set relative to earth. The moon is about 0.0025 AU away, so setting UUToAU to 10000 would only put the moon about 25 unreal units away (10000*0.0025) from the center of the earth, which is probably still inside the earth.

                Comment


                  #9
                  Originally posted by dingtech View Post

                  The reason the moon disappears into the earth is because the moon location in this example project is set relative to earth.
                  That totally makes sense now. Somehow I didn't realize that the distance of course is relative to earth in that case. Thank you for that detailed explanation.
                  By the way, I already was wondering for a longer time how one could achieve a cheap omnidirectional lighting effect for a setting like that in UE, so you delivered an answer and a really clever solution with your example project as well for that. Thanks again, I'll extend that to have all planets covered by it.

                  Before I forget, I'd suggest that you put the link to the documentation directly into the marketplace description. I was looking for quite some time and found it rather by accident in the comments section there. Meanwhile I also found it in the plugin content folder, but that's also not too obvious (because you only mention it to be in the blueprints docs folder) when starting out. I'm sure that would help others to a quicker start.

                  My next question is relating to the StarManager. As far as I can tell, there currently is no setting to have the stars positioned relative to the sun or - even more important in my case- the system barycenter, is that correct? I'm basing that assumption on the available observer location types. Then again, there also is a space location and velocity setting and different possible coord system settings, but for me as a beginner it's not clear what to do with all these settings. Would be great if you could explain that a little bit in-depth as well. And thanks for your time so far, I really appreciate that.
                  Last edited by HaBe2305; 09-03-2019, 01:13 PM.

                  Comment


                    #10
                    Originally posted by HaBe2305 View Post

                    That totally makes sense now. Somehow I didn't realize that the distance of course is relative to earth in that case. Thank you for that detailed explanation.
                    By the way, I already was wondering for a longer time how one could achieve a cheap omnidirectional lighting effect for a setting like that in UE, so you delivered an answer and a really clever solution with your example project as well for that. Thanks again, I'll extend that to have all planets covered by it.

                    Before I forget, I'd suggest that you put the link to the documentation directly into the marketplace description. I was looking for quite some time and found it rather by accident in the comments section there. Meanwhile I also found it in the plugin content folder, but that's also not too obvious (because you only mention it to be in the blueprints docs folder) when starting out. I'm sure that would help others to a quicker start.

                    My next question is relating to the StarManager. As far as I can tell, there currently is no setting to have the stars positioned relative to the sun or - even more important in my case- the system barycenter, is that correct? I'm basing that assumption on the available observer location types. Then again, there also is a space location and velocity setting and different possible coord system settings, but for me as a beginner it's not clear what to do with all these settings. Would be great if you could explain that a little bit in-depth as well. And thanks for your time so far, I really appreciate that.

                    Thanks for letting me know about the documentation, I have updated the marketplace listing and I will fix the folder for the 4.23 update.

                    There isn't an easy way to get star positions from the barycenter right now. I'll look into how difficult it will be to add for the 4.23 update, but unfortunately there isn't an easy way for me to add that so I'm not sure I will be able to get to it. If you really need it, you could set the observer to Near Earth Spacecraft, then for the Space Location provide the barycenter position in the GCRS (center of earth) coordinate system for the UTCTime you are using in StarManager. Keep in mind though that because star's are very far away, the perspective of viewing the star from earth or the barycenter won't matter very much. The closest star to earth has a parallax of about 0.7 arcsseconds, or about 0.0002 degrees, probably lower than the precision that unreal will be rendering the star anyway.

                    Coordinate systems are a complex subject...there are no predefined up, down, left, right, or center positions in the universe, so astronomers agree to define systems usually based on where the earths equinox would be at various dates. The systems differ by using different ways of calculating where earths equinox would be, or differ because updated measurements allow scientists to improve the prediction of earth's location. Most of the different systems are very close to one another and shouldn't make much of a difference. I haven't found any particularly good references about this subject online, but I found the US Naval Observatory's Astronomical Almanac (available on amazon) helpful while developing the plugin.

                    Comment


                      #11
                      Originally posted by dingtech View Post

                      There isn't an easy way to get star positions from the barycenter right now. I'll look into how difficult it will be to add for the 4.23 update, but unfortunately there isn't an easy way for me to add that so I'm not sure I will be able to get to it. If you really need it, you could set the observer to Near Earth Spacecraft, then for the Space Location provide the barycenter position in the GCRS (center of earth) coordinate system for the UTCTime you are using in StarManager. Keep in mind though that because star's are very far away, the perspective of viewing the star from earth or the barycenter won't matter very much. The closest star to earth has a parallax of about 0.7 arcsseconds, or about 0.0002 degrees, probably lower than the precision that unreal will be rendering the star anyway.
                      I see... so maybe that's a missunderstanding on my side. Precision is not important in my case, but star locations for a given time and date seen from space are. Right now it seems like all the stars rotate aprox. 360 degrees during 24 hours (using Fast Update method), so I thought that's happening because star locations are calculated based on earth rotation. If not, that would mean that the whole solar system would be rotating like that in a day, which I've never heard of, but then again I don't know that much on that topic yet.
                      Last edited by HaBe2305; 09-03-2019, 10:08 PM.

                      Comment


                        #12
                        Ah, I misunderstood your question. You are right, if you are observing from the perspective of the solar system the stars should not be rotating

                        Comment


                          #13
                          Originally posted by dingtech View Post
                          Ah, I misunderstood your question. You are right, if you are observing from the perspective of the solar system the stars should not be rotating
                          Never mind, being a beginner on that topic and also not being a native speaker makes it harder to be clear with words, so that's on me.
                          I've experimented a bit more, and I think I found out what the different Star Calculation Methods are for, but a bit more documentation or explanation on them would be nice as well. So if I set to "Fast Update", the stars rotate (like seen from earth I guess), if set to "Only Celestial", the stars only move noticably when stepping like a hundred years into the future, so I guess that's the movement relative to the whole solar system. So what do "Full" and "Only Horizon" do in that regard and what else would be good to know about the different update modes from a beginner standpoint?

                          Comment


                            #14
                            Originally posted by HaBe2305 View Post

                            Never mind, being a beginner on that topic and also not being a native speaker makes it harder to be clear with words, so that's on me.
                            I've experimented a bit more, and I think I found out what the different Star Calculation Methods are for, but a bit more documentation or explanation on them would be nice as well. So if I set to "Fast Update", the stars rotate (like seen from earth I guess), if set to "Only Celestial", the stars only move noticably when stepping like a hundred years into the future, so I guess that's the movement relative to the whole solar system. So what do "Full" and "Only Horizon" do in that regard and what else would be good to know about the different update modes from a beginner standpoint?
                            Yes, I think only celestial is the mode you want for the solar system view. But I would like to do some double checking and debuging on that mode over the next few days, I was mostly thinking about this from the earth perspective so I want to make sure it is calculating everything correctly from the in space perspective.

                            The Only Horizon mode only computes the changes to a stars location based on the rotation of the earth, so it is less computational intensive than the full mode.

                            The full mode computes a star position update based on the earths rotation, and also the changes from the stars velocity over time, gravity warping of the light by the sun, atmospheric refraction, etc. So it is more accurate but much more computationally intensive.

                            The fast update mode is a very rough estimate of the star position that only uses an estimate of the earths rotation. It is the least accurate but the fastest to generate.

                            Comment


                              #15
                              Originally posted by dingtech View Post

                              Yes, I think only celestial is the mode you want for the solar system view. But I would like to do some double checking and debuging on that mode over the next few days, I was mostly thinking about this from the earth perspective so I want to make sure it is calculating everything correctly from the in space perspective.

                              The Only Horizon mode only computes the changes to a stars location based on the rotation of the earth, so it is less computational intensive than the full mode.

                              The full mode computes a star position update based on the earths rotation, and also the changes from the stars velocity over time, gravity warping of the light by the sun, atmospheric refraction, etc. So it is more accurate but much more computationally intensive.

                              The fast update mode is a very rough estimate of the star position that only uses an estimate of the earths rotation. It is the least accurate but the fastest to generate.
                              Understood, great, thank you very much again! Please let me know if you find anything or if I could support you by trying something with that.

                              I've made some extensions already that I think would be interesting for others as well, so maybe you'd want to include them in the next update (simple and fast to add).

                              I've added a switch to the example game mode (and an additional checkbox to the HUD for it) that uses the actual delta time per tick for adding to UTCTime if enabled, so everything will move in realtime independend from framerate. DeltaTime could also be multiplied with IterateTimeSpan as well for the same benefit.

                              I also extended the SolarSystemMoonEarth blueprint to always face the earth actor (PlanetOrbiting) using a simple FindLookAtRotation. Since that's one of the main features of our moon, I think that should definitely be included in anything astronomy.

                              If you'd want to extend it a bit further with a useful function, it would be nice to get a rotator from the lib that rotates for example a skybox so that the center of our galaxy would be at the correct position, or at least a vector that points in the direction of the milkyway center, if that's even doable. Just suggesting and thinking out loud right now. I'm sure it's nothing trivial in this regard.

                              And now for my last question on my list so far. Does the BSP Ephemeris data also come with actual planet rotations? I've found that GetEarthRotator function in the Earth BP only, so my guess is you're calculating earth rotation differently and it's not doable for the other planets because of lacking data, right?

                              Comment

                              Working...
                              X