# Show Graphics on top of ParametricPlot3D

I want to show a curved trajectory in 3D with a small Sphere/Point denoting a specific point. Therefore, the Sphere/Point needs to be always visualised "in front" of the curve; instead, I get exactly the opposite, even though I Show the sphere afterwards:

Show[ParametricPlot3D[{0, Cos[4 t], Sin[4 t]}, {t, 0, 2}],
Graphics3D[{Red, PointSize[0.02], Opacity, Point[{0, 1, 0}]},
Boxed -> False],
Boxed -> False, Axes -> False, PlotRange -> Full]


Setting max opacity didn't help, as you can see.

Update: Using Ball does not solve the problem in all orientations:

Show[ParametricPlot3D[{0, Cos[4 t], Sin[4 t]}, {t, 0, 2}],
Graphics3D[{Red, Ball[{0, 1, 0}, 0.05]}, Boxed -> False],
Boxed -> False, Axes -> False, PlotRange -> Full,
ViewAngle -> 0.05441036690859109,
ViewCenter -> {{0.5, 0.5,
0.5}, {-0.4060312376176072, -0.06631185777677895}},
ViewPoint -> {1.2849282470004935, -2.9518747023382326,
1.0418229896464233},
ViewVertical -> {0.8518775666674835, -0.15812469380775868,
0.49930070360143686}] The inaccurate intersection is shown simply by using the ViewPoint setting, but I zoomed in to highlight the problem.

• Use Ball with an appropriate radius, not Point. – MarcoB Jul 16 at 16:25
• Does not work, see e.g. Show[ParametricPlot3D[{0, Cos[4 t], Sin[4 t]}, {t, 0, 2}], Graphics3D[{Red, Ball[{0, 1, 0}, 0.05]}, Boxed -> False], Boxed -> False, Axes -> False, PlotRange -> Full] – sdnnds Jul 16 at 17:00
• Re reopening: Since Ball does not solve the problem of showing the intersection of the ball and curve accurately, it's hard to see how this is a simple mistake. And the issue is certainly not addressed in the documentation. – Michael E2 Jul 22 at 12:55

You mean you want even the part of the point/ball that is behind the curve to be drawn in front? The normal 3D model won't do that, I'm pretty sure. You could have layers, such as you get with Overlay, but you have to take care that all the visualization parameters agree (ViewPoint, PlotRange, ImageSize, etc.):

Overlay[{
ParametricPlot3D[{0, Cos[4 t], Sin[4 t]}, {t, 0, 2},
Boxed -> False, Axes -> False, PlotRange -> 1],
Graphics3D[{Red, Ball[{0, 1, 0}, 0.05]}, Boxed -> False,
Boxed -> False, Axes -> False, PlotRange -> 1]
}] Note that the output is not a Graphics3DBox[..] and cannot be rotated.

I feel that the OP's version of @MarcoB's suggestion is the best way, in which the curve passes through the ball in a natural way:

Show[
ParametricPlot3D[{0, Cos[4 t], Sin[4 t]}, {t, 0, 2}],
Graphics3D[{Red, Ball[{0, 1, 0}, 0.05]}, Boxed -> False],
Boxed -> False, Axes -> False, PlotRange -> Full]


I think I understand the comment: The intersection of the Line and the Ball is not shown accurately from all view points.

Things seem to be displayed more accurately if the graphics elements all have the same dimension. If we use surface elements for both the line and point, namely Tube and Ball, the displayed graphics perhaps look better.

Show[ParametricPlot3D[{0, Cos[4 t], Sin[4 t]}, {t, 0, 2},
PlotStyle -> Tube[0.01]],
Graphics3D[{Red, Ball[{0, 1, 0}, 0.05]}, Boxed -> False],
Boxed -> False, Axes -> False, PlotRange -> Full] • The issue is that the approach with "Ball" seems not to work when the ball is too small, i.e. I always see the line in front of it, no matter how I rotate it, in an unphysical way. The approach with Overlay would work, but this needs to go within a larger figure and I wasn't be able to make the axis align in spite of setting the same ImageSize, PlotRange and Viewpoint. – sdnnds Jul 17 at 5:26
• @sdnnds See if Tube works for you (see my update). – Michael E2 Jul 17 at 11:43
• Using tube it works perfectly, thanks. I don't understand why the question was closed... – sdnnds Jul 22 at 12:44
• @sdnnds You're welcome. Re closing: My guess is that they didn't understand and thought Ball solved it (2 upvotes on MarcoB's comment). I don't think it was an easy question to understand. Descriptions of what one person sees often are not without a good image to support the description (especially in this case, in which seeing the issue depends on how you rotate the 3D graphics). For instance, it took me two tries at solving to understand the problem correctly. – Michael E2 Jul 22 at 12:50