Is there a reason why the negative Z-axis is considered as the depth axis in graphics? I think many computer vision algorithms use the positive Z-axis to represent depth.
ilovecg
Why map z to the range [-1, 1] instead of [0, 1]?
Max
Those are both just conventional - OpenGL assumes depth is [-1,1], D3D assumes [0,1], and both assume depth is the third coordinate (which is positive or negative z depending on your camera transform).
JavaSwing
I'm a bit confused on how these are mapped to a cube. The original frustrum is essentially a 3d trapezoid right? Why would we make that into a cube?
Max
This is the perspective divide - regions further away (towards the larger part of the trapezoid) get scaled down in normalized coordinates compared to closer regions.
Is there a reason why the negative Z-axis is considered as the depth axis in graphics? I think many computer vision algorithms use the positive Z-axis to represent depth.
Why map z to the range [-1, 1] instead of [0, 1]?
Those are both just conventional - OpenGL assumes depth is [-1,1], D3D assumes [0,1], and both assume depth is the third coordinate (which is positive or negative z depending on your camera transform).
I'm a bit confused on how these are mapped to a cube. The original frustrum is essentially a 3d trapezoid right? Why would we make that into a cube?
This is the perspective divide - regions further away (towards the larger part of the trapezoid) get scaled down in normalized coordinates compared to closer regions.