Animate a 3D Lissajous curve by rotating the camera and save it to MP4 and ASCII.
The data and the axis limits stay fixed; only the view azimuth advances per frame (matplotlib's ax.view_init(elev, azim) pattern), so the 3D box keeps a constant shape instead of rescaling.
| Type | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|
| integer, | parameter | :: | N_POINTS | = | 200 | |
| integer, | parameter | :: | N_FRAMES | = | 60 | |
| character(len=*), | parameter | :: | OUTDIR | = | "output/example/fortran/3d_animation_demo" | |
| type(figure_t), | pointer | :: | pfig | |||
| type(animation_t) | :: | anim | ||||
| real(kind=wp), | dimension(N_POINTS) | :: | xs | |||
| real(kind=wp), | dimension(N_POINTS) | :: | ys | |||
| real(kind=wp), | dimension(N_POINTS) | :: | zs | |||
| real(kind=wp) | :: | t | ||||
| integer | :: | i | ||||
| integer | :: | status | ||||
| logical | :: | ok |
Pin the axis box so autoscale does not refit between frames.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | frame |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | label | |||
| integer, | intent(in) | :: | st |