View Single Post
Old 04-20-12, 07:03 PM   #29
11Bravo
Medic
 
Join Date: Dec 2006
Location: Error Triangle
Posts: 168
Downloads: 157
Uploads: 0
Default

The second type of distortion depends on the altitude, not the bearing. To understand and measure it, we must first discuss the cameras.dat file, and the important parameters of the cameras for the stations we will use.

Veteran Kaleuns know of the awesome work by skwas on his Silent 3ditor and have used this tool to explore the inner workings of their u-boats and the SH3 environment. Every captain owes it to himself to download and use this tool to better understand the game, the work of the developers, and the modders. skwas!!



First we have to understand the vertical field of view (FOV) of the camera. There is a parameter called AngularAngle that I believe controls the horizontal field of view (untested). I have found that the vertical field of view is 0.8 of the AngularAngle. In other words the aspect ratio of the cameras is 5:4 horizontal to vertical. This was interesting to me because the aspect ratio of the GUI is 4:3 horizontal to vertical (1024x768).

Second we have to define two angular scales for the vertical. The first is Screen Altitude. It defines the vertical position of an object on the screen or viewport of the camera. It ranges from 0° at the bottom to the FOV° at the top. So if the AngularAngle of your camera is 75°, the vertical FOV is 0.8*75=60° and the Screen Altitude ranges from 0° to 60°. The second scale is Sky Altitude. It is the vertical position of an object in the game relative to the horizon. This is what we want to measure for celestial navigation. The horizon defines 0° of Sky Altitude. Other parameters control the link between these two scales.

Based on early measurements with linear sextants and reading the Subsim forums, it was clear to me that the star positions were tantalizingly close to accurate. It didn't make sense that they would be so close, but not correct. So I assumed they were correct, and that it was the game engine rendering that was "wrong", not the star positions. This implies that the game engine displays correct information incorrectly. And I can show you that it does just that.

There are two parameters in the cameras.dat that control the position of the horizon in external views. This is the Elevation Min and Max. Lets talk only of the Min for now. The Elevation Min is the Sky Altitude of the middle of the vertical FOV when the camera is tilted down all the way. In other words, it is the angle of the middle of the screen from the horizon. When the Elevation Min is 0°, the horizon displays in the middle of the screen. The purpose of the Elevation Min and Max is just that...to control where the horizon appears in external views. But if you carefully measure the position of the horizon, you will find it displays incorrectly.

The error is the second type of distortion present in SH3. It can be measured and a calibration curve created to allow correction of altitude measurements. This will be the basis of our accurate sextant.
__________________
"Sounds of terror are in his ears; While at peace the destroyer comes upon him." -- Job 15:21
11Bravo is offline   Reply With Quote