Many rgl shapes contain lists of vertices with various
attributes (available via
rgl.attrib). This function
modifies the data for those attributes in a WebGL scene.
1 2 3 4 5 6
Numeric vector with one value per vertex, used to determine the “age” of the vertex when displaying it.
A non-decreasing sequence of “ages”.
Attributes of the vertices. Non-
The object ids and scene prefixes to modify. These are recycled to the same length.
Default values to be used by a slider control calling the generated function.
The vertex attributes are specified as follows:
A vector of colors in a format suitable for input to
A numeric vector of alpha values between 0 and 1.
A numeric vector of sphere radii.
A 3-column matrix of vertex coordinates.
A 3-column matrix of vertex normals.
A 2-column matrix of origins for text or sprites.
A 2-column matrix of texture coordinates.
All attributes must have the same number of entries (rows for the matrices)
ages vector. The
births vector must have the
same number of entries as the number of vertices in the object.
Not all objects contain all attributes listed here; if one is
chosen that is not a property of the corresponding object, a
alert() will be generated.
A character vector of class
code defining a function suitable for use in a
The function takes a single argument,
time, and uses it to compute the
“age” of vertex
time - births[i].
Those are then used with the
argument to linearly interpolate settings of the specified attributes.
Extrapolation is constant. Repeated values in
ages can be used
to obtain discontinuities in the settings.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.