sandbox/bugs/view_arguments.c
View not recognizing tx,ty arguments
When setting the camera position with the parameters tx and ty, if a zero value is specified no argument is taken for those parameters. When view is called multiple times this may generate errors in the camera position. If in a previous call the camera is displaced from the default centered position, in successive calls assigning \displaystyle tx = 0 does not move back the camera to the centered position.
#include "fractions.h"
#include "view.h"
int main() {
We first define a volume fraction field.
init_grid (16);
origin (-0.5,-0.5,-0.5);
scalar f[];
fraction (f, sq(x) + sq(y) + sq(z) - sq(0.3));
We set a first view displacing the camera in the x direction.
We set a second view centered on the origin.
A simple workaround is to specify a very small number instead of zero.
}