From 9f12be95640fed8614352a6f7279b02bd8926aa8 Mon Sep 17 00:00:00 2001 From: TheCodeTherapy Date: Thu, 8 Aug 2024 13:05:43 +0100 Subject: [PATCH] fixes initial sun positioning according to Environment Configuration --- packages/3d-web-client-core/src/rendering/composer.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/3d-web-client-core/src/rendering/composer.ts b/packages/3d-web-client-core/src/rendering/composer.ts index cee06d3e..60941d37 100644 --- a/packages/3d-web-client-core/src/rendering/composer.ts +++ b/packages/3d-web-client-core/src/rendering/composer.ts @@ -540,11 +540,13 @@ export class Composer { } if (typeof this.environmentConfiguration?.sun?.azimuthalAngle === "number") { sunValues.sunPosition.sunAzimuthalAngle = this.environmentConfiguration.sun.azimuthalAngle; - this.sun?.setAzimuthalAngle(this.environmentConfiguration.sun.azimuthalAngle); + this.sun?.setAzimuthalAngle( + this.environmentConfiguration.sun.azimuthalAngle * (Math.PI / 180), + ); } if (typeof this.environmentConfiguration?.sun?.polarAngle === "number") { sunValues.sunPosition.sunPolarAngle = this.environmentConfiguration.sun.polarAngle; - this.sun?.setPolarAngle(this.environmentConfiguration.sun.polarAngle); + this.sun?.setPolarAngle(this.environmentConfiguration.sun.polarAngle * (Math.PI / 180)); } }