fix: make Globe light position accurate

Takes UTC current time with timezone difference, based on noon
I guess thanks again ChatGPT + StackOverflow?
This commit is contained in:
2023-02-15 19:11:37 +01:00
parent fd77c6d24f
commit d4f0a7431c
2 changed files with 3 additions and 3 deletions

View File

@@ -18,8 +18,8 @@ export class Globe {
// Calculate local time for sun position // Calculate local time for sun position
const date = new Date() const date = new Date()
const localHour = date.getHours() + date.getTimezoneOffset() / 60 const localHour = date.getUTCHours() + date.getTimezoneOffset() / 60
this.options.sunAngle = (localHour - 12) / 12 this.options.sunAngle = 2 * Math.PI * (localHour - 12) / 24
// Parameters // Parameters
this.params = { this.params = {