fix docs for FOVPerspectiveCamera

Summary: Small documentation fix for FOVPerspectiveCamera. The error pointed out in the GitHub issue was due to the docs referring to the OpenGL z parameterization from [-1, 1] whereas we use the [0, 1] range.

Reviewed By: gkioxari

Differential Revision: D23857312

fbshipit-source-id: 2d20677ec614c935e76f67e100a41a23df708d59
This commit is contained in:
Nikhila Ravi 2020-09-23 17:26:57 -07:00 committed by Facebook GitHub Bot
parent 956d3a010c
commit e5ac38aa87

View File

@ -381,14 +381,17 @@ class FoVPerspectiveCameras(CamerasBase):
.. code-block:: python .. code-block:: python
f1 = -(far + near)/(farnear)
f2 = -2*far*near/(far-near)
h1 = (max_y + min_y)/(max_y - min_y) h1 = (max_y + min_y)/(max_y - min_y)
w1 = (max_x + min_x)/(max_x - min_x) w1 = (max_x + min_x)/(max_x - min_x)
tanhalffov = tan((fov/2)) tanhalffov = tan((fov/2))
s1 = 1/tanhalffov s1 = 1/tanhalffov
s2 = 1/(tanhalffov * (aspect_ratio)) s2 = 1/(tanhalffov * (aspect_ratio))
# To map z to the range [0, 1] use:
f1 = far / (far - near)
f2 = -(far * near) / (far - near)
# Projection matrix
P = [ P = [
[s1, 0, w1, 0], [s1, 0, w1, 0],
[0, s2, h1, 0], [0, s2, h1, 0],