view change in one event

35 views
Skip to first unread message

Yi Dai

unread,
Nov 18, 2022, 8:21:43 AM11/18/22
to basilisk-fr
Hello,

I was trying to visual one vertical slice and one 3D view. I have a problem that one of the view() setting mixed with another. Below is a small example(hopefully it represents my case): http://www.basilisk.fr/sandbox/YiDai/viewC.c

#include "grid/octree.h"
#include "view.h"
#include "run.h"

int main()
{
    init_grid(1);
    origin(-0.5, -0.5, -0.5);
    run();
}

event view2D(t += 1; t < 2)
{
    view();
    box();
    char name2[90];
    snprintf(name2, 90, "view2D%g.png", t);
    save(name2);
    clear();
}

event view3D(t += 1; t < 2)
{
    view(phi = 0.4);
    box();
    char name3[90];
    snprintf(name3, 90, "view3D%g.png", t);
    save(name3);
    clear();
}

Thank you!
Dai
view3D0.png
view2D1.png
view2D0.png
view3D1.png
Reply all
Reply to author
Forward
0 new messages