copperpen, on 12 August 2015 - 12:16 PM, said:
Cab control animations are not the same as an animated pantograph. Cab controls work from a series of small pictures of the control in different positions.
I do not think that it is a case of the animation will "fall apart", more of a case that the animation is made for a set wire height and the parts are made to fit that size. The animation positions and part positions are controlled by the matrix within the shape file. To have a 7.2 metre panto match a 5.2 metre wire height would require some form of manipulation of the shape file on the fly during loading.
3D cab animations are simple shape animations. usually with one start and and ending keyframe, in every game. But actually the wheel animations are the same, those animations are played with variable speed, stopped, reversed according to the movement of the vehicle.
If the animator makes a pantograph animation to 7.2m, the animation just need to be stopped at certain animation time, where the pantograph is at 5.2m, no need for any shape manipulation, just some named marker that indicates the position of the top of the pantograph, a dummy object maybe "PANTO~1 CONTACT" that is placed at the top of the pantograph, and linked with the shape object itself. The next thing is to calculate the animation time where that named object is at the desired height, and play the animation to that time.
Or just a multi keyframe pantograph animation, where the second keyframe is the lowest possible wire height, and the third keyframe is the highest possible. Then all you need is a percentage of the required position between these.