Seeking assistance with implementing camera movement in ThreeJS.
Despite having no errors, clicking the button does not trigger the camera movement as expected.
The function aimed at moving the camera by 200 units in all directions seems to have no effect:
var button = document.getElementById("button");
button.addEventListener("click", function() {
var tween1 = new TWEEN.Tween(camera.position)
.to({
x : 200,
y : 200,
z : 200
} , 1000)
.easing(TWEEN.Easing.Linear.None)
.start();
});
What could be the issue in my approach?
Providing the complete ThreeJS script for better insight:
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );
camera.position.z = 4;
// remaining code is the same as original