AJ170 Smiroberto 99

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Multi-Layer Implicit Garment Models

Roberto E. Pérez-Urbiola
Isaac Rudomı́n G.
Instituto Tecnológico y de Estudios Superiores de Monterrey
Campus Estado de México
Km. 3.5 Carretera Lago de Guadalupe
Atizapán de Zaragoza, Estado de México, CP 52926. México
rperez@campus.cem.itesm.mx
rudomin@campus.cem.itesm.mx

Abstract proximate the appearance of hanging cloth from its corners.


Hybrid techniques combine geometric approaches with
This paper presents a new way to model clothing worn by some sort of physical phase. Rudomı́n [13] approximates
articulated implicit characters. A scalar field is produced the initial state of draping cloth on an object with its convex
using ellipsoids as primitives. Isosurfaces are then used to hull, then continues with physical simulation.
place garments in one or more layers. As each implicit sur- Terzopoulos et al. [14] generalised deformable model
face is independent, collision detection is not needed. The was one of the first physical methods introduced. Neverthe-
cloth is a polygonal mesh whose vertices are in turn moved less, it requires solving a large system of simultaneous ordi-
towards their destination isosurface using the gradient of nary differential equations.
the scalar field. In order to maintain the cloth’s shape and Since then, physical methods have been commonly sim-
size a net of simple springs is used. We improve appearance ulated by calculating the actual forces and energies involved
by adding noise to simulate wrinkles and light wind. in a grid of particles. For static views of cloth, a minimum
energy state is searched. For dynamics, it is necessary to in-
tegrate the equations using Euler or Runge-Kutta.
1. Introduction Breen et al. [5][9] employ an interacting-particle model
which is based on the microstructure of woven cloth.
Computer animations that we can see today consist The modelling of clothing worn by virtual actors has been
mostly of rigid solid objects. Lately, however, we are start- investigated by Thalmann et al. [19]. Their algorithm is
ing to see flexible objects being used more often. generic enough to handle cloth by itself (i.e. clothing with-
Solid objects are usually described by a polygon mesh out a person under it) [15]. They pursue physically accurate
that is too complex to manage in a vertex by vertex way, clothing coupled with an optimised algorithm for collision
as is often the case when dealing with flexible characters. detection [16]. References to their hierarchical collision de-
Implicit surfaces can be used to model them. An implicit tection solution and other algorithms can be found in [17].
surface is defined as all the points that satisfy the condition Their clothing systems [19][18] include a collision detection
F (x; y; z ) = k in a given three dimensional scalar field. engine, a mechanical simulation engine, software for human
Different constants k refer to separate isosurfaces. body modelling and deformation, garment design and sim-
In order to create realistic articulated soft objects, we ulation, and a graphical interface. Garments are first assem-
can use ellipsoids in combination with blending functions bled from panels and latter placed on a human model.
to shape the scalar field. Our articulated model is similar to Baraff et al. [1] has dramatically reduced the time needed
Wilhelms’ [21] and includes a skeleton, joints and muscles. to perform implicit integration which allows the simulation
Many researchers are working in the cloth design, mod- to advance in larger steps that with either Euler or Runge-
elling and animation [4][10], with various approaches. Kutta.
Both physical and geometric methods have been used to Nevertheless, the issue of multiple layers of clothing has
model cloth. Geometric approaches try to imitate the shape not yet been addressed. The problem is the large amount of
of cloth. For example, Weil [20] uses catenary curves to ap- time needed for calculating collision detection.
In this paper, we propose a hybrid method where we take
advantage of the scalar field generated by the implicit sur-
faces to handle multiple layer clothing. This method avoids
the computation of collisions since each layer is placed on a
different isosurface. The isosurfaces are obtained from the
same ellipsoidal primitives that we use to model the char-
acters. A polygonal mesh with springs is used to maintain
the cloth’s shape and size. Moving the cloth is simplified by
storing the vertex’s positions relative to local coordinate sys-
tem of the nearest ellipsoid. Optionally, sinusoidal noise is
added to increase realism.
The rest of the paper is organised as follows: we first in-
troduce the use of implicit surfaces to model clothing. Then,
we outline the articulated objects used. We continue with
the garments’ design, placement and appearance. Next, we
summarise the implementation and results, and finally, we
discuss future work.

2. Implicit Surfaces for Modelling Clothing


Figure 1. Using isosurfaces to place gar-
ments
The fundamental idea behind the work described in this
paper is to use implicit surfaces for modelling clothing of
implicit articulated characters.
Clothing is usually worn by humans in layers, however, root controls the position and orientation of the character.
in computer graphics this is hardly ever animated due to the Each segment is a local coordinate system whose origin is
time needed for calculating collision detection. We solve the used as a joint.
problem by using isosurfaces that surround the subject. As Ellipsoids are specified by the two ends of the main axis,
the scalar field can not have two different values for a given the volume, the orientation of a second axis and the ratio be-
point, we conclude that we can place each layer of clothing tween the second and third axis. The coordinates are given
in different isosurfaces without having to worry much about in the local coordinate system of the segment to which they
collisions. See figure 1. are attached. It is possible to specify different segments for
To accomplish this, we first have to create a scalar each end point. See figure 2.
field. We designed our character using ellipsoidal primitives
blended together using a formula introduced by Blinn [2]:

g(r) = ae,br
2

In our case, r is the distance to the centre of a sphere,


while the constants a and b equal one and 0.8 respectively.
The sphere is also scaled and rotated to adjust it to the axis
and orientation of the desired ellipsoid.
Each layer of clothing is assigned to a different isosur-
face. In order to maintain a similar distance between the lay-
ers, offset isosurfaces were considered, but discarded later
because the required numerical method was too expensive.
Instead, long ellipsoids where replaced by two or three more Figure 2. The three points shown, the volume
spherical ones. and the ratio of axis 1 and 2 define an ellip-
soid.
3. Implicit Articulated Objects
The character is animated by changing the joints’ angles
The model for implicit articulated objects used is a sim- and axes of rotation. This data was stored in a text file. As
plification of the one presented in Wilhelms’ article [21]. the animation proceeds, ellipsoids are automatically moved
A hierarchy of skeleton elements is implemented where the and reshaped without any other user intervention. We calcu-
late the lengths of the three axes to preserve the volume of
the individual ellipsoids at each frame. Nevertheless, the fi-
nal volume might vary due to the blending operations. In [6]
local volume variations are corrected but were not imple-
mented for this research.
Blending groups (of ellipsoids) and the following steps
avoid unwanted joining of nearby members:
 To calculate the value of the scalar field at a point
(x; y; z ):

– Compute the sum of all the ellipsoids in each


blending group. Ellipsoids can belong to more
than one group.
– We select the highest value from the groups.
We first used marching cubes [3] to display the isosur-
face of the character, but later we changed to pieces of “skin”
placed as we describe in section 5.

4. Garment Design
Figure 4. Correspondence between polygons,
Garments consist of pieces of clothing to be worn on dif- springs, triangles and vertices.
ferent layers. The design of each piece is performed in a
Computer Aided Design program, using quadrilateral and
triangular elements. See figure 3.
We found that the cloth’s shape didn’t need to be a per-
fect match with the isosurface, because we kept the cloth at-
tached to it. Nevertheless, any extra cloth was cut in order
to prevent the mesh from folding over itself.

5. Garment Placement

Pieces’ vertices are locked to the respective isosurface


using the gradient of the scalar field, like in Witkin and
Heckbert [22][8]. So far, the number of particles remains
constant but multi-resolution extensions of the method pre-
sented in this article could change that.
The gradient is easily calculated due to the nature of the
blending function (an exponential, already described in sec-
tion 2). The direction in which we have to move a parti-
cle that is outside or inside the target isosurface is decided
by comparing the scalar field value at the particle’s position
with the desired value of the isosurface.
The isosurface-locking algorithm is:

 For each vertex:


Figure 3. A sample garment before using iso-
surfaces. – The value of the scalar field is calculated at the
vertex’s position.
– If the value is close enough to the target isosur-
Springs are added to each side of the polygons and
face, we are done with this vertex.
between opposite corners in the quadrilateral elements as
shown in figure 4. – The gradient at the point is obtained.
– If the value of the field is higher than the isosur- system of the nearest ellipsoid in the vicinity (more about
face sought, we subtract from the vertex’s posi- this below). After the joints have been calculated the world
tion the unitary vector of the gradient multiplied coordinates of the vertices are updated. This allows the ma-
by a small predefined distance. Otherwise, we jority of the vertices to be very close to their final position
add this same vector. for the frame.
– If a maximum number of iterations has been With vicinity in the previous paragraph, we refer to the
reached, we continue with the next vertex. fact that a vertex is restricted to move from adjacent blend-
ing groups only. That is, a vertex whose coordinates were
The method combines the isosurface’s lock that holds assigned to the isosurface of an arm can only stay there or
the pieces in place with springs that approximately preserve move to the elbow, it can not jump to the isosurface gener-
cloths’ size and shape. ated by the thorax ellipsoids.
The algorithm for the springs is simple. All the springs The final corrections and movements of the clothing are
try to move their vertices in order to arrive to a rest distance. done combining the isosurface-locking algorithm with the
The sum of the effect of all the springs is what finally adjusts spring algorithm. In our model we use an I-S-I-S-I combi-
the positions. The spring algorithm follows: nation per frame where I is an execution of the isosurface-
locking algorithm and S is a run of the spring algorithm.
 The displacement variable for all vertices is set to zero.
 For each spring: 6. Appearance
– We accumulate the distance that the vertices i and
In order to improve the appearance of clothing it is nec-
j of the spring r will move:
essary to simulate the wrinkles and some sort of wind-like
dir + = (vj , vi ) 
jvj , vi j , r )  r
( movement.
jvj , vi j We considered some alternatives. We could use a tex-
ture map, either bump or displacement based. Unfortunately
(jv , v j , r )  r
djr , = (vj , vi )  j i the time (in the order of minutes) required for displacement
jvj , vi j mapping using flow fields [11] is beyond our goals. In gen-
Where dir is the displacement that vertex i (of
eral, displacement textures using the normal of the surface
spring r) will have. vi , vj are the positions of
could be used but would have problems with multi-layer
clothing, as collisions are likely to occur. Bump mapping
the vertices expressed in terms of the global co-
would require the recalculation of the texture bitmaps in or-
ordinate system. r is the rest distance of spring
der to produce moving wrinkles. Finally, applying textures
r. r controls the amount of movement. Finally
+= and ,= are the usual C language operators. directly to the isosurface proves too costly (also in the or-
der of minutes per frame), because a parameterisation is re-
 Optionally, we check that no vertex is moved more than quired as shown in [12].
a user-defined distance. This is especially useful when We settled for the option of adding noise to the scalar
the constant r is greater than 0.20. field, as it is simple and it can be controlled to give the im-
pression of light wind. In addition, the noise function can
 We can restrict the displacement direction to the tan- be designed to be continuous so that the layers do not col-
gent plane of the isosurface. This is expensive because lide even after it is added.
we need to calculate the gradient for every vertex even A noise scalar field is generated from the ellipsoids,
when the final position is close enough to the isosur- where each one contributes with six sinusoidal functions
face. In our tests, it was faster to let the isosurface- that vary in frequency and amplitude. Even these character-
locking algorithm take care of the errors. istics vary in time to avoid cyclic effects and achieve wind-
 The vertices’ positions are updated according to the fi- like movements of the cloth.
nal values of the displacement variables. The noise is consistent in time, as it is based on the el-
lipsoids. It moves with the character’s limbs. For example,
Before the first frame, it is necessary to position the cloth a wrinkle in an arm doesn’t suddenly disappear as the arm
close to the object, and then run the previously described al- moves.
gorithms many times until we reach a stable initial state. The noise is added to the value of the isosurface searched.
During the animation, a great amount of movement oc- This could cause some self-collisions between adjacent lay-
curs that would be expensive to compensate only by means ers, but was, in most cases, solved by calculating the noise
of the above algorithms. Instead, before each frame, the po- before every iteration of the isosurface-locking algorithm,
sition of each vertex is saved in terms of the local coordinate this way, the layers converge into a non-penetrating state. In
Method Seconds including Colour Plate 3 shows the same character and clothing
1 second to write the with wrinkles, rendered with BMRT (Blue Moon Render-
VRML file to disk. ing Tools). The use of shadows enhanced the overall appear-
Noise & spring-projection 7.7 sec/frame ance.
Noise only 6.4 sec/frame
Spring-projection only 4.6 sec/frame 8. Conclusions and Future Work
Plain algorithm 3.3 sec/frame
When working with multiple layers of clothing, colli-
Table 1. Statistics of a 40-frame animation. sion detection is usually a time consuming process. We
presented a method that combines implicit surfaces with
multiple-layer garment modelling that makes that phase un-
the few cases where they didn’t, it was because not enough necessary. The algorithms presented are focused in cloth-
iterations were made or because the triangles intersected due ing for articulated implicit characters. Special attention was
to the curvature. given to the garments’ size, shape and placement.
This approach can be complemented by more investiga-
7. Implementation and Results tion in the following areas:

The code was written in C. VRML was output with a


 Lower cost noise, one that doesn’t need to be constantly
calculated in order for the layer to converge into a non-
speed of 6.4 sec/frame (5.4 sec discounting the VRML gen-
penetrating state or one that does not use the expensive
eration), considering a total of 12,000 triangles in three cloth sine functions.
layers with noise (quadrilaterals were split to display them).
See Colour Plate 1. The tests were done in a Pentium II at  Textures should be mapped correctly to the garments.
233Mhz with 96MB RAM. Clothing without wrinkles was
as fast as 2.3 sec/frame, discounting the time needed to write  Modelling software designed for this approach would
the VRML file. Table 1 contains more details. provide better-looking characters and clothing for the
In the table, noise refers to the sinusoidal functions added animations.
to improve appearance, while the spring-projection con-  Some springs calculations could be avoided, at least
strains the movements caused by the springs to the plane tan- in the second iteration of a frame, if we identify the
gent to the isosurface. As we can see, the spring-projections springs that affected insignificantly their vertices in the
lowers the amount of displacements towards the isosurface previous iteration.
but requires too much time.
The animation was performed without collision detec-  Adding physics and other effects could be investigated.
tion, but as desired, the layers of clothing behaved well For example, by applying deformations from impacts
thanks to the isosurface-locking algorithm. It is possible to directly to the isosurface as in [7].
use parallelism, as each garment is independent, they can be
computed separately.
 Shapes that differ from the character’s silhouette can be
implemented. For example, skirts could benefit from
The springs helped, mainly at the joints, to adjust the gar-
modifications made to the scalar field after the char-
ments’ size and prevent polygon deformation.
acter has been polygonized. Likewise, Flared trousers
The clothing automatically followed the character, while
can be modeled by adding some ellipsoids to the legs or
maintaining its shape and size closely. The constraint that
by letting the vertices move using physics, but limited
avoids a vertex to jump to the wrong isosurface worked well
between two isosurfaces. See figure 5.
but not perfectly, still if the concavities are very pronounced
the vertices may move from vicinities and not be able to find  Resolution of the mesh could vary depending on the
their way back naturally. Our model required some fine- curvature of the isosurface.
tuning of the ellipsoids and blending groups in the armpit
section.  Buttons, pins and alike can be added. Collisions could
Texture was added experimentally, simply by specifying be avoided by generating an extra contribution to the
it in the VRML file (see Colour Plate 2). While VRML did scalar field before attaching the next clothing layer.
a fine job showing the textures’ potential, it doesn’t map the  Clothing by itself using isosurfaces, with no character
texture consistently and uniformly throughout the frames. wearing it, is still an open research subject.
This isn’t a limitation of the model, the mesh can be param-
eterised for texture mapping as any other, but for now, we  Dressed avatars could be obtained with a simplifica-
didn’t implement this. tion of this approach and a lower resolution.
[7] M.-P. Gascuel. An implicit formulation for precise contact
modeling between flexible solids. Computer Graphics (SIG-
GRAPH ’93 Proceedings), 27:313–320, August 1993.
[8] P. S. Heckbert. Fast surface particle repulsion. In SIG-
GRAPH ’97, New Frontiers in Modeling and Texturing
Course, pages 95–114. ACM Press, August 1997.
[9] D. H. House, R. W. DeVaul, and D. E. Breen. Towards sim-
ulating cloth dynamics using interacting particles. Interna-
tional Journal of Clothing Science and Technology, 8(3):75–
94, February 1996.
[10] H. N. Ng and R. L. Grimsdale. Computer graphics tech-
niques for modeling cloth. IEEE Computer Graphics and
Applications, 16(5):28–41, September 1996.
[11] H. K. Pedersen. Displacement mapping using flow fields.
Computer Graphics (SIGGRAPH ’94 Proceedings), 28:279–
286, July 1994.
[12] H. K. Pedersen. Decorating implicit surfaces. Computer
Graphics (SIGGRAPH ’95 Proceedings), 29:291–300, Au-
gust 1995.
[13] I. Rudomı́n. Simulating cloth using a mixed geometric-
physical method. Ph.D. thesis, Department of Computer
and Information Science, University of Pennsylvania, Au-
gust 1990.
Figure 5. Flared trousers. A) Using an extra
[14] D. Terzopoulos, J. Platt, A. Barr, and K. Fleischer. Elastically
ellipsoid. B) Using two isosurfaces as bound- deformable models. Computer Graphics (SIGGRAPH ’87
aries. Proceedings), 21(4):205–214, July 1987.
[15] P. Volino, M. Courchesne, and N. Magnenat Thalmann. Ver-
satile and efficient techniques for simulating cloth and other
9. Acknowledgements deformable objects. Computer Graphics (SIGGRAPH ’95
Proceedings), 29:137–144, August 1995.
[16] P. Volino and N. Magnenat Thalmann. Efficient self-collision
This article is a summary of the Master thesis presented detection on smoothly discretised surface animations using
by R. Pérez, who thanks his thesis advisor I. Rudomı́n for geometrical shape regularity. Computer Graphics Forum
the insights given, and the reviewers for the corrections. (Eurographics ’94 Proceedings), 13(3):155–166, September
1994.
[17] P. Volino and N. Magnenat Thalmann. Collision and self-
References collision detection: Efficient and robust solutions for highly
deformable surfaces. In D. Terzopoulos and D. Thalmann,
[1] D. Baraff and A. Witkin. Large steps in cloth simulation. In editors, Computer Animation and Simulation ’95, pages 55–
M. Cohen, editor, SIGGRAPH 98 Conference Proceedings, 65. Eurographics, Springer-Verlag, September 1995.
Annual Conference Series, pages 43–54. ACM SIGGRAPH, [18] P. Volino and N. Magnenat Thalmann. Developing simula-
Addison Wesley, July 1998. tion techniques for an interactive clothing system. In Inter-
national Conference on Virtual Systems and Multimedia ’97
[2] J. F. Blinn. A generalization of algebraic surface drawing.
Proceedings, pages 109–118, Geneve, Switzerland, Septem-
ACM Transactions on Graphics, 1(3):235–256, July 1982.
ber 1997. International Society on Virtual Systems and Mul-
[3] J. Bloomenthal. An implicit surface polygonizer. In P. Heck-
timedia.
bert, editor, Graphics Gems IV, pages 324–349. Academic [19] P. Volino, N. Magnenat Thalmann, S. Jianhua, and D. Thal-
Press, Boston, 1994.
mann. An evolving system for simulating clothes on vir-
[4] D. E. Breen, J. W. Eischen, M. Kass, N. Magnenat Thal- tual actors. IEEE Computer Graphics and Applications,
mann, and M. Vecchione. Can we get there from here?: 16(5):42–51, September 1996.
Current challenges in cloth design, modeling, and anima- [20] J. Weil. The synthesis of cloth objects. Computer Graphics
tion. Computer Graphics (SIGGRAPH ’97 Proceedings), (SIGGRAPH ’86 Proceedings), 20(4):49–54, August 1986.
31(3A):437–439, August 1997. [21] J. Wilhelms. Animals with anatomy. IEEE Computer Graph-
[5] D. E. Breen, D. H. House, and M. J. Wozny. A particle-based ics and Applications, 17(3):22–30, May/June 1997.
model for simulating the draping behavior of woven cloth. [22] A. P. Witkin and P. S. Heckbert. Using particles to sam-
Textile Research Journal, 64(11):663–685, November 1994. ple and control implicit surfaces. Computer Graphics (SIG-
[6] M. Desbrun and M.-P. Gascuel. Animating soft substances GRAPH ’94 Proceedings), 28:269–278, July 1994.
with implicit surfaces. Computer Graphics (SIGGRAPH ’95
Proceedings), 29:287–290, August 1995.

You might also like