equirect2xyz: Equirectangular to Cartesian Conversion
Spherical coordinate transformation
The equirectangular projection maps a spherical surface onto a rectangular plane. This function converts UV coordinates back to 3D Cartesian coordinates on the unit sphere:
Where represents elevation from the equator and represents azimuth around the sphere.
Coordinate System Mapping
UV Input | Angle Range | Description |
---|---|---|
Front center | ||
Back center | ||
South pole (bottom) | ||
Equator (middle) | ||
North pole (top) |
Directional Visualization
Live Editor
const fragment = () => { const dir = equirect2xyz(uv) const color = iTime.sin().mul(dir).add(0.5) return vec4(color, 1) }