The project I am working on is about an animation of a car that travels on a grid using x y z coordinates.

The rotation around the z axis was done with a simple rotation matrix using the angle, more accurately atan2(y2-y1,x2-x1), the rotation of the car when taking corners is done but now i need the car to rotate when going up on the z axis and when going down, simulating a slope like a real car would do.

So the problem is that I need 2 rotations in a single matrix, one for steering and one for "climbing" and "going down" a slope. I can't seem to find a good rotation matrix or calculate the right angle for that incline/decline.

Any ideas?