How to get distance of view point to xy-plane for given fov angle in <a:camera>

Regina Henschel 151 Reputation points
2022-03-12T18:38:28.97+00:00

Hi,

The camera in OOXML (20.1.5.5) has an attribute fov, which is an angle. How is the distance of projection center to xy-plane calculated? From my experiments I get distance = number / tan(fov/2). Is that correct?

The part 1/tan(fov/2) is as expected. But what is about number? I get values about 16cm.
Is it correct, that this number is a constant?
If constant, what is the exact value?
If not constant, how is it calculated?

Kind regards,
Regina

Office Open Specifications
Office Open Specifications
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Open Specifications: Technical documents for protocols, computer languages, standards support, and data portability. The goal with Open Specifications is to help developers open new opportunities to interoperate with Windows, SQL, Office, and SharePoint.
127 questions
{count} votes

Accepted answer
  1. Hung-Chun Yu 976 Reputation points Microsoft Employee
    2022-03-23T15:47:06.643+00:00

    Hi @Regina Henschel

    Here what I found, for perspective cameras, we calculate this distance as “cameraMagnitudeFromLookAtPoint = 6.28f / tanf( fieldOfViewRadians * 0.5f )”. 6.28f is a unitless ratio; mapping this to real world units like cm depends on this size of the whole 3D scene in document units.

    A couple other constants & facts that may figure into camera calculations:
    • No matter what the file format values are for a perspective camera, we impose a min FOV of 0.01 radians, and a max FOV of (Pi – 0.01) radians.
    • We estimate the bounds of the shapes the camera is looking at in the projection space z-volume, and if these scene bounds fall behind the camera, we will nudge the camera backwards a little bit behind the min z-extent of that scene. The min distance we keep from the scene contents is 2% of the z-volume. This nudging won’t happen much in practice but is there to avoid the camera ending up inside the view frustum or scene geometry being clipped out of view.
    • One of our initial design goals was that when 3D settings are applied to a 2D shape, it uses defaults and logic that make the shape occupy exactly the same space in 3D as it did in 2D. Similarly, our ambient & directional lights mainly try to balance the shape lighting so that a flat surface has a similar color in 3D as it did in 2D.

    Let me know that answers the questions


0 additional answers

Sort by: Most helpful