<p>IIRC this and some other texture mapping/projection techniques are discussed in <a href="https://archive.org/details/advanced-animation-and-rendering-techniques-1992" rel="nofollow noreferrer">Watt &amp; Watt's <em>Advanced Animation and Rendering Techniques</em></a><br />
Skip forward to around page 180.  FWIW that has a reference to a 1946 (!) document but I haven't gone looking to see if it's the original source :)</p>
<p><a href="https://i.sstatic.net/TTy4v.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TTy4v.png" alt="Spherical mapping excerpt from AAaRT" /></a></p>
<p>Though 'old', <em>Watt &amp; Watt</em> is well worth buying IMHO.</p>

CC BY-SA 4.0
2023-03-09T09:33:03.090Z
2023-03-09T09:40:00.997Z
2023-03-09T09:40:00.997Z
Simon F
<p>I found the answer, someone pointed me to the spherical coordinates system and it is the exact match. <a href="https://tutorial.math.lamar.edu/Classes/CalcIII/TISphericalCoords.aspx" rel="nofollow noreferrer">as shown here</a>
The only difference is that, this assumes <strong>phi</strong> is actually calculated from the z-axis towards xy-plane, however in the picture I shared in the question <strong>V</strong> varies from south pole to north pole, for that we take the negative of the north pole in V calculation.</p>

CC BY-SA 4.0
2022-06-05T16:05:42.837Z
2022-06-05T16:05:42.837Z
Serilena
<p>I am reading the book <strong>An introduction to raytracing by Eric Haines</strong> and it mentions an algorithm to map a point from a sphere into a UV plane, it calls it <strong>Inverse Spherical Mapping</strong> (page 49). I googled a lot about this term and could not find a single piece of information regarding it.</p>
<p>Given the normal to a point on a sphere (<strong>Sn</strong>) and the sphere's north pole unit vector (<strong>Sp</strong>) and a unit vector from the sphere's origin to the sphere's equator (<strong>Se</strong>) as shown below</p>
<p><a href="https://i.sstatic.net/MJJ7u.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/MJJ7u.png" alt="enter image description here" /></a></p>
<p>Using the right-hand coordinates system. It drives the following formula for v and u</p>
<p><a href="https://i.sstatic.net/ysmyP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ysmyP.png" alt="enter image description here" /></a></p>
<p>I understand the <strong>Dot product</strong> yields <strong>cosine</strong> of an angle between two vectors, but why <strong>-Sn</strong>? from the picture <strong>v</strong> starts from the south pole and varies towards the north, but why the <strong>minus sign</strong>? (the book mentions <strong>v</strong> varies from <strong>-Sp</strong> to <strong>+Sp</strong> )</p>
<p>As for <strong>u</strong> I am not sure why we do divide by <strong>sine phi</strong>. and why do we take the cross product to determine <strong>u</strong>? (I know the <strong>cross-product</strong> gives us a perpendicular vector to both, which is probably used to know on which side the normal is, but I am not sure exactly how that worked as the <strong>equator</strong> is changing, so it can be both right and left)</p>

CC BY-SA 4.0
2022-06-04T13:11:53.197Z
For the -Sn it has been sorted, the problem I had was I was using the left-hand coordinates system and the book strictly stated it was using right-hand coordinates (maybe my habit got me to keep using the left-hand coordinates) 
However, I still don't know how the cross-product is used here, or why the division with sin(phi)
Serilena
CC BY-SA 4.0
2022-06-05T09:57:39.990Z
$(\vec A \times\vec B) \cdot \vec C$ is the "scalar triple" product, the sign flips under inversion.
pmw1234
CC BY-SA 4.0
2022-06-05T10:09:30.167Z
hmm that was a little cryptic the scalar triple product can be rewritten as $\left \| \vec A \times \vec B \right \| \left \| \vec C \right \| sin(\theta)$
pmw1234
CC BY-SA 4.0
2022-06-05T16:00:04.740Z
Thanks, I got it in the end, it seems to be a standard conversion from the spherical coordinate system.
Serilena
<raytracing><projections><uv-mapping>
mapping of a point from a sphere into UV plane
Serilena
# mapping of a point from a sphere into UV plane

(Asked by: username_0 on 2022-06-03)

I am reading the book **An introduction to raytracing by Eric Haines** and it mentions an algorithm to map a point from a sphere into a UV plane, it calls it **Inverse Spherical Mapping** (page 49). I googled a lot about this term and could not find a single piece of information regarding it.

Given the normal to a point on a sphere (**Sn**) and the sphere's north pole unit vector (**Sp**) and a unit vector from the sphere's origin to the sphere's equator (**Se**) as shown below

[![enter image description here](https://i.sstatic.net/MJJ7u.png)](https://i.sstatic.net/MJJ7u.png)

Using the right-hand coordinates system. It drives the following formula for v and u

[![enter image description here](https://i.sstatic.net/ysmyP.png)](https://i.sstatic.net/ysmyP.png)

I understand the **Dot product** yields **cosine** of an angle between two vectors, but why **-Sn**? from the picture **v** starts from the south pole and varies towards the north, but why the **minus sign**? (the book mentions **v** varies from **-Sp** to **+Sp** )

As for **u** I am not sure why we do divide by **sine phi**. and why do we take the cross product to determine **u**? (I know the **cross-product** gives us a perpendicular vector to both, which is probably used to know on which side the normal is, but I am not sure exactly how that worked as the **equator** is changing, so it can be both right and left)

**Tags:** raytracing, projections, uv-mapping

> **Comments:**
> **username_0**: For the -Sn it has been sorted, the problem I had was I was using the left-hand coordinates system and the book strictly stated it was using right-hand coordinates (maybe my habit got me to keep using the left-hand coordinates)  However, I still don't know how the cross-product is used here, or why the division with sin(phi)  
> **username_1**: $(\vec A \times\vec B) \cdot \vec C$ is the "scalar triple" product, the sign flips under inversion.  
> **username_1**: hmm that was a little cryptic the scalar triple product can be rewritten as $\left \| \vec A \times \vec B \right \| \left \| \vec C \right \| sin(\theta)$  
> **username_0**: Thanks, I got it in the end, it seems to be a standard conversion from the spherical coordinate system.  

---

## 2 answers

### Answer by username_2 on 2023-03-09. Score: 1

IIRC this and some other texture mapping/projection techniques are discussed in [Watt & Watt's *Advanced Animation and Rendering Techniques*](https://archive.org/details/advanced-animation-and-rendering-techniques-1992)  
Skip forward to around page 180. FWIW that has a reference to a 1946 (!) document but I haven't gone looking to see if it's the original source :)

[![Spherical mapping excerpt from AAaRT](https://i.sstatic.net/TTy4v.png)](https://i.sstatic.net/TTy4v.png)

Though 'old', *Watt & Watt* is well worth buying IMHO.


---

### Answer by username_0 on 2022-06-05. Score: 0

I found the answer, someone pointed me to the spherical coordinates system and it is the exact match. [as shown here](https://tutorial.math.lamar.edu/Classes/CalcIII/TISphericalCoords.aspx)
The only difference is that, this assumes **phi** is actually calculated from the z-axis towards xy-plane, however in the picture I shared in the question **V** varies from south pole to north pole, for that we take the negative of the north pole in V calculation.


---

