Graphics Reference
In-Depth Information
a common notation in physics. In animation, time appears in all equations and is
always denoted by t (except when we need temporary variables for integration),
so all derivatives are with respect to t (e.g., x ( t )= d dt ( t ) ). Multiple dots indicate
higher-order derivatives (e.g., x ( t )= d 2 x
dt 2 ( t ) ).
There are two hazards in this dot notation. The first is that “ x ” is such a com-
pact form that it is easy to drop the “ ( t ) ” and treat the value of a velocity expression
as a variable instead of as the evaluation of a function. When taking derivatives
of complex expressions such as momentum that are based on velocity, forget-
ting that velocity is a function of time can lead to errors if you forget to apply
the chain rule. For example, let's look at a function of two arguments defined by
p ( m , v )= 2 m v 2 (which happens to be the momentum equation). We can com-
pute the partial derivatives, p
m ( m , v )= 2 v 2 ; p
v ( m , v )= m v . What you might see
in an animation paper is a description of this function where the author writes,
p ( m , x )= 2 m x 2 .” And you'll even see things like “ p
x ( m , x )= m x .” Here, x is
being treated as a variable, just like v , and it is almost reasonable to do so thus
far. It is also common to see “ dt p ( m , x )= m xx .” This is a little strange because t
isn't even one of the arguments of function p , and x has changed from its role as
a variable whose symbol happens to have a dot hat to representing a function of
time whose time derivative is denoted x . Thus, for clarity, in this chapter when we
want such a function, we write either p ( m , t )= 2 m x ( t ) 2 , or more verbosely,
p ( m , v )= 1
2 m v 2 ,
(35.11)
p ( m , t )= p ( m , x ( t )) = 1
2 m x ( t ) 2 , and
(35.12)
p ( m , t )
= m x ( t ) x ( t ) .
(35.13)
t
The second notational hazard is that the implementation of a dynamics sys-
tem often uses higher-order functions. That is, it contains functions that take
other functions as their arguments. In programming, the argument functions are
called first-class functions or function pointers. There is a real distinction between
the vector-valued function x (i.e., Vector3 position(float time) ... ) and the
vector value of that function at time t , x ( t ) (i.e., Vector3 currentPosition; ).
Passing the wrong one as an argument will lead to programming errors. We there-
fore always keep the derivatives in function notation for this chapter. However, be
warned that in the animation literature it is commonplace to move between the
variable and function notation.
Here's one critical example of this notation. When discussing numerical inte-
gration schemes that dominate the dynamics portion of this chapter, we distin-
guish three fundamental representations. The position of an object (which may
represent only position, or may be extended with other information) is x ( t ) , which
is a vector-valued function. The elements of the vector may be, for example, x -,
y -, and z -coordinates, or those coordinates and rotational (and other pose) infor-
mation. Since there may be many objects in a system, or many points on a single
object, we consider a set of functions. When evaluated at t , their values are denoted
x 1 ( t ) , x 2 ( t ) , etc. The state function of the entire system, which comprises the entire
set of position functions and their derivatives, is written X ( t ) when evaluated at
time t . The state function is defined for continuous t .
When we approximate the state function with a numerical integrator that takes
discrete steps, we refer to the values of the state function at given step indices.
 
Search WWH ::




Custom Search