0
$\begingroup$
  • We have two spheres with the same origin point
  • Sphere A has radius X
  • Sphere B has radius X+Y
  • Sphere A is opaque
  • Sphere B is semi-transparent

How do I determine the visible degrees of sphere B, including the backface as it wraps before going "behind" sphere A

See this image for clarification:

enter image description here

1 sphere contains the continents, the smaller one contains the lat/lng lines. I'm rendering 90° of the smaller one (so you can't see the back of it at all) and 120° of the larger one, but 120° is too much. I'm trying to figure out how to exactly calculate this angle based on the radii of the two spheres.

This is 107°:

enter image description here

1 Answers 1

0

Answering my own question.

If you look at this like a circle instead of a sphere, we're just trying to calculate the arc length of a circle cut off at a specific y value (where you can no longer see it because of the inner sphere).

So:

x = ratio of inner sphere to outer sphere
y = sqrt(1 - x^2)
angle = atan(y / x)

And the total angle is 90° plus this one (converted from radians to degrees)