I'm currently experimenting with a particle system project and I would like to incorporate a slight delay in the rotation of my Points Object in three.js. At the moment, I am using D3.js linear scale which results in a 1:1 rotation. This means that if you quickly move your cursor all the way to the right, my Points Object will move at the same speed as your cursor. However, I am looking to introduce a smoother rotation effect where the rotation completes approximately 1 second after your cursor reaches the far right. Below is the snippet of my current code.
var rotYScale = d3.scale.linear().domain([0, window.innerWidth]).range([25,-25]);
var rotXScale = d3.scale.linear().domain([0, window.innerHeight]).range([15,-15]);
d3.select("body").on("mousemove", function() {
particleSystem.rotation.y = rotYScale(d3.mouse(this)[0]) * Math.PI / 180;
particleSystem.rotation.x = rotXScale(d3.mouse(this)[1]) * Math.PI / 180;
});`