Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

make turntable rotate other direction

Scott Petrovic1d1f7492a1ec
diff --git a/src/lib/SceneEnvironmentManager.ts b/src/lib/SceneEnvironmentManager.ts
index 199c289..8e13621 100644
--- a/src/lib/SceneEnvironmentManager.ts
+++ b/src/lib/SceneEnvironmentManager.ts
@@ -149,7 +149,11 @@ export class SceneEnvironmentManager {
}
this.controls.autoRotate = this.turntable_speed > 0
- this.controls.autoRotateSpeed = this.turntable_speed
+
+ // we make negative to flip the rotation direction to match the typical turntable direction (left to right)
+ // the slider goes from 0 to positive values, but OrbitControls with negative autoRotateSpeed
+ // will rotate in the desired direction
+ this.controls.autoRotateSpeed = -this.turntable_speed
// Keep the turntable effect centered around scene origin.
if (this.turntable_speed > 0) {