Skip to main content

sphere_project

sphere_project(sph, cam, fl) ⇒ number

Computations of screen-space pixel area covered by a sphere NOTE: Port of GLSL code by Ingo Quilez. Source: http://www.iquilezles.org/www/articles/sphereproj/sphereproj.htm

Kind: global function
Returns: number - area on the screen as a fraction, 1=entire screen, 0=zero area

ParamTypeDescription
sphArray.<number> | ObjectSphere in world space
camArray.<number> | Float32Arraycamera transform matrix (world to camera)(inverse world matrix of camera)
flnumberfocal length (fov in Radians)