Celestial Vault: Sun Position

Summary

The Sun is not positioned where it should be at the start of the day, and obviously the incorrect offset persists as the day cycle runs.

Please select what you are reporting on:

Creative

What Type of Bug are you experiencing?

Assets

Steps to Reproduce

· same date/location as default (2025-01-07, GMT -5, Lat/Lon: 45.0°, -73.0°)
· time of the day set as 7h30’ (7.5)

Expected Result

The Plugin calculates correctly the Right Ascension and Declination (which it does, I also checked with other software). These correct celestial coordinates should correspond to the Sun just rising from the horizon.

Observed Result

The Sun is up higher instead (see 1st attached image). The celestial coordinate grid included in the plugin also helps showing the Sun misalignment.

Platform(s)

Tested on Windows 10, probably everywhere else

Upload an image



Additional Notes

I think I’ve found the problem, but I’m not sure: inside the function GetSunInfo(double JulianDate), the X and Z components of the vector were accidentally left out of the scaling operation.

Considerations:
· RA, Dec are correct (RA = -4.738352, Dec = -22.298728)
· The Direction Toward Earth vector seems to be incorrect (calculations in the 2nd attached image)

My guess is (see the 3rd attached image):
Inside the function GetSunInfo(double JulianDate), RA and Dec are first set (and those, as said, are correct), then the Sun location is calculated, then to convert to UE frame there is this line of code:
SunLocation.Y *= -100.0; // Convert to UE Frame by inverting Y and scaling to UE Units

The Y is inverted and scaled, but I think X and Z should be scaled too.

Indeed, by multiplying by 100 the X and Z components of the “supposedly wrong” vector (-0.003, -1.000, 0.004) and then normalizing we obtain the “supposedly right” one (-0.300, -0.875, 0.379).

Thanks in advance (P.S. REALLY AWESOME plugin!!)