A cart consists of a carriage and another object like a horse that pulls it. The carriage follows the horse and their distance is fix. For a straight movement this is quite easy - a bit trickier are curves. If you want to animate a cart more or less realistic you have to use at least two objects: the horse plus the drawbar and the carriage.
Let's define some coordinates:
- W is the origin of the rear axle
- D is the origin of the front axle
- H is the origin of the horse
l = (D-H).length is fixed as well as (D-W).length If H is transformed, D and W have to follow.
Let us move H to H' and S should be the transform vector (H'-H).
The carriage follows the horse and its position and rotation is somewhat between its original and the direction of the horse. Let's put D' somewhere between D and H'.
S = H' - H
l = (D - H).length
D' = l * (H' - D).identity
The same goes with W':
l = (W - D).length
W' = l * (D' - W).identity


