3
$\begingroup$

In my understanding the z-coordinate of the camera's view looks at the observer, away from the image plane. This is consistent with the camera angles of (0, 0, 0) while the camera looks down and the camera's z-axis points in the same direction as the global z-axis.

In the rendered image window, when I click on a point in the image, I am getting a positive z-coordinate for an object in front of the camera. Should that not be negative?

$\endgroup$

2 Answers 2

5
$\begingroup$

The Local Axis for the camera is as you describe: Negative Z is the direction the camera is looking at (the camera local axis is independent of the global axis, and might not be aligned to the global axis at all).

If you move the camera using positive values on it's local Z axis , the camera moves back (away from wherever it is pointing at)

enter image description here

The local Z Axis for the camera and and Z-Depth on the image created by the camera are no the same "Z".

The Z-Depth values (or Z-pass) are always in positive numbers, they represents the absolute distance from the camera to geometry in the scene for every pixel of the image. The camera is the 0 on the scale and the units used for its values are the working units set for the scene (blender units, meters, cm, inches, etc) The minimum and maximum value are clipped according to the camera's start and end clip distances.

Z Depth does not give you any information on the coordinates of the objects on the scene nor does it give you any information on the coordinates or rotation of the camera.

Just to clarify... Z-Depth values are positive values away from the camera (in its negative local Z axis...) and all of these Zs are completely independent of the World's Z axis.

$\endgroup$
0
$\begingroup$

The answer by cegation contains error. I've done experiments using Z depth for point cloud alignments, and quite sure that the camera direction is +Z axis. Thus, from his diagram, Z and Y axis should be negated!

$\endgroup$
4
  • $\begingroup$ As stated in the answer, Z-depth values are not the camera local axis.i.stack.imgur.com/MPYbn.png $\endgroup$
    – user1853
    Aug 16, 2017 at 23:22
  • $\begingroup$ It is though. I verified this with experiments where I aligned point cloud generated from multiple cameras globally. The intrinsic and extrinsic matrices only made sense when I treat depth along Z axis. I'm pretty sure of this. $\endgroup$
    – foothill
    Aug 16, 2017 at 23:47
  • $\begingroup$ You are confusing to Z depth and local Z axis, they are not the same. Z depth values represent distance from the camera and cannot be negative (otherwise they would be behind the camera, which makes no sense). Things that are in front of the camera are in the camera's Local Negative Z axis. If you move the camera using positive numbers in the local Z axis, the camera moves away form the objects in front of it. $\endgroup$
    – user1853
    Aug 16, 2017 at 23:57
  • $\begingroup$ I'm not confusing those two. They CAN be different, but they ARE same, according to my experiment. (i.e. Z depth and local Z axis is same in blender) I won't argue anymore, but please try some experiments to figure that out dude. $\endgroup$
    – foothill
    Aug 17, 2017 at 1:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .