Announcement

Collapse
No announcement yet.

Vray Camera, Max Camera & FOV calculation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Vray Camera, Max Camera & FOV calculation

    I'm stuck for days now at something I thought was a minor problem...

    In a scripted plugin I need to match a VRay camera to a max camera as closely as possible (ideally 100% correct), which proves to be a task next to impossible without introducing some arbitrary correction factor, which just does not feel right. Aperture setting in max and film gate in the VRay camera (36mm) are the same, but the same focal length produces different FOVs in both cameras. Not vastly different, but too much to be tolerable in this case.

    What would really help is knowing how VRay calculates the FOV from the focal length. The common solution ( fov = 2 * atan(0.5 * film_width / focal_length ) applies to the stadard max cam, but does not seem to apply to the VRay camera. Maybe something more sophisticated is done?

    Some help would be really appreciated. I tend to take such things as challenges, but this time I'm really at a loss...
    Last edited by ralf_al; 13-09-2012, 02:32 AM.

  • #2
    OK, I just found out that the FOV actually depends on the target distance too not only focal length and film width, something I strangely never realized before. That just shouldn't be the case, should it? This is a really bad thing in my case, and not only in mine, I guess. That should impact anyone who has to match any camera, being it virtual or real.
    Last edited by ralf_al; 13-09-2012, 05:15 AM.

    Comment


    • #3
      Why not just link the FOV parameter of the physical camera to the FOV parameter of the 3ds Max camera? In that case you will always get a perfect match. You might need to convert from radians to degrees somewhere along the way, but the parameter wiring functionality works well for this.

      There is not an easy way to compute the formula for the FOV, since it also depends on the lens distortion. The formula that you quoted is only correct if the camera is focused at inifnity.

      Best regards,
      Vlado
      I only act like I know everything, Rogers.

      Comment


      • #4
        Thanks for replying so quickly. I could certainly do that, if the camera had a FOV parameter... Is this something new to 2.0? I'm still on 1.5 here, and to be honest, didn't feel the urge to upgrade so far.

        Apart from that: isn't this just wrong? Given a 'normal' cg pinhole camera (which I would have expected with zero lens distortion) this shouldn't happen, I would think. The effect is only visible at relatively small target distances, that's most likely why I never realized it before, but it gets pretty extreme the smaller the distance gets. Testscene attached (scene scale is mm), simply moving the camera target is enough to show the effect.
        Attached Files
        Last edited by ralf_al; 13-09-2012, 08:30 AM.

        Comment


        • #5
          I had this checked by someone with 2.0 and there is indeed a FOV parameter in maxscript. At least that. Looks like I finally got a reason to update, although I'm not too happy about it...

          The camera behavior itself is unchanged though in 2.0. It would be really nice if that could be taken care of. It makes working on correct scale in the <50cm range impossible due to a heavily changing FOV by simply moving the camera. Strange that this remained undetected over so many years.
          Last edited by ralf_al; 13-09-2012, 10:07 AM.

          Comment

          Working...
          X