ThreeJS Keyframe Tracks and Animation
A KeyframeTrack is a timed series of keyframes that are made up of lists of times and related values and are used to animate an object's unique property.
BooleanKeyframeTrack
A Track of boolean keyframe values.
Constructor
BooleanKeyframeTrack( name : String, times : Array, values : Array )
name - (required) identifier for the KeyframeTrack.
times - (required) array of keyframe times.
values - values for the keyframes at the times specified.
Properties
It inherits its properties from Keyframe Track, refer to previous lessons. The unique properties are as follows:
.DefaultInterpolation : Constant
The default interpolation type to use, InterpolateDiscrete.
.ValueBufferType : Array
A normal Array (no Float32Array in this case, unlike ValueBufferType of KeyframeTrack).
.ValueTypeName : String
String 'bool'.
Methods
The BooleanKeyframeTrack inherits methods from KeyframeTrack that you can refer in the previous lessons.
.InterpolantFactoryMethodLinear () : undefined
The value of this method here is 'undefined', as it does not make sense for discrete properties.
.InterpolantFactoryMethodSmooth () : undefined
The value of this method here is 'undefined', as it does not make sense for discrete properties.
ColorKeyframeTrack
Color changes are represented via a track of keyframe values.
This subclass's very basic implementation has nothing noteworthy yet. This is, however, the location for colour space parameterization.
Constructor
ColorKeyframeTrack( name : String, times : Array, values : Array )
name - (required) identifier for the KeyframeTrack.
times - (required) array of keyframe times.
values - values for the keyframes at the times specified, a flat array of color components between 0 and 1.
interpolation - the type of interpolation to use.
NumberKeyframeTrack
A Track of numeric keyframe values.
Constructor
NumberKeyframeTrack( name : String, times : Array, values : Array )
name - (required) identifier for the KeyframeTrack.
times - (required) array of keyframe times.
values - values for the keyframes at the times specified.
interpolation - the type of interpolation to use.
QuarterionKeyframeTrack
A Track of quaternion keyframe values.
Constructor
QuaternionKeyframeTrack( name : String, times : Array, values : Array )
name (required) identifier for the KeyframeTrack.
times (required) array of keyframe times.
values for the keyframes at the times specified, a flat array of quaternion components.
interpolation is the type of interpolation to use.
Properties and Methods
It inherits the properties and methods of KeyframTrack. The unique ones are as follows:
.DefaultInterpolation : Constant
The default interpolation type to use, InterpolateLinear.
.ValueTypeName : String
String 'quaternion'.
.InterpolantFactoryMethodLinear () : QuaternionLinearInterpolant
Returns a new QuaternionLinearInterpolant based on the values, times and valueSize of the keyframes.
StringKeyframeTrack
A Track of string keyframe values.
Constructor
StringKeyframeTrack( name : String, times : Array, values : Array )
name - (required) identifier for the KeyframeTrack.
times - (required) array of keyframe times.
values - values for the keyframes at the times specified.
interpolation - the type of interpolation to use.
Properties and Methods
It inherits the properties and methods of KeyframTrack. The unique ones are as follows:
.DefaultInterpolation : Constant
The default interpolation type to use, InterpolateDiscrete.
.ValueBufferType : Array
A normal Array (no Float32Array in this case, unlike ValueBufferType of KeyframeTrack).
.ValueTypeName : String
String 'string'.
.InterpolantFactoryMethodLinear () : undefined
The value of this method here is 'undefined', as it does not make sense for discrete properties.
.InterpolantFactoryMethodSmooth () : undefined
The value of this method here is 'undefined', as it does not make sense for discrete properties.
VectorKeyframeTrack
A Track of vector keyframe values.
Constructor
VectorKeyframeTrack( name : String, times : Array, values : Array )
name - (required) identifier for the KeyframeTrack.
times - (required) array of keyframe times.
Values - values for the keyframes at the times specified a flat array of vector components.
Interpolation - the type of interpolation to use.