Reputation: 61
I have a perspective camera which is travelling across a spline curve.So I want to get the traveled time of the camera. total distance is calculated.what next?
Upvotes: 0
Views: 49
Reputation: 12632
To get the time at the beginning of your animation use:
var startTime = performance.now();
when your animation is finished use:
var endTime = performance.now();
and then
speed = distance / (endTime-startTime);
Upvotes: 1
Reputation: 3305
speed is distance/time, so if you know the distance and the desired speed, then time is distance/speed. Seems straightforward, but your question IS rather vague.
Upvotes: 0