![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|||||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
03-25-26, 09:37 PM
|
#1 |
|
Engineer
![]() |
I'm posting here hoping someone may find useful:
Code:
Came up with this series of data while updating some scopes and camera.dat files for use with the new full interior boats by Vickers as well as TMO BH.
Here is the listing of my findings in full:
==========================
Setting up the "Optical" section of the camera.dat file
-------------------------------------------------------
Optical
MinZoom: = 8.0 <--- The FOV at High (Min degrees in scope)
MaxZoom: = 32.0 <--- The FOV at Low (Max degrees in scope)
ZoomLevels[2]
[0] = 1.5 <--- Magnification equating to "initial" view zoom to give MinZoom FOV value.
[1] = 6.0 <--- Magnification equating to "next step" view zoom. If only other zoom level, then the amount of zoom factor that gives MaxZoom FOV value.
If there were "ZoomLevels[3]" in the file, then the "middle" one would be interpolated from the MinZoom and MaxZoom values.
If there were even more "ZoomLevels" in the file, then all the values between the [0] and Max ([3], [4], [5], etc.), would be interpolated.
This has to be set this way, otherwise the rest of the formulae in this post won't work. At least from the limited testing I've been able to do.
==========================
Setting up the "AngularAngle" entry of the "Camera" section of the camera.dat file
----------------------------------------------------------------------------------
Now we look at the vertical and horizontal ratios and how to set up the "AngularAngle" in the camera.dat file.
If you have a 1920 x 1080 screen, then:
Formulae:
---------
Degrees Screen = 544 = 32
(Actual Horiz.) ----------- ===> 1920 * 32 / 544 = 112.94117647 ... (left to right across your screen)
1920 = ??
Degrees Screen = 544
(Orig. Vert.) ---------- ===> = 0.708333333 ... (mask/aperture size divided by original vertical pixels)
768
AngularAngle = 112.94117647 * 0.708333333 = 80 (79.99999999999 ...)
(so, multiply actual screen resolution's FOV (113* or so) by ratio of "ini" vertical pixels in original screen resolution for AngularAngle)
==========================
Menu_1024_768.ini File in all this
----------------------------------
So, as stated, the "Zone" section in the menu_1024_768.ini file also plays a role in this since it's the file that is going to be referenced with regards to the ratios. It's where you tell the sim how to display the graphic.
In most default stuff, the resolution in the "ini" file is "1024, 768" in the "Zone" line where it comes to the mask -- even if the mask is 1024 x 1024 pixels. The authors will then "crop" the file to fit the "1024 x 768" size of the virtual "screen" the sim is using. That's why the masks always look like they are HUGE from top to bottom -- almost like ALL THE WAY from the top to the bottom of the screen.
In the case of the masks I'm using, this is the case since you "crop" the image just below the "Zone" line in the "Crop" line.
So, you take the size of the aperture (544 x 544 in our case) as you would expect, but use the INI vertical as a "base" for the ratio factor to use. Since the vertical is 768 in the ini, then:
544 / 768 = 0.708333333333333 ...
You now have a ratio by which I multiplied above to get the 80 and, in the end, calibrate the scope.
==========================
Calibrating the "Viewport" section in the camera.dat file
---------------------------------------------------------
For this to work, however, you also need to have the "Viewport" section configured accurately with the percentages of where the limits are. These measurements are based on the actual screen you are using, so in this case it would be 1920 x 1080. Take half the mask image aperture size in both directions (272 for both in this case for a square mask hole of 544) and do the following:
(Right Screen / 2 - Full Scope + 1/2 Scope = Left Scope Edge / Right Screen = Left: Entry)
Left: 1920 / 2 - 544 + 272 = 688 / 1920 = 0.3583333
(Left Scope Edge + Scope Size = Right Scope Edge / Right Screen = Right: Entry)
Right: 688 + 544 = 1232 / 1920 = 0.6416666
(Bottom Screen / 2 + 1/2 Scope = Temp Number. Then Bottom Screen - Temp Number = Bottom Scope Edge. Then Bottom Scope Edge / Bottom Screen = Bottom: Entry)
Bottom: 1080 / 2 + 272 = 812. 1080 - 812 = 268. 268 / 1080 = 0.2481481
(Temp Number / Bottom Screen = Top: Entry)
Top: 812 / 1080 = 0.7518518
NOTE: Numbers for "Top" and "Bottom" are REVERSED in the formulae. For entry into camera.dat, remember the order is, "Left, Right, TOP, BOTTOM" instead. I just reversed it for ease of calculations.
If using Excel or LibreOffice, you can just plug in the main numbers and it does the math for you once you have the formulae written. Then you can just re-use for any other scope.
I'm wondering if I should be using the "ini" numbers from the "Zone" line instead, but so far this has been working for me so I'm going with this particular setup for the "Viewport" section of the camera.dat file.
==========================
Closing thoughts
----------------
This is just a theory since I haven't had a chance to actually test this fully, but so far it seems to work for the stadimeter "drop" ranging (superimposing the image) as well as using the telemeter marks in the scope. Even with something as "dirty" as you see for an S-Boat, it's still getting me "close enough" for the shots.
A screenshot I uploaded in another post should show what it is I'm talking about with regards to the calibration.
Thoughts? ElCid97 Last edited by ElCid97; 04-19-26 at 08:39 AM. |
|
|
04-04-26, 06:37 PM
|
#2 |
|
Swabbie
![]() Join Date: May 2006
Location: Toulouse, France
Posts: 5
Downloads: 102
Uploads: 0
|
First of all, thank you for your post.
I don't anything about the theory of setting up the camera.dat file, but it seems you made a mistake while computing the degrees of screen for the line "Orig. Vert. 768*32/544 = 45.17 by my computation. Or perhaps the formula you wrote is not exactly the one you used ? Szut |
|
|
04-19-26, 08:36 AM
|
#3 | |
|
Engineer
![]() |
Quote:
You should take the aperture size (544 in our case) and divide by the original screen resolution used by the devs (768 at the time) in order to get the 0.708 .... for the computation. Then it just becomes a simple matter of "cross-multiplying" as in the rest of the ratio formulae. Sorry for the confusion on that! Saludos! ElCid97 Miami, FL |
|
|
|
![]() |
|
|
