Closed guker closed 3 years ago
We need to specify where the near and far planes of the frustum are (i.e. where z=-1 and z=1 are in clip space). size
effectively controls the separation between the z=-1 and z=1 planes (size
is that distance in camera space). We calculate size
using the width/height in order to obtain a square-ish frustum. z=0 corresponds to z_ref in camera space.
got it, thanks.
Hey anibali,
I thought about opening a new issue request but I think it is more appropriate to open this issue again.
May I ask what purpose does this line sqrt(z_ref ** 2 + size ** 2)
serve ? I can see there is a triangle somewhere but I'm not sure why is it there. wouldn't 0.5 * (z_ref +/- size)
get the job done intuitively? All I know the sqrt(z_ref ** 2 + size ** 2)
is important for z_ref=2fn/(f+n)
to be equal.
Also, I don't know why the far side is z_ref - size
and the near frustum side is z_ref + size
, shouldn't it be the opposite? or is the z-axis is negative from the camera point of view? because when I calculate far - near
it appears to be equal to -size not size.
There are lots of different ways in which you could define a normalised space if you wanted. However, I decided to adhere to two properties to define mine: the "depth" of the space is based on the width/height (making it a cube assuming those two dimensions are equal), and z=0 in normalised space corresponds to the reference z in camera space. The "flipped" z-axis was a result of wanting a right-handed coordinate system, if I recall correctly.
https://github.com/anibali/pose3d-utils/blob/8ecab2c9c842d7a41c59f01cb8d00fd3166bb3e0/pose3d_utils/skeleton_normaliser.py#L8
what is the meaning of size in code?