This disclosure is directed to simulating the motion of thin and long objects (“strands” as such hair) in the field of computer graphics, and specifically for approximating strands for computer enabled animation.
Media productions employ increasingly complex computer enabled animations to produce realistic images. Examples of strands that improve an animation's realism include depictions of long hair, wavy or curly hair, braids, animal ears, tails, foliage, and jewelry.
Strands are typically represented in animation by curves. Because computer graphics generated curves are computer resource intensive to animate, it is desirable to approximate curves during parts of the animation process to reduce computer processing time and memory requirements.
The viability of animating strands using approximations depends on a computer enabled animation system's ability to approximate accurately and quickly. The present approach produces line segments that approximate strands represented by B-spline curves, and vice versa, accurately and quickly to support computer enabled animation processes.
Computer enabled animation systems consist of multiple parts. In some parts of the system, it is desirable to operate on strands that are represented by B-spline curves because of curves' mathematical properties. In other parts of the system, it is desirable to operate on line segment approximations of strands because line segments improve efficiency.
In one embodiment, a conventional part of the animation system, called a dynamics simulator, operates on line segment approximations of strands. The present approach can function with different dynamics simulators. U.S. patent application publication number 2009/0091575 A1, incorporated herein by reference in its entirety, discloses a relevant dynamics simulator. The present approach can also function with conventional commercial animation software such as Autodesk® Maya®.
Other parts of the animation system upstream and downstream from the dynamics simulator, however, operate on B-spine curve representation of strands. For instance, another conventional part of the animation system, called a rendering module, operates on B-spine curve representations of strands. Rendering may also be carried out in different ways. The present approach functions with DreamWorks Animation's proprietary “EMO” and “RIG” animation tools.
The present method and apparatus produces line segment approximations of strands represented by curves. The present approach also produces curved representations of line segment approximations after the strand approximations have been simulated. This has the advantage of producing approximations accurately and quickly to enable animation.
One skilled in the art will recognize that the present approach may be implemented in various parts of a computer enabled animation system, including but not limited to dynamics simulators, and that strands may be depicted in two, or three dimensions.
In one embodiment, each strand is represented by one endpoint interpolating cubic uniform B-spline curve (hereafter “B-spline curve”). In general, let N denote the number of control vertices in a B-spline curve. Endpoint interpolating cubic B-spline curves are controlled by at least four control vertices (i.e., N≧4). A uniform B-spline curve is one where the intervals between successive control vertices are equal.
Let Ck denote control vertices of a B-spline curve indexed by k. For example, the control vertices of a curve having six control vertices (N=6) may be denoted as C0 . . . C5, or, Ck where 0≦k≦N−1.
In the present approach, control vertices of a B-spline curve are treated as points in affine space. Affine combinations require that the coefficients of affine points in the combination sum up to one. Thus, a three-point affine combination (Ak) of B-spline control vertices (Ck) is defined as:
Ak=αkCk+αk−1Ck−1+αk+1Ck+1
where αk+αk−1+ak+1=1 (2)
A section of a curve is approximated based on whether it is at, near, or away from the curve's endpoints. Three-point affine combinations Ak are considered “away” from a curve's endpoints where 3≦k≦N−4. Three-point affine combinations Ak are considered “at or near” a curve's endpoints where (0≦k<3 or N−4<k<N). Three-point affine combinations Ak for B-spline curves having four or five control vertices (N=4 or N=5) are given special consideration. Approximations “away” from endpoints are discussed first. Approximations “at or near” endpoints are discussed subsequently. Finally, curves of special symmetry are discussed.
Approximations away from endpoints are discussed first. Three-point affine combinations Ak are considered away from a curve's endpoints where 3≦k≦N−4, N>5.
An approximation's geometry should not change if the sequence of control vertices is reversed. In other words, an approximation calculated from the perspective of control vertices sequence of C0, C1, . . . CN−1 should be the same as an approximation calculated from the perspective of sequence CN−1, CN−2, . . . C0. This is because the same potion of the curve is being approximated; only the perspective of control vertices has been reversed. Consequently, for affine combinations away from the endpoints, equation (2) is simplified by applying equal weight to control vertices adjacent to Ck (i.e., Ck−1 and Ck+1) so that the affine combination is symmetric. Because αk−1=αk+1, equation (2) simplifies into:
Equation (3) calculates affine combinations (Ak) away from a B-spline curve's endpoints. Ck−1, Ck, Ck+1 is a sequence of three successive control points of the B-spline curve. In
Affine combinations are used as line segment vertices of the line segment approximation. Once each affine combination (Ak) away from a B-spline curve's endpoints is determined, each pair of successive affine combinations (i.e., Ak and Ak+1) is connected with a line segment.
One skilled in the art will recognize that strands may be represented mathematically by different types of curves with different numbers of control vertices (i.e., N), and that affine combinations of different orders (i.e., n) may be used. For example, it is also possible to represent strands using free-end B-spline curves, Catmull-Rom spline curves, or Parabolic spline curves. One skilled in the art will thus be able to apply the present method on various types of curves, with different numbers of control vertices and affine combinations, including but not limited to the examples described above.
Equation (3) provides a family of resulting affine combinations for different values of parameter “α.” Of these resulting affine combinations, some are better approximations than others. It is desirable to determine a such that line segments connecting affine combinations most closely approximates their respective portions of the curve (“arcs”). It is also desirable to determine α independently of any particular curve, such that a general equation may be derived to approximate any B-spline curve accurately.
The present approach allows the value of α to vary. Thus, it is desirable to determine an optimized value of α, such that a line segment (e.g., 402) and the arc (e.g., 404) it approximates are approximately equal in length.
The length of an arc of radius 1 connecting arc endpoints 514 and 516 is:
Length=Rθ (5)
Affine combinations 524 and 526 are on a circle of radius RA:
RA=α+(1−α)cos θ (6)
The length of a line segment 522 connecting affine combinations 524 and 526 is:
The goal is to derive α such that the length of line segment 522 (equation 7) is as equal as possible to the length of the B-spline curve segment 512 (equation 5):
One skilled in the art will recognize that line segment 522 and arc 512 become closer in length as angle θ is reduced. Therefore, it is desirable to determine if a finite, well defined value exists for α as θ approaches zero:
A value of α=¾ exists as θ approaches zero. Using this value, line segments (e.g., 522) that are approximately equal in length to the arcs (e.g., 512) being approximated may be calculated. Applying α=¾ to equation (3) yields a general equation for approximating B-spline curve segments with line segments of approximately equal length:
Approximations at or near curve endpoints are now discussed. Three-point affine combinations Ak are considered at or near a curve's endpoints where (0<k<3 or N−4<k<N). In
A0=C0 (12)
An end-point interpolating cubic uniform B-spline curve with control vertices C0, C1, and C2 (602, 604, 606) shares the same arc 600 with a free-end cubic uniform B-spline curve with successive control vertices C′0, C2, and C3 (618, 606, 608). Given this characteristic, control vertex C0 (618) may be described as a function of control vertices C1 (604), and C2 (606).
In general, the knot sequence of an endpoint-interpolating uniform B-spline curve is:
{u0,u1,u2,u3,u4, . . . }={0,0,0,1,2, . . . } (13)
Control vertices correspond to parameter values known as Greville abscissas which are obtained from knots using the formula:
Applying equation (14) to knot sequences (13), the following sequence of Greville abscissas is obtained:
Relationships between Greville abscissas and B-spline curve control vertices are explored in knot insertion algorithms; see G. Farin, Curves and Surfaces for Computer Aided Geometric Design, (Academic Press, 1997): 143-147. The relationship allows C1 to be written as a function of Greville abscissas and control vertices:
And C′0 (618) may be derived:
The affine combination A2 (654) is obtained by combining equation (17) with equation (11):
In determining A1, it is noted that the optimized value of α previously calculated (and used by equation (11)) is not applicable near the endpoints of a curve. The general equation form of an affine combination is used again to determine A1. Here, the weight corresponding to C0 is twice that of the weight corresponding to C2. This is in proportion to the intervals separating the corresponding Greville abscissas (14).
The affine combination A1 is well defined as long as coefficient α1 is chosen such that all three coefficients of the affine combination are non-zero, positive, and add up to 1. In other words,
A new optimized value α1 is determined by equating the length of arc 600 with the lengths of the two line segments 656 and 658. Using the same approach shown by equations (4)-(10), a well defined value of α1=0.172 is found as θ approaches zero.
One skilled in the art will recognize that as long as
a computer enabled animation system performing floating point calculations will be able to carry out equation (19) whether α1 equals
or 0.167. For subsequent discussion, an approximated value of
is used to describe the present approach more easily.
In summary, we obtain the following affine combinations for approximation at or near the endpoints of a curve:
By symmetry, at the curve's opposite end:
The case of B-spline curves with four control vertices is now discussed.
C′3=2C2−C1 (24)
Once each affine combination (Ak) near a B-spline curve's endpoints is determined, each pair of successive affine combinations (i.e., Ak and Ak+1) is connected with a line segment. The endpoints of the curve are not connected to each other. In this way, line segments approximating portions of the curve near its endpoints is determined. Naturally, these line segments connect to the chain of line segments previously determined for portions of the curve away from the endpoints. In this way, a plurality of line segments approximating the entire B-spline curve is determined.
Substituting equation (24) into equation (20) yields:
By symmetry, at the curve's opposite end:
Finally:
A0=C0 (27)
A3=C3 (28)
The configuration of control vertices in
Thus, we obtain the following affine combinations:
A0=C0 (12, repeated)
By symmetry, at the opposite end of the B-spline curve:
For the discussion below, it is helpful to recognize the present approach can be described in linear equation form. Conversion between a line segment representation (A) and a B-spline curve representation (C) of an object (and vice versa) may be represented by the linear equation:
A=MNC (33)
where MN is a matrix of affine coefficients for a curve with N control vertices
MN represents affine coefficients computed using the equations discussed above. Examples of affine coefficient matrices MN computed using equations discussed above are:
Linear equation (33) makes clear that the process of determining an unknown approximation (A) from a known B-spline curve (B) and known affine coefficients (MN) involves basic linear algebra. One skilled in the art will recognize that this calculation is relatively simple, and thus, manageable for a computer enabled animation system even if large numbers of strands are approximated.
Furthermore, equation (33) also represents the conversion of approximated strands back to B-spine curve representations after simulation. In linear algebra, however, it can be computationally intensive to determine an unknown C from a known A and a known MN using equation (31).
The issue of computational efficiency is addressed, first by recognizing that the present approach allows affine combinations (e.g., matrices (32)-(35)) for a curve to be managed as a tridiagonal matrix (MN). Equation (37) expands upon equation (31) to show the tridiagonal arrangement of affine coefficients mi,k in matrix MN:
Methods of solving linear equations with tridiagonal matrices are well documented. Equation (37) may be solved using the well-known tridiagonal matrix algorithm (TDMA). TDMA solves equation (37) for control vertices (C) in a number of operations that is linearly proportional to the size of MN. This performance allows the present approach to function within a computer enabled animation system.
In one embodiment, the present approach provides processes downstream from the dynamics simulator with B-spine curve representations of simulated strands in a linear number of operations. The curve, in B-spline curve representation, is then processed by the rendering module and displayed to the user. One skilled in the art will recognize that the present approach may be used in other parts of a computer enabled animation system, including but not limited to, dynamics simulators.
The present approach is typically implemented in the form of computer software (code) executed on a computer. The computer may be a general-purpose computer including, for example, a processor, memory, storage, and input/output devices (e.g., monitor, keyboard, disk drive, Internet connection, etc.). However, the computer may include circuitry or other specialized hardware for carrying out some or all aspects of the processes. In some operational settings, the apparatus may be configured as a system that includes one or more units, each of which is configured to carry out some aspects of the processes either in software, in hardware or in some combination thereof.
Coding the computer software program, in light of this disclosure, would be routine; a suitable computer language is C++. The software itself would typically be stored in source code or compiled form on a computer readable storage medium, such as a hard disk, disk, tape, flash memory, CD-R, DVD, memory, so forth, for execution by the computer processor. At least some values based on the results of the processes can be saved, either in temporary storage (e.g., memory) or permanent storage (e.g., disk) for later use (e.g., display or further processing).
One skilled in the art will recognize that
Furthermore, the use of storage 1014 by different modules may differ. One skilled in the art will recognize that the usage of computer storage during processing also affects performance and scalability. As such, usage strategies are likely to be implementation and/or data specific.
This disclosure is illustrative and not limiting; further modification will be apparent to those skilled in the art in light of this disclosure. Accordingly, all such modifications are intended to be included within the scope of this invention. Figures provided with this disclosure are meant to be illustrative, and may focus on specific features of the preset approach. They may be not drawn to scale.
Number | Name | Date | Kind |
---|---|---|---|
4620287 | Yam | Oct 1986 | A |
5133052 | Bier et al. | Jul 1992 | A |
5261033 | Oka | Nov 1993 | A |
6097396 | Rouet et al. | Aug 2000 | A |
6268846 | Georgiev | Jul 2001 | B1 |
6366927 | Meek et al. | Apr 2002 | B1 |
6559849 | Anderson et al. | May 2003 | B1 |
6587745 | Polden et al. | Jul 2003 | B1 |
6903742 | Fushiki et al. | Jun 2005 | B1 |
6904151 | Deguillaume et al. | Jun 2005 | B2 |
7496416 | Ferguson et al. | Feb 2009 | B2 |
20090027398 | Frisken | Jan 2009 | A1 |
20090040218 | Museth et al. | Feb 2009 | A1 |
Number | Date | Country | |
---|---|---|---|
20100045679 A1 | Feb 2010 | US |