I have a piece of software that I have been working on that takes some information about boxes on a conveyor from a database and then needs to do an animation based on that information to show the boxes moving across the conveyor. The problem I am having is figuring out the proper algorithm to calculate the duration of the animation for each box. So what I have is a track, which has a set length in feet and a set speed which is feet per second. Now the actual shape I am using for the track in javafx is 1200px. Now I need to take say a track length of 21 feet with a speed of 1ft/s and figure out how long the animation should last, for
testing each box is being thrown on the conveyor in random positions and the track length could change between tracks.
So for example if we have a conveyor that is 21 feet with a speed of 1ft/s and the boxes current position is 10 feet in then we calculate how long it will take for the animation to complete for that specific box, the trouble comes in when converting things from pixels to feet since the physical track object in the program will always be equal to 1200px no matter what the actual size of the track is..so a 21 foot track will be displayed as a 1200px rectangle but a 500 foot track would also be a 1200px rectangle.
Hopefully I made it clear enough if not I can try to elaborate more if needed.