par3dinterp               package:rgl               R Documentation

_I_n_t_e_r_p_o_l_a_t_o_r _f_o_r _p_a_r_3_d _p_a_r_a_m_e_t_e_r_s

_D_e_s_c_r_i_p_t_i_o_n:

     Returns a function which interpolates 'par3d' parameter values,
     suitable for use in animations.

_U_s_a_g_e:

     par3dinterp(times = NULL, userMatrix, scale, zoom, FOV, 
                 method = c("spline", "linear"), 
                 extrapolate = c("oscillate", "cycle", "constant"))

_A_r_g_u_m_e_n_t_s:

   times: Times at which values are recorded or a list; see below 

userMatrix: Values of 'par3d("userMatrix")' 

   scale: Values of 'par3d("userMatrix")' 

    zoom: Values of 'par3d("zoom")' 

     FOV: Values of 'par3d("FOV")' 

  method: Method of interpolation 

extrapolate: How to extrapolate outside the time range 

_D_e_t_a_i_l_s:

     This function is intended to be used in constructing animations. 
     It produces a function that returns a list suitable to pass to
     'par3d', to set  the viewpoint at a given point in time.

     All of the parameters are optional.  Only those 'par3d' parameters
     that are  specified will be returned.

     The input values other than 'times' may each be specified as
     lists, giving the parameter value settings at a fixed time, or as
     matrices or arrays.  If not lists, the following formats should be
     used: 'userMatrix' can be a '4 x 4 x n' array, or a '4 x 4n'
     matrix; 'scale' should be an 'n x 3' matrix; 'zoom' and 'FOV'
     should be length 'n' vectors.

     An alternative form of input is to put all of the above arguments
     into a list (i.e. a list of lists, or a list of
     arrays/matrices/vectors), and pass it as the first argument.  This
     is the most convenient way to use this function with the 'tkrgl'
     function 'par3dsave'.

     Interpolation is by cubic spline or linear interpolation in an
     appropriate coordinate-wise fashion.  Extrapolation may oscillate
     (repeat the sequence forward, backward, forward, etc.), cycle
     (repeat it forward), or be constant (no repetition outside the
     specified time range).  In the case of cycling, the first and last
     specified values should be equal, or the last one will be dropped.

_V_a_l_u_e:

     A function is returned.  The function takes one argument, and
     returns a list of  'par3d' settings interpolated to that time.

_N_o_t_e:

     Due to a bug in R (fixed in R 2.6.0), using  'extrapolate' equal
     to '"oscillate"'  will sometimes fail when only two points are
     given.

_A_u_t_h_o_r(_s):

     Duncan Murdoch

_S_e_e _A_l_s_o:

     'play3d' to play the animation.

_E_x_a_m_p_l_e_s:

     f <- par3dinterp( zoom = c(1,2,3,1) )
     f(0)
     f(1)
     f(0.5)
     ## Not run: 
     play3d(f)
     ## End(Not run)

