Graphics Reference
In-Depth Information
speed until frame 35, and then smoothly decelerate until frame 60 at the end of the curve at position D .
These kinds of constraints can be accommodated in a system that can compute the distance traveled
along any span of the curve.
Assume that the position of an object in three-dimensional space (also referred to as three-space)
is being interpolated. The objective is to define a parameterized function that evaluates to a point in
three-dimensional space as a function of the parametric value; this defines a space curve . Assume for
now that the function is a cubic polynomial as a function of a single parametric variable (as we will see,
this is typically the case), that is, Equation 3.1 .
3
2
P ðuÞ¼ a u
þ b u
þ c u þ d
(3.1)
Remember that in three-space this really represents three equations: one for the x -coordinate, one for
the y -coordinate, and one for the z -coordinate. Each of the three equations has its own constants a , b , c ,
and d . The equation can also be written explicitly representing these three equations, as in Equation 3.2 .
P ðuÞ¼ðxðuÞ; yðuÞ; zðuÞÞ
xðuÞ¼a x u
3
2
þ b x u
þ c x u þ d x
(3.2)
3
2
yðuÞ¼a y u
þ b y u
þ c y u þ d y
3
2
zðuÞ¼a z u
þ b z u
þ c z u þ d z
Each of the three equations is a cubic polynomial of the form given in Equation 3.1 . The curve itself
can be specified using any of the standard ways of generating a spline (see Appendix B.5 or texts on the
subject, e.g., [ 6 ] ). Once the curve has been specified, an object is moved along it by choosing a value of
the parametric variable, and then the x -, y -, and z -coordinates of the corresponding point on the curve
are calculated.
It is important to remember that in animation the path swept out by the curve in space is not the only
important thing. Equally important is how the path is swept out over time. A very different effect will be
evoked by the animation if an object travels over the curve at a strictly constant speed instead of
smoothly accelerating at the beginning and smoothly decelerating at the end. As a consequence, it
is important to discuss both the curve that defines the path to be followed by the object and the function
that relates time to distance traveled. The former is the previously mentioned space curve and the term
distance-time function will be used to refer to the latter. In discussing the distance-time function, the
curve that represents the function will be referred to often. As a result, the terms curve and function will
be used interchangeably in some contexts.
Notice that a function is desired that relates time to a position on the space curve. The user supplies,
in one way or another (to be discussed in the sections that follow), the distance-time function that
relates time to the distance traveled along the curve. The distance along a curve is defined as arc length
and, in this text, is denoted by s . When the arc length computation is given as a function of a variable u
and this dependence is noteworthy, then s ¼ S ( u ) is used. The arc length at a specific parametric value,
such as S ( u i ), is often denoted as s i . If the arc length computation is specified as a function of time, then
S ( t ) is used. Similarly, the function of arc length that computes a parametric value is specified as u ¼
U ( s ).
The interpolating function relates parametric value to position on the space curve. The relationship
between distance along the curve and parametric value needs to be established. This relationship is the
arc length parameterization of the space curve. It allows movement along the curve at a constant speed
by evaluating the curve at equal arc length intervals. Further, it allows acceleration and deceleration
along the curve by controlling the distance traveled in a given time interval.
 
Search WWH ::




Custom Search