Commit e5ac38aa authored by Nikhila Ravi's avatar Nikhila Ravi Committed by Facebook GitHub Bot
Browse files

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
parent 956d3a01
...@@ -381,14 +381,17 @@ class FoVPerspectiveCameras(CamerasBase): ...@@ -381,14 +381,17 @@ class FoVPerspectiveCameras(CamerasBase):
.. code-block:: python .. code-block:: python
f1 = -(far + near)/(far−near)
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],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment