Re: 3D plot with orthographic projection

• To: mathgroup at smc.vnet.net
• Subject: [mg101414] Re: 3D plot with orthographic projection
• From: "Alexander Elkins" <alexander_elkins at hotmail.com>
• Date: Sun, 5 Jul 2009 23:16:57 -0400 (EDT)
• References: <h2kjel\$imk\$1@smc.vnet.net>

```Have a look at the very poor documentation for ViewMatrix.

In the example shown, replace

{{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, -1, 0}, {0, 0, 0, 1}}

with

TransformationMatrix[ReflectionTransform[{0, 0, 1}]]

giving

Graphics3D[Sphere[], Boxed -> False,
ViewMatrix -> {TransformationMatrix[
RescalingTransform[{{-1, 1}, {-1, 1}, {-1, 1}}]],
TransformationMatrix[ReflectionTransform[{0, 0, 1}]]}]

The reason for having two matrices has to do with lighting.

For a somewhat more meaningful example try the following:

Manipulate[
Graphics3D[{PointSize[0.05], Sphere[{-1, -1, -1}, 0.05] ,
Arrowheads[{0.05}], Red, Arrow[Tube[{{0, 0, 0}, {1, 0, 0}}, 0.02]],
Text[Style["X", "Section"], {1, 0, 0}], Green,
Arrow[Tube[{{0, 0, 0}, {0, 1, 0}}, 0.02]],
Text[Style["Y", "Section"], {0, 1, 0}], Blue,
Arrow[Tube[{{0, 0, 0}, {0, 0, 1}}, 0.02]],
Text[Style["Z", "Section"], {0, 0, 1}]},
ViewCenter -> {{1/2, 1/2, 1/2}, ImageScaled[{1, 1}]},
ViewMatrix -> {TransformationMatrix[ScalingTransform[{1, 1, 1} s]],
TransformationMatrix[
ReflectionTransform[
Append[Normalize[pt - {1/2, 1/2}], -1 +
2 SquaredEuclideanDistance @@ (pt - {1/2,
1/2})]]]}], {{s, 0.27,
"Scale"}, 0.1, 0.5}, {pt, {{0.777, 0.292}}, Locator}]

Move the locator about to get different views.

Hope this helps...
Alexander

"markus" <markusg.phys at googlemail.com> wrote in message
news:h2kjel\$imk\$1 at smc.vnet.net...
> Hi,
>
> I would like to create a 3D Plot in Mathematica 7 using an
> orthographic projection instead of the default stereographic mode. So
> far, I have found that it is possible to give something like
> "ViewPoint->{0,0,Infinity}" as an option in order to view at the plot
> from the top plane, using orthographic projection. But the ViewPoint
> option seems to accept only  +/-Infinity for *one* of the directions,
> keeping all other zero. However, I would like to look at an
> orthographic plot from any viewpoint, just as in the default 3d plots
> (that I can rotate with the moue).
> Does anybody know how that is possible?
>
> Thanks,
> Markus

```

• Prev by Date: Re: eyeofra_ifs.gif (GIF Image, 1044x1044 pixels) - Scaled (87%)
• Next by Date: Re: Re: Re: Union slowdown when
• Previous by thread: 3D plot with orthographic projection
• Next by thread: Re: 3D plot with orthographic projection