Page 1 of 1

Compensate rotation

Posted: 01.02.2004, 20:35
by AuReality
I hope someone here knows enough about physics to help solve a mathematical problem I have:
In Celestia, I am on a planet with radius R. My distance from the surface is D. I have the horizon in view in the midst of the screen, and it is not skewed. Now I rotate a number of degrees (A) on the Y-axis. This results in
a) a lowering of the horizon
b) a skewing of the horizon
How can I compensate for these effects so that the horizon is in the middle of the screen again, and not skewed anymore? I'd like to be able to calculate this for any R, D and A. By trial and error I've found out that when A is 45 degrees, the necessary compensation is to also rotate 45 degrees on the X-axis, and 90 degrees on the Z-axis. I expect some kind of sine or cosine relation to be in effect, but I can not find the right formula.
Anyone?

Paul