Hello everyone, I am making a graph of a roller coaster that looks like a sine graph. I am trying to make the boxcar follow the path of the tracks and keep going around the tracks in a constant loop. I already got the first part with the straight track at the bottom as you can see from the picture, and to do this I graphed the points of each polygon of the boxcar and I made it so that the x-coordinate was subtracted by t (t was the time from a timer I have in desmos) and the y-coordinate was increased by the slope of the path.
However I am having trouble making the boxcar move up the following tracks and follow their path. I tried to do a piecewise function at first so that the value subtracted from the x-coordinate and added to the y-coordinate at the beginning would only apply for the first few seconds, and then when t was greater than some number then a different value would be added/subtracted from the coordinates. For this I made each polygon’s points different letters, like (A,B), (C,D), etc and I made A equal a certain function until t was a certain value and then I made it equal another function, and the same for the other points. However this didn’t work and it said “Too many variables, I don’t know what to do with this”. Is there any other way I can get the boxcar to follow the tracks?
Also, I am trying to get the boxcar to rotate near the “y-axis” I drew on my roller coaster since at the top of that y-axis, which is the first peak in the roller coaster, the bottom of the boxcar is supposed to be visible with wheels, etc, and when it does down from the peak then the top will be visible, then it will go up the next hill and the bottom will be visible again and so on. But to do this I need to get the boxcar to look like it’s rotating as it goes up the track near the y-axis, so I need to make it go from the top being visible (near the bottom), to the sides (in the middle), to the bottom being visible (near the top of the track near the y-axis). How should I do this?
Thank you for any help!