It is possible, but somehow complicated.
In fact, to build a transformation in matrix form you can get around these angles, calculating a transform directly out of your “coaster track”.
The idea is to extract two vectors: An “forward” vector, that points forward from the object, eg. tangent to the spline, and an simple “up” vector, that directs the object’s top. (mostly (0,1,0) ) The idea is to build a transform like that:
-Use the normalized “forward” as -z -Vector.
-Orthonormalize the “up”-vector
-find the third direction by cross-product.
these three vectors now builds up an orthonormal matrix, hence the needed transform to align the object with the track, standing upright to “up”.
You can displace the original “up”-vector to do things as roll movement in fast coaster curves.
AFAIK this trnsform can be automatically computed as i explained above by:
gluLookAt(obj.x, obj.y, obj.z, at.x, at.y, at.z, up.x,up.y,up.z);
this command is made for camera orientation, but should work as well for object transform.
You could set obj=(0,0,0), at=tangent to your spline and up=(0,1,0) for a first test.
calling the above command should then align the object to the coaster track.
if you want to include even the placement of the object, you could try something like:
obj=deltaCurrent
at =deltaNext (a track position slightly before me (~length of object ahead should be good))
up=(0,1,0)
although thats not what you questioned for, maybe its helps