0
$\begingroup$

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? *)

enter image description here

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:

g1

g2:

g2

g3:

g3

g4:

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).

$\endgroup$
  • 2
    $\begingroup$ 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. $\endgroup$ – MarcoB Aug 12 '17 at 2:34
  • $\begingroup$ @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. $\endgroup$ – barrycarter Aug 12 '17 at 3:15
  • $\begingroup$ 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. $\endgroup$ – J. M. will be back soon Aug 12 '17 at 6:01
  • $\begingroup$ @J.M. Yes, it's a simulation of the upcoming solar eclipse. $\endgroup$ – barrycarter Aug 12 '17 at 14:55
1
$\begingroup$

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]

plot

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

$\endgroup$
  • $\begingroup$ 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? $\endgroup$ – barrycarter Aug 12 '17 at 14:57
  • $\begingroup$ OK, I added some details in my original question and found a simpler broken example. $\endgroup$ – barrycarter Aug 12 '17 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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