three_d_animation_demo Program

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.


Variables

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

Subroutines

subroutine set_fixed_limits()

Pin the axis box so autoscale does not refit between frames.

Arguments

None

subroutine rotate_view(frame)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: frame

subroutine report_status(label, st)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: label
integer, intent(in) :: st