In my project using THREE.js, I am aiming to create a captivating animation where an object gradually shrinks into nothingness.
After exploring solutions on Three.js - Animate object size, I found methods to adjust the size of an object. However, the changes occur instantly, and I desire a smooth transition over a 3-second interval. Additionally, it seems this question has been around for quite some time :)
The code snippet below showcases my current implementation. The 'backwardMeshOct' is simply a THREE.Mesh constructed with specific geometry and material:
var time = 20;
function animate() {
backwardMeshOct.scale.x = Math.abs(Math.sin(time * 50));
}
requestAnimationFrame(animate);
Despite experimenting by adjusting the 'time' variable and its multiplier, I have not achieved the desired effect. The scaling on the x-axis remains instantaneous.
Your assistance in addressing this challenge would be greatly appreciated. Thank you, everyone!