# Align / orient a 2D inset within a 3D graphic?

Posted 2 months ago
209 Views
|
4 Replies
|
3 Total Likes
|
 This is what I have gotten to work: drawSphereRadius = 1/8; Graphics3D[ { Inset[Plot[x^2, {x, -1, +1}]], Sphere[{0, 0, 0}, drawSphereRadius], Sphere[{1, 0, 0}, drawSphereRadius], Sphere[{0, 1, 0}, drawSphereRadius] } ] But it results in the 2D plot facing the viewer dead on. That isn't where I want the 2D plot; I want: the origin of the parabola coincident with the sphere at the 3D origin; the parabola to lie within the plane containing the three spheres; the line splitting the parabola should contain the spheres at 0,0,0 and 0,1,0. I have no idea how to translate by verbal description into the correct parameters for Inset[]. I have looked at the Inset-function manual page and the inset tutorial, but still unable to do this. Thank you.
4 Replies
Sort By:
Posted 2 months ago
 This may be a way: drawSphereRadius = 1/8; Graphics3D[{Inset[Plot[x^2, {x, -1, +1}], {0, 0, 0}, {0, 0}], Sphere[{0, 0, 0}, drawSphereRadius], Sphere[{1, 0, 0}, drawSphereRadius], Sphere[{0, 1, 0}, drawSphereRadius]}, ViewPoint -> Above] Otherwise Show[ParametricPlot3D[{x, x^2, 0}, {x, -1, 1}], Graphics3D[{Sphere[{0, 0, 0}, drawSphereRadius], Sphere[{1, 0, 0}, drawSphereRadius], Sphere[{0, 1, 0}, drawSphereRadius]}], PlotRange -> All] 
Posted 2 months ago
 Thank you. Your second solution returns what I had envisioned, oriented as I had hoped for, while your first solution intrigues me because it exercises the 2nd and 3rd parameters in the function Inset[], and those parameters are confusing me even after I've read the docs. Can you please briefly explain to me how you selected {0, 0, 0}, {0, 0} as your values for those parameters? I'll speculate the {0,0,0} refers to the origin of the 3D system, and {0,0} refers to the origin of the 2D system, which is also the parabola's vertex? And while you specified that those two origins should be coincident, the 2D and 3D axes happened to align in the way I had hoped, even though you specified nothing explicitly about alignment?
 Yes, you guessed right about the Inset parameters. The remaining two spheres go into place with ViewPoint -> Above. You can still make more fine-tuning of the size parameter of Inset, which is almost but not exactly right already.