I hope its good place for my question.
Im using animateMotion to move several objects along path, its a horse race so they have different dur, keyTimes and keyPoints based on the data from php, so objects slows down, speeds up ect.
i got it working quite nice. (im proud of it as im a svg noobie)
Its a race so i want to add a dynamic Scoreboard which will show current positions of all objects.
Im stuck here.
so the question is: Is it possible to get info about position of object moving along path ? it would be best in percentage.
Now i have:
Code: Select all
elapsed = document.getElementById("anims").getCurrentTime() * 1000;
dur = document.getElementById("anims").getSimpleDuration() * 1000;
percent = elapsed % dur / dur;
but its not good, since my objects have different speeds along the path, for example object1 move slow at beginning but speeds up along path, and is first at the end, object2 start fast, but slows down later, and is second at end.
the path is not a straight line, it has curves (it looks like serpentine or a river )
Anyone can help me ?
(sorry for my bad English)
regards
thelazyone