VI: Configure Perspective Correction


This section describes how to put the sweet spot anywhere it is desired, as long as it is within view of the multiscreen display. This is accomplished with with certain parameters shown in the CaveUT.ini file. They are shown highlighted here:

[CaveUT.Spectator]
CaveRoll=0.000000
CavePitch=0.000000
CaveYaw=0.000000
CaveOffsetX=0.000000
CaveOffsetY=0.000000
CaveOffsetZ=0.000000
CaveFOV=100.000000
OffAxis=No
FOVleft=-45
FOVright=45
FOVtop=36.87
FOVbottom=-36.87

[CaveUT.CaveUTInteraction]
RotateIncrement=0.250000
OffsetIncrement=0.500000
FOVIncrement=0.500000


In other literature, this technique of producing a "lop-sided" projection is referred to as "off-axis projection."

As with the other parameters, they only govern the one display for the computer it is installed on. For this capability, CaveUT depends on VRGL, a generic package for perspective and other VR related visual effects.

Step 1: Set OffAxis=Yes

This will activate CaveUT's perspective effects. When OffAxis=No, the values in FOVleft, FOVright, etc., do not matter.

Step 2: Read This: What the Four "FOV..." Parameters Do

The four perspective parameters, FOVleft, FOVright, FOVtop, and FOVbottm, refer to the left, right, top and bottom sides of that display, as shown to the right. The frustum in pink shows the original, unmodified, view. Both views share a single view axis, which is the shortest perpendicular from the eye to the screen. In the unmodified view it is in the exact center of the screen. In the modified view, it is off-center, because the frustum is deliberately lop-sided, as specified by the perspective parameters.

For example, FOVtop is the angle, in degrees, between the view axis and the center line of the top edge of the frustum. For a more technical description of how this works, look at the documentation for VRGL.

In the default CaveUT.ini, shown above, note how FOVleft is negative, while FOVright is positive. (By convention, left is the negative direction while right is the positive direction, like clockwise and counterclockwise.) For the view axis to actually intersect the screen, FOVleft must always be negative while FOVright is always positive. Similarly, FOVtop is positive and FOV bottom is negative.

It is sometimes desirable to make both parameters positive or negative to produce an extremely skewed view frustum, a more advanced use which is described at the end of this section. In other literature, this technique of producing a "lop-sided" projection is referred to as "off-axis projection."

Warning: If you enter values that make no sense, such as getting the positive/negative signs backward, UT2004 will start, but it will produce visual nonsense. To exit the game, press the back quote key, "`", type "quit" and press return.

Step 3: Compute and Set the FOV Parameters for Each Screen

Go back to your diagram for your multiscreen display, add the new sweet spot, and compute the FOV angles using trigonometry. For example, the image on the right shows a diagram of the BNAVE and the measurements for the right screen. The blue line roughly represents the viewer standing in the BNAVE, where the top of the line is the sweet spot. The Left/Right/Bottom/Top markings on the right side screen show what the game engine on that PC thinks is going on.

As you can see, the display is physically rotated so the "Right" side is actually on top, etc. This notation is somewhat confusing, but allows us to keep track of what amounts to disinformation we are providing to the game engine -- disinformation which must remain consistent.

The shortest perpendicular from the sweet spot to screen is shown in red, 43.7" long. That angle between it and the rightmost edge of the screen is 20.11 degrees. ( 21.11 deg = atan(16/43.7) ) That edge is the "bottom" of the normal view screen, as far as the game engine is concerned, so in CaveUT.ini, FOVbottom=20.11. Similarly, FOVright=35.59, FOVleft=56.09, FOVtop=47. Study the diagram and make sure you understand why.

For the BNAVE, the perspective parameters are much the same, but with the parameters reordered or their signs reversed. It depends on which way the screen was rotated.

Two more diagrams complete the example. The first one diagrams the angles for the front screen and the second diagrams the floor screen.

Step 4: Compute and Set the CaveFOV Parameter

The CaveFOV parameter tells the UT2004 game engine how much of the virtual world to render (that is, to calculate what game-world shapes should look like and make the information available to the display.) With the perspective effects turned off, CaveFOV it also determines the dimensions of the user's view frustum from the real and into the virtual world, so the engine only has to render just enough to accurately fill the viewer's display.

But when the perspective functions are active, ( OffAxis=Yes ), CaveUT directly controls the dimensions of the main view frustum. It is easy to show more of the virtual world than the engine thinks the viewer is seeing. This results in gaps in the display, where some or all of the visible objects are missing, as shown in the diagram above and to the right. In that example, CaveFOV=60, RightFOV=30 (these numbers are correct), but LeftFOV=45, leaving a 15-degree area not fully rendered.

The solution to this problem is to simply make CaveFOV large enough to accommodate the CaveUT-specified view frustum. In the example on the left, CaveFOV=90, so the left half of the rendered view is 45 degrees -- large enough to the accommodate the part of the display specified by FOVleft. Note that the right half is also 45 degrees, which is more than what is needed. The engine renders an additional 15 degrees of the world that will not be shown. There's no way to avoid this, because the rendering engine will only render for a symmetric view frustum.

So why not set CaveFOV to some very high value and don't worry about it? Because the more the engine has to render, the harder it has to work and the greater the load on the computer -- a waste of rendering speed. In practice, you can have several displays with significantly different CaveFOV values and not notice a difference in performance, as with the BNAVE. However, when performance starts to lag because of a very large virtual word or too many (virtual) people in it, problems should show up first in the displays with high CaveFOV settings.

Step 5: Fine-Tune the Perspective Effects

When you finally install and run CaveUT on your multiscreen display, CaveUT's perspective parameters will probably need some tweaking. You need to carefully measure the physical dimensions of the physical display and account for any discrepancies between that and your original diagram. For example, the image projected onto the right side of the physical BNAVE is elongated by a good four inches, an unfortunate side-effect of the optical setup. To make it fit, the current operators of the BNAVE simply run that extra four inches off the top of physical screen. The effect is a negligible loss of resolution on the right side and a small but important lengthwise stretching of the image.

The best way to compensate for this error in CaveUT is to recompute the FOVtop parameter, using the area of the projection itself, rather than that of the physical screen, as shown in the diagram on the right. The original FOVright was atan( 31"/43.7") = 35.59 , while the new one is atan( (31"+4")/43.7" ) = 38.69" Doing this makes the image look right, missing only a little bit of resolution.

Side Note: This is a small demonstration how CaveUT can handle rectangular displays of arbitrary dimension and placement.

It is very important make these types of perspective adjustments, because you will not be able to compensate for them with the rotations or offsets. In fact, if you are absolutely unable to make the screens line up using the keyboard fine-tune adjustments, it is a sure sign that you need to recalculate the perspective correction. There are no keyboard incremental adjustments for the perspective parameters -- you have to recalculate them and change the values in CaveUT.ini.

Advanced Usage: Making a Very Skewed View Frustum

Situations crop up in which the main view axis for a screen does not intersect the screen itself.

In the example diagrammed on the left, three screens are used to make one, flat, composite display. The two side screens can only be viewed an oblique angle. To make them show the virtual world in a visually naturalistic way, the perspective correction has to be rather severe. All of the FOV parameters are calculated as before, using the shortest perpendicular from the sweet spot to the plane in which the view screen lies. In fact, it was never necessary for this perpendicular to intersect the screen itself, it just happens to be that way for the screens in the BNAVE example, above.

In this example, FOVleft will be positive thirty degrees, while FOVright a positive 49 degrees. FOVleft can be positive, just so long as FOVright is larger. FOVtop and FOVbottom could be manipulated in exactly the same way to skew the view frustum vertically.

Last updated January 16, 2004.
URL: http://www.planetjeff.net/ut/CUT4Install6.html
This page is copyright © 2004 by Jeffrey Jacobson.
See this web site's copyright notice for information
on duplicating or distributing this page or its contents.