Hi
i use skypack modules for Threejs and Tween => no problem
But my canva is a part of my html, and i want to use custom function to trigger interaction with it
it’s ok by moving the declration of scene, camera, controlls etc. but i fail to do it with Tween.
My code is not best practices and under dev
You can look it at the source code here : ChronoBackup.com : Visualisation 3D de la TimeLine
Brefiely :
<script>
let camera, controls, scene, raycaster, renderer;//,labelRenderer;
function GO(item){
const mytarget=scene.getObjectByProperty('ref',item,true)
const p = mytarget.position;
let n=p.clone();
n.x-=70;
n.y+=25;
camera.position.x=n.x;
camera.position.y=n.y;
camera.position.z=n.z;
controls.target.x=p.x;
controls.target.y=p.y;
controls.target.z=p.z;
//scene.positionTween = new TWEEN.Tween(camera.position).easing(TWEEN.Easing.Quadratic.InOut);
// scene.rotationTween = new TWEEN.Tween(controls.target).easing(TWEEN.Easing.Quadratic.InOut);
//scene.updateCameraTweens(n,p);
}
</script>
<script type="module">
// Find the latest version by visiting https://cdn.skypack.dev/three.
import * as THREE from 'https://cdn.skypack.dev/three@0.132.2';
import * as TWEEN from 'https://cdn.skypack.dev/@tweenjs/tween.js';
Any suggestion to enable tween transition on my custom js function ?