question

ReginaHenschel-4160 avatar image
0 Votes"
ReginaHenschel-4160 asked HungChunYu-3579 commented

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

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



openspecs-office-fileformats
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @ReginaHenschel-4160 ,

Thank you for your question regarding Microsoft Open Specifications. One of our team members will contact you soon to assist you with this question.

Michael Bowen
Escalation Engineer - Microsoft Open Specifications

0 Votes 0 ·

Hi @ReginaHenschel-4160

I will be researching answer for you, stay tuned.

Hung-Chun Yu
Microsoft Open Specifications Support

0 Votes 0 ·

Do you need further infos from me?

0 Votes 0 ·

1 Answer

HungChunYu-3579 avatar image
0 Votes"
HungChunYu-3579 answered HungChunYu-3579 commented

Hi @ReginaHenschel-4160

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

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you, the relationships are clear now. I think, it is now possible to map the values in file to our internal model.

0 Votes 0 ·
HungChunYu-3579 avatar image HungChunYu-3579 ReginaHenschel-4160 ·

That is awesome. Thank you for the confirmation.

0 Votes 0 ·