Announcement

Collapse
No announcement yet.

"Focal Length" of Cabview Camera?

Collapse
This topic is closed.
X
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    "Focal Length" of Cabview Camera?

    Hello. After a hiatus of several years, I want to get back into train-simming.

    One of the tasks I wanted to do was create my own cabviews. Unlike some perople, who simply take a photograph of the cab of the prototype they are modelling and modify it to be used by MSTS, I want to create cabs completely from scratch--that means modelling a detailed cab in Blender--textures and all. But there is one critical question:

    To look convincing, the render camera in Blender for the 3D cab model has to have the same focal length as MSTS' in-game cabview camera, upon which the cab and control graphics are overlaid (unless, of course you press "SHIFT-1"). Does anyone know the focal length or other specifications of the in-game MSTS cabview camera? I had found the following tutorial: http://msts.steam4me.net/tutorials/cabview.html, but it does not mention anything about focal length, or other specifications of the in-game camera.
    Last edited by Traindude; 09-09-2012, 16:22.

    #2
    Cab interiors in MSTS aren't 3D models so there is no such thing as 'focal length'. Cabviews in MSTS are nothing more than looking at pictures. You can create those pictures from scratch, but either way, they will still just be pictures. 'From scratch' is how some early and not so early modelers made their cabs and no matter how much they tried to look prototypical by mimicking texture, etc., they all looked 'cartoonish' or fake. The good cabs out there utilize actual photographs. Nothing else comes close.

    Brad

    Comment


      #3
      Well, there can be a blank cabview and a 3D cab interior like what Sandy River Tom recently did with a Baldwin 4-4-0 over at Elvas Tower. However, these cabs cannot be animated.
      sigpic

      Comment


        #4
        Originally posted by Traindude View Post
        Does anyone know the focal length or other specifications of the in-game MSTS cabview camera?
        The only relevant specification of the in-game MSTS cabview camera I can think of is the "field of view" (Fov) which is specified in the "camcfg.dat" file located in the "GLOBAL" folder. In the default version of "camcfg.dat" the Fov of the cabview camera is 60°. Maybe you can use this information to calculate the focal length.

        Comment


          #5
          Originally posted by uli2 View Post
          The only relevant specification of the in-game MSTS cabview camera I can think of is the "field of view" (Fov) which is specified in the "camcfg.dat" file located in the "GLOBAL" folder. In the default version of "camcfg.dat" the Fov of the cabview camera is 60°. Maybe you can use this information to calculate the focal length.
          This has nothing to do with the engineer view inside the cab. It is the degrees the camera pans when the engineer sticks his head out the window. There is no such thing as focal length in regular cab views. As Dustin explained, it is possible to have a 3D cab view, but not only does the sim take a fps hit, the controls/gauges don't work and the resolution is very poor.

          Brad

          Comment


            #6
            Originally posted by Brad3816 View Post
            This has nothing to do with the engineer view inside the cab. It is the degrees the camera pans when the engineer sticks his head out the window.
            What you mean is the "RotationLimit" that is specified in the headout cam section. In the "camcfg.dat" there are different sections for the cab cam ("CamTypeCab") and for the headout cam ("CamTypeHeadout").The cab cam and the headout cam can have a different Fov.

            Of course adjusting the Fov of the cab cam does not change the way the 2D cab and control graphics are displayed, but it changes the view of the "outside world" behind those graphics.

            Comment


              #7
              MSTS absolutely does incorporate focal length. This is, as previously stated, the FOV (field of view) range. Just try a couple different numbers in the FOV field of the camcfg.dat to see for yourself.

              camera ( CamTypeCab
              CamType ( CamTypeCab CamControlViewSwitch )

              CameraOffset ( -0.51231 4.28496 10.0387 )

              Fov ( 60 )
              ZClip ( 0.5 )
              WagonNum ( 0 )
              Description (Cab_Cam)
              )

              This is the default cab cam code with an Fov of 60°. If you change that value to 120, it will be twice as wide of an angle. If you change it to 30, it will be half as wide of an angle, same as if you take a wide or telephoto image with a camera.

              I am not really familiar with how different lenses may create different angles of view in terms of "fish eye" effect, but if you have a wide angle lens, you should be able to take a photo that is a similar to the 60
              ° standard.

              For example. I did a google search on the specs for my Nikon 18-55mm f3.5/5.6G AF-S VR DX Nikkor lens (see
              http://www.dpreview.com/lensreviews/nikon_18-55_3p5-)5p6_vr_n15). It has has a Diagonal Angle of View of 76°-29°. That means with my lens a photo taken at 18mm has an angle of view of 76°, and conversely a photo taken at 55mm has an angle of view of 29°. By those figures and with my lens, I can create a proportion to figure out a millimeter figure for 60 degrees.

              Using the widest angle, the math works out as follows:
              18mm / 76 = x / 60

              Cross multiply that with the following equation: (18 * 60) / 76 = x, so that means x = 14.21mm, same as x = 60 degrees.

              With my lens, I cannot achieve the 60°, since of course the widest available is 76°. I'd need to get a lens that was capable of 14mm. The cheaper and easier solution would be to photograph a cab for MSTS purposes at 18mm, then when I want to run with that cab have an alternative camcfg.dat set up for 76° Fov.

              The only thing that leaves to question is: Does MSTS field of view refer to horizontal field of view or diagonal field of view? If its horizontal then, the proportion I attached is not accurate. But it should give you a better idea of what focal length the 60
              °.

              Here is a really good article describing the relation between focal length and field of view that I think you folks might find informative.
              http://mansurovs.com/equivalent-foca...-field-of-view
              Jon Clark - Butler, Pa
              sigpic

              Comment


                #8
                Originally posted by bessemer View Post
                MSTS absolutely does incorporate focal length. This is, as previously stated, the FOV (field of view) range. Just try a couple different numbers in the FOV field of the camcfg.dat to see for yourself.

                camera ( CamTypeCab
                CamType ( CamTypeCab CamControlViewSwitch )

                CameraOffset ( -0.51231 4.28496 10.0387 )

                Fov ( 60 )
                ZClip ( 0.5 )
                WagonNum ( 0 )
                Description (Cab_Cam)
                )

                This is the default cab cam code with an Fov of 60°. If you change that value to 120, it will be twice as wide of an angle. If you change it to 30, it will be half as wide of an angle, same as if you take a wide or telephoto image with a camera.

                I am not really familiar with how different lenses may create different angles of view in terms of "fish eye" effect, but if you have a wide angle lens, you should be able to take a photo that is a similar to the 60
                ° standard.

                For example. I did a google search on the specs for my Nikon 18-55mm f3.5/5.6G AF-S VR DX Nikkor lens (see
                http://www.dpreview.com/lensreviews/nikon_18-55_3p5-)5p6_vr_n15). It has has a Diagonal Angle of View of 76°-29°. That means with my lens a photo taken at 18mm has an angle of view of 76°, and conversely a photo taken at 55mm has an angle of view of 29°. By those figures and with my lens, I can create a proportion to figure out a millimeter figure for 60 degrees.

                Using the widest angle, the math works out as follows:
                18mm / 76 = x / 60

                Cross multiply that with the following equation: (18 * 60) / 76 = x, so that means x = 14.21mm, same as x = 60 degrees.

                With my lens, I cannot achieve the 60°, since of course the widest available is 76°. I'd need to get a lens that was capable of 14mm. The cheaper and easier solution would be to photograph a cab for MSTS purposes at 18mm, then when I want to run with that cab have an alternative camcfg.dat set up for 76° Fov.

                The only thing that leaves to question is: Does MSTS field of view refer to horizontal field of view or diagonal field of view? If its horizontal then, the proportion I attached is not accurate. But it should give you a better idea of what focal length the 60
                °.

                Here is a really good article describing the relation between focal length and field of view that I think you folks might find informative.
                http://mansurovs.com/equivalent-foca...-field-of-view
                The only thing you have said here is that camcfg.dat has an entry for CamTypeCab. You haven't explained it or detailed how if impacts cab views. Taking what you said, I changed the fov setting and here is what I got:

                fov 120




                fov 48 (default setting in my camcfg.dat file)



                The difference is zilch in my cab views. I get the changes in your shots by changing the direction values in the *.cvf file, however.

                I have been developing (from scratch) and posting cabs for years. Main cab ACE files are made from bitmaps which aren't viewed in 3D in the sim. If someone doesn't want to use a photograph bitmap and wants to draw their own cabs and incorporate textures, go for it. IMO, it's not going to look better than using photographs of the real thing.

                Brad
                Last edited by Brad3816; 09-13-2012, 13:20.

                Comment


                  #9
                  "The only thing you have said here is that camcfg.dat has an entry for CamTypeCab. You haven't explained it or detailed how it impacts cab views and what you have said in an attempt to explain it is all supposition and has nothing whatsoever to do with MSTS."


                  Easy Brad, I'm not trying to discount your experience with cabs or any of what you are saying. But you are misunderstanding some of what I said. I'm confused and concerned by your smug bluntness towards me, as we have worked on cabs together in the past and gotten along famously. I don't want to spoil any good relations with you over any of this, but I strongly beg to differ with how you claim I am completely wrong. Don't talk down on me when I may have a better understanding of this then you give me credit for.

                  All of what I post here is assuming that whoever is reading this already knows at least what the Cab Cam codes look like, and that I need not explain how they work. If the reader needs explained to them how CamTypeCab impacts cabviews or doesn't know how it works, then I see it as being their responsibility to reasearch and learn themselves or ask for the clarification.

                  As far as Fov goes, you must have altered the wrong value, because I tried exactly what I explained, and I got the result I described. No supposition, simply observation.
                  Here are the screenshots to back myself up.

                  Fov 30:


                  Fov 60 (my default):


                  Fov 120:


                  The difference is clear to me, and far from zilch as you insisted.

                  Larger Fov numbers and it will be zoomed out, smaller numbers will be zoomed in. It has already been addressed earlier in this thread that the Fov has no effect on the main view texture image in the ACE file, but rather the Fov of the environment that the cabview is displayed upon; Demonstrated in my screenshots.


                  "Main cab ACE files are made from bitmaps. There is nothing 3D about them and nothing in camcfg.dat impacts them. If someone doesn't want to use a photograph bitmap and wants to draw their own cabs and incorporate textures, go for it. It can't possibly look better than the real thing."


                  Now in regards to the 3D cab being better or worse than a Phototextured cab, thats debatable case by case. If the focal length of the photo is close to what the Fov setting for the MSTS cabview camera is, then providing the CVF file is tweaked to position and angle the image in the environment, it will look just about the way it should. However if the angles and focal length are different, then it will seem like nothing more than a poster of a cab interior floating awkwardly down the tracks in front of the player. There are a couple of 3D cabs that are very well positioned in accordance to their field of view. Off the top of my head, IIRC the KLW MP36 cab is a screenshot of a 3D cab, and placed excellently. Accurate but perhaps a bit cartoonish. Its an older cab so I can deal with that. Diesel's West's cabs are pretty well positioned. Also the cabview that comes with the PRR E44's in the file library matches well with the Fov. All of these used 3D models to create the images in the ACE files.

                  All the camera jargon I was throwing around in my previous post was intended to give people an idea how to figure out the proper angle (millimeters on the lens of the camera) to photograph a prototype cabview for use in MSTS, and in turn creating a more realistic field of view for the ace file when in game it's displayed in front of the 3D environment by the CVF file. I really am not sure how you misconstrued that as me saying that I think 3D cabs are more realistic. The same principals of figuring Fov can be applied to taking a screen shot of a 3D cab. If the artist does their homework, they could easily give a photo-textured cabview a real run for it's money with a high quality 3D one.
                  Jon Clark - Butler, Pa
                  sigpic

                  Comment

                  Working...
                  X