I am trying to make a 3D animation in Asymptote involving moving infinite surfaces. I would like to set up a "steady camera", so that a unit ball would always look the same size relative to the screen, no matter how far the surfaces actually extend beyond the screen.
However, it seems that after projecting, Asymptote automatically computes a bounding box that includes everything that is displayed, and then crops the picture to that box. If you change the "zoom" parameter (setting it for example to 10), you get a bounding box 1/10th that size; however, it still depends on what happens outside the screen.
Is there any way to specify a projection with a fixed viewport?
Here is a minimal working example:
unitsize(100);
import three;
import solids;
import animation;
animation A;
int n = 50; //number of steps
int m = 10; //step at which we reach "normal" size
for(int i=0; i<=n; ++i) {
save();
surface sphere = (scale3(i/m) * unitsphere);
draw(sphere, gray+opacity(0.5));
A.add();
restore();
}
A.movie(0,n);
When I compile it, the sphere moves around the screen first in a seemingly random fashion (it is not even centered!! why?), then constrained by the boundaries of the screen.
I would like the sphere to start in the center, hit the screen boundaries at frame 10 (on all sides at the same time), then keep growing past the screen boundaries (so that at the end only a small part of the sphere is visible.)
A possible workaround would be to write
draw(circle(O,100,camera), invisible);
and then to set zoom=100. But this does not look very clean, takes forever to render, and depends on being sure that no object will ever extend past the invisible circle.