The first figure is the (almost) the example elevation.asy from the demo gallery.

I'd like to do an animation of a moving camera navigating in-between the peaks (a bit like a walkthrough in architecture software, or if the animation was a video captured from a plane in a hilly landscape).

I fail because I when I choose a camera position in the box defined by the axis (e.g. currentprojection=perspective(camera=(0.1,.3,.5),autoadjust=true);), the camera is automatically adjusted to the nearest position outside the box (see second figure). If I specify autoadjust=false I get an error (Error: /configurationerror in --setpagedevice--). I am really not sure that it is possible to do what I want because in the interactive mode (when compiled with option -V), I cannot set such a POV.

Question: Would it be possible to choose a POV inside the box defined by the axis?

With currentprojection=perspective(0.8,1,1);: enter image description here

With currentprojection=perspective(camera=(0.1,.3,.5),autoadjust=true);: enter image description here

Code for first picture:

import graph3;
import grid3;
import palette;




real f(pair z) {return cos(2*pi*z.x)*sin(2*pi*z.y);}

surface s=surface(f,(-1/2,-1/2),(1/2,1/2),50,Spline);


  • Wild guess: Use negative values for the camera position. – Werner Feb 8 '15 at 18:36
  • @Werner I tried but the same behaviour occurs (except the adjusted camera position is on the other side, still targeting (0,0,0)). – anderstood Feb 8 '15 at 18:38
  • Not sure that it is possible. Possible workaround is zoom (but the perspective does not change). Another way is to eliminate some Bézier patches of the surface (no XYZaxis) with respect to the camera (see the partialsurface.asy example) to avoid camera too closed. – O.G. Feb 8 '15 at 20:34
  • Have you tried interactive zooming with asy -V? It looks that you need to adjust the angle. I've got a close view with currentprojection=perspective(camera=(1,-0.3,2.6),angle=4,autoadjust=false);. – g.kov Feb 9 '15 at 7:08
  • @g.kov I did try interactive zooming, but does not make me travel "on" the object, it just gives a closer view (just as zooming when you take a picture in the mountains is not the same as taking a picture while flying towards the mountains, if you see what I mean). – anderstood Feb 9 '15 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.