Currently, I am attempting to smoothly adjust the camera's rotation in order to focus on a specific object within a graph.
Up until now, my implementation includes:
fourd.render_loop.push(() => TWEEN.update());
fourd.intersect_callback = function(vertex){
console.log(vertex);
var camera = fourd._internals.camera;
var start = new THREE.Euler().copy(camera.rotation);
camera.lookAt(vertex.position);
var end = new THREE.Euler().copy(camera.rotation);
camera.rotation.copy(start);
var tween = new TWEEN.Tween(camera.rotation)
.to(end, 600)
.easing(TWEEN.Easing.Quadratic.In)
.start();
};
The render_loop function acts as a collection of functions that are called in every render cycle. Despite this setup, I seem to be encountering an error message:
THREE.Euler: .setFromRotationMatrix() given unsupported order: NaN