The code is supposed to move a disc mesh in such way, that it separate visible and hidden parts of the sphere from given point of view. CenterToEyeDist is length of virtual sphere location in camera space. OffsetDist is the distance mesh would be offset from virtual sphere center towards view origin. offsetScale is distance mesh vertices would be pushed away from mesh center on a XY plane of camera space. r is radius of virtual sphere.