Announcement

Collapse
No announcement yet.

PlanetaryPositions [heliocentric/geocentric positions, auto time-zone detection]

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [PLUGIN] PlanetaryPositions [heliocentric/geocentric positions, auto time-zone detection]

    Hey,

    i've decided to give the Unreal Engine a try so that i've started working on a plugin the few last weeks, which can be used to compute the positions of various planets in relation to a given position (latitude & longitude) on eath. I'm sure that there are already plugins/extensions available for this purpose but i've wanted to try it out by myself (learning by doing).

    So far i've come up with a C++/C++17 (needed for the necessary precision: double instead of float) plugin which provides the following features:



    Position on earth
    First of all the positions of the planets are being computed in relation to a given reference position on earth. The first step is setting a valid geo-location (latitude/longitude). This can be done in two ways:
    • a custom latitude/longitude,
    • a latitude/longitude out of ~120 predefined cities around the world
    Click image for larger version  Name:	GeoLocation_custom.png Views:	4 Size:	6.2 KB ID:	1774553Click image for larger version  Name:	GeoLocation_predefined.png Views:	4 Size:	7.1 KB ID:	1774554

    Time on earth
    Besides the position on earth, the positions of the planets ultimately depend on the chosen time on earth.
    Click image for larger version  Name:	TimeSelection.png Views:	4 Size:	7.8 KB ID:	1774555

    To make the handling of time zones more convinient for the user, i've integrated the fantastic work of https://github.com/evansiroky/timezone-boundary-builder to determine the time zone.
    Combined with the date & time library provided by https://github.com/HowardHinnant/date the plugin can automatically determine the IANA time zone ID & the UTC hour offset for a given position on earth.
    All you have to do is to provide a time zone bundle asset, which contains all the needed information. Such a bundle contains several different information:
    • The converted / processed data from the Timezone Boundary Builder
    • Selected files from https://www.iana.org/time-zones to be able to compute the UTC hour offset
    The plugin comes already with a fully featured time zone bundle asset, which can be used in the following way:

    Click image for larger version  Name:	TimeZone.png Views:	4 Size:	10.2 KB ID:	1774556
    To disable the automatic time zone detection simply clear the "Time Zone Data" and set a custom UTC hour offset

    Planetary positions
    After setting-up the reference position and the time on earth, the planetary positions can finally be computed. Currently the plugin only supports computations for the moon and the sun. There are a few confgurations for both "planets"

    Click image for larger version  Name:	SunMoonParameter.png Views:	4 Size:	12.9 KB ID:	1774557

    The computation of the sun provides following data:
    • Azimuthal coordinates (hour angle, altitude, azimuth)
    • Obliquity of the ecliptic
    • True longitude
    • Mean longitude
    • Mean anomaly
    • Right ascension
    • Declination
    • GMST / GMST0 / LST (local sidereal time)
    • Local time for the sunset
    • Local time for the sunrise Local time for the solar noon
    • "Behaviour" of the sun: normal (has sunrise/sunset), always below the horizon, always above the horizon
    The computation of the moon provides quite similar data:
    • Azimuthal coordinates (hour angle, altitude, azimuth)
    • Obliquity of the ecliptic
    • True longitude
    • Mean longitude
    • Mean anomaly
    • Right ascension
    • Declination
    Use in projects
    To acutally use the C++ modules i've implemented a example day-night-cycle blueprint. In addition to the previously show configurations there are few more regarding the actual simulation setup and the simple debug interface:

    Click image for larger version  Name:	AdditionalConfigurations.png Views:	4 Size:	18.5 KB ID:	1774558
    During simulation the time & date will automatically increased or decreased, depending on the sign of the simulation speed.

    Download (Beta!)
    Last edited by LeBoozer; 06-12-2020, 09:05 AM.

    #2
    Today i extended the plugin to support the computation of the heliocentric positions for the planets: mars, venus, mercury& jupiter.
    To see anything moving i needed to heavily increase the simulation speed (can be seen in the left top corner), since the planets are quite slow the further away they are from the sun. The time zone and location don't matter in this case...

    Comment

    Working...
    X