How to show orthogonal views for a 3D plot(ParametricPlot3D)?
Please refer to the following picture(top view/front view/side view):
How to show orthogonal views for a 3D plot(ParametricPlot3D)?
Please refer to the following picture(top view/front view/side view):
Sample object:
g=Graphics3D[{Cylinder[],Blue,Cuboid[{-2,-3,-1},{2,3,0}]},Boxed->False]
There are special commands for this:
Show[g,ViewPoint->#]&/@{Back,Bottom,Front,Top,Left,Right}
The usefulness of all projections (Left different from Right etc.) is more clear on a completely asymmetric case:
m=ConvexHullMesh[RandomReal[{-1,1},{30,3}]];
Show[m,ViewPoint->#]&/@{Back,Bottom,Front,Top,Left,Right}
ViewProjection -> "Orthographic"
, which I also just learned myself by first setting something like ViewPoint -> {Infinity, 0, 0}
, then using Options
to see what options the resulting Graphcis3D
actually contains. (By that time I already wrote the first part of my answer, this is why I ended up mentioning ViewProjection
only at the end.)
$\endgroup$
What Vitaliy shows is not quite the full solution. Notice that in the Front
view, the top of the cylinder still looks curved. With a true orthographic projection, it should look flat, as in the illustration given in the question.
To achieve an accurate orthographic projection, we need to set the view distance to infinity. Using Vitaliy's graphics (g
) for illustration, this is what we get with Front
:
Show[g, ViewPoint -> Front]
The view distance is not infinite, causing a noticeable curve on the cylinder cap. Now let us set it to infinity:
Show[g, ViewPoint -> {Infinity, 0, 0}]
This is now a true orthographic projection.
This is documented in the doc page of ViewPoint
, under "Details".
Here's an isometric view:
Show[g, ViewPoint -> {Infinity, Infinity, Infinity}]
All good so far, but what if we want to view the object under a different angle, and still use orthographic projection? We can't use ViewPoint -> {2 Infinity, Infinity, Infinity}
as 2 Infinity
is clearly the same as Infinity
.
The solution is to use finite numbers in ViewPoint
, but set ViewProjection -> "Orthographic"
. See ViewProjection
.
Show[g, ViewPoint -> {2, 1, 1}, ViewProjection -> "Orthographic"]