<<<<<<<<<<<<<<<<<

q_spline(spline) Spline Interpolation q_spline(spline)

NAME

q_spline - quaternion spline

SUPERCLASS

spline

DESCRIPTION

Q_Spline is used to create interpolated data points for orientation data (Euler angles). Q_Spline should be used for doing inbetweening of orientations for computer animation. It uses quaternions as described in Computer Graphics, vol. 19, Number 3, pp. 245-254, July 1985.

INSTANCE VARIABLES

None

MESSAGES

compute! Calculate spline coefficients. This method should be executed if spline data is changed. The message should be sent before the first delta! of tick! is sent.

delta! Calculate spline value(s) at current time, return the difference between the spline value(s) and old_values, store new spline value(s) in the old_values, and increment time by 1 / resolution.

new! Create new instance of q_spline.

print! Print q_spline.

tick! Calculate and return the spline value(s) at current time and increment time by 1 / resolution.

EXAMPLE

Q_Spline object is used in combination with data object. Q_Splines are usually used to calculate intermediate values for various parameters in animation. As a rule, complicated scripts for q_splines are generated automatically by various generator objects (camera_generator, actor_generator, keyframe).

/*

Below is slightly abbreviated script generated by keyframe object.

This script assumes that camera c1 is defined and there is an actor, a

modeller, a scene, and a renderer. The script controlls animation of a

camera orientation. */

cue new: key1_c1_azimuth; k_spline new: key1_c1_azimuth_spline; data new: key1_c1_azimuth_data dimension= 1;

key1_c1_azimuth_data t= 0.000000 value= 0.000000; key1_c1_azimuth_data t= 1.000000 value= -5.000000; key1_c1_azimuth_data t= 2.000000 value= 5.000000; key1_c1_azimuth_data t= 3.000000 value= 0.000000; key1_c1_azimuth_data normalize_t!; key1_c1_azimuth_spline scale_off! max= 5.000000 min= -5.000000 duration= 3.000000 data= key1_c1_azimuth_data; key1_c1_azimuth start= 0.000000 end= 3.000000 start_actions+ "key1_c1_azimuth_spline time= 0;" tick_actions+ "c1 azimuth: [key1_c1_azimuth_spline delta!];" end_actions+ "key1_c1_azimuth_spline time= [key1_c1_azimuth_spline end?];" end_actions+ "c1 azimuth: [key1_c1_azimuth_spline delta!];";

SEE ALSO

data, spline, c_spline, o_spline, k_spline


Please send comments and suggestions to
consult@rpi.edu