1、安装tweenJs
npm i @tweenjs/tween.js@^18
2、引入tween.js
import TWEEN from '@tweenjs/tween.js'
3、创建并执行动画
// 相机切换动画
// controls的target就是场景的旋转中心
// 修改相机的位置就可以变换场景的显示效果
animateCamera(oldP, oldT, newP, newT, time, callBack) {
var _this = this
if (TWEEN) {
// 初始化相机以及控制器的target位置,一般为当前位置
var tween = new TWEEN.Tween({
x1: oldP.x, // 相机x
y1: