Cube to Sphere mapping (inverse function wanted)
问题 I've came across a cube to sphere mapping function that provides a more uniform result than just normalizing the coordinates or other mapping methods. Unfortunately there is no unwrapping function. Source: http://mathproofs.blogspot.com/2005/07/mapping-cube-to-sphere.html vec3 spherify ( vec3 v ) { float x2 = v.x * v.x; float y2 = v.y * v.y; float z2 = v.z * v.z; vec3 s; s.x = v.x * sqrt(1.0 - y2 / 2.0 - z2 / 2.0 + y2 * z2 / 3.0); s.y = v.y * sqrt(1.0 - x2 / 2.0 - z2 / 2.0 + x2 * z2 / 3.0); s