Top Banner

of 159

Efficient Collision Detection for Animation and Robotics - Ming C Lin

Apr 10, 2018

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    1/159

    E c i e n t C o l l i s i o n D e t e c t i o n f o r

    A n i m a t i o n a n d R o b o t i c s

    M i n g C . L i n

    D e p a r t m e n t o f E l e c t r i c a l E n g i n e e r i n g

    a n d C o m p u t e r S c i e n c e

    U n i v e r s i t y o f C a l i f o r n i a , B e r k e l e y

    B e r k e l e y , C A ,

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    2/159

    E c i e n t C o l l i s i o n D e t e c t i o n f o r A n i m a t i o n a n d R o b o t i c s

    b y

    M i n g C h i e h L i n

    B . S . U n i v e r s i t y o f C a l i f o r n i a a t B e r k e l e y 1 9 8 8

    M . S . U n i v e r s i t y o f C a l i f o r n i a a t B e r k e l e y 1 9 9 1

    A d i s s e r t a t i o n s u b m i t t e d i n p a r t i a l s a t i s f a c t i o n o f t h e

    r e q u i r e m e n t s f o r t h e d e g r e e o f

    D o c t o r o f P h i l o s o p h y

    i n

    E n g i n e e r i n g - E l e c t r i c a l E n g i n e e r i n g

    a n d C o m p u t e r S c i e n c e s

    i n t h e

    G R A D U A T E D I V I S I O N

    o f t h e

    U N I V E R S I T Y o f C A L I F O R N I A a t B E R K E L E Y

    C o m m i t t e e i n c h a r g e :

    P r o f e s s o r J o h n F . C a n n y , C h a i r

    P r o f e s s o r R o n a l d F e a r i n g

    P r o f e s s o r A n d r e w P a c k a r d

    1 9 9 3

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    3/159

    E c i e n t C o l l i s i o n D e t e c t i o n f o r A n i m a t i o n a n d R o b o t i c s

    C o p y r i g h t

    c

    1 9 9 3

    b y

    M i n g C h i e h L i n

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    4/159

    i

    A b s t r a c t

    E c i e n t C o l l i s i o n D e t e c t i o n f o r A n i m a t i o n a n d R o b o t i c s

    b y

    M i n g C h i e h L i n

    D o c t o r o f P h i l o s o p h y i n E l e c t r i c a l E n g i n e e r i n g

    a n d C o m p u t e r S c i e n c e

    U n i v e r s i t y o f C a l i f o r n i a a t B e r k e l e y

    P r o f e s s o r J o h n F . C a n n y , C h a i r

    W e p r e s e n t e c i e n t a l g o r i t h m s f o r c o l l i s i o n d e t e c t i o n a n d c o n t a c t d e t e r m i n a -

    t i o n b e t w e e n g e o m e t r i c m o d e l s , d e s c r i b e d b y l i n e a r o r c u r v e d b o u n d a r i e s , u n d e r g o i n g

    r i g i d m o t i o n . T h e h e a r t o f o u r c o l l i s i o n d e t e c t i o n a l g o r i t h m i s a s i m p l e a n d f a s t

    i n c r e m e n t a l m e t h o d t o c o m p u t e t h e d i s t a n c e b e t w e e n t w o c o n v e x p o l y h e d r a . I t u t i -

    l i z e s c o n v e x i t y t o e s t a b l i s h s o m e l o c a l a p p l i c a b i l i t y c r i t e r i a f o r v e r i f y i n g t h e c l o s e s t

    f e a t u r e s . A p r e p r o c e s s i n g p r o c e d u r e i s u s e d t o s u b d i v i d e e a c h f e a t u r e ' s n e i g h b o r i n g

    f e a t u r e s t o a c o n s t a n t s i z e a n d t h u s g u a r a n t e e e x p e c t e d c o n s t a n t r u n n i n g t i m e f o r

    e a c h t e s t .

    T h e e x p e c t e d c o n s t a n t t i m e p e r f o r m a n c e i s a n a t t r i b u t e f r o m e x p l o i t i n g t h e

    g e o m e t r i c c o h e r e n c e a n d l o c a l i t y . L e t n b e t h e t o t a l n u m b e r o f f e a t u r e s , t h e e x p e c t e d

    r u n t i m e i s b e t w e e n O

    p

    n a n d O n d e p e n d i n g o n t h e s h a p e , i f n o s p e c i a l i n i t i a l -

    i z a t i o n i s d o n e . T h i s t e c h n i q u e c a n b e u s e d f o r d y n a m i c c o l l i s i o n d e t e c t i o n , p l a n n i n g

    i n t h r e e - d i m e n s i o n a l s p a c e , p h y s i c a l s i m u l a t i o n , a n d o t h e r r o b o t i c s p r o b l e m s .

    T h e s e t o f m o d e l s w e c o n s i d e r i n c l u d e s p o l y h e d r a a n d o b j e c t s w i t h s u r f a c e s

    d e s c r i b e d b y r a t i o n a l s p l i n e p a t c h e s o r p i e c e w i s e a l g e b r a i c f u n c t i o n s . W e u s e t h e

    e x p e c t e d c o n s t a n t t i m e d i s t a n c e c o m p u t a t i o n a l g o r i t h m f o r c o l l i s i o n d e t e c t i o n b e -

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    5/159

    i i

    t w e e n c o n v e x p o l y h e d r a l o b j e c t s a n d e x t e n d i t u s i n g a h i e r a r c h i c a l r e p r e s e n t a t i o n t o

    d i s t a n c e m e a s u r e m e n t b e t w e e n n o n - c o n v e x p o l y t o p e s . N e x t , w e u s e g l o b a l a l g e b r a i c

    m e t h o d s f o r s o l v i n g p o l y n o m i a l e q u a t i o n s a n d t h e h i e r a r c h i c a l d e s c r i p t i o n t o d e v i s e

    e c i e n t a l g o r i t h m s f o r a r b i t r a r y c u r v e d o b j e c t s .

    W e a l s o d e s c r i b e t w o d i e r e n t a p p r o a c h e s t o r e d u c e t h e f r e q u e n c y o f c o l l i -

    s i o n d e t e c t i o n f r o m

    0

    @

    N

    2

    1

    A

    p a i r w i s e c o m p a r i s o n s i n a n e n v i r o n m e n t w i t h n m o v i n g

    o b j e c t s . O n e o f t h e m i s t o u s e a p r i o r i t y q u e u e s o r t e d b y a l o w e r b o u n d o n t i m e t o

    c o l l i s i o n ; t h e o t h e r u s e s a n o v e r l a p t e s t o n b o u n d i n g b o x e s .

    F i n a l l y , w e p r e s e n t a n o p p o r t u n i s t i c g l o b a l p a t h p l a n n e r a l g o r i t h m w h i c h

    u s e s t h e i n c r e m e n t a l d i s t a n c e c o m p u t a t i o n a l g o r i t h m t o t r a c e o u t a o n e - d i m e n s i o n a l

    s k e l e t o n f o r t h e p u r p o s e o f r o b o t m o t i o n p l a n n i n g .

    T h e p e r f o r m a n c e o f t h e d i s t a n c e c o m p u t a t i o n a n d c o l l i s i o n d e t e c t i o n a l g o -

    r i t h m s a t t e s t s t h e i r p r o m i s e f o r r e a l - t i m e d y n a m i c s i m u l a t i o n s a s w e l l a s a p p l i c a t i o n s

    i n a c o m p u t e r g e n e r a t e d v i r t u a l e n v i r o n m e n t .

    A p p r o v e d : J o h n F . C a n n y

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    6/159

    i i i

    A c k n o w l e d g e m e n t s

    T h e s u c c e s s f u l c o m p l e t i o n o f t h i s t h e s i s i s t h e r e s u l t o f t h e h e l p , c o o p -

    e r a t i o n , f a i t h a n d s u p p o r t o f m a n y p e o p l e .

    F i r s t o f a l l , I w o u l d l i k e t o t h a n k P r o f e s s o r J o h n C a n n y f o r t h e i n -

    s i g h t f u l d i s c u s s i o n s w e h a d , h i s g u i d a n c e d u r i n g m y g r a d u a t e s t u d i e s a t

    B e r k e l e y , h i s p a t i e n c e a n d s u p p o r t t h r o u g h s o m e o f t h e w o r s t t i m e s i n

    m y l i f e . S o m e o f t h e r e s u l t s i n t h i s t h e s i s w o u l d n o t h a v e b e e n p o s s i b l e

    w i t h o u t h i s s u g g e s t i o n s a n d f e e d b a c k s .

    I a m a l s o g r a t e f u l t o a l l m y c o m m i t t e e m e m b e r s P r o f e s s o r R . F e a r -

    i n g , A . P a c k a r d , a n d J . M a l i k , e s p e c a i l l y P r o f e s s o r R o n a l d F e a r i n g a n d

    A n d r e w P a c k a r d f o r c a r e f u l l y p r o o f r e a d i n g m y t h e s i s a n d p r o v i d i n g c o n -

    s t r u c t i v e c r i t i c i s m .

    I w o u l d l i k e t o e x t e n d m y s i n c e r e a p p r e c i a t i o n t o P r o f e s s o r D i n e s h

    M a n o c h a f o r h i s c h e e r f u l s u p p o r t a n d c o l l a b o r a t i o n , a n d f o r s h a r i n g h i s

    i n v a l u a b l e e x p e r i e n c e i n j o b h u n t i n g " . P a r t s o f C h a p t e r 4 a n d a s e c t i o n

    o f C h a p t e r 5 i n t h i s t h e s i s a r e t h e r e s u l t o f o u r j o i n t w o r k .

    S p e c i a l t h a n k s a r e d u e t o B r i a n M i r t i c h f o r h i s h e l p i n r e - i m p l e m e n t i n g

    t h e d i s t a n c e a l g o r i t h m d e s c r i b e d i n C h a p t e r 3 i n A N S I C , t h o r o u g h

    t e s t i n g , b u g r e p o r t i n g , a n d h i s i n p u t t o t h e r o b u s t n e s s o f t h e d i s t a n c e

    c o m p u t a t i o n f o r c o n v e x p o l y h e d r a .

    I w i s h t o a c k n o w l e d g e P r o f e s s o r D a v i d B a r a a t C a r n e g i e M e l l o n U n i -

    v e r s i t y f o r t h e d i s c u s s i o n w e h a d o n o n e - d i m e n s i o n a l s w e e p i n g m e t h o d . I

    w o u l d a l s o l i k e t o t h a n k P r o f e s s o r R a i m o n d S e i d e l a n d P r o f e s s o r H e r b e r t

    E d e l s b r u n n e r f o r c o m m e n t s o n r e c t a n g l e i n t e r s e c t i o n a n d c o n v e x d e c o m -

    p o s i t i o n a l g o r i t h m s ; a n d t o P r o f e s s o r G e o r g e V a n e c e k o f P u r d u e U n i v e r -

    s i t y a n d P r o f e s s o r J a m e s C r e m e r f o r d i s c u s s i o n s o n c o n t a c t a n a l y s i s a n d

    d y n a m i c s .

    I a l s o a p p r e c i a t e t h e c h a n c e t o c o n v e r s e a b o u t o u r w o r k t h r o u g h e l e c -

    t r o n i c m a i l c o r r e s p o n d e n c e , t e l e p h o n e c o n v e r s a t i o n , a n d i n - p e r s o n i n t e r -

    a c t i o n w i t h D r . D a v i d S t r i p e i n S a n d i a N a t i o n a l L a b , R i c h a r d M a s t r o a n d

    K a r e l Z i k a n i n B o e i n g . T h e s e d i s c u s s i o n s h e l p e d m e d i s c o v e r s o m e o f t h e

    p o s s i b l e r e s e a r c h p r o b l e m s I n e e d t o a d d r e s s a s w e l l a s f u t u r e a p p l i c a t i o n

    a r e a s f o r o u r c o l l i s i o n d e t e c t i o n a l g o r i t h m s .

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    7/159

    i v

    I w o u l d a l s o l i k e t o t h a n k a l l m y l o n g t i m e c o l l e g e p a l s : Y v o n n e a n d

    R o b e r t H o u , C a r o l i n e a n d G a n i J u s u f , A l f r e d Y e u n g , L e s l i e F i e l d , D e v

    C h e n a n d G a u t a m D o s h i . T h a n k y o u a l l f o r t h e l a s t s i x , s e v e n y e a r s o f

    f r i e n d s h i p a n d s u p p o r t , e s p e c i a l l y w h e n I w a s a t D e n v e r . B e r k e l e y c a n

    n e v e r b e t h e s a m e w t h o u t y o u ! ! !

    A n d , I a m n o t f o r g e t t i n g y o u a l l : I s a b e l l M a z o n , t h e C a n n y G a n g " ,

    a n d a l l m y 3 0 + o c e m a t e s a n d l a b m a t e s f o r a l l t h e i n t e l l e c t u a l c o n v e r -

    s a t i o n s a n d c a s u a l c h a t t i n g . T h a n k s f o r t h e 3 3 3 C o r y H a l l a n d R o b o t i c s

    L a b m e m o r i e s , a s w e l l a s t h e m a n y f u n h o u r s w e s h a r e d t o g e t h e r .

    I a l s o w i s h t o e x p r e s s m y g r a t i t u d e t o D r . C o l b e r t f o r h e r g e n u i n e c a r e ,

    1 0 0 a t t e n t i v e n e s s , a n d b u o y a n t s p i r i t . H e r v i v a c i t y w a s c o n t a g i o u s . I

    c o u l d n o t h a v e m a d e i t w i t h o u t h e r !

    L a s t b u t n o t l e a s t , I w o u l d l i k e t o t h a n k m y f a m i l y , w h o a r e a l w a y s

    s u p p o r t i v e , c a r i n g , a n d m a i n l y r e s p o n s i b l e f o r m y e n o r m o u s a m o u n t o f

    h u g e p h o n e b i l l s . I h a v e g o n e t h r o u g h s o m e t r a u m a t i c e x p e r i e n c e s d u r i n g

    m y y e a r s a t C A L , b u t t h e y h a v e b e e n t h e r e t o c a t c h m e w h e n I f e l l , t o

    s t a n d b y m y s i d e w h e n I w a s d o w n , a n d w e r e A L W A Y S t h e r e f o r m e n o

    m a t t e r w h a t h a p p e n e d . I w o u l d l i k e t o a c k n o w l e d g e t h e m f o r b e i n g m y

    m o r a l b a c k b o n e " , e s p e c i a l l y t o D a d a n d M o m , w h o t a u g h t m e t o b e

    s t r o n g i n t h e f a c e o f a l l a d v e r s i t i e s .

    M i n g C . L i n

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    8/159

    v

    C o n t e n t s

    L i s t o f F i g u r e s v i i i

    1 I n t r o d u c t i o n 1

    1 . 1 P r e v i o u s W o r k : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 4

    1 . 2 O v e r v i e w o f t h e T h e s i s : : : : : : : : : : : : : : : : : : : : : : : : : : 9

    2 B a c k g r o u n d 1 2

    2 . 1 B a s i c C o n c e n p t s : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 2

    2 . 1 . 1 M o d e l R e p r e s e n t a t i o n s : : : : : : : : : : : : : : : : : : : : : : 1 2

    2 . 1 . 2 D a t a S t r u c t u r e s a n d B a s i c T e r m i n o l o g y : : : : : : : : : : : : : 1 4

    2 . 1 . 3 V o r o n o i D i a g r a m : : : : : : : : : : : : : : : : : : : : : : : : : 1 6

    2 . 1 . 4 V o r o n o i R e g i o n : : : : : : : : : : : : : : : : : : : : : : : : : : 1 7

    2 . 2 O b j e c t M o d e l i n g : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 7

    2 . 2 . 1 M o t i o n D e s c r i p t i o n : : : : : : : : : : : : : : : : : : : : : : : : 1 8

    2 . 2 . 2 S y s t e m o f A l g e b r a i c E q u a t i o n s : : : : : : : : : : : : : : : : : : 1 9

    3 A n I n c r e m e n t a l D i s t a n c e C o m p u t a t i o n A l g o r i t h m 2 1

    3 . 1 C l o s e s t F e a t u r e P a i r : : : : : : : : : : : : : : : : : : : : : : : : : : : 2 2

    3 . 2 A p p l i c a b i l i t y C r i t e r i a : : : : : : : : : : : : : : : : : : : : : : : : : : : 2 5

    3 . 2 . 1 P o i n t - V e r t e x A p p l i c a b i l i t y C r i t e r i o n : : : : : : : : : : : : : : : 2 5

    3 . 2 . 2 P o i n t - E d g e A p p l i c a b i l i t y C r i t e r i o n : : : : : : : : : : : : : : : 2 5

    3 . 2 . 3 P o i n t - F a c e A p p l i c a b i l i t y C r i t e r i o n : : : : : : : : : : : : : : : : 2 6

    3 . 2 . 4 S u b d i v i s i o n P r o c e d u r e : : : : : : : : : : : : : : : : : : : : : : 2 8

    3 . 2 . 5 I m p l e m e n t a t i o n I s s u e s : : : : : : : : : : : : : : : : : : : : : : 2 9

    3 . 3 T h e A l g o r i t h m : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 3 2

    3 . 3 . 1 D e s c r i p t i o n o f t h e O v e r a l l A p p r o a c h : : : : : : : : : : : : : : 3 2

    3 . 3 . 2 G e o m e t r i c S u b r o u t i n e s : : : : : : : : : : : : : : : : : : : : : : 3 6

    3 . 3 . 3 A n a l y s i s o f t h e A l g o r i t h m : : : : : : : : : : : : : : : : : : : : 3 8

    3 . 3 . 4 E x p e c t e d R u n n i n g T i m e : : : : : : : : : : : : : : : : : : : : : 3 9

    3 . 4 P r o o f o f C o m p l e t e n e s s : : : : : : : : : : : : : : : : : : : : : : : : : : 4 0

    3 . 5 N u m e r i c a l E x p e r i m e n t s : : : : : : : : : : : : : : : : : : : : : : : : : : 5 2

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    9/159

    v i

    3 . 6 D y n a m i c C o l l i s i o n D e t e c t i o n f o r C o n v e x P o l y h e d r a : : : : : : : : : : 5 6

    4 E x t e n s i o n t o N o n - C o n v e x O b j e c t s a n d C u r v e d O b j e c t s 5 8

    4 . 1 C o l l i s i o n D e t e c t i o n f o r N o n - c o n v e x O b j e c t s : : : : : : : : : : : : : : : 5 8

    4 . 1 . 1 S u b - P a r t H i e r a r c h i c a l T r e e R e p r e s e n t a t i o n : : : : : : : : : : : 5 8

    4 . 1 . 2 D e t e c t i o n f o r N o n - C o n v e x P o l y h e d r a : : : : : : : : : : : : : : 6 1

    4 . 2 C o l l i s i o n D e t e c t i o n f o r C u r v e d O b j e c t s : : : : : : : : : : : : : : : : : 6 4

    4 . 2 . 1 C o l l i s i o n D e t e c t i o n a n d S u r f a c e I n t e r s e c t i o n : : : : : : : : : : 6 4

    4 . 2 . 2 C l o s e s t F e a t u r e s : : : : : : : : : : : : : : : : : : : : : : : : : : 6 4

    4 . 2 . 3 C o n t a c t F o r m u l a t i o n : : : : : : : : : : : : : : : : : : : : : : : 6 8

    4 . 3 C o h e r e n c e f o r C o l l i s i o n D e t e c t i o n b e t w e e n C u r v e d O b j e c t s : : : : : : 7 1

    4 . 3 . 1 A p p r o x i m a t i n g C u r v e d O b j e c t s b y P o l y h e d r a l M o d e l s : : : : : 7 1

    4 . 3 . 2 C o n v e x C u r v e d S u r f a c e s : : : : : : : : : : : : : : : : : : : : : 7 2

    4 . 3 . 3 N o n - C o n v e x C u r v e d O b j e c t s : : : : : : : : : : : : : : : : : : : 7 4

    5 I n t e r f e r e n c e T e s t s f o r M u l t i p l e O b j e c t s 7 7

    5 . 1 S c h e d u l i n g S c h e m e : : : : : : : : : : : : : : : : : : : : : : : : : : : : 7 8

    5 . 1 . 1 B o u n d i n g T i m e t o C o l l i s i o n : : : : : : : : : : : : : : : : : : : 7 8

    5 . 1 . 2 T h e O v e r a l l A p p r o a c h : : : : : : : : : : : : : : : : : : : : : : 8 0

    5 . 2 S w e e p & S o r t a n d I n t e r v a l T r e e : : : : : : : : : : : : : : : : : : : : : 8 1

    5 . 2 . 1 U s i n g B o u n d i n g V o l u m e s : : : : : : : : : : : : : : : : : : : : : 8 1

    5 . 2 . 2 O n e - D i m e n s i o n a l S o r t a n d S w e e p : : : : : : : : : : : : : : : : 8 4

    5 . 2 . 3 I n t e r v a l T r e e f o r 2 D I n t e r s e c t i o n T e s t s : : : : : : : : : : : : : 8 5

    5 . 3 O t h e r A p p r o a c h e s : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 8 6

    5 . 3 . 1 B S P - T r e e s a n d O c t r e e s : : : : : : : : : : : : : : : : : : : : : : 8 6

    5 . 3 . 2 U n i f o r m S p a t i a l S u b d i v i s i o n : : : : : : : : : : : : : : : : : : : 8 7

    5 . 4 A p p l i c a t i o n s i n D y n a m i c S i m u l a t i o n a n d V i r t u a l E n v i r o n m e n t : : : : 8 7

    6 A n O p p o r t u n i s t i c G l o b a l P a t h P l a n n e r 8 9

    6 . 1 B a c k g r o u n d : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 9 0

    6 . 2 A M a x i m u m C l e a r a n c e R o a d m a p A l g o r i t h m : : : : : : : : : : : : : : 9 2

    6 . 2 . 1 D e n i t i o n s : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 9 2

    6 . 2 . 2 T h e G e n e r a l R o a d m a p : : : : : : : : : : : : : : : : : : : : : : 9 3

    6 . 3 D e n i n g t h e D i s t a n c e F u n c t i o n : : : : : : : : : : : : : : : : : : : : : 9 9

    6 . 4 A l g o r i t h m D e t a i l s : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 0 0

    6 . 4 . 1 F r e e w a y s a n d B r i d g e s : : : : : : : : : : : : : : : : : : : : : : : 1 0 1

    6 . 4 . 2 T w o - D i m e n s i o n a l W o r k s p a c e : : : : : : : : : : : : : : : : : : : 1 0 3

    6 . 4 . 3 T h r e e - D i m e n s i o n a l W o r k s p a c e : : : : : : : : : : : : : : : : : : 1 0 6

    6 . 4 . 4 P a t h O p t i m i z a t i o n : : : : : : : : : : : : : : : : : : : : : : : : 1 0 7

    6 . 5 P r o o f o f C o m p l e t e n e s s f o r a n O p p o r t u n i s t i c G l o b a l P a t h P l a n n e r 1 0 8

    6 . 6 C o m p l e x i t y B o u n d : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 1 4

    6 . 7 G e o m e t r i c R e l a t i o n s b e t w e e n C r i t i c a l P o i n t s a n d C o n t a c t C o n s t r a i n t s 1 1 4

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    10/159

    v i i

    6 . 8 B r i e f D i s c u s s i o n : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 1 6

    7 C o n c l u s i o n s 1 1 8

    7 . 1 S u m m a r y : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 1 8

    7 . 2 F u t u r e W o r k : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 1 9

    7 . 2 . 1 O v e r l a p D e t e c t i o n f o r C o n v e x P o l y h e d r a : : : : : : : : : : : : 1 2 0

    7 . 2 . 2 I n t e r s e c t i o n T e s t f o r C o n c a v e O b j e c t s : : : : : : : : : : : : : : 1 2 1

    7 . 2 . 3 C o l l i s i o n D e t e c t i o n f o r D e f o r m a b l e o b j e c t s : : : : : : : : : : : 1 2 3

    7 . 2 . 4 C o l l i s i o n R e s p o n s e : : : : : : : : : : : : : : : : : : : : : : : : 1 2 5

    B i b l i o g r a p h y 1 2 7

    A C a l c u l a t i n g t h e N e a r e s t P o i n t s b e t w e e n T w o F e a t u r e s 1 3 6

    B P s e u d o C o d e o f t h e D i s t a n c e A l g o r i t h m 1 3 9

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    11/159

    v i i i

    L i s t o f F i g u r e s

    2 . 1 A w i n g e d e d g e r e p r e s e n t a t i o n : : : : : : : : : : : : : : : : : : : : : : 1 5

    3 . 1 A p p l i c a b i l i t y T e s t : F

    a

    ; V

    b

    ! E

    a

    ; V

    b

    s i n c e V

    b

    f a i l s t h e a p p l i c a b i l i t y

    t e s t i m p o s e d b y t h e c o n s t r a i n t p l a n e C P R

    1

    a n d R

    2

    a r e t h e V o r o n o i

    r e g i o n s o f F

    a

    a n d E

    a

    r e s p e c t i v e l y . : : : : : : : : : : : : : : : : : : : : 2 4

    3 . 2 P o i n t - V e r t e x A p p l i c a b i l i t y C r i t e r i o n : : : : : : : : : : : : : : : : : : : 2 6

    3 . 3 P o i n t - E d g e A p p l i c a b i l i t y C r i t e r i o n : : : : : : : : : : : : : : : : : : : : 2 7

    3 . 4 V e r t e x - F a c e A p p l i c a b i l i t y C r i t e r i o n : : : : : : : : : : : : : : : : : : : 2 8

    3 . 5 P r e p r o c e s s i n g o f a v e r t e x ' s c o n i c a l a p p l i c a b i l i t y r e g i o n a n d a f a c e ' s

    c y l i n d r i c a l a p p l i c a b i l i t y r e g i o n : : : : : : : : : : : : : : : : : : : : : : 3 0

    3 . 6 A n e x a m p l e o f F l a r e d V o r o n o i C e l l s : C P

    F

    c o r r e s p o n d s t o t h e a r e d

    c o n s t r a i n t p l a c e C P o f a f a c e a n d C P

    E

    c o r r e s p o n d s t o t h e a r e d c o n -

    s t r a i n t p l a n e C P o f a n e d g e . R

    0

    1

    a n d R

    0

    2

    a r e t h e a r e d V o r o n o i r e g i o n s

    o f u n p e r t u r b e d R

    1

    a n d R

    2

    . N o t e t h a t t h e y o v e r l a p e a c h o t h e r . : : : : 3 1

    3 . 7 a A n o v e r h e a d v i e w o f a n e d g e l y i n g a b o v e a f a c e b A s i d e v i e w o f

    t h e f a c e o u t w a r d n o r m a l b o u n d e d b y t h e t w o o u t w a r d n o r m a l s o f t h e

    e d g e ' s l e f t a n d r i g h t f a c e s . : : : : : : : : : : : : : : : : : : : : : : : : 3 5

    3 . 8 A S i d e V i e w f o r P o i n t - V e r t e x A p p l i c a b i l i t y C r i t e r i o n P r o o f : : : : : : 4 3

    3 . 9 A n O v e r h e a d V i e w f o r P o i n t - E d g e A p p l i c a b i l i t y C r i t e r i o n P r o o f 4 4

    3 . 1 0 A S i d e V i e w f o r P o i n t - E d g e A p p l i c a b i l i t y C r i t e r i o n P r o o f : : : : : : : 4 4

    3 . 1 1 A S i d e V i e w f o r P o i n t - F a c e A p p l i c a b i l i t y C r i t e r i o n P r o o f : : : : : : : 4 5

    3 . 1 2 C o m p u t a t i o n t i m e v s . t o t a l n o . o f v e r t i c e s : : : : : : : : : : : : : : : 5 3

    3 . 1 3 P o l y t o p e s U s e d i n E x a m p l e C o m p u t a t i o n s : : : : : : : : : : : : : : : 5 5

    4 . 1 A n e x a m p l e o f s u b - p a r t h i e r a r c h y t r e e : : : : : : : : : : : : : : : : : 5 9

    4 . 2 A n e x a m p l e f o r n o n - c o n v e x o b j e c t s : : : : : : : : : : : : : : : : : : : 6 3

    4 . 3 T a n g e n t i a l i n t e r s e c t i o n a n d b o u n d a r y i n t e r s e c t i o n b e t w e e n t w o B e z i e r

    s u r f a c e s : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 6 7

    4 . 4 C l o s e s t f e a t u r e s b e t w e e n t w o d i e r e n t o r i e n t a t i o n s o f a c y l i n d e r 7 1

    4 . 5 H i e r a r c h i c a l r e p r e s e n t a t i o n o f a t o r u s c o m p o s e d o f B e z i e r s u r f a c e s 7 5

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    12/159

    i x

    6 . 1 A s c h e m a t i z e d 2 - d c o n g u r a t i o n s p a c e a n d t h e p a r t i t i o n o f f r e e s p a c e

    i n t o x

    1

    - c h a n n e l s . : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 9 4

    6 . 2 T w o c h a n n e l s C

    1

    a n d C

    2

    j o i n i n g t h e c h a n n e l C

    3

    , a n d a b r i d g e c u r v e i n

    C

    3

    : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 9 6

    6 . 3 A p i c t o r i a l e x a m p l e o f a n i n e c t i o n p o i n t i n C S R v s . i t s v i e w i n

    R y a t t h e s l i c e x = x

    0

    : : : : : : : : : : : : : : : : : : : : : : : : : 1 0 3

    6 . 4 A n e x a m p l e o f t h e a l g o r i t h m i n t h e 2 - d w o r k s p a c e : : : : : : : : : : : 1 0 5

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    13/159

    1

    C h a p t e r 1

    I n t r o d u c t i o n

    T h e p r o b l e m o f c o l l i s i o n d e t e c t i o n o r c o n t a c t d e t e r m i n a t i o n b e t w e e n t w o

    o r m o r e o b j e c t s i s f u n d a m e n t a l t o c o m p u t e r a n i m a t i o n , p h y s i c a l b a s e d m o d e l i n g ,

    m o l e c u l a r m o d e l i n g , c o m p u t e r s i m u l a t e d e n v i r o n m e n t s e . g . v i r t u a l e n v i r o n m e n t s

    a n d r o b o t m o t i o n p l a n n i n g a s w e l l 3 , 7 , 1 2 , 2 0 , 4 3 , 4 5 , 6 3 , 6 9 , 7 0 , 7 2 , 8 2 , 8 5 . D e -

    p e n d i n g o n t h e c o n t e n t o f a p p l i c a t i o n s , i t i s a l s o c a l l e d w i t h m a n y d i e r e n t n a m e s ,

    s u c h a s i n t e r f e r e n c e d e t e c t i o n , c l a s h d e t e c t i o n , i n t e r s e c t i o n t e s t s , e t c . I n r o b o t i c s ,

    a n e s s e n t i a l c o m p o n e n t o f r o b o t m o t i o n p l a n n i n g a n d c o l l i s i o n a v o i d a n c e i s a g e o -

    m e t r i c r e a s o n i n g s y s t e m w h i c h c a n d e t e c t p o t e n t i a l c o n t a c t s a n d d e t e r m i n e t h e e x a c t

    c o l l i s i o n p o i n t s b e t w e e n t h e r o b o t m a n i p u l a t o r a n d t h e o b s t a c l e s i n t h e w o r k s p a c e .

    A l t h o u g h i t d o e s n ' t p r o v i d e a c o m p l e t e s o l u t i o n t o t h e p a t h p l a n n i n g a n d o b s t a c l e

    a v o i d a n c e p r o b l e m s , i t o f t e n s e r v e s a s a g o o d i n d i c a t o r t o s t e e r t h e r o b o t a w a y f r o m

    i t s s u r r o u n d i n g o b s t a c l e s b e f o r e a n a c t u a l c o l l i s i o n o c c u r s .

    S i m i l a r l y , i n c o m p u t e r a n i m a t i o n , i n t e r a c t i o n s a m o n g o b j e c t s a r e s i m u l a t e d

    b y m o d e l i n g t h e c o n t a c t c o n s t r a i n t s a n d i m p a c t d y n a m i c s . S i n c e p r o m p t r e c o g n i t i o n

    o f p o s s i b l e i m p a c t s i s a k e y t o s u c c e s s f u l r e s p o n s e t o c o l l i s i o n s i n a t i m e l y f a s h i o n , a

    s i m p l e y e t e c i e n t a l g o r i t h m f o r c o l l i s i o n d e t e c t i o n i s i m p o r t a n t f o r f a s t a n d r e a l i s t i c

    a n i m a t i o n a n d s i m u l a t i o n o f m o v i n g o b j e c t s . T h e i n t e r f e r e n c e d e t e c t i o n p r o b l e m

    h a s b e e n c o n s i d e r e d o n e o f t h e m a j o r b o t t l e n e c k s i n a c h e i v i n g r e a l - t i m e d y n a m i c

    s i m u l a t i o n .

    C o l l i s i o n d e t e c t i o n i s a l s o a n i n t e g r a l p a r t o f m a n y n e w , e x c i t i n g t e c h n o l o g -

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    14/159

    2

    i c a l d e v e l o p m e n t s . V i r t u a l p r o t o t y p i n g s y s t e m s c r e a t e e l e c t r o n i c r e p r e s e n t a t i o n s o f

    m e c h a n i c a l p a r t s , t o o l s , a n d m a c h i n e s , w h i c h n e e d t o b e t e s t e d f o r i n t e r c o n n e c t i v i t y ,

    f u n c t i o n a l i t y , a n d r e l i a b i l i t y . T h e g o a l o f t h e s e s y s t e m s i s t o s a v e p r o c e s s i n g a n d

    m a n u f a c t u r i n g c o s t s b y a v o i d i n g t h e a c t u a l p h y s i c a l m a n u f a c t u r e o f p r o t o t y p e s . T h i s

    i s s i m i l a r t o t h e g o a l o f C A D t o o l s f o r V L S I , e x c e p t t h a t v i r t u a l p r o t o t y p i n g i s m o r e

    d e m a n d i n g . I t r e q u i r e s a c o m p l e t e t e s t e n v i r o n m e n t c o n t a i n i n g h u n d r e d s o f p a r t s ,

    w h o s e c o m p l e x i n t e r a c t i o n s a r e b a s e d o n p h y s i c s a n d g e o m e t r y . C o l l i s i o n d e t e c t i o n

    i s v i t a l c o m p o n e n t o f s u c h e n v i r o n m e n t s .

    A n o t h e r a r e a o f r i s i n g i n t e r e s t s i s s y n t h e t i c e n v i r o n m e n t , c o m m o n l y k n o w n

    a s v i r t u a l r e a l i t y " w h i c h i s a c o m p r e h e n s i v e t e r m p r o m o t i n g m u c h h y p e s a n d h o p e s .

    I n a s y n t h e t i c e n v i r o n m e n t , v i r t u a l o b j e c t s m o s t o f t h e m s t a t i o n a r y a r e c r e a t e d a n d

    p l a c e d i n t h e w o r l d . A h u m a n p a r t i c i p a n t m a y w i s h t o m o v e t h e v i r t u a l o b j e c t s o r

    a l t e r t h e s c e n e . S u c h a s i m p l e a c t i o n a s t o u c h i n g a n d g r a s p i n g i n v o l v e s g e o m e t r i c

    c o n t a c t s . A c o l l i s i o n d e t e c t i o n a l g o r i t h m m u s t b e i m p l e m e n t e d t o a c h i e v e a n y d e g r e e

    o f r e a l i s m f o r s u c h a b a s i c m o t i o n . H o w e v e r , o f t e n t h e r e a r e h u n d r e d s , e v e n t h o u s a n d s

    o f o b j e c t s i n t h e v i r t u a l w o r l d , a n a i v e a l g o r i t h m w o u l d p r o b a b l y t a k e h o u r s j u s t t o

    c h e c k f o r p o s s i b l e i n t e r f e r e n c e w h e n e v e r a h u m a n p a r t i c i p a n t m o v e s . T h i s i s n o t

    a c c e p t a b l e f o r a n i n t e r a c t i v e v i r t u a l e n v i r o n m e n t . T h e r e f o r e , a s i m p l e y e t e c i e n t

    c o l l i s i o n d e t e c t i o n a l g o r i t h m i s a l m o s t i n d i s p e n s a b l e t o a n i n t e r a c t i v e , r e a l i s t i c v i r t u a l

    e n v i r o n m e n t .

    T h e o b j e c t i v e o f c o l l i s i o n d e t e c t i o n i s t o a u t o m a t i c a l l y r e p o r t a g e o m e t r i c

    c o n t a c t w h e n i t i s a b o u t t o o c c u r o r h a s a c t u a l l y o c c u r r e d . I t i s t y p i c a l l y u s e d i n o r d e r

    t o s i m u l a t e t h e p h y s i c s o f m o v i n g o b j e c t s , o r t o p r o v i d e t h e g e o m e t r i c i n f o r m a t i o n

    w h i c h i s n e e d e d i n p a t h p l a n n i n g f o r r o b o t s . T h e s t a t i c c o l l i s i o n d e t e c t i o n p r o b l e m

    i s o f t e n s t u d i e d a n d t h e n l a t e r e x t e n d e d t o a d y n a m i c e n v i r o n m e n t . H o w e v e r , t h e

    c h o i c e o f s t e p s i z e c a n e a s i l y a e c t t h e o u t c o m e o f t h e d y n a m i c a l g o r i t h m s . I f t h e

    p o s i t i o n a n d o r i e n t a t i o n o f t h e o b j e c t s i s k n o w n i n a d v a n c e , t h e c o l l i s i o n d e t e c t i o n

    c a n b e s o l v e d a s a f u n c t i o n o f t i m e .

    A r e l a t e d p r o b l e m t o c o l l i s i o n d e t e c t i o n i s d e t e r m i n i n g t h e m i n i m u m E u -

    c l i d e a n d i s t a n c e b e t w e e n t w o o b j e c t s . T h e E u c l i d e a n d i s t a n c e b e t w e e n t w o o b j e c t s

    i s a n a t u r a l m e a s u r e m e n t o f p r o x i m i t y f o r r e a s o n i n g a b o u t t h e i r s p a t i a l r e l a t i o n s h i p .

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    15/159

    3

    A d y n a m i c s o l u t i o n t o d e t e r m i n i n g t h e m i n i m u m s e p a r a t i o n b e t w e e n t w o m o v i n g

    o b j e c t s c a n b e a u s e f u l t o o l i n s o l v i n g t h e i n t e r f e r e n c e d e t e c t i o n p r o b l e m , s i n c e t h e

    d i s t a n c e m e a s u r e m e n t p r o v i d e s a l l t h e n e c e s s a r y l o c a l g e o m e t r i c i n f o r m a t i o n a n d t h e

    s o l u t i o n t o t h e p r o x i m i t y q u e s t i o n b e t w e e n t w o o b j e c t s . H o w e v e r , i t i s n o t n e c e s s a r y

    t o d e t e r m i n e t h e e x a c t a m o u n t o f s e p a r a t i o n o r p e n e t r a t i o n b e t w e e n t w o o b j e c t s t o

    d e c i d e w h e t h e r a c o l l i s i o n h a s t a k e n p l a c e o r n o t . T h a t i s , d e t e r m i n i n g t h e m i n i m u m

    s e p a r a t i o n o r m a x i m u m p e n e t r a t i o n m a k e s a m u c h s t r o n g e r s t a t e m e n t t h a n w h a t

    i s n e c e s s a r y t o a n s w e r t h e c o l l i s i o n d e t e c t i o n p r o b l e m . B u t , t h i s a d d i t i o n a l k n o w l -

    e d g e c a n b e e x t r e m e l y u s e f u l i n c o m p u t i n g t h e i n t e r a c t i o n f o r c e s a n d o t h e r p e n a l t y

    f u n c t i o n s i n m o t i o n p l a n n i n g .

    C o l l i s i o n d e t e c t i o n i s u s u a l l y c o u p l e d w i t h a n a p p r o p r i a t e r e s p o n s e t o t h e

    c o l l i s i o n . T h e c o l l i s i o n r e s p o n s e i s g e n e r a l l y a p p l i c a t i o n d e p e n d e n t a n d m a n y a l g o -

    r i t h m s h a v e b e e n p r o p o s e d f o r d i e r e n t e n v i r o n m e n t s l i k e m o t i o n c o n t r o l i n a n i m a -

    t i o n b y M o o r e a n d W i l h e l m 6 3 , p h y s i c a l s i m u l a t i o n s b y B a r a , H a h n , P e n t l a n d a n d

    W i l l i a m s 3 , 4 3 , 7 0 o r m o l e c u l a r m o d e l i n g b y T u r k 8 5 . S i n c e s i m p l i c i t y a n d e a s e o f

    i m p l e m e n t a t i o n i s c o n s i d e r e d a s o n e o f t h e i m p o r t a n t f a c t o r s f o r a n y p r a c t i c a l a l g o -

    r i t h m i n t h e c o m p u t e r g r a p h i c s c o m m u n i t y , m o s t c o l l i s i o n d e t e c t i o n a l g o r i t h m s u s e d

    f o r c o m p u t e r a n i m a t i o n a r e r a t h e r s i m p l e b u t n o t n e c e s s a r y e c i e n t . T h e s i m p l e s t

    a l g o r i t h m s f o r c o l l i s i o n d e t e c t i o n a r e b a s e d u p o n u s i n g b o u n d i n g v o l u m e s a n d s p a t i a l

    d e c o m p o s i t i o n t e c h n i q u e s . T y p i c a l e x a m p l e s o f b o u n d i n g v o l u m e s i n c l u d e c u b o i d s ,

    s p h e r e s , o c t r e e s e t c . , a n d t h e y a r e c h o s e n d u e t o t h e s i m p l i c i t y o f n d i n g c o l l i s i o n s

    b e t w e e n t w o s u c h v o l u m e s . O n c e t h e t w o o b j e c t s a r e i n t h e v i c i n i t y o f e a c h o t h e r ,

    s p a t i a l d e c o m p o s i t i o n t e c h n i q u e s b a s e d o n s u b d i v i s i o n a r e u s e d t o s o l v e t h e i n t e r f e r -

    e n c e p r o b l e m . R e c u r s i v e s u b d i v i s i o n i s r o b u s t b u t c o m p u t a t i o n a l l y e x p e n s i v e , a n d i t

    o f t e n r e q u i r e s s u b s t a n t i a l l y m o r e m e m o r y . F u r t h e r m o r e t h e c o n v e r g e n c e t o t h e s o l u -

    t i o n c o r r e s p o n d i n g t o t h e c o n t a c t p o i n t i s l i n e a r . R e p e a t i n g t h e s e s t e p s a t e a c h t i m e

    i n s t a n t m a k e s t h e o v e r a l l a l g o r i t h m v e r y s l o w . T h e r u n t i m e i m p a c t o f a s u b d i v i s i o n

    b a s e d c o l l i s i o n d e t e c t i o n a l g o r i t h m o n t h e p h y s i c a l s i m u l a t i o n h a s b e e n h i g h l i g h t e d

    b y H a h n 4 3 .

    A s i n t e r e s t i n d y n a m i c s i m u l a t i o n s h a s b e e n r i s i n g i n c o m p u t e r g r a p h i c s

    a n d r o b o t i c s , c o l l i s i o n d e t e c t i o n h a s a l s o r e c e i v e d a g r e a t d e a l o f a t t e n t i o n . T h e i m -

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    16/159

    4

    p o r t a n c e o f c o l l i s i o n d e t e c t i o n e x t e n d s t o s e v e r a l a r e a s l i k e r o b o t m o t i o n p l a n n i n g ,

    d y n a m i c s i m u l a t i o n , v i r t u a l r e a l i t y a p p l i c a t i o n s a n d i t h a s b e e n e x t e n s i v e l y s t u d i e d

    i n r o b o t i c s , c o m p u t a t i o n a l g e o m e t r y , a n d c o m p u t e r g r a p h i c s f o r m o r e t h a n a d e c a d e

    3 , 4 , 1 1 , 1 3 , 1 7 , 4 1 , 4 3 , 4 5 , 5 1 , 5 3 , 6 3 . Y e t , t h e r e i s n o p r a c t i c a l , e c i e n t a l g o -

    r i t h m a v a i l a b l e y e t f o r g e n e r a l g e o m e t r i c m o d e l s t o p e r f o r m c o l l i s i o n d e t e c t i o n i n r e a l

    t i m e . R e c e n t l y , P e n t l a n d h a s l i s t e d c o l l i s i o n d e t e c t i o n a s o n e o f t h e m a j o r b o t t l e n e c k s

    t o w a r d s r e a l t i m e v i r t u a l e n v i r o n m e n t s i m u l a t i o n s 6 9 .

    I n t h i s t h e s i s , w e p r e s e n t a n e c i e n t a l g o r i t h m f o r c o l l i s i o n d e t e c t i o n b e t w e e n

    o b j e c t s w i t h l i n e a r a n d c u r v e d b o u n d a r i e s , u n d e r g o i n g r i g i d m o t i o n . N o a s s u m p t i o n i s

    m a d e o n t h e m o t i o n o f t h e o b j e c t t o b e e x p r e s s e d a s a c l o s e d f o r m f u n c t i o n o f t i m e . A t

    e a c h i n s t a n t , w e o n l y a s s u m e t h e k n o w l e d g e o f p o s i t i o n a n d o r i e n t a t i o n w i t h r e s p e c t t o

    a g l o b a l o r i g i n . W e r s t d e v e l o p a f a s t , i n c r e m e n t a l d i s t a n c e c o m p u t a t i o n a l g o r i t h m

    w h i c h k e e p s t r a c k o f a p a i r o f c l o s e s t f e a t u r e s b e t w e e n t w o c o n v e x p o l y h e d r a . T h e

    e x p e c t e d r u n n i n g t i m e o f t h i s a l g o r i t h m i s c o n s t a n t .

    N e x t w e w i l l e x t e n d t h i s i n c r e m e n t a l a l g o r i t h m t o n o n - c o n v e x o b j e c t s b y

    u s i n g s u b - p a r t h i e r a r c h y t r e e r e p r e s e n t a t i o n a n d t o c u r v e d o b j e c t s b y c o m b i n i n g l o c a l

    a n d g l o b a l e q u a t i o n s o l v i n g t e c h n i q u e s . I n a d d i t i o n , t w o m e t h o d s a r e d e s c r i b e d t o

    r e d u c e t h e f r e q u e n c y o f i n t e r f e r e n c e d e t e c t i o n s b y 1 a p r i o r i t y q u e u e s o r t e d b y l o w e r

    b o u n d o n t i m e t o c o l l i s i o n s 2 s w e e p i n g a n d s o r t i n g a l g o r i t h m s a n d a g e o m e t r i c

    d a t a s t r u c t u r e . S o m e e x a m p l e s f o r a p p l i c a t i o n s o f t h e s e a l g o r i t h m s a r e a l s o b r i e y

    m e n t i o n e d . T h e p e r f o r m a n c e o f t h e s e a l g o r i t h m s s h o w s g r e a t p r o m i s e f o r r e a l - t i m e

    r o b o t i c s s i m u l a t i o n a n d c o m p u t e r a n i m a t i o n .

    1 . 1 P r e v i o u s W o r k

    C o l l i s i o n d e t e c t i o n a n d t h e r e l a t e d p r o b l e m o f d e t e r m i n i n g m i n i m u m d i s -

    t a n c e h a s a l o n g h i s t o r y . I t h a s b e e n c o n s i d e r e d i n b o t h s t a t i c a n d d y n a m i c m o v i n g

    o b j e c t s v e r s i o n s i n 3 , 1 1 , 1 3 , 1 7 , 2 6 , 2 7 , 3 9 , 4 0 , 4 1 , 6 5 .

    O n e o f t h e e a r l i e r s u r v e y o n c l a s h d e t e c t i o n " w a s p r e s e n t e d b y C a m e r o n

    1 2 . H e m e n t i o n e d t h r e e d i e r e n t a p p r o a c h e s f o r d y n a m i c c o l l i s i o n d e t e c t i o n . O n e o f

    t h e m i s t o p e r f o r m s t a t i c c o l l i s i o n d e t e c t i o n r e p e t i t i v e l y a t e a c h d i s c r e t e t i m e s t e p s ,

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    17/159

    5

    b u t i t i s p o s s i b l e t o m i s s a c o l l i s i o n b e t w e e n t i m e s t e p s i f t h e s t e p s i z e i s t o o l a r g e .

    Y e t , i t w o u l d b e a w a s t e o f c o m p u t a t i o n e o r t i f t h e s t e p s i z e i s t o o s m a l l . A n o t h e r

    m e t h o d i s t o u s e a s p a c e - t i m e a p p r o a c h : w o r k i n g d i r e c t l y i n t h e f o u r - d i m e n s i o n a l s e t s

    w h i c h f o r m t h e a b s t r a c t m o d e s o f t h e m o t i o n s h a p e s s w e p t v o l u m e s i n 4 D . N o t

    o n l y i s i t d i c u l t t o v i s u a l i z e , b u t i t i s a l s o a c h a l l e n g i n g t a s k t o m o d e l s u c h s e t s ,

    e s p e c i a l l y w h e n t h e m o t i o n i s c o m p l e x . T h e l a s t m e t h o d i s t o u s i n g s w e e p i n g v o l u m e

    t o r e p r e s e n t m o v i n g o b j e c t s o v e r a p e r i o d o f t i m e . T h i s s e e m s t o b e a r a t h e r i n t u i t i v e

    a p p r o a c h , b u t r a t h e r r e s t r i c t i v e . U n l e s s t h e m o t i o n o f t h e o b j e c t s a r e a l r e a d y k n o w n

    i n a d v a n c e , i t i s i m p o s s i b l e t o s w e e p o u t t h e e n v e l o p e o f t h e m o v i n g o b j e c t s a n d i t

    s u p p r e s s e s t h e t e m p o r a l i n f o r m a t i o n . I f t w o o b j e c t s a r e b o t h m o v i n g , t h e i n t e r s e c t i o n

    o f t w o s w e e p i n g v o l u m e d o e s n o t n e c e s s a r i l y i n d i c a t e a n a c t u a l c l a s h " b e t w e e n t w o

    o b j e c t s .

    L o c a l p r o p e r t i e s h a v e b e e n u s e d i n t h e e a r l i e r m o t i o n p l a n n i n g a l g o r i t h m s

    b y D o n a l d , L o z a n o - P e r e z a n d W e s l e y 2 8 , 5 3 w h e n t w o f e a t u r e s c o m e i n t o c o n t a c t .

    I n 5 3 , L o z a n o - P e r e z a n d W e s l e y c h a r a c t e r i z e d t h e c o l l i s i o n f r e e m o t i o n p l a n n i n g

    p r o b l e m b y u s i n g a p o i n t r o b o t n a v i g a t i n g i n t h e c o n g u r a t i o n s p a c e b y g r o w i n g t h e

    s t a t i o n a r y o b s t a c l e s w i t h t h e s i z e o f t h e r o b o t . A s l o n g a s t h e p o i n t r o b o t d o e s n o t

    e n t e r a f o r b i d d e n z o n e , a c o l l i s i o n d o e s n o t t a k e p l a c e .

    A f a c t t h a t h a s o f t e n b e e n o v e r l o o k e d i s t h a t c o l l i s i o n d e t e c t i o n f o r c o n v e x

    p o l y h e d r a c a n b e d o n e i n l i n e a r t i m e i n t h e w o r s t c a s e b y S a n c h e t i a n d K e e r t h i 7 7 .

    T h e p r o o f i s b y r e d u c t i o n t o l i n e a r p r o g r a m m i n g . I f t w o p o i n t s e t s h a v e d i s j o i n t c o n v e x

    h u l l s , t h e n t h e r e i s a p l a n e w h i c h s e p a r a t e s t h e t w o s e t s . L e t t i n g t h e f o u r p a r a m e t e r s o f

    t h e p l a n e e q u a t i o n s b e v a r i a b l e s , a d d a l i n e a r i n e q u a l i t y f o r e a c h v e r t e x o f p o l y h e d r o n

    A t h a t s p e c i e s t h a t t h e v e r t e x i s o n o n e s i d e o f t h e p l a n e , a n d a n i n e q u a l i t y f o r e a c h

    v e r t e x o f p o l y h e d r o n B t h a t s p e c i e s t h a t i t i s o n t h e o t h e r s i d e . M e g i d d o a n d D y e r s

    w o r k 3 0 , 5 8 , 5 9 s h o w e d t h a t l i n e a r p r o g r a m m i n g i s s o l v a b l e i n l i n e a r t i m e f o r a n y

    x e d n u m b e r o f v a r i a b l e s . M o r e r e c e n t w o r k b y S e i d e l 7 9 h a s s h o w n t h a t l i n e a r t i m e

    l i n e a r p r o g r a m m i n g a l g o r i t h m s a r e q u i t e p r a c t i c a l f o r a s m a l l n u m b e r o f v a r i a b l e s .

    T h e a l g o r i t h m o f 7 9 h a s b e e n i m p l e m e n t e d , a n d s e e m s f a s t i n p r a c t i c e .

    U s i n g l i n e a r - t i m e p r e p r o c e s s i n g , D o b k i n a n d K i r k p a t r i c k w e r e a b l e t o s o l v e

    t h e c o l l i s i o n d e t e c t i o n p r o b l e m a s w e l l a s c o m p u t e t h e s e p a r a t i o n b e t w e e n t w o c o n v e x

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    18/159

    6

    p o l y t o p e s i n O l o g A l o g B w h e r e A a n d B a r e p o l y h e d r a a n d d e n o t e s t h e t o t a l

    n u m b e r o f f a c e s 2 7 . T h i s a p p r o a c h u s e s a h i e r a r c h i c a l d e s c r i p t i o n o f t h e c o n v e x

    o b j e c t s a n d e x t e n s i o n o f t h e i r p r e v i o u s w o r k 2 6 . T h i s i s o n e o f t h e b e s t k n o w n

    t h e o r e t i c a l b o u n d s .

    T h e c a p a b i l i t y o f d e t e r m i n i n g p o s s i b l e c o n t a c t s i n d y n a m i c d o m a i n s i s i m -

    p o r t a n t f o r c o m p u t e r a n i m a t i o n o f m o v i n g o b j e c t s . W e w o u l d l i k e a n a n i m a t o r t o

    p e r f o r m i m p a c t d e t e r m i n a t i o n b y i t s e l f w i t h o u t h i g h c o m p u t a t i o n a l c o s t s o r m u c h

    c o d i n g e o r t s . S o m e a l g o r i t h m s s u c h a s B o y s e ' s 1 1 a n d C a n n y ' s 1 7 s o l v e t h e

    p r o b l e m i n m o r e g e n e r a l i t y t h a n i s n e c e s s a r y f o r c o m p u t e r a n i m a t i o n ; w h i l e o t h e r s

    d o n o t e a s i l y p r o d u c e t h e e x a c t c o l l i s i o n p o i n t s a n d c o n t a c t n o r m a l d i r e c t i o n f o r c o l -

    l i s i o n r e s p o n s e 3 4 . I n o n e o f t h e e a r l i e r a n i m a t i o n p a p e r s a d d r e s s i n g t h e i s s u e o f

    c o l l i s i o n d e t e c t i o n , M o o r e a n d W i l h e l m s 6 3 m e n t i o n e d t h e m e t h o d b a s e d o n t h e

    C y r u s - B e c k c l i p p i n g a l g o r i t h m 7 4 , w h i c h p r o v i d e s a s i m p l e , r o b u s t a l t e r n a t i v e b u t

    r u n s i n O n

    2

    m

    2

    t i m e f o r m p o l y h e d r a a n d n v e r t i c e s p e r p o l y h e d r o n . T h e m e t h o d

    w o r k s b y c h e c k i n g w h e t h e r a p o i n t l i e s i n s i d e a p o l y g o n o r p o l y h e d r o n b y u s i n g a i n n e r

    p r o d u c t c a l c u l a t i o n t e s t . F i r s t , a l l v e r t i c e s f r o m p o l y h e d r o n B a r e t e s t e d a g a i n s t p o l y -

    h e d r o n A , a n d t h e n a l l v e r t i c e s f r o m A a r e t e s t e d f o r i n c l u s i o n i n B . T h i s a p p r o a c h

    a l o n g w i t h s p e c i a l c a s e t r e a t m e n t s i s r e a s o n a b l y r e l i a b l e . B u t , t h e c o m p u t a t i o n r u n s

    i n O n

    2

    t i m e w h e r e n i s t h e n u m b e r o f v e r t i c e s p e r p o l y h e d r o n .

    H a h n 4 3 u s e d a h i e r a r c h i c a l m e t h o d i n v o l v i n g b o u n d i n g b o x e s f o r i n t e r s e c -

    t i o n t e s t s w h i c h r u n i n O n

    2

    t i m e f o r e a c h p a i r o f p o l y h e d r a w h e r e n i s t h e n u m b e r o f

    v e r t i c e s f o r e a c h p o l y h e d r o n . T h e a l g o r i t h m s w e e p s o u t t h e v o l u m e o f b o u n d i n g b o x e s

    o v e r a s m a l l t i m e s t e p t o n d t h e e x a c t c o n t a c t l o c a t i o n s . I n t e s t i n g f o r i n t e r f e r e n c e ,

    i t t a k e s e v e r y e d g e t o c h e c k a g a i n s t e a c h p o l y g o n a n d v i c e v e r s a . I t s p e r f o r m a n c e i s

    c o m p a r a b l e t o C y r u s - B e c k c l i p p i n g a l g o r i t h m . O u r a l g o r i t h m i s a s i m p l e a n d e c i e n t

    m e t h o d w h i c h r u n s i n e x p e c t e d c o n s t a n t t i m e f o r e a c h p a i r o f p o l y h e d r a , i n d e p e n d e n t

    o f t h e g e o m e t r i c c o m p l e x i t y o f e a c h p o l y h e d r o n . I t w o u l d o n l y t a k e O m

    2

    t i m e f o r

    m p o l y h e d r a w i t h a n y n u m b e r o f v e r t i c e s p e r p o l y h e d r o n . T h i s p r o v i d e s a s i g n i c a n t

    g a i n i n s p e e d f o r c o m p u t e r a n i m a t i o n , e s p e c i a l l y f o r p o l y h e d r a w i t h a l a r g e n u m b e r

    o f v e r t i c e s .

    I n a p p l i c a t i o n s i n v o l v i n g d y n a m i c s i m u l a t i o n s a n d p h y s i c a l m o t i o n , g e o m e t -

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    19/159

    7

    r i c c o h e r e n c e h a s b e e n u t i l i z e d t o d e v i s e a l g o r i t h m s b a s e d o n l o c a l f e a t u r e s 3 . T h i s

    h a s s i g n i c a n t l y i m p r o v e d t h e p e r f o r m a n c e o f c o l l i s i o n d e t e c t i o n a l g o r i t h m s i n d y -

    n a m i c e n v i r o n m e n t s . B a r a u s e s c a c h e d e d g e s a n d f a c e s t o n d a s e p a r a t i n g p l a n e

    b e t w e e n t w o c o n v e x p o l y t o p e s 3 . H o w e v e r , B a r a ' s a s s u m p t i o n t o c a c h e t h e l a s t

    w i t n e s s e s " d o e s n o t h o l d w h e n r e l a t i v e d i s p l a c e m e n t o f o b j e c t s b e t w e e n s u c c e s s i v e

    t i m e s t e p s a r e l a r g e a n d w h e n c l o s e s t f e a t u r e s c h a n g e s , i t f a l l s b a c k o n a g l o b a l s e a r c h ;

    w h i l e o u r m e t h o d w o r k s f a s t e v e n w h e n t h e r e a r e r e l a t i v e l y l a r g e d i s p l a c e m e n t s o f o b -

    j e c t s a n d c h a n g e s i n c l o s e s t f e a t u r e s .

    A s f o r c u r v e d o b j e c t s , H e r z e n a n d e t c . 4 5 h a v e d e s c r i b e d a g e n e r a l a l -

    g o r i t h m b a s e d o n t i m e d e p e n d e n t p a r a m e t r i c s u r f a c e s . I t t r e a t s t i m e a s a n e x t r a

    d i m e n s i o n a n d a l s o a s s u m e s b o u n d s o n d e r i v a t i v e s . T h e a l g o r i t h m u s e s s u b d i v i s i o n

    t e c h n i q u e i n t h e r e s u l t i n g s p a c e a n d c a n t h e r e f o r e b e s l o w . A s i m i l a r m e t h o d u s -

    i n g i n t e r v a l a r i t h m e t i c a n d s u b d i v i s i o n h a s b e e n p r e s e n t e d f o r c o l l i s i o n d e t e c t i o n b y

    D u 2 9 . D u h a s e x t e n d e d i t t o d y n a m i c e n v i r o n m e n t s a s w e l l . H o w e v e r , f o r c o m -

    m o n l y u s e d s p l i n e p a t c h e s c o m p u t i n g a n d r e p r e s e n t i n g t h e i m p l i c i t r e p r e s e n t a t i o n s

    i s c o m p u t a t i o n a l l y e x p e n s i v e a s s t a t e d b y H o m a n n 4 6 . B o t h a l g o r i t h m s , 2 9 , 4 6 ,

    e x p e c t a c l o s e d f o r m e x p r e s s i o n o f m o t i o n a s a f u n c t i o n o f t i m e . I n 7 0 , P e n t l a n d a n d

    W i l l i a m s p r o p o s e s u s i n g i m p l i c i t f u n c t i o n s t o r e p r e s e n t s h a p e a n d t h e p r o p e r t y o f t h e

    i n s i d e - o u t s i d e " f u n c t i o n s f o r c o l l i s i o n d e t e c t i o n . B e s i d e s i t s r e s t r i c t i o n t o i m p l i c i t s

    o n l y , t h i s a l g o r i t h m h a s a d r a w b a c k i n t e r m s o f r o b u s t n e s s , a s i t u s e s p o i n t s a m p l e s .

    A d e t a i l e d e x p l a n a t i o n o f t h e s e p r o b l e m s a r e d e s c r i b e d i n 2 9 . B a r a h a s a l s o p r e -

    s e n t e d a n a l g o r i t h m f o r n d i n g c l o s e s t p o i n t s b e t w e e n t w o c o n v e x c l o s e d o b j e c t s o n l y

    3 .

    I n t h e r e l a t e d p r o b l e m o f c o m p u t i n g t h e m i n i m u m s e p a r a t i o n b e t w e e n t w o

    o b j e c t s , G i l b e r t a n d h i s c o l l a b o r a t o r s c o m p u t e d t h e m i n i m u m d i s t a n c e b e t w e e n t w o

    c o n v e x o b j e c t s w i t h a n e x p e c t e d l i n e a r t i m e a l g o r i t h m a n d u s e d i t f o r c o l l i s i o n d e -

    t e c t i o n . O u r w o r k s h a r e s w i t h 3 8 , 3 9 , a n d 4 1 t h e c a l c u l a t i o n a n d m a i n t e n a n c e

    o f c l o s e s t p o i n t s d u r i n g i n c r e m e n t a l m o t i o n . B u t w h e r e a s 3 8 , 3 9 , a n d 4 1 r e q u i r e

    e x p e c t e d l i n e a r t i m e t o v e r i f y t h e c l o s e s t p o i n t s , w e u s e t h e p r o p e r t i e s o f c o n v e x s e t s

    t o r e d u c e t h i s c h e c k t o c o n s t a n t t i m e .

    C a m e r o n a n d C u l l e y f u r t h e r d i s c u s s e d t h e p r o b l e m o f i n t e r p e n e t r a t i o n a n d

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    20/159

    8

    p r o v i d e d t h e i n t e r s e c t i o n m e a s u r e m e n t f o r t h e u s e i n a p e n a l t y f u n c t i o n f o r r o b o t m o -

    t i o n p l a n n i n g 1 3 . T h e c l a s s i c a l n o n - l i n e a r p r o g r a m m i n g a p p r o a c h e s f o r t h i s p r o b l e m

    a r e p r e s e n t e d i n 1 a n d 9 . M o r e r e c e n t l y , S a n c h e t i a n d K e e r t h i 7 7 d i s c u s s e d t h e

    c o m p u t a t i o n o f p r o x i m i t y b e t w e e n t w o c o n v e x p o l y t o p e s f r o m a c o m p l e x i t y v i e w -

    p o i n t , i n w h i c h t h e u s e o f q u a d r a t i c p r o g r a m m i n g i s p r o p o s e d a s a n a l t e r n a t i v e t o

    c o m p u t e t h e s e p a r a t i o n a n d d e t e c t i o n p r o b l e m b e t w e e n t w o c o n v e x o b j e c t s i n O n

    t i m e i n a x e d d i m e n s i o n d , w h e r e n i s t h e n u m b e r o f v e r t i c e s o f e a c h p o l y t o p e s .

    I n f a c t , t h e s e t e c h n i q u e s a r e u s e d b y r e s e a r c h e r s K a r e l Z i k a n 9 1 , R i c h a r d M a s t r o ,

    e t c . a t t h e B o e i n g V i r t u a l R e a l i t y R e s e a r c h L a b o r a t o r y a s a m e a n o f c o m p u t i n g t h e

    d i s t a n c e b e t w e e n t w o o b j e c t s .

    M e g g i d o ' s r e s u l t i n 5 8 s t a t e d t h a t w e c a n s o l v e t h e p r o b l e m o f m i n i m i z -

    i n g a c o n v e x q u a d r a t i c f u n c t i o n , s u b j e c t t o l i n e a r c o n s t r a i n t s i n R

    3

    i n l i n e a r t i m e b y

    t r a n s f o r m i n g t h e q u a d r a t i c p r o g r a m m i n g u s i n g a n a p p r o p r i a t e a n e t r a n s f o r m a t i o n

    o f R

    3

    f o u n d i n c o n s t a n t t i m e t o a l i n e a r p r o g r a m m i n g p r o b l e m . I n 6 0 , M e g i d d o

    a n d T a m i r h a v e f u r t h e r s h o w n t h a t a l a r g e c l a s s o f s e p a r a b l e c o n v e x q u a d r a t i c t r a n s -

    p o r t a t i o n p r o b l e m s w i t h a x e d n u m b e r o f s o u r c e s a n d s e p a r a b l e c o n v e x q u a d r a t i c

    p r o g r a m m i n g w i t h n o n n e g a t i v i t y c o n s t r a i n t s a n d a x e d n u m b e r o f l i n e a r e q u a l i t y

    c o n s t r a i n t s c a n b e s o l v e d i n l i n e a r t i m e . B e l o w , w e w i l l p r e s e n t a s h o r t d e s c r i p t i o n o f

    h o w w e c a n r e d u c e t h e d i s t a n c e c o m p u t a t i o n p r o b l e m u s i n g q u a d r a t i c p r o g r a m m i n g

    t o a l i n e a r p r o g r a m m i n g p r o b l e m a n d s o l v e i t i n l i n e a r t i m e .

    T h e c o n v e x o p t i m i z a t i o n p r o b l e m o f c o m p u t i n g t h e d i s t a n c e b e t w e e n t w o

    c o n v e x p o l y h e d r a A a n d B b y q u a d r a t i c p r o g r a m m i n g c a n b e f o r m u l a t e d a s f o l l o w s :

    M i n i m i z e k v k

    2

    = k q , p k

    2

    , s . t . p 2 A , q 2 B

    s u b j e c t t o

    n

    1

    X

    i = 1

    i

    p

    i

    = p ;

    n

    1

    X

    i = 1

    i

    = 1 ;

    i

    0

    n

    2

    X

    j = 1

    j

    q

    j

    = q = p + v ;

    n

    2

    X

    j = 1

    j

    = 1 ;

    j

    0

    w h e r e p

    i

    a n d q

    j

    a r e v e r t i c e s o f A a n d B r e s p e c t i v e l y . T h e v a r i a b l e s a r e p , v ,

    i

    ' s a n d

    j

    ' s . T h e r e a r e n

    1

    + n

    2

    + 6 c o n s t r a i n t s : n

    1

    a n d n

    2

    l i n e a r c o n s t r a i n t s f r o m s o l v i n g

    i

    ' s

    a n d

    j

    ' s a n d 3 l i n e a r c o n s t r a i n t s e a c h f r o m s o l v i n g t h e x ; y ; z , c o o r d i n a t e s o f p a n d

    v r e s p e c t i v e l y . S i n c e w e a l s o h a v e t h e n o n n e g a t i v i t y c o n s t r a i n t s f o r p a n d v , w e c a n

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    21/159

    9

    d i s p l a c e b o t h A a n d B t o e n s u r e t h e c o o r d i n a t e s o f p 0 a n d t o n d t h e s o l u t i o n s

    o f 8 s y s t e m s o f e q u a t i o n s i n 8 o c t a n t s t o v e r i f y t h a t t h e c o n s t r a i n t s , t h e x ; y ; z ,

    c o o r d i n a t e s o f v 0 , a r e e n f o r c e d a s w e l l . A c c o r d i n g t o t h e r e s u l t o n s e p a r a b l e

    q u a d r a t i c p r o g r a m m i n g i n 6 0 , t h i s Q P p r o b l e m c a n b e s o l v e d i n O n

    1

    + n

    2

    t i m e .

    O v e r a l l , n o g o o d c o l l i s i o n d e t e c t i o n a l g o r i t h m s o r d i s t a n c e c o m p u t a t i o n

    m e t h o d s a r e k n o w n f o r g e n e r a l g e o m e t r i c m o d e l s . M o r e o v e r , m o s t o f t h e l i t e r a -

    t u r e h a s f o c u s s e d o n c o l l i s i o n d e t e c t i o n a n d t h e s e p a r a t i o n p r o b l e m b e t w e e n a p a i r o f

    o b j e c t s a s c o m p a r e d t o h a n d l i n g e n v i r o n m e n t s w i t h m u l t i p l e o b j e c t m o d e l s .

    1 . 2 O v e r v i e w o f t h e T h e s i s

    C h a p t e r 3 t h r o u g h 5 o f t h i s t h e s i s d e a l w i t h a l g o r i t h m s f o r c o l l i s i o n d e t e c t i o n ,

    w h i l e c h a p t e r 6 g i v e s a n a p p l i c a t i o n o f t h e c o l l i s i o n d e t e c t i o n a l g o r i t h m s i n r o b o t

    m o t i o n p l a n n i n g . W e b e g i n i n C h a p t e r 2 b y d e s c r i b i n g t h e b a s i c k n o w l e d g e n e c e s s a r y

    t o f o l l o w t h e d e v e l o p m e n t o f t h i s t h e s i s w o r k . T h e c o r e o f t h e c o l l i s i o n d e t e c t i o n

    a l g o r i t h m s l i e s i n C h a p t e r 3 , w h e r e t h e i n c r e m e n t a l d i s t a n c e c o m p u t a t i o n a l g o r i t h m

    i s d e s c r i b e d . S i n c e t h i s m e t h o d i s e s p e c i a l l y t a i l o r e d t o w a r d c o n v e x p o l y h e d r a , i t s

    e x t e n s i o n t o w a r d n o n - c o n v e x p o l y t o p e s a n d t h e o b j e c t s w i t h c u r v e d b o u n d a r i e s i s

    d e s c r i b e d i n C h a p t e r 4 . C h a p t e r 5 g i v e s a t r e a t m e n t o n r e d u c i n g t h e f r e q u e n c y o f

    c o l l i s i o n c h e c k s i n a l a r g e e n v i r o n m e n t w h e r e t h e r e m a y b e t h o u s a n d s o f o b j e c t s

    p r e s e n t . C h a p t e r 6 i s m o r e o r l e s s s e l f c o n t a i n e d , a n d d e s c r i b e s a n o p p o r t u n i s t i c

    g l o b a l p a t h p l a n n e r w h i c h u s e s t h e t e c h n i q u e s d e s c r i b e d i n C h a p t e r 3 t o c o n s t r u c t a

    o n e - d i m e n s i o n a l s k e l e t o n f o r t h e p u r p o s e o f r o b o t m o t i o n p l a n n i n g .

    C h a p t e r 2 d e s c r i b e d s o m e c o m p u t a t i o n a l g e o m e t r y a n d m o d e l i n g c o n c e p t s

    w h i c h l e a d s t o t h e d e v e l o p m e n t o f t h e a l g o r i t h m s p r e s e n t e d i n t h i s t h e s i s , a s w e l l a s

    t h e o b j e c t m o d e l i n g t o t h e i n p u t o f o u r a l g o r i t h m s d e s c r i b e d i n t h i s t h e s i s .

    C h a p t e r 3 c o n t a i n s t h e m a i n r e s u l t o f t h e s i s , w h i c h i s a s i m p l e a n d f a s t

    a l g o r i t h m t o c o m p u t e t h e d i s t a n c e b e t w e e n t w o p o l y h e d r a b y n d i n g t h e c l o s e s t f e a -

    t u r e s b e t w e e n t w o c o n v e x p o l y h e d r a . I t u t i l i z e s t h e g e o m e t r y o f p o l y h e d r a t o e s t a b l i s h

    s o m e l o c a l a p p l i c a b i l i t y c r i t e r i a f o r v e r i f y i n g t h e c l o s e s t f e a t u r e s , w i t h a p r e p r o c e s s i n g

    p r o c e d u r e t o r e d u c e e a c h f e a t u r e ' s n e i g h b o r s t o a c o n s t a n t s i z e , a n d t h u s g u a r a n t e e s

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    22/159

    1 0

    e x p e c t e d c o n s t a n t r u n n i n g t i m e f o r e a c h t e s t . D a t a f r o m n u m e r o u s e x p e r i m e n t s t e s t e d

    o n a b r o a d s e t o f c o n v e x p o l y h e d r a i n R

    3

    s h o w t h a t t h e e x p e c t e d r u n n i n g t i m e i s c o n -

    s t a n t f o r n d i n g c l o s e s t f e a t u r e s w h e n t h e c l o s e s t f e a t u r e s f r o m t h e p r e v i o u s t i m e s t e p

    a r e k n o w n . I t i s l i n e a r i n t o t a l n u m b e r o f f e a t u r e s i f n o s p e c i a l i n i t i a l i z a t i o n i s d o n e .

    T h i s t e c h n i q u e c a n b e u s e d f o r d y n a m i c c o l l i s i o n d e t e c t i o n , p h y s i c a l s i m u l a t i o n , p l a n -

    n i n g i n t h r e e - d i m e n s i o n a l s p a c e , a n d o t h e r r o b o t i c s p r o b l e m s . I t f o r m s t h e h e a r t o f

    t h e m o t i o n p l a n n i n g a l g o r i t h m d e s c r i b e d i n C h a p t e r 6 .

    I n C h a p t e r 4 , w e w i l l d i s c u s s h o w w e c a n u s e t h e i n c r e m e n t a l d i s t a n c e c o m -

    p u t a t i o n a l g o r i t h m i n C h a p t e r 3 f o r d y n a m i c c o l l i s i o n d e t e c t i o n b e t w e e n n o n - c o n v e x

    p o l y t o p e s a n d o b j e c t s w i t h c u r v e d b o u n d a r y . S i n c e t h e i n c r e m e n t a l d i s t a n c e c o m -

    p u t a t i o n a l g o r i t h m i s d e s i g n e d b a s e d u p o n t h e p r o p e r t i e s o f c o n v e x s e t s , e x t e n s i o n

    t o n o n - c o n v e x p o l y t o p e s u s i n g a s u b - p a r t h i e r a r c h i c a l t r e e r e p r e s e n t a t i o n w i l l b e d e -

    s c r i b e d i n d e t a i l h e r e . T h e l a t e r p a r t o f t h i s c h a p t e r d e a l s w i t h c o n t a c t d e t e r m i n a t i o n

    b e t w e e n g e o m e t r i c m o d e l s d e s c r i b e d b y c u r v e d b o u n d a r i e s a n d u n d e r g o i n g r i g i d m o -

    t i o n . T h e s e t o f m o d e l s i n c l u d e s u r f a c e s d e s c r i b e d b y r a t i o n a l s p l i n e p a t c h e s o r p i e c e -

    w i s e a l g e b r a i c f u n c t i o n s . I n c o n t r a s t t o p r e v i o u s a p p r o a c h e s , w e u t i l i z e t h e e x p e c t e d

    c o n s t a n t t i m e a l g o r i t h m f o r t r a c k i n g t h e c l o s e s t f e a t u r e s b e t w e e n c o n v e x p o l y t o p e s

    d e s c r i b e d i n C h a p t e r 3 a n d l o c a l n u m e r i c a l m e t h o d s t o e x t e n d t h e i n c r e m e n t a l n a t u r e

    t o c o n v e x c u r v e d o b j e c t s . T h i s a p p r o a c h p r e s e r v e s t h e c o h e r e n c e b e t w e e n s u c c e s s i v e

    m o t i o n s a n d e x p l o i t s t h e l o c a l i t y i n u p d a t i n g t h e i r p o s s i b l e c o n t a c t s t a t u s . W e u s e

    l o c a l a n d g l o b a l a l g e b r a i c m e t h o d s f o r s o l v i n g p o l y n o m i a l e q u a t i o n s a n d t h e g e o m e t -

    r i c f o r m u l a t i o n o f t h e p r o b l e m t o d e v i s e e c i e n t a l g o r i t h m s f o r n o n - c o n v e x c u r v e d

    o b j e c t s a s w e l l , a n d t o d e t e r m i n e t h e e x a c t c o n t a c t p o i n t s w h e n c o l l i s i o n s o c c u r . P a r t s

    o f t h i s c h a p t e r r e p r e s e n t j o i n t w o r k w i t h D i n e s h M a n o c h a o f t h e U n i v e r s i t y o f N o r t h

    C a r o l i n a a t C h a p e l H i l l .

    C h a p t e r 5 c o m p l e m e n t s t h e p r e v i o u s c h a p t e r s b y d e s c r i b i n g t w o m e t h o d s

    w h i c h f u r t h e r r e d u c e t h e f r e q u e n c y o f c o l l i s i o n c h e c k s i n a n e n v i r o n m e n t w i t h m u l t i p l e

    o b j e c t s m o v i n g a r o u n d . O n e a s s u m e s t h e k n o w l e d g e o f m a x i m u m a c c e l e r a t i o n a n d

    v e l o c i t y t o e s t a b l i s h a p r i o r i t y q u e u e s o r t e d b y t h e l o w e r b o u n d o n t i m e t o c o l l i s i o n .

    T h e o t h e r p u r e l y e x p l o i t s t h e s p a t i a l a r r a n g e m e n t w i t h o u t a n y o t h e r i n f o r m a t i o n

    t o r e d u c e t h e n u m b e r o f p a i r w i s e i n t e r f e r e n c e t e s t s . T h e r a t i o n a l b e h i n d t h i s w o r k

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    23/159

    1 1

    c o m e s f r o m t h e f a c t t h a t t h o u g h e a c h p a i r w i s e i n t e r f e r e n c e t e s t o n l y t a k e s e x p e c t e d

    c o n s t a n t t i m e , t o c h e c k f o r a l l p o s s i b l e c o n t a c t s a m o n g n o b j e c t s a t a l l t i m e c a n b e

    q u i t e t i m e c o n s u m i n g , e s p e c i a l l y i f n i s i n t h e r a n g e o f h u n d r e d s o r t h o u s a n d s . T h i s

    n

    2

    f a c t o r i n t h e c o l l i s i o n d e t e c t i o n c o m p u t a t i o n w i l l d o m i n a t e t h e r u n t i m e , o n c e n

    i n c r e a s e s . T h e r e f o r e , i t i s e s s e n t i a l t o c o m e u p w i t h e i t h e r h e u r i s t i c a p p r o a c h e s o r

    g o o d t h e o r e t i c a l a l g o r i t h m s t o r e d u c e t h e n

    2

    p a i r w i s e c o m p a r i s o n s .

    C h a p t e r 6 i s i n d e p e n d e n t o f t h e o t h e r c h a p t e r s o f t h e t h e s i s , a n d p r e s e n t s

    a n e w r o b o t p a t h p l a n n i n g a l g o r i t h m t h a t c o n s t r u c t s a g l o b a l s k e l e t o n o f f r e e - s p a c e

    b y t h e i n c r e m e n t a l l o c a l m e t h o d d e s c r i b e d i n C h a p t e r 3 . T h e c u r v e s o f t h e s k e l e t o n

    a r e t h e l o c i o f m a x i m a o f a n a r t i c i a l p o t e n t i a l e l d t h a t i s d i r e c t l y p r o p o r t i o n a l t o

    d i s t a n c e o f t h e r o b o t f r o m o b s t a c l e s . T h i s m e t h o d h a s t h e a d v a n t a g e o f f a s t c o n v e r -

    g e n c e o f l o c a l m e t h o d s i n u n c l u t t e r e d e n v i r o n m e n t s , b u t i t a l s o h a s a d e t e r m i n i s t i c

    a n d e c i e n t m e t h o d o f e s c a p i n g l o c a l e x t r e m a l p o i n t s o f t h e p o t e n t i a l f u n c t i o n . W e

    r s t d e s c r i b e a g e n e r a l r o a d m a p a l g o r i t h m , f o r c o n g u r a t i o n s p a c e s o f a n y d i m e n s i o n ,

    a n d t h e n d e s c r i b e s p e c i c a p p l i c a t i o n s o f t h e a l g o r i t h m f o r r o b o t s w i t h t w o a n d t h r e e

    d e g r e e s o f f r e e d o m .

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    24/159

    1 2

    C h a p t e r 2

    B a c k g r o u n d

    I n t h i s c h a p t e r , w e w i l l d e s c r i b e s o m e m o d e l i n g a n d c o m p u t a t i o n a l g e o m e -

    t r y c o n c e p t s w h i c h l e a d s t o t h e d e v e l o p m e n t o f t h e a l g o r i t h m s p r e s e n t e d l a t e r i n t h i s

    t h e s i s , a s w e l l a s t h e o b j e c t m o d e l i n g f o r t h e i n p u t t o o u r c o l l i s i o n d e t e c t i o n a l g o -

    r i t h m s . S o m e o f t h e m a t e r i a l s p r e s e n t e d i n t h i s c h a p t e r c a n b e f o u n d i n t h e b o o k s b y

    H o m a n n , P r e p a r a t a a n d S h a m o s 4 6 , 7 1 .

    T h e s e t o f m o d e l s w e u s e d i n c l u d e r i g i d p o l y h e d r a a n d o b j e c t s w i t h s u r f a c e s

    d e s c r i b e d b y r a t i o n a l s p l i n e o r p i e c e w i s e a l g e b r a i c f u n c t i o n s . N o d e f o r m a t i o n o f t h e

    o b j e c t s i s a s s u m e d u n d e r m o t i o n o r e x t e r n a l f o r c e s . T h i s m a y s e e m a r e s t r i c t i v e

    c o n s t r a i n t . H o w e v e r , i n g e n e r a l t h i s a s s u m p t i o n y i e l d s v e r y s a t i s f a c t o r y r e s u l t s , u n l e s s

    t h e o b j e c t n a t u r e i s e x i b l e a n d d e f o r m a b l e .

    2 . 1 B a s i c C o n c e n p t s

    W e w i l l r s t r e v i e w s o m e o f t h e b a s i c c o n c e p t s a n d t e r m i n o l o g i e s w h i c h a r e

    e s s e n t i a l t o t h e l a t e r d e v e l o p m e n t o f t h i s t h e s i s w o r k .

    2 . 1 . 1 M o d e l R e p r e s e n t a t i o n s

    I n s o l i d a n d g e o m e t r i c m o d e l i n g , t h e r e a r e t w o m a j o r r e p r e s e n t a t i o n s s c h e m a t a :

    B - r e p b o u n d a r y r e p r e s e n t a t i o n a n d C S G c o n s t r u c t i v e s o l i d g e o m e t r y . E a c h h a s

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    25/159

    1 3

    i t s o w n a d v a n t a g e s a n d i n h e r e n t p r o b l e m s .

    B o u n d a r y R e p r e s e n t a t i o n : t o r e p r e s e n t a s o l i d o b j e c t b y d e s c r i b i n g i t s s u r f a c e ,

    s u c h t h a t w e h a v e t h e c o m p l e t e i n f o r m a t i o n a b o u t t h e i n t e r i o r a n d e x t e r i o r o f a n

    o b j e c t . T h i s r e p r e s e n t a t i o n g i v e s u s t w o t y p e s o f d e s c r i p t i o n : a g e o m e t r i c t h e

    p a r a m e t e r s n e e d e d t o d e s c r i b e a f a c e , a n e d g e , a n d a v e r t e x ; b t o p o l o g i c a l t h e

    a d j a c e n c i e s a n d i n c i d e n c e s o f v e r t i c e s , e d g e s , a n d f a c e s . T h i s r e p r e s e n t a t i o n e v o l v e s

    f r o m t h e d e s c r i p t i o n f o r p o l y h e d r a .

    C o n s t r u c t i v e S o l i d G e o m e t r y : t o r e p r e s e n t a s o l i d o b j e c t b y a s e t - t h e o r e t i c

    B o o l e a n e x p r e s s i o n o f p r i m i t i v e o b j e c t s . T h e C S G o p e r a t i o n s i n c l u d e r o t a t i o n , t r a n s -

    l a t i o n , r e g u l a r i z e d u n i o n , r e g u l a r i z e d i n t e r s e c t i o n a n d r e g u l a r i z e d d i e r e n c e . T h e C S G

    s t a n d a r d p r i m i t i v e s a r e t h e s p h e r e , t h e c y l i n d e r , t h e c o n e , t h e p a r a l l e l e p i p e d , t h e t r i -

    a n g u l a r p r i s m , a n d t h e t o r u s . T o c r e a t e a p r i m i t i v e p a r t , t h e u s e r n e e d s t o s p e c i f y

    t h e d i m e n s i o n s s u c h a s t h e h e i g h t , w i d t h , a n d l e n g t h o f a b l o c k o f t h e s e p r i m i t i v e s .

    E a c h o b j e c t h a s a l o c a l c o o r d i n a t e f r a m e a s s o c i a t e d w i t h i t . T h e c o n g u r a t i o n o f e a c h

    o b j e c t i s e x p r e s s e d b y t h e b a s i c C S G o p e r a t i o n s i . e . r o t a t i o n a n d t r a n s l a t i o n t o

    p l a c e e a c h o b j e c t w i t h r e s p e c t t o a g l o b a l w o r l d c o o r d i n a t e f r a m e

    D u e t o t h e n a t u r e o f t h e d i s t a n c e c o m p u t a t i o n a l g o r i t h m f o r c o n v e x p o l y -

    t o p e s p r e s e n t e d i n C h a p t e r 3 , w h i c h u t i l i z e s t h e a d j a c e n c i e s a n d i n c i d e n c e s o f f e a -

    t u r e s a s w e l l a s t h e g e o m e t r i c i n f o r m a t i o n t o d e s c r i b e t h e g e o m e t r i c e m b e d d i n g r e -

    l a t i o n s h i p , w e h a v e c h o s e n t h e m o d i e d b o u n d a r y r e p r e s e n t a t i o n t o d e s c r i b e e a c h

    p o l y h e d r o n d e s c r i b e d i n t h e n e x t s e c t i o n . H o w e v e r , t h e b a s i c c o n c e p t o f C S G r e p -

    r e s e n t a t i o n i s u s e d i n c o n s t r u c t i n g t h e s u b p a r t h i e r a r c h i c a l t r e e t o d e s c r i b e t h e n o n -

    c o n v e x p o l y h e d r a l o b j e c t s , s i n c e e a c h c o n v e x p i e c e e n c l o s e s a v o l u m e c a n b e t h o u g h t

    o f a s a n o b j e c t p r i m i t i v e .

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    26/159

    1 4

    2 . 1 . 2 D a t a S t r u c t u r e s a n d B a s i c T e r m i n o l o g y

    G i v e n t h e t w o m a j o r d i e r e n t r e p r e s e n t a t i o n s c h e m a , n e x t w e w i l l d e s c r i b e

    t h e m o d i e d b o u n d a r y r e p r e s e n t a t i o n , w h i c h w e u s e t o r e p r e s e n t c o n v e x p o l y t o p e i n

    o u r a l g o r i t h m , a s w e l l a s s o m e b a s i c t e r m i n o l o g i e s d e s c r i b i n g t h e g e o m e t r i c r e l a t i o n -

    s h i p b e t w e e n g e o m e t r i c e n t i t i e s .

    L e t A b e a p o l y t o p e . A i s p a r t i t i o n e d i n t o f e a t u r e s f

    1

    ; : : : ; f

    n

    w h e r e n i s

    t h e t o t a l n u m b e r o f f e a t u r e s , i . e . n = f + e + v w h e r e f , e , v s t a n d s f o r t h e t o t a l

    n u m b e r o f f a c e s , e d g e s , v e r t i c e s r e s p e c t i v e l y . E a c h f e a t u r e e x c e p t v e r t e x i s a n o p e n

    s u b s e t o f a n a n e p l a n e a n d d o e s n o t c o n t a i n i t s b o u n d a r y . T h i s i m p l i e s t h e f o l l o w i n g

    r e l a t i o n s h i p s :

    f

    i

    = A ; i = 1 ; : : : ; n

    f

    i

    f

    j

    = ; ; i 6= j

    D e n i t i o n : B i s i n t h e b o u n d a r y o f F a n d F i s i n c o b o u n d a r y o f B , i f a n d o n l y i f B

    i s i n t h e c l o s u r e o f F , i . e . B F a n d B h a s o n e f e w e r d i m e n s i o n t h a n F d o e s .

    F o r e x a m p l e , t h e c o b o u n d a r y o f a v e r t e x i s t h e s e t o f e d g e s t o u c h i n g i t a n d

    t h e c o b o u n d a r y o f a n e d g e i s t h e t w o f a c e s a d j a c e n t t o i t . T h e b o u n d a r y o f a f a c e i s

    t h e s e t o f e d g e s i n t h e c l o s u r e o f t h e f a c e .

    W e a l s o a d a p t t h e w i n g e d e d g e r e p r e s e n t a t i o n . F o r t h o s e r e a d e r s w h o a r e

    n o t f a m i l i a r w i t h t h i s t e r m i n o l o g y , p l e a s e r e f e r t o 4 6 . H e r e w e g i v e a b r i e f d e s c r i p t i o n

    o f t h e w i n g e d e d g e r e p r e s e n t a t i o n :

    T h e e d g e i s o r i e n t e d b y g i v i n g t w o i n c i d e n t v e r t i c e s t h e h e a d a n d t a i l .

    T h e e d g e p o i n t s f r o m t a i l t o h e a d . I t h a s t w o a d j a c e n t f a c e s c o b o u n d i n g i t a s w e l l .

    L o o k i n g f r o m t h e t h e t a i l e n d t o w a r d t h e h e a d , t h e a d j a c e n t f a c e l y i n g t o t h e r i g h t

    h a n d s i d e i s w h a t w e c a l l e d t h e r i g h t f a c e " a n d s i m i l a r l y f o r t h e l e f t f a c e " p l e a s e

    s e e F i g . 2 . 1 .

    E a c h p o l y h e d r o n d a t a s t r u c t u r e h a s a e l d f o r i t s f e a t u r e s f a c e s , e d g e s ,

    v e r t i c e s a n d V o r o n o i c e l l s d e s c r i b e d b e l o w i n S e c 2 . 1 . 4 . E a c h f e a t u r e a v e r t e x , a n

    e d g e , o r a f a c e i s d e s c r i b e d b y i t s g e o m e t r i c p a r a m e t e r s . I t s d a t a s t r u c t u r e a l s o

    i n c l u d e s a l i s t o f i t s b o u n d a r y , c o b o u n d a r y , a n d V o r o n o i r e g i o n s d e n e d l a t e r i n

    S e c 2 . 1 . 4 .

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    27/159

    1 5

    HE

    TE

    RightFace

    LeftFace

    E

    F i g u r e 2 . 1 : A w i n g e d e d g e r e p r e s e n t a t i o n

    I n a d d i t i o n , w e w i l l u s e t h e w o r d a b o v e " a n d b e n e a t h " t o d e s c r i b e t h e

    r e l a t i o n s h i p b e t w e e n a p o i n t a n d a f a c e . I n t h e h o m o g e n e o u s r e p r e s e n t a t i o n w h e r e

    a p o i n t P i s p r e s e n t e d a s a v e c t o r P

    x

    ; P

    y

    ; P

    z

    ; 1 a n d F ' s n o r m a l i z e d u n i t o u t w a r d

    n o r m a l N

    F

    i s p r e s e n t e d a s v e c t o r a ; b ; c ; , d , w h e r e , d i s t h e d i r e c t i o n a l d i s t a n c e

    f r o m t h e o r i g i n a n d t h e v e c t o r n = a ; b ; c h a s t h e m a g n i t u d e o f 1 . T h e p l a n e w h i c h

    F l i e s o n i s d e s c r i b e d b y t h e p l a n e e q u a t i o n a x + b y + c z + d = 0

    A p o i n t P i s a b o v e F P N

    F

    0

    A p o i n t P i s o n F P N

    F

    = 0

    A p o i n t P i s b e n e a t h F P N

    F

    0

    S o , i f , d 0 , t h e n t h e o r i g i n l i e s , d u n i t s b e n e a t h t h e f a c e F a n d v i c e v e r s a .

    S i m i l a r l y , l e t ~e b e t h e v e c t o r r e p r e s e n t i n g a n e d g e E . L e t H

    E

    = H

    x

    ; H

    y

    ; H

    z

    a n d

    T

    E

    = T

    x

    ; T

    y

    ; T

    z

    ~e = H

    E

    , T

    E

    = H

    x

    , T

    x

    ; H

    y

    , T

    y

    ; H

    z

    , T

    Z

    ; 0 w h e r e H

    E

    a n d T

    E

    a r e t h e h e a d a n d t a i l o f t h e e d g e E r e s p e c t i v e l y .

    A n e d g e E p o i n t s i n t o a f a c e F ~e N

    F

    0

    A n e d g e E i s p a r a l l e l t o a f a c e F ~e N

    F

    = 0

    A n e d g e E p o i n t s o u t o f a f a c e F ~e N

    F

    0

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    28/159

    1 6

    2 . 1 . 3 V o r o n o i D i a g r a m

    T h e p r o x i m i t y p r o b l e m , i . e . g i v e n a s e t S o f N p o i n t s i n R

    2

    , f o r e a c h p o i n t

    p

    i

    2 S w h a t i s t h e s e t o f p o i n t s x ; y i n t h e p l a n e t h a t a r e c l o s e r t o p

    i

    t h a n t o a n y

    o t h e r p o i n t i n S ? " , i s o f t e n a n s w e r e d b y t h e r e t r a c t i o n a p p r o a c h i n c o m p u t a t i o n a l

    g e o m e t r y . T h i s a p p r o a c h i s c o m m o n l y k n o w n a s c o n s t r u c t i n g t h e V o r o n o i d i a g r a m

    o f t h e p o i n t s e t S . T h i s i s a n i m p o r t a n t c o n c e p t w h i c h w e w i l l r e v i s i t i n C h a p t e r 3 .

    H e r e w e w i l l g i v e a b r i e f d e n i t i o n o f V o r o n o i d i a g r a m .

    T h e i n t u i t i o n t o s o l v e t h e p r o x i m i t y p r o b l e m i n R

    2

    i s t o p a r t i t i o n t h e p l a n e

    i n t o r e g i o n s , e a c h o f t h e s e i s t h e s e t o f t h e p o i n t s w h i c h a r e c l o s e r t o a p o i n t p

    i

    2 S

    t h a n a n y o t h e r . I f w e k n o w t h i s p a r t i t i o n i n g , t h e n w e c a n s o l v e t h e p r o b l e m o f

    p r o x i m i t y d i r e c t l y b y a s i m p l e q u e r y . T h e p a r t i t i o n i s b a s e d o n t h e s e t o f c l o s e s t

    p o i n t s , e . g . b i s e c t o r s w h i c h h a v e 2 o r 3 c l o s e s t p o i n t s .

    G i v e n t w o p o i n t s p

    i

    a n d p

    j

    , t h e s e t o f p o i n t s c l o s e r t o p

    i

    t h a n t o p

    j

    i s j u s t t h e

    h a l f - p l a n e H

    i

    p

    i

    ; p

    j

    c o n t a i n i n g p

    i

    H

    i

    p

    i

    ; p

    j

    i s d e n e d b y t h e p e r p e n d i c u l a r b i s e c t o r

    t o p

    i

    p

    j

    . T h e s e t o f p o i n t s c l o s e r t o p

    i

    t h a n t o a n y o t h e r p o i n t i s f o r m e d b y t h e

    i n t e r s e c t i o n o f a t m o s t N , 1 h a l f - p l a n e s , w h e r e N i s t h e n u m b e r o f p o i n t s i n t h e s e t

    S . T h i s s e t o f p o i n t s , V

    i

    , i s c a l l e d t h e V o r o n o i p o l y g o n a s s o c i a t e d w i t h p

    i

    T h e c o l l e c t i o n o f N V o r o n o i p o l y g o n s g i v e n t h e N p o i n t s i n t h e s e t S i s

    t h e V o r o n o i d i a g r a m , V o r S , o f t h e p o i n t s e t S . E v e r y p o i n t x ; y i n t h e p l a n e l i e s

    w i t h i n a V o r o n o i p o l y g o n . I f a p o i n t x ; y 2 V i , t h e n p

    i

    i s a n e a r e s t p o i n t t o t h e

    p o i n t x ; y . T h e r e f o r e , t h e V o r o n o i d i a g r a m c o n t a i n s a l l t h e i n f o r m a t i o n n e c e s s a r y

    t o s o l v e t h e p r o x i m i t y p r o b l e m s g i v e n a s e t o f p o i n t s i n R

    2

    . A s i m i l a r i d e a a p p l i e s t o

    t h e s a m e p r o b l e m i n t h r e e - d i m e n s i o n a l o r h i g h e r d i m e n s i o n a l s p a c e 1 5 , 3 2 .

    T h e e x t e n s i o n o f t h e V o r o n o i d i a g r a m t o h i g h e r d i m e n s i o n a l f e a t u r e s i n s t e a d

    o f p o i n t s i s c a l l e d t h e g e n e r a l i z e d V o r o n o i d i a g r a m , i . e . t h e s e t o f p o i n t s c l o s e s t t o

    a f e a t u r e , e . g . t h a t o f a p o l y h e d r o n . I n g e n e r a l , t h e g e n e r a l i z e d V o r o n o i d i a g r a m

    h a s q u a d r a t i c s u r f a c e b o u n d a r i e s i n i t . H o w e v e r , i f t h e o b j e c t s a r e c o n v e x , t h e n t h e

    g e n e r a l i z e d V o r o n o i d i a g r a m h a s p l a n a r b o u n d a r i e s . T h i s l e a d s t o t h e d e n i t i o n o f

    V o r o n o i r e g i o n s w h i c h w i l l b e d e s c r i b e d n e x t i n S e c 2 . 1 . 4 .

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics - Ming C Lin

    29/159

    1 7

    2 . 1 . 4 V o r o n o i R e g i o n

    A V o r o n o i r e g i o n a s s o c i a t e d w i t h a f e a t u r e i s a s e t o f p o i n t s e x t e r i o r t o t h e

    p o l y h e d r o n w h i c h a r e c l o s e r t o t h a t f e a t u r e t h a n a n y o t h e r . T h e V o r o n o i r e g i o n s

    f o r m a p a r t i t i o n o f s p a c e o u t s i d e t h e p o l y h e d r o n a c c o r d i n g t o t h e c l o s e s t f e a t u r e .

    T h e c o l l e c t i o n o f V o r o n o i r e g i o n s o f e a c h p o l y h e d r o n i s t h e V o r o n o i d i a g r a m o f t h e

    p o l y h e d r o n . N o t e t h a t t h e V o r o n o i d i a g r a m o f a c o n v e x p o l y h e d r o n h a s l i n e a r s i z e

    a n d c o n s i s t s o f p o l y h e d r a l r e g i o n s . A c e l l i s t h e d a t a s t r u c t u r e f o r a V o r o n o i r e g i o n .

    I t h a s a s e t o f c o n s t r a i n t p l a n e s w h i c h b o u n d t h e V o r o n o i r e g i o n w i t h p o i n t e r s t o t h e

    n e i g h b o r i n g c e l l s w h i c h s h a r e a c o n s t r a i n t p l a n e w i t h i t i n i t s d a t a s t r u c t u r e . I f a

    p o i n t l i e s o n a c o n s t r a i n t p l a n e , t h e n i t i s e q u i - d i s t a n t f r o m t h e t w o f e a t u r e s w h i c h

    s h a r e t h i s c o n s t r a i n t p l a n e i n t h e i r V o r o n o i r e g i o n s .

    U s i n g t h e g e o m e t r i c p r o p e r t i e s o f c o n v e x s e t s , a p p l i c a b i l i t y c r i t e r i a e x -

    p l a i n e d i n S e c . 3 . 2 a r e e s t a b l i s h e d b a s e d u p o n t h e V o r o n o i r e g i o n s . I f a p o i n t P

    o n o b j e c t A l i e s i n s i d e t h e V o r o n o i r e g i o n o f f

    B

    o n o b j e c t B , t h e n f

    B

    i s a c l o s e s t

    f e a t u r e t o t h e p o i n t P . M o r e d e t a i l s w i l l b e p r e s e n t e d i n C h a p t e r 3 .

    I n C h a p t e r 3 , w e w i l l d e s c r i b e o u r i n c r e m e n t a l d i s t a n c e c o m p u t a t i o n a l -

    g o r i t h m w h i c h u t i l i z e s t h e c o n c e p t o f V o r o n o i r e g i o n s a n d t h e p r o p e r t i e s o f c o n v e x

    p o l y h e d r a t o p e r f o r m c o l l i s i o n d e t e c t i o n i n e x p e c t e d c o n s t a n t t i m e . A f t e r g i v i n g t h e

    d e t a i l s o f p o l y h e d r a l m o d e l r e p r e s e n t a t i o n s , i n t h e n e x t s e c t i o n w e w i l l d e s c r i b e m o r e

    g e n e r a l o b j e c t m o d e l i n g t o i n c l u d e t h e c l a s s o f n o n - p o l y h e d r a l o b j e c t s a s w e l l , w i t h

    e m p h a s i s o n c u r v e d s u r f a c e s .

    2 . 2 O b j e c t M o d e l i n g

    T h e s e t o f o b j e c t s w e c o n s i d e r , b e s i d e s c o n v e x p o l y t o p e s , i n c l u d e s n o n -

    c o n v e x o b j e c t s l i k e a t o r u s a s w e l l a s t w o d i m e n s i o n a l m a n i f o l d s d e s c r i b e d u s i n g

    p o l y n o m i a l s . T h e c l a s s o f p a r a m e t r i c a n d i m p l i c i t s u r f a c e s d e s c r i b e d i n t e r m s o f

    p i e c e w i s e p o l y n o m i a l e q u a t i o n s i s c u r r e n t l y c o n s i d e r e d t h e s t a t e o f t h e a r t f o r m o d -

    e l i n g a p p l i c a t i o n s 3 5 , 4 6 . T h e s e i n c l u d e f r e e - f o r m s u r f a c e s d e s c r i b e d u s i n g s p l i n e

    p a t c h e s , p r i m i t i v e o b j e c t s l i k e p o l y h e d r a , q u a d r i c s s u r f a c e s l i k e c o n e s , e l l i p s o i d s ,

  • 8/8/2019 Efficient Collision Detection for Animation and Robotics