Edit - I made the example data much smaller, so it's not so much to download.
I am trying to make animations of electronic orbitals, using functions like the ones listed here. In order to make an animation, I need for the resulting 3D image to have a stationary camera - i.e. no jumping around from frame to frame. Here are two examples that I can't get this to work on.
{model,polygons1,polygons2}=Get["https://gist.githubusercontent.com/jasondbiggs/474f13ef2680bf5afe1c/raw/3defa3ce25f3c10eeb7ab2836dbb50ce4b3d50a1/data.m"];
Graphics3D /@ {model, polygons1, polygons2}
We have a skeleton, and a group of polygons (stripped from a 3D contour plot). I combine them and give them the same options for ViewPoint
, ViewVertical
, and ViewCenter
.
image1 = Graphics3D[{{Red, polygons1}, model},
ViewPoint -> {0.14, 0.2, -3.4}, ViewVertical -> {0.04, 0.01, -2.0},
Boxed -> False, ViewPoint -> {0, 0, 3.4}];
image2 =
Graphics3D[{{Blue, polygons2}, model},
ViewPoint -> {0.14, 0.2, -3.4}, ViewVertical -> {0.04, 0.01, -2.0},
Boxed -> False, ViewPoint -> {0, 0, 3.4}];
But when I cycle through them, they are clearly shown from different vantage points,
Manipulate[Show[{image1, image2}[[image]]], {image, {1, 2}}]
So what am I missing? How can I make sure that every single time I create a 3D image that the view is identical? Is there another important viewing option besides those 3?
Thanks in advance.
View*
options:ViewVector
,ViewAngle
,ViewVertical
,ViewPoint
,ViewCenter
, andViewRange
(I think the first three are the ones you need to fix). Instead of setting each of these individually, you can just set theViewMatrix
(which in turn depends on these) and you should be fine. See this question for more, especially Heike's answer: mathematica.stackexchange.com/q/3528/5 (I think this fully addresses what you want to achieve) $\endgroup$ViewMatrix
will help you? This is inconvenient with the given limitations ofAbsoluteOptions
. $\endgroup$