I am currently working on creating a circular motion for an object within a set time frame.
This project involves designing a clock with smooth motion.
Instead of simply updating the position to fixed coordinates every time .getSeconds()
changes, I aim to use a combination of
(.getSeconds() + (.getMilliseconds()/1000)
to accurately display the movement of the second hand continuously.
In previous projects involving circular motion, I utilized the following pair of functions:
var OrbitCalculationX = function(velocityPartial, orbitalRadius) {
return (Math.sin(Date.now() / 16000 * velocityPartial) * orbitalRadius);
};
var OrbitCalculationZ = function(velocityPartial, orbitalRadius) {
return (Math.cos(Date.now() / 16000 * velocityPartial) * orbitalRadius);
};`
The value 16000
in that calculation determined the orbital time, but it was not accurate. Is there a method to control a x-axis sin vs z-axis cos
equation pairing with precise time constraints?
If not, is there a way to define an animation path to complete within an exact timeframe using THREEjs?