13
$\begingroup$

The following post (Projection of a 3d curve to 2d) explain how to project a 3D curve on 2d.

Now there is a command which permit the Porjection of ImplicitRegion. But I have a function z = -(x^2 + y^2)^.2 and I want to plot it in 3D with the 3 projections on the walls xz and yz and the floor xy. I have search in many place but I do not know even how to begin.

$\endgroup$

2 Answers 2

17
$\begingroup$

This is actually pretty straightforward when you put textured rectangles on the sides. This approach is very general and can be used with almost anything you want to put on the walls. For your particular purpose, I like the solution of @ubpdqn more. Nevertheless, here an example

pr = {{-5, 5}, {-5, 5}, {-2.5, -.5}};
p3d = Plot3D[-(x^2 + y^2)^.2, {x, -5, 5}, {y, -5, 5}, PlotRange -> pr]

You have to create the projection images which is nothing more than the view from one side in orthogonal projection of the same function

tex = Plot3D[-(x^2 + y^2)^.2, {x, -5, 5}, {y, -5, 5}, PlotRange -> pr,
    ViewPoint -> {Infinity, 0, 0}, Axes -> False, Boxed -> False, 
   PlotStyle -> Green, Background -> None];

Then you take your original plot and put rectangular polygons on the sides and use your tex image as textures:

Graphics3D[{First[p3d], Texture[tex], 
  Polygon[{{-5, 5, -2.5}, {5, 5, -2.5}, {5, 5, -.5}, {-5, 5, -.5}}, 
   VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}],
  Polygon[{{-5, -5, -2.5}, {-5, 5, -2.5}, {-5, 
     5, -.5}, {-5, -5, -.5}}, 
   VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]
  }, BoxRatios -> {1, 1, 1/2}, Lighting -> "Neutral", Boxed -> False]

Mathematica graphics

That should give you enough information to implement whatever you are after.

Btw, for similar things, you might want to look into SliceDensityPlot3D and SliceContourPlot3D

f = Sin[x + y^2];
Show[
 Plot3D[f, {x, -3, 3}, {y, -2, 2}],
 SliceDensityPlot3D[f, 
  "BackPlanes", {x, -3, 3}, {y, -2, 2}, {z, -2.5, 1}], PlotRange -> All
 ]

Mathematica graphics

$\endgroup$
16
$\begingroup$

You could define your own projection and use ParametricPlot3D:

f1[x_, y_] := {x, y, -(x^2 + y^2)^(0.2)}
f2[x_, y_] := {x, 4, -(x^2 + y^2)^(0.2)}
f3[x_, y_] := {-4, y, -(x^2 + y^2)^(0.2)}
ParametricPlot3D[{f1[x, y], f2[x, y], f3[x, y]}, {x, -4, 4}, {y, -4, 
  4}, BoxRatios -> {1, 1, 1/2}]

enter image description here

$\endgroup$
2
  • $\begingroup$ +1 For this particular purpose, I like your idea much more than mine. $\endgroup$
    – halirutan
    Jan 28, 2018 at 13:38
  • $\begingroup$ It's very difficult to attribuate the points since the two solutions fit accordingly to the question. So I gives the point to ubpdqn due to the comment to halirutan $\endgroup$ Jan 28, 2018 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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