Page 1 of 1
How does CC guess shift values ?
Posted: Tue Jun 26, 2018 8:07 pm
by feras
When loading a point cloud that is geo referenced, if the original coordinate system is too far from the origin, a Global Shift/Scale window will appear with estimated values. How does CC calculate the shift exactly ? I have multiple clouds that get all the same shift values (which is a good thing). I would like to replicate this in personal software.
A code/algorithm snippet or simply the reference to the source file in the repo would be greatly appreciated. I looked up the
Wiki but found nothing
Re: How does CC guess shift values ?
Posted: Thu Jun 28, 2018 5:14 pm
by daniel
CC will use the first encountered point as the origin (but it will round off the values to something like hundreds). Then CC will remember this shift vector, and whenever a new file is loaded, it will check it the previous shift vector also works with the first point of the new file. If it works, then CC will keep the previous shift vector, instead of generating a new one (which would be bothersome).
Re: How does CC guess shift values ?
Posted: Fri Jun 29, 2018 1:55 am
by feras
I see. So it is to avoid too much computation overhead when loading the cloud. I looked
here and
there but it did not occur to me that it simply stored the last value. Fair enough ! I will do something similar with my code. I have to compute the point cloud centroid anyway so I might just use it as my shift vector anyway.
Re: How does CC guess shift values ?
Posted: Fri Jun 29, 2018 7:42 am
by daniel
No the shift is necessary:
- to avoid losing accuracy when storing the coordinates as 32 bits floating point values
- to avoid issues with displaying large numbers with OpenGL