How can I have two overlapped spheres given by

Graphics3D[{Specularity[White, 50], Blue, Sphere[{0.0, 0, 0}, 1.0], 
Green, Sphere[{.7, 0, .7}]}, Lighting -> "Neutral", Boxed -> False]

enter image description here

in a such way that the result contains one sphere (for example the green one) as

enter image description here

and another (blue one) as

enter image description here

However, these spheres are drawn by another software, and their difference is related to distances between lines on the surfaces.

up vote 2 down vote accepted

You can use the following function based on SphericalPlot3D with Mesh -> Full and Mesh -> All options

ClearAll[sphere]

sphere[pos_, r_, mesh_, style_, points_: 20] := 
  GeometricTransformation[
   First@SphericalPlot3D[r, {θ, 0, Pi}, {ϕ, 0, 2 Pi}, Mesh -> mesh, 
     MaxRecursion -> 0, PlotPoints -> points, PlotStyle -> Directive[style]], 
   TranslationTransform[pos]];

Graphics3D[{sphere[{0.0, 0, 0}, 1, All, {Specularity[White, 50], Blue}], 
  sphere[{.7, 0, .7}, 1, Full, {Specularity[White, 50], Green}]}, 
 Lighting -> "Neutral", Boxed -> False]

enter image description here

You might want to start with something like the following:

ParametricPlot3D[
  {Sin[u] Cos[v], Cos[u] Cos[v], Sin[v]}, {u, -Pi, Pi}, {v, -Pi, Pi},
  Mesh -> {45, 45}, PlotStyle -> White, Lighting -> "Neutral"
]

ParametricPlot3D[
  {0.8 + Sin[u] Cos[v], 0.8 + Cos[u] Cos[v], Sin[v]}, {u, -Pi, Pi}, {v, -Pi, Pi},
  Mesh -> {15, 19}, PlotStyle -> Directive[White, Opacity[0.5]], 
  Lighting -> {{"Ambient", RGBColor[0.9, 0.8, 0.9]}}
]

Mathematica graphics

  • Besides so much thanks, I am trying to use of your answer to intersect two spheres. – Unbelievable Nov 9 '15 at 17:15

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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