How to get visible size of DisplayObject with perspective projection
Posted
by Ain
on Stack Overflow
See other posts from Stack Overflow
or by Ain
Published on 2010-05-02T11:38:23Z
Indexed on
2010/05/02
11:47 UTC
Read the original article
Hit count: 276
The following is entirely a math question.
As we know, PerspectiveProjection
delivers perspective transformations in 3D represented by the interdependent values of fieldOfView
and focalLength
according to the following formula:
focalLength = stageWidth/2 * (cos(fieldOfView/2) / sin(fieldOfView/2)
Bjørn Gunnar Staal has prepared a good image to illustrate the situation.
Q: How to get the visible on-screen size of the DisplayObject (Cube on the above-linked image) to which PerspectiveProjection has been applied?
© Stack Overflow or respective owner