# Graphics3D displays spheres individually, but not together

I've found a simpler example that fails and am providing it below with more details on what I expect to see. I'm leaving my original question below for reference.

(* here are two 3D points *)

pt1 = {-303335746, 213871159, 489763};
pt2 = {-128868984574, 79336116609, -2720851};

(* as viewed from the origin, their angular distance is small *)

N[VectorAngle[pt1, pt2]/Degree]

(* yields 3.56925 degrees *)

(* now, two spheres of different sizes centered at these points *)

r1 = 1738100
r2 = 696300000

sph1 = Sphere[pt1, r1]
sph2 = Sphere[pt2, r2]

(* let's compute the angular diameter of these spheres as viewed from origin *)

N[2*ArcTan[r1/Norm[pt1]]/Degree]
N[2*ArcTan[r2/Norm[pt2]]/Degree]

(* the answers are 0.536627 degrees for sph1 and 0.527248 degrees for sph2 *)

(* now, let's look directly at pt1 with a 10 degree view angle; since
both spheres have the same angular diameter and are only 3 degrees
apart, we should see both *)

g0 = Graphics3D[{sph1,sph2}]
Show[g0, ViewVector -> { {0,0,0}, pt1}, ViewAngle -> 10*Degree]

(* but I only see sph2 [image below], why? *)


EVERYTHING BELOW THIS LINE IS MY ORIGINAL QUESTION

(* Version is '11.1.0 for Linux x86 (64-bit) (March 13, 2017)' *)

(* here are two spheres *)

sph1 = Sphere[{128940484175, -78312608306, -17241976}, 1738100]
sph2 = Sphere[{374835347, 809637144, -20452590}, 696300000]

(* and a fixed view vector and view angle *)

vv = {{129243819921, -78526479465, -17731739},
{-128565648828, 79122245450, -3210615}}

va = 10*Degree

(* see below for results *)

(* this shows sph1, as expected *)
g1 = Graphics3D[sph1, ViewVector -> vv, ViewAngle -> va]

(* this shows sph2, as expected *)
g2 = Graphics3D[sph2, ViewVector -> vv, ViewAngle -> va]

(* this shows only sph2, why? *)
g3 = Graphics3D[{sph1, sph2}, ViewVector -> vv, ViewAngle -> va]

(* even reversed, this shows only sph2, why? *)
g4 = Graphics3D[{sph2, sph1}, ViewVector -> vv, ViewAngle -> va]


g1:

g2:

g3:

g4:

I've tried many variants of the commands above, but get the same results.

My one thought: maybe I'm using such large and small quantities that the coordinates for sph1 are somehow obscuring the coordinates for sph2.

EDIT: I tried ViewRange -> All, but it didn't change anything (which I expected, since that's the default ViewRange anyway).

• Your radii and distances span a ridiculously huge range. At the scale you are using, the second sphere is invisible because it is entirely too small to be represented, at that scale and distance from the first one. Notice that, if you use scaled up radii by e.g. 1000x, both spheres show up just fine. – MarcoB Aug 12 '17 at 2:34
• @MarcoB OK, but in g1 and g2 above, the view angle is the same, so I can see both spheres, just not at the same time. If I multiply radii by 10x, same problem. If I multiple radii by 1000x as you suggest, I appear to be inside the spheres. Make sure you use the same viewvector and viewangle settings I use. The viewvector puts the camera right where the two spheres have roughly equal angular size. – barrycarter Aug 12 '17 at 3:15
• Are you trying to simulate planets here? There's a reason why either planet size or inter-planet distance in some models is slightly exaggerated. – J. M. will be back soon Aug 12 '17 at 6:01
• @J.M. Yes, it's a simulation of the upcoming solar eclipse. – barrycarter Aug 12 '17 at 14:55

You have a big time scaling problem. sph2 is roughly 1000 times bigger than sph1. Also, the distance between them is more than 100 times the diameter of the larger sphere. So there is essentially no point in space from which you could have both spheres in the field of view and both appearing large enough to be visible.

To get an idea of the magnitude of the problem (pun intended), let's enlarge the sph1 by a factor of 1000, plot the midpoint between the two spheres and look down on them from directly above the midpoint. We will let Mathematica choose the viewpoint to give us the necessary field of view.

sph1 = Sphere[{128940484175, -78312608306, -17241976}, 738100 1000];
sph2 = Sphere[{374835347, 809637144, -20452590}, 696300000];


Here is the plot.

Graphics3D[{Red, sph1, Blue, sph2, Black, AbsolutePointSize[4], Point[midPt]},
ViewPoint -> Top,
PlotRange -> All,
ImageSize -> 500]


Now you can see that if sph1 wasn't inflated by 1000, it wouldn't take up even one pixel and would be invisible.

• I guess my question then is: why do g1 and g2 look the way they do? They're both from the same point in space, looking towards the same point in space with the same view angle. What am I missing that makes the spheres visible individually, but not together? – barrycarter Aug 12 '17 at 14:57
• OK, I added some details in my original question and found a simpler broken example. – barrycarter Aug 12 '17 at 20:26