So i am wondering how to go about animating fog in my scene and also the PerspectiveCamera
here are my defaults:
var camera, densityFog, colorFog2;
colorFog2 = 0xfee2ed;
densityFog = 0.25;
scene.fog = new THREE.FogExp2(colorFog2, densityFog);
camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 10000);
I am trying to tween the fog density to 0.02 and the perspective camera to 60 instead of 45
I haven’t even tried to animate the camera as i have no idea how but here is what I tried with the fog:
tween = new TWEEN.Tween(scene.fog)
.to({densityFog: 0.02}, 1000 )
.easing(TWEEN.Easing.Exponential.InOut)
.onComplete(function() { }).start();
gsap.to(scene.fog, {
duration: 2,
densityFog: 0.02,
onUpdate: function () {
controls.update();
isZoomed = 0;
controls.enabled = false;
},
});
thank you in advance for any help
tweening libs im using: tween.esm.js and GSAP