% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/animate-3d.R
\name{renderers_3d}
\alias{renderers_3d}
\alias{gifski_renderer_3d}
\alias{av_renderer_3d}
\alias{file_renderer_3d}
\title{Animation renderers for animate_3d}
\usage{
gifski_renderer_3d(file = NULL, loop = TRUE)

av_renderer_3d(file = NULL, vfilter = "null", codec = NULL)

file_renderer_3d(dir = tempdir(), prefix = "ggcube_frame", overwrite = FALSE)
}
\arguments{
\item{file}{Output file path. If \code{NULL}, a temporary file is used.}

\item{loop}{Logical. Should the GIF loop? Default is \code{TRUE}.}

\item{vfilter}{A video filter string for ffmpeg (passed to \pkg{av}).}

\item{codec}{Video codec name. Default lets \pkg{av} choose.}

\item{dir}{Directory to copy frame files into. Defaults to a session
temporary directory (\code{tempdir()}). For animations you want to keep,
pass an explicit directory.}

\item{prefix}{Filename prefix for copied frame files.}

\item{overwrite}{Logical. Overwrite existing files? Default is \code{FALSE}.}
}
\value{
A function with signature \code{function(frames, fps, width, height)}
that produces the animation output.
}
\description{
Renderer functions that combine individual frame images into a final
animation file. These are factory functions that return the actual
rendering function.
}
\examples{
\dontshow{if (requireNamespace("gifski", quietly = TRUE) && requireNamespace("av", quietly = TRUE)) withAutoprint(\{ # examplesIf}
\donttest{
p <- ggplot() +
  geom_function_3d(
    fun = function(x, y) sin(x) * cos(y),
    xlim = c(-pi, pi), ylim = c(-pi, pi),
    fill = "steelblue", color = "steelblue") +
  coord_3d()

# GIF output (default)
animate_3d(p, yaw = c(0, 360), renderer = gifski_renderer_3d())

# Video output
animate_3d(p, yaw = c(0, 360), renderer = av_renderer_3d())

# Keep individual frame files in a chosen directory
animate_3d(p, yaw = c(0, 360),
    renderer = file_renderer_3d(dir = file.path(tempdir(), "my_frames")))
}
\dontshow{\}) # examplesIf}
}
