JAnimateScenes: Animate a list of 'JScene's.

View source: R/anim-tools.R

JAnimateScenesR Documentation

Animate a list of JScenes.

Description

Animates a list of JScene objects by plotting each frame and then combining them into a single animated GIF.

Usage

JAnimateScenes(videoFileName, scenes, ...)

Arguments

videoFileName

Name of the GIF file to be created.

scenes

A list of scene objects, each one created by calling the JScene constructor.

...

Additional parameters are passed on to JAnimateGIF.

Details

See JAnimateGIF for general information about creating animations from R.

Value

The list of arguments passed to the JAnimateGIF function (invisibly).

See Also

JAnimateGIF, JScene, JTransition, JEase, JPlotSceneFn

Examples

## Not run: 
scenes <- list(JScene(1, 20,
                      pt1 = JTransition(1, 0, JEaseInOut),
                      pt2 = JTransition(0, 1),
                      plotFn = function(pt1, pt2) {
                        plot(c(pt1, pt2), c(1, pt2), type = "b", xlim = c(0, 1), ylim = c(0, 1))
                      }),

               JScene(1, 20,
                      pt1 = JTransition(0, 1, JEaseInOut),
                      pt2 = JTransition(1, 0, JEaseIn),
                      plotFn = function(pt1, pt2) {
                        plot(c(pt1, pt2), c(1, pt2), type = "b", xlim = c(0, 1), ylim = c(0, 1))
                      })
)
JAnimateScenes("animation.gif", scenes)

## End(Not run)


JimMcL/JUtils documentation built on Nov. 7, 2024, 11:25 a.m.