# The intersection point of a line crossing a surface is not displayed correctly In 3D Graphics

This is my code:

Show[{ParametricPlot3D[{x, y, 0}, {x, -4, 4}, {y, -4, 4},
PlotStyle -> LightGray, Mesh -> None],
ParametricPlot3D[{0, 0, t}, {t, -8, 8}, PlotStyle -> Blue],
ParametricPlot3D[{x, 0, z}, {x, -3, 3}, {z, -3, 3}, Mesh -> None]}]


Output

I noticed that the intersection point of the vertical line with the horizontal plane is not on the intersection line of the two planes, although the vertical line is defined on the vertical plane. By setting the axes of the Plot at the origin, I found that the intersection line of two planes is displayed correctly.

So my questions why the insection point of the vertical line with the horizontal plane is not displayed right? How can I make it right? Thanks a lot!

• looks like a version/os-related issue. It works as expected in version 11.3 (windows 10) and version 12.0 (wolfram cloud)
– kglr
Feb 24 '20 at 17:42
• I am using MMA 12.0 on Windows 10 Feb 26 '20 at 12:00
• It might be a graphics driver issue. There are some QAs around that discuss occluding graphics and z-fighting issues which may be helpful. Jul 24 '20 at 3:40

Use the "BSPTree" rendering method as this doesn't suffer from z-buffer precision issues and produces crisp edges:

theplot =
Show[{ParametricPlot3D[{x, y, 0}, {x, -4, 4}, {y, -4, 4},
PlotStyle -> LightGray, Mesh -> None],
ParametricPlot3D[{0, 0, t}, {t, -8, 8}, PlotStyle -> Blue],
ParametricPlot3D[{x, 0, z}, {x, -3, 3}, {z, -3, 3},
Mesh -> None]}];

GraphicsRow[{
theplot
, Style[theplot, RenderingOptions -> {"3DRenderingMethod" -> "BSPTree"}]
}]


Notice how the blue line juts out over the plane by a tiny fraction on the left image, but the right image renders correctly and uses BSP trees for visibility testing instead of a z-buffer.

• Documentation for this option is here. Nov 21 '20 at 0:15

It's a matter of viewpoint. I am using Windows 10 and MMA 12.0 and most other viewpoints had rendering looking a bit more precise.

I also changed the order of the three graphics, but the rendering stayed the same as yours.

c = ParametricPlot3D[{x, y, 0}, {x, -4, 4}, {y, -4, 4},
PlotStyle -> LightGray, Mesh -> None];
d = ParametricPlot3D[{0, 0, t}, {t, -8, 8}, PlotStyle -> Blue];
e = ParametricPlot3D[{a, 0, b}, {a, -3, 3}, {b, -3, 3}, Mesh -> None];
Show /@ Permutations[{c, d, e}]


We probably should have wrapped these in Module as part of best practices, especially since x and y show up in several places.

• Thanks for the trials. The extent of the false rending does depend on the viewpoint. But that is very annoying. I have found that this intersection point problem also happens to cases of curves crossing planes. Feb 26 '20 at 16:08