I'm writing some code to simulate a vehicle (tank or car) driving over a heightmap terrain. I'm not using a full physics engine, and just simply checking the height of the terrain at the 4 bottom corners of the vehicle bounding box for collision. The vehicle has a quaternion to represent rotation, and a 3D position.
I have orientation working if there are at least 3 wheels touching the ground (I can define a plane and determine the orientation from the normal), but what I'd like to do is react pseudo-realistically rotate the car if two wheels are touching the ground.
For example, if the rear two wheels hit the ground, I'd like to calculate a rotation to make the front of the vehicle drop until 3+ wheels touch the ground.
Obviously if I have two wheels intersection points, I have an axis, but I'm not sure how to manipulate the rotation and position to rotate around that axis when it's not central to the body.