Perspective Projection Matrix | Camera Projection Matrix
Global Parameters
Enter intrinsic parameters for the camera
θx and θy are the angles of view along the x and y axes
Skew : s = 0 Principal point : (x0, y0) = (0, 0)
Enter a set of 3D world points for projection
(The view frustum is in the negative portion of the z axis)
Project basic structures onto the screen
Step 1: First rotate the points around respective axes
Default rotation order: first z then y then x
Rotate x: 0ℼ
0
2ℼ
Rotate y: 0ℼ
0
2ℼ
Rotate z: 0ℼ
0
2ℼ
Step 2: Then translate the points in respective directions
Translate x
-10
10
Translate y
-10
10
Translate z
-10
10
Perspective Projection in Graphics
Rotation X Matrix
100010001
·
Rotate Y Matrix
100010001
·
Rotate Z Matrix
100010001
Flattens the 3D points onto the 2D XY plane by setting z to 0
1000010000000001
Transforms canonical perspective view frustum into canonical parallel view frustum
1000010000far/far - near-100near/far-near0
Transforms perspective view frustum into canonical perspective view frustum
1/tan(θx/2)00001/tan(θy/2)0000100001
Moves the far clipping plane to z = -1
-1/far0000-1/far0000-1/far00001
Transforms 3D world coordinates to camera coordinates
rx1ry1rz10rx2ry2rz20rx3ry3rz30txtytz1
1000010000000001
·
10000100001.05-1000.050
·
1000010000100001
·
0.100000.100000.100001
·
1000010000100001
=
Perspective Projection Matrix
0.100000.100000-0.10000
Perspective Projection Matrix
0.100000.100000-0.10000
·
World Points
0001000100010001
Projected Points
001001001001
1·
Point 1
001
,1·
Point 2
001
,1·
Point 3
001
,1·
Point 4
001
The coordinates can be inaccurate when the far clipping plane has a very negative z value.
Intrinsic Matrix
100010001
·
Extrinsic Matrix
100010001000
=
Camera Projection Matrix
100010001000
The extrinsic matrix is the same as the first 3 rows of the transformation matrix,
while the intrinsic matrix is the product of the perspective matrix and the scaling matrix except for the 3rd row.
Camera Projection in Vision
Transforms points in the camera coordinates to the 2D image coordinates
fx00sfy0x0y01
Transforms 3D world coordinates to camera coordinates
rx1ry1rz1rx2ry2rz2rx3ry3rz3txtytz
100010001
·
100010001000
=
Camera Projection Matrix
100010001000
Camera Projection Matrix
100010001000
·
World Points
0001000100010001
Projected Points
001001001001
1·
Point 1
001
,1·
Point 2
001
,1·
Point 3
001
,1·
Point 4
001
Note! The inversion step exists only in camera projection because its z are negative before dehomogenization, while the z in perspective projection have been negated by the projection matrix.
Orthographic Projection Matrix
1000010000000001
·
Projection Matrix
10000100001-10000
·
Perspective Matrix
1000010000100001
·
Scaling Matrix
0.100000.100000.100001
·
Transformation Matrix
1000010000100001
=
Perspective Projection Matrix
0.100000.100000-0.10000
The transformation matrix is equal to the extrinsic matrix except for their shape. The projection matrix and scaling matrix are not unique, because the clipping points and scaling factors are not taken into account in the intrinsic matrix. The perspective matrix corresponds with the intrinsic matrix.
Created by Wanjia Fu, Brown University, Summer 2023.