RayTracing / raytracing.github.io

Main Web Site (Online Books)
https://raytracing.github.io/
Creative Commons Zero v1.0 Universal
8.84k stars 868 forks source link

Book 3.4: Mapping unit sphere to 2D space #1536

Open dimitry-ishenko opened 6 months ago

dimitry-ishenko commented 6 months ago

3rd paragraph in chapter 4 is not very clear IMHO:

Every direction in 3D space has an associated point on the unit sphere and can be generated by solving for the vector that travels from the origin to that associated point. You can think of choosing a random direction as choosing a random point in a constrained two dimensional plane: the plane created by mapping the unit sphere to Cartesian coordinates.

My understanding of this is:

In the spherical coordinate system each point on a sphere can be represented by $r$, $\theta$ and $\phi$ (radial distance, polar angle and azimuth). Since $r = 1$ for a unit-sphere, we only need to map the two angles in a constrained two-dimensional space, where $\theta \in [0, \pi]$ and $\phi \in [0, 2\pi]$.

hollasch commented 2 months ago

Slipping to next release.