I am trying to move the virtual camera over a static 3D scene. The Cuboid is disappearing for the latter two thirds of this animation, though, and I don't want it to disappear. Is there a way to do graphics in Mathematica without them randomly disappearing?
In[92]:= go[resolution_, framesPerSecond_, totalSeconds_] := Module[
{
totalFrames = framesPerSecond*totalSeconds,
totalBuildingsX = 100, totalBuildingsY = 100,
distanceBetweenBuildingsX = 100, distanceBetweenBuildingsY = 200,
lengthPerBuildingPerDistanceBetweenBuildings = 8/9,
lengthPerBuildingX, lengthPerBuildingY,
totalLengthX, totalLengthY,
viewAngle = (Pi/4),
graphicsList
},
lengthPerBuildingX =
distanceBetweenBuildingsX*
lengthPerBuildingPerDistanceBetweenBuildings;
lengthPerBuildingY =
distanceBetweenBuildingsY*
lengthPerBuildingPerDistanceBetweenBuildings;
totalLengthX = totalBuildingsX*distanceBetweenBuildingsX;
totalLengthY = totalBuildingsY*distanceBetweenBuildingsY;
graphicsList = {Opacity[2/2]}~Join~
{Opacity[1/4],
Cuboid[{0, 0, 0}, {totalLengthX, totalLengthY, 3000}]};
Export[
"t.avi",
Table[
Graphics3D[
graphicsList,
Axes -> False,
PlotRange -> {{-2 totalLengthX, +2 totalLengthX}, {-2 \
totalLengthY, +2 totalLengthY}, {-1, 12000}},
ViewCenter -> {1/2, 1/2, 0},
ViewPoint -> {totalLengthX/2 -
totalLengthX ((frame - 1)/totalFrames)/2, totalLengthX,
totalLengthX (totalFrames - (frame - 1))/totalFrames},
ViewAngle -> viewAngle,
Boxed -> False,
ViewVertical -> {0, 0, 1}, SphericalRegion -> True,
ImageSize -> resolution
],
{frame, 1, totalFrames}
],
"FrameRate" -> framesPerSecond
]
]
In[91]:= go[
{720, 480}/8 (* resolution *),
4 (* frames per second *),
4 (* total seconds *)
]
Out[91]= "t.avi"
Everything was fine while the camera was fixed up high, but then I parameterized its height only to discover Mathematica obliterates the entire scene if I do that. Why would Mathematica do that?
This never happened with other rendering programs. Was there some forewarning in the documentation that the Cuboid would disappear? Wolfram employees are invited to come over and watch me try to be productive with this program.
I have a lengthy notebook where I'm just trying to figure out how to set Graphics3D options to get it to do what I want, which is very simple with other powerful rendering programs. What a pain. What a horrible way to spend the final period of my life, battling this monster.