bmild / nerf

Code release for NeRF (Neural Radiance Fields)
http://tancik.com/nerf
MIT License
9.58k stars 1.34k forks source link

Potential inconsistency in the implementation of final trick in NDC #144

Closed NagabhushanSN95 closed 2 years ago

NagabhushanSN95 commented 2 years ago

Hi,

In the NDC writeup you provided in this issue, when computing t_n for the final trick, d is assumed to a unit vector right? If d is not a unit vector, then I think t_n should be multiplied by norm(d) as in here. Can you please clarify if I've got something wrong?

NagabhushanSN95 commented 2 years ago

The code is correct, my bad. Since the shifted origin is computed o' = o + t_n * d and t_n * d has the same effect for normalized or unnormalized d, it all works out.