As the title indicates, I want to build (and manipulate) two three-dimensional surfaces in one bounding box, so that their intersection is highlighted and the unwanted parts of the surfaces are removed during their movement relative to each other.
First of all I created surface $x=0$ using ContourPlot3D
. Here is the corresponding code (I used the right tool?):
cp1 = ContourPlot3D[x == 0, {x, -5, 5}, {y, -5, 5}, {z, -5, 5},
AxesLabel -> {"x", "y", "z"}]
which produces this output:
Then I created surface $\cos (x) \sin (y)$ using Plot3D
. Here is the corresponding code (I used the right tool?):
Plot3D[Cos[x]*Sin[y], {x, -5, 5}, {y, -5, 5}, AxesLabel -> {"x", "y", "z"}]
which produces this output:
Then I created two three-dimensional surfaces ($\cos (x) \sin (y)$ and $x=0$) in one bounding box. Here is the corresponding code (I used the right tool?):
Show[cp1, Plot3D[Cos[x]*Sin[y], {x, -5, 5}, {y, -5, 5}, AxesLabel -> {"x", "y", "z"}]]
I get this output:
My question is the following: How can I move (manipulate) the surface $x=0$ along the $x$ axis (no movement along the $y$ and $z$ axes), so that surface $x=0$ would be cutoff surface for surface $\cos (x) \sin (y)$ and their intersection is highlighted. Surface $\cos (x) \sin (y)$ not moving.
If for example (this picture is taken not from Mathematics):
EDIT
@JM code is not working: