# Specifying view angle of a 3D plot [duplicate]

This question already has an answer here:

I would like to create a stereogram from a 3d plot; I would like to export two images of a 3d plot at a slightly different angle, so that when each picture is presented to a different eye, one gets the feeling it is actually 3 dimensional.

I have tried to put two plots next to eachother, then turn one plot slightly by hand (mouse), but when I then export, it is as if I hadn't turned the plot at all!

example:

s1 =
Plot3D[PDF[MultinormalDistribution[{0, 0}, {{1, 1/2}, {1/2, 1}}], {x, y}],
{x, -2.3, 2.3}, {y, -2.3, 2.3}]
Show[GraphicsArray[{s1, s1}]]


How can I specify at which angle the 3d plot is exported?

PS: Just to be clear: I don't want to rotate the function which is plotted, I want to rotate the plot, including the edges of the bounding box of the plot.

-

## marked as duplicate by m_goldberg, Sjoerd C. de Vries, RunnyKine, Simon Woods, belisariusMay 21 '14 at 17:45

Have you checked ViewVector? –  Öskå May 21 '14 at 12:36
Seems to work. Why isn't it in the documentation of Plot3D? –  Angelorf May 21 '14 at 12:39
It is in Options@Plot3D at least.. :) –  Öskå May 21 '14 at 12:39
I see. I didn't know the possibility to do Options@ yet. Thanks. –  Angelorf May 21 '14 at 12:42
Some graphics options appear only in the documentation of Graphics3D. –  Michael E2 May 21 '14 at 14:18

Here is a small tool make it easier thanks to that answer:

With[{dplot =
Plot3D[PDF[MultinormalDistribution[{0, 0}, {{1, 1/2}, {1/2, 1}}],
{x, y}], {x, -2.3, 2.3}, {y, -2.3, 2.3}, ImageSize -> 350,
ViewVector -> Dynamic@vp]},
DynamicModule[{vp, views, plot},
Panel@Column[{dplot,
Button["Record View point", AppendTo[views, vp]],
Button["Export", {Export["~/test.pdf", GraphicsRow[plot /@ views]];
extViews = views}]}, Center],

Initialization :> (
extViews = 0;
views = {};
plot =
Plot3D[PDF[MultinormalDistribution[{0, 0}, {{1, 1/2}, {1/2, 1}}],
{x, y}], {x, -2.3, 2.3}, {y, -2.3, 2.3}, ImageSize -> 350,
ViewVector -> #] &;
vp = Options[Graphics3D, ViewPoint][[1, 2]];
)]]


producing:

My problem here is that I have to write twice the Plot3D, one with Dynamic@vp one with #. If anyone can enlighten me.. :)

-
I suppose you could store the plot in a variable and then use Show to change ViewVector. But your code doesn't work for me because of problems with the syntax. –  Pickett May 21 '14 at 14:29
@Pickett dangdang, thanks for telling me! –  Öskå May 21 '14 at 14:34
It works for me (MMA 9). –  corey979 Apr 10 at 17:13
@corey979 I'm glad it does, I did use v8 if I remember correctly :) –  Öskå Apr 10 at 18:10