1
$\begingroup$

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

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

enter image description here

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)

$\endgroup$
4
  • $\begingroup$ 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) $\endgroup$
    – Serilena
    Commented Jun 4, 2022 at 13:11
  • $\begingroup$ $(\vec A \times\vec B) \cdot \vec C$ is the "scalar triple" product, the sign flips under inversion. $\endgroup$
    – pmw1234
    Commented Jun 5, 2022 at 9:57
  • $\begingroup$ 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)$ $\endgroup$
    – pmw1234
    Commented Jun 5, 2022 at 10:09
  • $\begingroup$ Thanks, I got it in the end, it seems to be a standard conversion from the spherical coordinate system. $\endgroup$
    – Serilena
    Commented Jun 5, 2022 at 16:00

2 Answers 2

1
$\begingroup$

IIRC this and some other texture mapping/projection techniques are discussed in Watt & Watt's Advanced Animation and Rendering Techniques
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

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

$\endgroup$
0
$\begingroup$

I found the answer, someone pointed me to the spherical coordinates system and it is the exact match. as shown here 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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.