The ray that is cast from the lower left corner will go through the point <0,0,0> in your model space. Now you should identify two other points in your model space whose surrounding are exactly the same as for point <0,0,0>. These points will specify your view of the model, call these points P1 and P2. The ray that is cast from the lower right corner of the image will go through the point P1 and the ray for the upper left corner of the image will go through the point P2. Because we are using projection (orthographic camera) the ray cast for the upper right corner will go through the point P1+P2 in your model space. The other way saying this is that the point P1 is projected to lower right corner and point P2 is projected to upper left corner. You should also decide the aspect ratio R of the desired image.
Now simply calculate alpha^2, beta^2, gamma, image width W, and image height H=RW. Calculate the square roots and pick the signs so that alpha times beta is of the same sign as the dot-product of P1 and P2. If now alpha+beta is negative, swap the signs for both of them. The equation alpha+beta >0 simply means that the upper right corner is further away from the camera than the corner <0,0,0>.
Next, calculate the transformation matrix A. You should be able to use this transformation matrix to rotate your camera to correct angle, or you can calculate the rotation angles from the elements of the matrix as given below. (X, Y, and Z).
Now insert these values into this template and create your scenery ...
So, as an example we'll create a set of infinitely ascending steps. Here is a sketch of the target image where you can see the orientation of the axis (remember that POVRAY has a left-handed coordinate system) as well as the dimensions and the points P1 and P2.
As you can see from the sketch, the faces of the steps are 1 times 1 units and are parallel to X-Y plane. When moving in X-direction the offset to the next step is <1,-0.1,-0.1> and in Y-direction the offset is <0,1,-0.4>.
Now we have to select the two points P1 and P2. As one can see, the point P1 is selected from the step that is one row below the <0,0,0> corner-point and 5 steps to the right of it, giving the coordinates 5*<1,-0.1,-0.1> - <0,1,-0.4> = <5,-1.5,-0.1>. The point P2 is located 3 rows above and 2 steps to positive X-direction giving: 2*<1,-0.1,-0.1> + 3*<0,1,-0.4> = <2,2.8,-1.4>. For the aspect ratio R (image height/image width) we select a value 0.5 as the width of the sketch seems to be about twice the height.
Now we get:
alpha^2 | = | 4.3684 | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
beta^2 | = | 8.0771 | |||||||||
P1*P2 | = | 5.9400 (dot-product) | |||||||||
alpha | = | 2.0901 | |||||||||
beta | = | 2.8420 | |||||||||
alpha*beta | <-> | P1*P2 (are of the same sign) | |||||||||
alpha+beta | > | 0.0 (We don't need to swap signs) | |||||||||
W | = | 4.7845 | |||||||||
H | = | 2.3923 | |||||||||
gamma | = | 340.9044 | |||||||||
A | = |
| |||||||||
X | = | -72.3252 deg | |||||||||
Y | = | 8.7423 deg | |||||||||
Z | = | -39.1248 deg |