UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

Modelling and animating three-dimensional articulate figures Cachola, Danny G. 1986

You don't seem to have a PDF reader installed, try download the pdf

Item Metadata

Download

Media
UBC_1986_A6_7 C32.pdf [ 2.95MB ]
Metadata
JSON: 1.0051891.json
JSON-LD: 1.0051891+ld.json
RDF/XML (Pretty): 1.0051891.xml
RDF/JSON: 1.0051891+rdf.json
Turtle: 1.0051891+rdf-turtle.txt
N-Triples: 1.0051891+rdf-ntriples.txt
Original Record: 1.0051891 +original-record.json
Full Text
1.0051891.txt
Citation
1.0051891.ris

Full Text

MODELLING AND ANIMATING THREE-DIMENSIONAL ARTICULATE FIGURES A THESIS SUBMITTED IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE r ,THE FACULTY OF GRADUATE STUDIES We ac c e p t t h i s t h e s i s as c o n f o r m i n g t o the r e q u i r e d s t a n d a r d THE UNIVERSITY OF BRITISH COLUMBIA A p r i l 1986 © Danny G. C a c h o l a , 1986 by DANNY G. CACHOLA i n Computer S c i e n c e In presenting this thesis in partial fulfilment of the requirements for an advanced degree at the University of British Columbia, I agree that the Library shall make it freely available for reference and study. I further agree that permission for extensive copying of this thesis for scholarly purposes may be granted by the head of my department or by his or her representatives. It is understood that copying or publication of this thesis for financial gain shall not be allowed without my written permission. Department of Cn^A+s ^ciffMC-f The University of British Columbia 1956 Main Mall Vancouver, Canada V6T 1Y3 Date frprA 1ST I M9c ABSTRACT T h i s t h e s i s d e s c r i b e s an a n i m a t i o n e x t e n s i o n t o a h i g h - l e v e l g r a p h i c a l programming language which p r o v i d e s c o n s t r u c t s f o r the d e f i n i t i o n , m a n i p u l a t i o n , and e x t e r n a l r e p r e s e n t a t i o n of t h r e e - d i m e n s i o n a l a r t i c u l a t e f i g u r e s and and t h e i r a s s o c i a t e d movements. The e x t e n s i o n p e r m i t s the d e f i n i t i o n of models c o n s i s t i n g of segments and j o i n t s and the s p e c i f i c a t i o n of each model's motion at a h i g h l e v e l of a b s t r a c t i o n . The r e l a t i o n s h i p of the e x t e n s i o n w i t h r e s p e c t t o ^ t h e h o s t language i s d i s c u s s e d and a g e n e r a l d e s c r i p t i o n of the a n i m a t i o n language's d e s i g n and i m p l e m e n t a t i o n i s g i v e n . The m o d e l l i n g and motion c o n s t r u c t s a r e d i s c u s s e d and examples of the c o n s t r u c t s a r e p r e s e n t e d . I t i s c o n c l u d e d t h a t h i g h l e v e l a n i m a t i o n p e r m i t s the i m p l e m e n t a t i o n of s o p h i s t i c a t e d a p p l i c a t i o n programs t h a t are easy t o r e a d and u n d e r s t a n d . TABLE OF CONTENTS LIST OF FIGURES i v 1. INTRODUCTION 1 2. LANGUAGE DESIGN ENVIRONMENT 6 3. MODELLING SYSTEM 11 3.1 DESCRIPTION OF JOINTS 11 3.2 INTERNAL REPRESENTATION 15 3.3 MODEL DEFINITION USING SUBMODELS 22 3.4 MODEL DEFINITION BY CONSTRUCT 25 3.5 MODEL TRANSFORMATIONS 28 4. MOTION PRIMITIVES 3 5 4.1 MOTION SPECIFICATION 37 4.2 EXPLICIT DEFINITION 40 4.3 IMPLICIT DEFINITION 45 4.4 MOTION TRANSFORMATIONS 50 5. CREATING ANIMATION 53 5.1 TOOLS FOR ANIMATION 53 5.2 MODEL TRAVERSAL 58 5.3 LEVELS OF LANGUAGE USAGE 59 6. CONCLUSION 61 BIBLIOGRAPHY 68 APPENDIX A - A LIG ANIMATE PROGRAM 70 APPENDIX B - IMPLEMENTATION NOTES 75 i i i LIST OF FIGURES F i g u r e Page 1 Two j o i n t s i n d i f f e r e n t n e u t r a l p o s i t i o n s 15 2 D e f i n i t i o n of g r a p h i c a l o b j e c t s 16 3 Sample j o i n t extremes 17 4 P a r t i a l model of a human f i g u r e 18 5 I n t e r n a l s t r u c t u r e of a model 18 6 I n f o r m a t i o n a s s o c i a t e d w i t h each l i n k 20 7a Open k i n e m a t i c c h a i n 21 7b C l o s e d k i n e m a t i c c h a i n 21 8 Model symbol t a b l e 21 9 Model assignment 23 10a Model s q u a t t i n g 31 10b M o d i f i e d model s q u a t t i n g 31 11 Model s q u a t t i n g w i t h the f o o t as main l i n k 32 12 Model s q u a t t i n g w i t h the t o r s o as main l i n k 32 13 J o i n t s w i t h same a n g l e but d i f f e r e n t s i g n 34 14 Model i m p r o p e r l y s q u a t t i n g 34 15 M o t i o n s p e c i f i c a t i o n f o r a s i n g l e j o i n t 38 16 Keyframe i n f o r m a t i o n 38 17 M o t i o n t e m p l a t e 39 18 Frames from the c l o c k a n i m a t i o n 43 19 S t r i p o p e r a t i o n 48 i v 20 S y n c h r o n i z e o p e r a t i o n 49 21 Sample motion a 51 22 M o t i o n b from b = a <SCALE FRAMES -2.0> 51 2 3 M o t i o n b from b = a <SCALE EXTREMES 0.5> 52 v Chapter 1 INTRODUCTION "Animation i s the g r a p h i c a r t which o c c u r s i n t i m e . Whereas a s t a t i c image (such as a P i c a s s o or a complex graph) may convey complex i n f o r m a t i o n t h r o u g h a s i n g l e p i c t u r e , a n i m a t i o n conveys e q u i v a l e n t l y complex i n f o r m a t i o n t h r o u g h a sequence of images seen i n t i m e . I t i s c h a r a c t e r i s t i c of t h i s medium opposed t o s t a t i c imagery, t h a t the a c t u a l g r a p h i c a l i n f o r m a t i o n a t any g i v e n i n s t a n t i s r e l a t i v e l y s l i g h t . The source of i n f o r m a t i o n f o r the viewer of a n i m a t i o n i s i m p l i c i t i n p i c t u r e change: change i n r e l a t i v e p o s i t i o n , shape, and dynamics. T h e r e f o r e , a computer i s i d e a l l y s u i t e d t o making a n i m a t i o n ' p o s s i b l e ' t h rough the f l u i d r e f i n e m e n t of t h e s e changes." Baecker [4] Mankind has always been i n t e r e s t e d i n p i c t o r i a l l y r e p r e s e n t i n g h i s w o r l d . T h i s i s u n d e r s t a n d a b l e ; p i c t u r e s can invoke emotions, r e f r e s h memories, t e a c h , and e x p l a i n . They a l l o w the r e p r e s e n t a t i o n of a maximum amount of i n f o r m a t i o n i n a minimum a r e a . W i t h i n the l a s t one hundred y e a r s , a new i n t e r e s t has d e v e l o p e d ; t h e d e s i r e t o add movement t o p i c t u r e s . The use of a n i m a t i o n has been w i d e l y a c c e p t e d and moving p i c t u r e s have become common, however, the c r e a t i o n of a n i m a t i o n i s a l a b o u r - i n t e n s i v e p r o c e s s . For each second of v i e w i n g t i m e , h i g h q u a l i t y - f i l m a n i m a t i o n r e q u i r e s the p r e p a r a t i o n of t w e n t y - f o u r images ( f r a m e s ) , each d i f f e r i n g o n l y s l i g h t l y 1 2 from the p r e c e d i n g one. A two-hour animated f e a t u r e f i l m c o n t a i n s a p p r o x i m a t e l y 170,000 frames. In an attempt t o d e c r e a s e the l a b o u r i n v o l v e d , commercial s t u d i o s have t r a d i t i o n a l l y p a i n t e d images onto c e l l u l o i d s h e e t s c a l l e d " e e l s " . S e v e r a l of these o v e r l a y s are used t o c r e a t e a frame. T h i s t e c h n i q u e saves t i m e , because o n l y the p a r t s of a c h a r a c t e r t h a t a c t u a l l y move i n a p a r t i c u l a r frame have t o be redrawn. The e n t i r e p r o c e s s can s t i l l be q u i t e e x p e n s i v e , s i n c e a f e a t u r e f i l m may r e q u i r e the p r e p a r a t i o n of over h a l f a m i l l i o n e e l s [ 6 ] , With the i n t r o d u c t i o n of computers, a f a s t e r and cheaper method of p r o d u c i n g animated f i l m s was made p o s s i b l e . The f i r s t e f f o r t s t o u t i l i z e d i g i t a l computers i n the p r o d u c t i o n of animated f i l m s d a t e s back t o the e a r l y 1960s. C o m p u t e r - a s s i s t e d a n i m a t i o n has s i n c e p l a y e d a r o l e i n the t h r e e main a r e a s of c o n v e n t i o n a l a n i m a t i o n : the c r e a t i o n of d r a w i n g s , the p r o d u c t i o n of in-between frames, and the p a i n t i n g of e e l s . Recent advances i n computer g r a p h i c s hardware and s o f t w a r e have made computer a n i m a t i o n a r a p i d l y expanding f i e l d which now i n c l u d e s a l a r g e number of d i f f e r e n t p r o d u c t i o n s t y l e s , a pproaches, and t e c h n i q u e s . One new approach t h a t has been d e v e l o p e d i s computer- m o d e l l e d a n i m a t i o n . Computer-modelled a n i m a t i o n d i f f e r s from c o m p u t e r - a s s i s t e d a n i m a t i o n because i t c o r r e s p o n d s t o 3 a n i m a t i o n sequences i n which t h r e e - d i m e n s i o n a l models move about i n a t h r e e - d i m e n s i o n a l space. T h i s p r o c e s s i s ve r y complex w i t h o u t a computer. Many of the advances which have o c c u r r e d i n computer m o d e l l i n g i n the l a s t few y e a r s have been i n the ar e a of f i g u r e m o d e l l i n g and motion s p e c i f i c a t i o n . S e v e r a l methods have been proposed i n c l u d i n g the m o d e l l i n g and c o n t r o l of f i g u r e s u s i n g p r o c e d u r e s ( p r o c e d u r a l m o d e l l i n g ) [ 1 3 ] , the c o n t r o l of a p h y s i c a l model by the a p p l i c a t i o n of f o r c e s (dynamic m o d e l l i n g ) [ 1 ] , the use of g o a l - d i r e c t e d systems f o r the g e n e r a t i o n of a model's motion [12, 2 3 ] , and the use of key frame a n i m a t i o n [ 7 ] , one of the o l d e s t a n i m a t i o n t e c h n i q u e s s t i l l i n use. A d i f f e r e n t approach f o r the m o d e l l i n g of a t h r e e - d i m e n s i o n a l a r t i c u l a t e f i g u r e and the subsequent c o n t r o l of i t s motions w i l l be p r e s e n t e d h e r e . Whereas many of the p r e v i o u s methods have approached f i g u r e m o d e l l i n g from a s u b r o u t i n e l e v e l , t h i s approach i n v o l v e s the use of a h i g h - l e v e l a n i m a t i o n programming language. I t p r o v i d e s c o n s t r u c t s t h a t p e r m i t a programmer t o d e f i n e and m a n i p u l a t e d a t a of the type MODEL and MOTION, t h e r e f o r e a l l o w i n g the r e p r e s e n t a t i o n of r e a l t h r e e - d i m e n s i o n a l j o i n t e d b o d i e s and t h e i r a s s o c i a t e d motions [ 2 4 ] . 4 T h i s t h e s i s d i s c u s s e s a s p e c t s of the d e s i g n and i m p l e m e n t a t i o n of such a language. The problem of f i g u r e m o d e l l i n g and motion s p e c i f i c a t i o n i s d e a l t w i t h i n terms of k i n e m a t i c s : the study of p o s i t i o n ( d i s p l a c e m e n t ) and i t s time d e r i v a t i v e s ( v e l o c i t y and a c c e l e r a t i o n ) . C o n s i d - e r a t i o n s of f o r c e , mass (dynamics) [ 1 1 , 17], b a l a n c e [ 1 5 ] , and o b s t a c l e a v o i d a n c e [ 1 8 ] are beyond th e scope of t h i s t h e s i s. Chapter 2 p r e s e n t s an overview of the a n i m a t i o n language. The o v e r a l l r e l a t i o n s h i p of the language w i t h r e s p e c t t o the host language i s c o n s i d e r e d . In a d d i t i o n , a g e n e r a l d e s c r i p t i o n of the language's d e s i g n and i m p l e m e n t a t i o n i s g i v e n . The language's m o d e l l i n g c o n s t r u c t s a r e s t u d i e d i n Chapter 3. The i n t e r n a l r e p r e s e n t a t i o n of a f i g u r e and i t s i m p l e m e n t a t i o n i s d i s c u s s e d . A l s o , two d i f f e r e n t t e c h n i q u e s f o r m o d i f y i n g a d e f i n e d model a r e p r e s e n t e d . Chapter 4 i n t r o d u c e s the concept of a motion p r i m i t i v e and examines the c o n s t r u c t s which a l l o w the motion's d e f i n i t i o n and m a n i p u l a t i o n . The motion's i n t e r n a l r e p r e s e n t a t i o n i s a n a l y z e d and i t s i m p l e m e n t a t i o n i s p r e s e n t e d . 5 Chapter 5 examines how the a r t i c u l a t e f i g u r e s and motion p r i m i t i v e s a r e i n t e g r a t e d t o produce a n i m a t i o n . In a d d i t i o n , s e v e r a l language f e a t u r e s are i n t r o d u c e d which s i m p l i f y the a n i m a t i o n p r o c e s s . Chapter 2 LANGUAGE DESIGN ENVIRONMENT V i r t u a l l y a l l g r a p h i c s programming languages a r e e x t e n s i o n s t o e x i s t i n g h i g h - l e v e l computer languages, s i n c e a g r a p h i c s a p p l i c a t i o n program g e n e r a l l y r e q u i r e s non- g r a p h i c s c o n s t r u c t s f o r s u p p o r t . The same a p p l i e s t o the a n i m a t i o n language d i s c u s s e d h e r e . I t assumes the a v a i l a b i l i t y of a h i g h - l e v e l g r a p h i c s programming language which p r o v i d e s the support f o r the non-animation c o n s t r u c t s p r e s e n t i n an a n i m a t i o n a p p l i c a t i o n program. The c o n s t r u c t s and f e a t u r e s i n t r o d u c e d are independent of any of the h o s t c o n s t r u c t s , c o n s e q u e n t l y the a n i m a t i o n e x t e n s i o n can be a p p l i e d t o any h i g h - l e v e l g r a p h i c s language w i t h e q u a l s u c c e s s . The h o s t language used i n the i m p l e m e n t a t i o n i s c a l l e d LIG6 (Language f o r I n t e r a c t i v e G r a p h i c s V e r s i o n 6) [19, 22] and i s c u r r e n t l y i n use o n l y a t the U n i v e r s i t y of B r i t i s h C o l umbia. The LIG6 system i s implemented on a 48 megabyte Amdahl 5850 mainframe, under the M i c h i g a n T e r m i n a l System. The language LIG6 was chosen f o r two main r e a s o n s : i t i s an easy language t o l e a r n , and i t has been d e s i g n e d as a p r o d u c t i o n system. A l s o , a l a r g e number of s t u d e n t s have been exposed t o LIG6, thus e n s u r i n g t h a t the language i s 6 7 f r e e of e r r o r s . S i n c e LIG6 i s the h o s t language, the a n i m a t i o n language i m p l e m e n t a t i o n i s c a l l e d LIG ANIMATE (Language f o r I n t e r a c t i v e G r a p h i c s ANIMATion E x t e n s i o n ) . LIG6 i s implemented as a FORTAN e x t e n s i o n . A p r e p r o c e s s o r w r i t t e n i n PASCAL c o n v e r t s LIG6 programs i n t o s t a n d a r d FORTRAN programs w i t h e x t e n s i o n elements t r a n s l a t e d i n t o c a l l s t o s u b r o u t i n e s i n a run-time l i b r a r y . The s u b r o u t i n e s a r e coded i n FORTRAN. When a LIG6 a p p l i c a t i o n program i s t o be e x e c u t e d , the o b j e c t deck produced by c o m p i l i n g the p r e p r o c e s s o r o u t p u t i s run i n c o n j u n c t i o n w i t h the run-time l i b r a r y ; more complete i n f o r m a t i o n i s a v a i l a b l e i n the LIG6 User ' s Manual [ 2 0 ] . S i n c e the LIG ANIMATE c o n s t r u c t s a re independent of i t s h o s t language, the t r a n s l a t o r f o r the language i s implemented as an independent p r e p r o c e s s o r . The p r e p r o c e s s o r a n a l y z e s o n l y the a n i m a t i o n c o n s t r u c t s p r e s e n t i n the a n i m a t i o n a p p l i c a t i o n program and produces LIG6 t a r g e t code. The d e c i s i o n t o use a p r e p r o c e s s o r has proven t o be s a t i s f a c t o r y . I t has a l l o w e d e x p e r i m e n t a t i o n w i t h d i f f e r e n t a n i m a t i o n c o n s t r u c t s and has a l l o w e d e x p e r i m e n t a t i o n w i t h the p r e p r o c e s s o r i t s e l f . In a d d i t i o n , the c o n s t r u c t i o n of a complete c o m p i l e r f o r LIG6 and the e x t e n s i o n would have c o m p l i c a t e d the o b j e c t i v e of t h i s t h e s i s . 8 The LIG ANIMATE p r e p r o c e s s o r was w r i t t e n w i t h the use of a top-down C o m p i l e r W r i t i n g System (CWS). A CWS a i d s i n the c r e a t i o n of a c o m p i l e r or p r e c o m p i l e r ( p r e p r o c e s s o r ) f o r a g e n e r a l language, hence, i t was unnecessary t o c o m p l e t e l y w r i t e the p r e p r o c e s s o r . S e v e r a l consequences r e s u l t from the use of a CWS i n c r e a t i n g the p r e p r o c e s s o r . The CWS does not support the f r e e form i n p u t c o n v e n t i o n s of LIG6; d e l i m i t e r s and r e s e r v e d words are r e q u i r e d [ 1 6 ] . Co n s e q u e n t l y , the host language s t a t e m e n t s can not be p a r s e d ; i t i s n e c e s s a r y t o f l a g t he e x t e n s i o n s t a t e m e n t s w i t h a s p e c i a l c h a r a c t e r (an a s t e r i s k ) i n the f i r s t column. The s e g r e g a t i o n of the host language and e x t e n s i o n s t a t e m e n t s i n t r o d u c e s two r e s t r i c t i o n s . The p r e p r o c e s s o r does not a l l o w t h e m i x t u r e of h o s t and e x t e n s i o n s t a t e m e n t s on a s i n g l e l i n e . Any s y n t a c t i c e r r o r s which a r e p r e s e n t i n the h o s t s t a t e m e n t s a r e not d e t e c t e d u n t i l the p r e p r o c e s s o r output i s c o m p i l e d . The o b j e c t i v e of the r e s e a r c h was not the c r e a t i o n of a complete p r o d u c t i o n system. I t s o b j e c t was t o examine the d e f i n i t i o n of a n i m a t i o n a t a h i g h l e v e l of a b s t r a c t i o n , t h e r e f o r e , the approach was chosen t o s i m p l i f y the i m p l e m e n t a t i o n . LIG ANIMATE has been d e s i g n e d i n d e p e n d e n t l y of the host language, hence, i t does not ta k e advantage of many of the h o s t ' s c o n s t r u c t f e a t u r e s . For example, LIG6 a l l o w s the use of. COMMON s t a t e m e n t s , a r r a y s , f u n c t i o n s , and parameter 9 p a s s i n g of the b a s i c d a t a t y p e s . LIG ANIMATE does not a l l o w t h e s e f e a t u r e s w i t h the use of i t s d a t a type MODEL, a l t h o u g h , MOTION data t y p e s can be used i n COMMON statements and passed as para m e t e r s . The i m p l e m e n t a t i o n does share some g e n e r a l i n p u t c o n v e n t i o n s w i t h LIG6. A l t h o u g h the p r e p r o c e s s o r i n t r o d u c e s r e s e r v e d words which must be d e l i m i t e d by b l a n k s , s t a t e m e n t s may span two or more l i n e s . M u l t i p l e e x t e n s i o n s t a t e m e n t s per l i n e a r e a l l o w e d , p r o v i d e d they a r e s e p a r a t e d by s e m i c o l o n s . Comments e n c l o s e d i n b r a c e s may appear anywhere. The l e n g t h of a l i n e i s 255 c h a r a c t e r s and column p o s i t i o n s a re not i m p o r t a n t w i t h r e s p e c t t o the b e g i n n i n g of s t a t e m e n t s . S e v e r a l LIG6 i n p u t c o n v e n t i o n s have been extended i n LIG ANIMATE. V a r i a b l e names, p r e s e n t i n the a n i m a t i o n c o n s t r u c t s , may c o n t a i n up t o f i f t e e n c h a r a c t e r s , however, the f i r s t f i v e c h a r a c t e r s must be un i q u e . I d e n t i f i e r s , v a r i a b l e s , and keywords used i n LIG ANIMATE may be i n e i t h e r upper case or lower c a s e , s i n c e they a r e t r a n s l a t e d t o upper c a s e . The o n l y c o n s i d e r a t i o n which a f f e c t s any of the host code s t a t e m e n t s i s t h a t none of the v a r i a b l e s p r e s e n t i n the ho s t s t a t e m e n t s or a n i m a t i o n c o n s t r u c t s can b e g i n w i t h the d o l l a r s i g n . V a r i a b l e s b e g i n n i n g w i t h the d o l l a r s i g n a re r e s t r i c t e d f o r use by the LIG6 ANIMATE r o u t i n e s . 1 0 Two f a c t o r s h e l p e d f u r t h e r shape the e v e n t u a l d e s i g n of the p r e p r o c e s s o r . The CWS i s based on PASCAL and LIG6 i s based on FORTRAN. A problem i s c r e a t e d s i n c e the m a n i p u l a t i o n of a r t i c u l a t e f i g u r e s i s n a t u r a l l y r e c u r s i v e . FORTRAN does not e a s i l y a l l o w the s i m u l a t i o n of r e c u r s i o n , t h e r e f o r e , the model database i s s t o r e d i n the p r e p r o c e s s o r . The p r e p r o c e s s o r r e c e i v e s commands to d e f i n e , m a n i p u l a t e , and d i s p l a y models i n i t s d a t a b a s e . When the p r e p r o c e s s o r d i s p l a y s the model, i t does so by c r e a t i n g program segments t h a t LIG6 can p r o c e s s . The motion database i s not s t o r e d i n the p r e p r o c e s s o r . A s u i t a b l e r e p r e s e n t a t i o n was implementable i n the host language, c o n s e q u e n t l y , motions a re s t o r e d i n the host language. The p r e p r o c e s s o r d i r e c t l y t r a n s l a t e s motion c o n s t r u c t s i n t o a form which the LIG6 language can c o m p i l e . The motion e x t e n s i o n s a re t r a n s l a t e d i n t o c a l l s t o s u b r o u t i n e s i n a run-time l i b r a r y . The s u b r o u t i n e s a re w r i t t e n i n LIG6. When a LIG ANIMATE program i s t o be ex e c u t e d , the o b j e c t deck produced by c o m p i l i n g the LIG6 output i s run i n c o n j u n c t i o n w i t h the run-time l i b r a r y . Chapter 3 MODELLING SYSTEM B e f o r e an attempt i s made t o s p e c i f y a d e s i r e d motion f o r a f i g u r e , a method f o r s p e c i f y i n g the f i g u r e must be a v a i l a b l e . T h i s c h a p t e r d i s c u s s e s the problems a s s o c i a t e d w i t h model s p e c i f i c a t i o n and p r e s e n t s two c o n s t r u c t s t h a t a l l o w the c r e a t i o n of an a r t i c u l a t e model. LIG ANIMATE assumes t h a t a l l of the model's segments ( l i n k s ) a r e r i g i d , t h a t i s , once d e f i n e d , the l i n k s a r e assumed t o remain the same shape throughout the l i f e of the model. No f o r m a l s p e c i f i c a t i o n i s i n c o r p o r a t e d i n LIG ANIMATE f o r the d e f i n i t i o n of l i n k s , they a r e assumed t o be d e f i n e d as g r a p h i c a l o b j e c t s i n the host language. Every segment i s assumed t o have been d e f i n e d i n i t s own l o c a l c o o r d i n a t e system [ 3 , 12, 2 3 ] , w i t h the o r i g i n a t the c e n t e r of the l i n k . 3.1 DESCRIPTION OF JOINTS In the s i m p l e s t form, an a r t i c u l a t e model c o n t a i n s two r i g i d segments and a j o i n t between the segments. S i n c e the r e s p o n s i b i l i t y f o r d e f i n i n g , m a n i p u l a t i n g , and d i s p l a y i n g the l i n k s i s t h a t of the host language, LIG ANIMATE i s o n l y 1 1 1 2 r e s p o n s i b l e f o r the s p e c i f i c a t i o n of the r e l a t i o n s h i p between the l i n k s . The s p e c i f i c a t i o n i n c l u d e s the p o s i t i o n , degrees of freedom, and r e s t r i c t i o n s on a j o i n t . A j o i n t has up t o t h r e e degrees of freedom; i t can be r o t a t e d about the X, Y, and Z axes. J o i n t s may be r e s t r i c t e d t o fewer than t h r e e degrees of freedom by p e r m i t t i n g the j o i n t t o r o t a t e about o n l y one or two of the axes. Thus, s i m p l e j o i n t s such as f i n g e r s ( h i n g e j o i n t s ) , and complex j o i n t s , such as s h o u l d e r s ( b a l l - a n d - s o c k e t j o i n t s ) can be s i m u l a t e d . A j o i n t c o n n e c t s o n l y two segments. A j o i n t can move i n d e p e n d e n t l y of a l l o t h e r j o i n t s , hence, the p o s i t i o n of one j o i n t does not a f f e c t the motion of a n o t h e r . L i n k s a re r e s t r i c t e d i n t h e i r movements about a j o i n t . D u r i n g a s i n g l e j o i n t ' s movement, one l i n k ( t h e p r i m a r y segment) i s c o n s i d e r e d s t a t i o n a r y and the second l i n k ( the secondary segment) moves w i t h r e s p e c t t o the s t a t i o n a r y l i n k . A s i n g l e l i n k can f u n c t i o n as both a p r i m a r y segment and a secondary segment i f i t belongs t o more than one j o i n t . One segment, the model's main l i n k , i s s i n g l e d out from the o t h e r s . A l l movement u l t i m a t e l y r e f e r s t o the main l i n k . Only one segment may be d e s i g n a t e d as the main l i n k and i t must be the p r i m a r y segment i n a l l j o i n t s i t belongs t o . 1 3 Each j o i n t i n s t a n c e i s a s s i g n e d a unique i d e n t i f i e r t h a t p e r m i t s subsequent r e f e r e n c e t o the j o i n t . The user may p l a c e r e s t r i c t i o n s on the range of a n g l e s t h rough which the secondary l i n k can t r a v e l and may s p e c i f y where the two segments a r e t o be j o i n e d . A t y p i c a l statement c r e a t i n g an a r t i c u l a t e j o i n t i s JOINT j o i n t _ i d e n t i f i e r , p r i m a r y _ l i n k , r e l a t i v e _ l o c a t i o n _ 1 , s e c o n d a r y _ l i n k , r e l a t i v e _ l o c a t i o n _ 2 , x_extremes, y_extremes, z_extremes where ' j o i n t _ i d e n t i f i e r ' i s the unique i d e n t i f i e r f o r t h i s j o i n t i n s t a n c e ; ' p r i m a r y _ l i n k ' and ' s e c o n d a r y _ l i n k ' a r e p r e v i o u s l y d e c l a r e d g r a p h i c a l o b j e c t s (which a r e d e f i n e d i n independent c o o r d i n a t e s y s t e m s ) . ' p r i m a r y _ l i n k ' i s the s t a t i o n a r y ( segment w i t h which ' s e c o n d a r y _ l i n k ' moves. ' r e l a t i v e _ l o c a t i o n _ 1 ' and ' r e l a t i v e _ l o c a t i o n _ 2 ' a r e v e c t o r s t h a t c o n t a i n the j o i n t ' s r e l a t i v e p o s i t i o n s , w i t h r e s p e c t t o each g r a p h i c a l o b j e c t ' s c o o r d i n a t e system. The extreme parameters a r e component v e c t o r s which s t o r e a p a i r of maximum a n g l e s beyond which the j o i n t can not move. Extremes, as w e l l as the j o i n t ' s c u r r e n t a n g l e s , a r e s p e c i f i e d r e l a t i v e t o the j o i n t ' s p r e d e f i n e d n e u t r a l p o s i t i o n of (0°, 0°, 0°). The n e u t r a l p o s i t i o n f o r a j o i n t i s d e t e r m i n e d by the d e f i n i t i o n of the g r a p h i c a l o b j e c t s used i n the j o i n t . Two d i f f e r e n t j o i n t s a r e shown i n F i g u r e 1. In b o t h c a s e s , the models a r e p r e s e n t i n t h e i r n e u t r a l p o s i t i o n s which i s 1 4 p o s s i b l e o n l y i f the segments a r e d e f i n e d as i n F i g u r e 2 and the j o i n t l o c a t i o n s a r e s p e c i f i e d as i n the subsequent s t a t e m e n t s . JOINT j o i n t _ i d , o b j e c t 1, ( 0 . 0 , - 2 . 0 , 0 . 0 ) , o b j e c t 2 , ( 0 . 0 , +2 . 0 , 0 . 0 ) , x_extremes, y_extremes, z_extremes JOINT j o i n t _ i d , o b j e c t 3 , ( 0 . 0 , - 2 . 0 , 0 . 0 ) , o b j e c t 4 , (-2 . 0 , 0 . 0 , 0 . 0 ) , x_extremes, y_extremes, z_extremes Both images i n F i g u r e 1 can be produced by e i t h e r of the j o i n t s p r e s e n t e d , i f the c u r r e n t a n g l e s i n e i t h e r j o i n t a re + 9 0 ° , or - 9 0 . 0 ° , r e s p e c t i v e l y . The d i r e c t i o n of the extremes a s s o c i a t e d w i t h a j o i n t can be d e t e r m i n e d by the r i g h t hand r u l e . By p o i n t i n g the r i g h t hand thumb i n the d i r e c t i o n of the p o s i t i v e h a l f of an a x i s and c l o s i n g the r i g h t hand, the c o u n t e r c l o c k w i s e d i r e c t i o n of the c u r l e d f i n g e r s i s the p o s i t i v e d i r e c t i o n f o r the extremes. C o n s e q u e n t l y , the c l o c k w i s e d i r e c t i o n about the a x i s i s the n e g a t i v e d i r e c t i o n f o r the extremes. F i g u r e 3 d i s p l a y s a j o i n t i n i t s n e u t r a l p o s i t i o n which c o n t a i n s one degree of freedom s i n c e the X and Y axes a r e l o c k e d a t 0 ° . The j o i n t ' s axes and the a s s o c i a t e d maximums are a l s o d i s p l a y e d i n the f i g u r e . The j o i n t can be c r e a t e d by the s t a t e m e n t : JOINT j o i n t _ i d , o b j e c t l , r e l _ l ' o c 1 , o b j e c t 2 , r e l l o c 2 , ( 0 ° , 0 ° ) , ( 0 7 7 , 0 ° ) , ( 0 ° , 135°) 1 5 F i g u r e 1 Two j o i n t s i n d i f f e r e n t n e u t r a l p o s i t i o n s 3.2 INTERNAL REPRESENTATION The i n t e r n a l r e p r e s e n t a t i o n of an a r t i c u l a t e f i g u r e i s d e s c r i b e d by a t r e e s t r u c t u r e of nodes and a r c s t h a t i s s t o r e d i n the LIG ANIMATE p r e p r o c e s s o r . L i n k s a re r e p r e s e n t e d by nodes and the j o i n t s a re r e p r e s e n t e d by a r c s [ 2 , 2 3 ] . Each l e v e l of nodes moves w i t h r e s p e c t t o the nodes of the h i g h e r l e v e l and i s c o n s i d e r e d s t a t i o n a r y by the nodes below. The nodes a t the l e a v e s of the t r e e r e p r e s e n t the outermost e x t r e m i t i e s of the model; the r o o t node i s c o n s i d e r e d the main l i n k . F i g u r e 4 i s an example of 16 Y Y 2.0 2.0 F i g u r e 2 D e f i n i t i o n of g r a p h i c a l o b j e c t s a p a r t i a l model of a human f i g u r e . F i g u r e 5 c o n t a i n s the model's i n t e r n a l s t r u c t u r e . A model may have a t most a t o t a l of m a r c s p r e s e n t i n i t s s t r u c t u r e . T h i s v a l u e i s t h e o r e t i c a l l y u n l i m i t e d , however, LIG ANIMATE c u r r e n t l y r e s t r i c t s models t o a maximum of t h i r t y a r c s ( j o i n t s ) . 1 7 Y axis X axis F i g u r e 3 Sample j o i n t extremes Each node i s a s s o c i a t e d w i t h a t l e a s t one a r c , as i n the case of the e x t r e m i t i e s t h a t a re secondary segments. T y p i c a l l y , two a r c s a r e a s s o c i a t e d w i t h a node, c o r r e s p o n d i n g to a l i n k (such as the femur of a l e g ) t h a t a c t s as both a p r i m a r y and secondary segment, however, a node may have t h r e e or more a r c s a s s o c i a t e d w i t h i t . For example, the hand has s i x a r c s (one r e p r e s e n t i n g the w r i s t j o i n t , t he o t h e r f i v e r e p r e s e n t i n g the f i n g e r j o i n t s ) . A F i g u r e 5 I n t e r n a l s t r u c t u r e of a model 19 node may be a s s o c i a t e d w i t h a t most n a r c s . The b r a n c h i n g f a c t o r n i s a l s o t h e o r e t i c a l l y u n l i m i t e d , but a f a c t o r of ten i s deemed s u f f i c i e n t t o d e f i n e most a r t i c u l a t e f i g u r e s . The i n f o r m a t i o n t y p i c a l l y a s s o c i a t e d w i t h a node i s shown i n F i g u r e 6. Every node c o n t a i n s g e n e r a l i n f o r m a t i o n such as the name of the c o r r e s p o n d i n g h o s t ' s g r a p h i c a l o b j e c t , the s c a l i n g f a c t o r , and the number of j o i n t s p r e s e n t i n which the c u r r e n t node i s a p r i m a r y l i n k . In a d d i t i o n , e v e r y node c a r r i e s j o i n t s p e c i f i c i n f o r m a t i o n . Both of the nodes bounding an a r c c o n t a i n i n f o r m a t i o n p e r t a i n i n g t o the j o i n t and a p o i n t e r t o the j o i n t ' s o p p o s i t e node. Each node a l s o c o n t a i n s a j o i n t i d e n t i f i e r and the l o c a t i o n of the j o i n t on the node's g r a p h i c a l o b j e c t . The j o i n t i d e n t i f i e r i s used t o i d e n t i f y a , j o i n t and a c t s as a p o i n t e r t o i n f o r m a t i o n s t o r e d at the model l e v e l c o n t a i n i n g the r e s t r i c t i o n s a s s o c i a t e d w i t h the j o i n t . The j o i n t i n f o r m a t i o n s t o r e d a t t a b l e l o c a t i o n z e r o r e p r e s e n t s a j o i n t i n which the c u r r e n t node i s a secondary segment (an upward a r c ) . The j o i n t i n f o r m a t i o n s t o r e d i n l o c a t i o n s one t o n r e p r e s e n t j o i n t s i n which the c u r r e n t node i s a p r i m a r y segment (a downward a r c ) . The model's t r e e s t r u c t u r e p e r m i t s the r e p r e s e n t a t i o n of open k i n e m a t i c c h a i n s o n l y . A k i n e m a t i c c h a i n . i s a l i n e a r sequence of l i n k s t h a t a r e co n n e c t e d by j o i n t s . In an open c h a i n , one end p o i n t i s f i x e d and the r e m a i n i n g 20 Graphical Object Name Object Scale Number of Sub jo in ts No. J o i n l # Ptr to Node Jo in t Loca t ion 0 0 0 ( 0 , 0 , 0 ) 1 0 0 ( 0 , 0 , 0 ) 2 0 0 ( 0 , 0 , 0 ) n 0 0 (0,0',0) F i g u r e 6 I n f o r m a t i o n a s s o c i a t e d w i t h each l i n k c h a i n i s a l l o w e d t o move f r e e l y , as i n F i g u r e 7a. In a c l o s e d c h a i n , more than one end p o i n t i s f i x e d i n space, as i n F i g u r e 7b. For example, i f two hands a r e j o i n e d t o g e t h e r and the arms a re a l l o w e d t o move w h i l e keeping the body m o t i o n l e s s , a c l o s e d k i n e m a t i c c h a i n i s formed by the arms. The motion produced i n such a c h a i n i s more complex t o a n a l y z e and i s beyond the scope of t h i s t h e s i s . Every model has an a s s o c i a t e d symbol t a b l e , see F i g u r e 8. The t a b l e c o n t a i n s i n f o r m a t i o n from the d e c l a r a t i o n of the model, i n a d d i t i o n t o s t a t e i n f o r m a t i o n . The i n f o r m a t i o n i n c l u d e s : the j o i n t i d e n t i f i e r s , the r o t a t i o n a l maximums a s s o c i a t e d w i t h each degree of freedom, the c u r r e n t r o t a t i o n a l a n g l e s of each degree of freedom, and the 21 F i g u r e 7a F i g u r e 7b a) Open k i n e m a t i c c h a i n b) C l o s e d k i n e m a t i c c h a i n i n s t a n t a n e o u s v e l o c i t y and a c c e l e r a t i o n of the j o i n t s a l o n g each degree of freedom. The t a b l e i s d e f i n e d t o d e s c r i b e the model's p o s i t i o n c o m p l e t e l y . The c o n t e n t s of the t a b l e , a t a s p e c i f i c frame, r e p r e s e n t s a model's c u r r e n t o r i e n t a t i o n . Jo in t # Cur rent O r i e n t a t i o n X E x t r e m e s Y E x t r e m e s z E x t r e m e s C u r r e n t V e l o c i t y Current A c c e l e r a t i o n No. 1 ( 0 , 0 , 0 ) ( 0 , 0 , 0 ) ( 0 , 0 , 0 ) (0 ,0 ,0 ) 0 0 No. 2 ( 0 , 0 , 0 ) ( 0 , 0 , 0 ) ( 0 , 0 , 0 ) ( 0 , 0 , 0 ) 0 0 No. 3 ( 0 , 0 , 0 ) ( 0 , 0 , 0 ) ( 0 , 0 , 0 ) (0 ,0 ,0 ) 0 0 No. m (0,o',0) (0,o",0) (0,o",0) (0,o",0) 0 0 F i g u r e 8 Model symbol t a b l e 22 S i n c e the s t a t e i n f o r m a t i o n must be a v a i l a b l e t o the model d u r i n g the a n i m a t i o n , the t a b l e can not be s t o r e d i n the p r e p r o c e s s o r . The t a b l e i s s t o r e d i n a s u i t a b l e form i n the host language. Whenever the p r e p r o c e s s o r r e c e i v e s a command t o r e t r i e v e a model, the p r e p r o c e s s o r t r a n s f e r s the model's e x t e r n a l r e p r e s e n t a t i o n and the model's symbol t a b l e t o the t a r g e t code. 3.3 MODEL DEFINITION USING SUBMODELS An a r t i c u l a t e model can be d e f i n e d u s i n g two b a s i c t e c h n i q u e s . The f i r s t uses the JOINT c o n s t r u c t and a l l o w s the use of a r t i c u l a t e submodels; the second approach i s d i s c u s s e d i n S e c t i o n 3.4. I n s t e a d of s i m p l y u s i n g a s t a t i c g r a p h i c a l o b j e c t f o r eve r y l i n k , each l i n k can c o n s i s t of a gr o u p i n g of o t h e r segments and j o i n t s , which p e r m i t s the c r e a t i o n of i n t e r m e d i a t e models or submodels t h a t can be r e f e r e n c e d i n d e p e n d e n t l y . In the s t a t e m e n t s , a :- JOINT .., o b j 1 , .., o b j 2 , .. b :- JOINT .., o b j 3 , .., a, c :- JOINT .., b, .., o b j 4 , .. d :- JOINT .., a, .., b, the symbols 'a', 'b', ' c ' , 'd' r e p r e s e n t v a r i a b l e s of the type MODEL. The symbol i s the model assignment o p e r a t o r , which causes the r e s u l t i n g node s t r u c t u r e on the r i g h t hand s i d e of the MODEL v a r i a b l e t o be s t o r e d on the 23 l e f t hand s i d e of the o p e r a t o r . I f each of the p r e c e d i n g s t a t e m e n t s were executed i n o r d e r , the s t r u c t u r e s i n F i g u r e 9 would be g e n e r a t e d r e s p e c t i v e l y . Model A Model B Model C Objl Obj2 Obj3 Objl Obj2 Obj3 Objl Obj4 Obj2 Model D Objl Obj2 Obj3 Objl Obj2 F i g u r e 9 Model assignment The JOINT c o n s t r u c t can be compared t o the '+' ( s u p e r p o s i t i o n ) i n h i g h - l e v e l g r a p h i c a l l a n g u a g e s . Whenever the secondary segment i s a model, the r e l a t i v e l o c a t i o n v e c t o r f o r the secondary segment must be s p e c i f i e d w i t h r e s p e c t t o the main l i n k i n the submodel. Models a r e i n t e r n a l l y r e p r e s e n t e d as p o i n t e r s t r u c t u r e s , hence, the LIG ANIMATE system does not a l l o w the user t o c r e a t e c y c l e s i n the s t r u c t u r e s . I n f i n i t e l o o p s a r e p r e v e n t e d s i n c e the system uses c o p i e s of the submodels s p e c i f i e d i n the JOINT c o n s t r u c t , i f the submodel's name i s not t h e same as the 24 r e c i p i e n t model. T h i s approach i s e f f e c t i v e because i t p r e v e n t s the c r e a t i o n of i n f i n i t e l o o p s , such as by the s t a t e m e n t s : a :- JOINT .., b, .., c, .. c :- JOINT .., a, .., d, The t e c h n i q u e a l l o w s an e f f i c i e n t i m p l e m e n t a t i o n of model a d d i t i o n . In the st a t e m e n t s a :- JOINT .., a, .., b, a :- JOINT . . , b,- . . , a, model 'b' i s added t o model 'a', w i t h o u t u s i n g c o p i e s of both models. The system has one r e s t r i c t i o n . The f o l l o w i n g statement a :- JOINT .., a, .., a, i s not a l l o w e d . The e x e c u t i o n of such a statement c r e a t e s a s t r u c t u r e c o n t a i n i n g a c y c l e , t h e r e f o r e , the p r e p r o c e s s o r produces an e r r o r message. An advantage t o the above method of model c r e a t i o n i s t h a t fewer s t a t e m e n t s a re r e q u i r e d t o c r e a t e symmetric models. For example, c r e a t i n g a model of a human body f i r s t e n t a i l s the c r e a t i o n of submodels f o r the r i g h t arm and the r i g h t l e g . Once d e f i n e d , both submodels can be d u p l i c a t e d and j o i n e d t o the r i g h t and l e f t h a l f of a human t o r s o . A s e p a r a t e s e t of l e f t l i m b s need not be d e f i n e d . One problem a r i s e s . The v a l u e s of the j o i n t i d e n t i f i e r s s h o u l d not be 25 d u p l i c a t e d i n the r i g h t hand and l e f t hand l i m b s , e l s e the two s e t s of l i m b s w i l l behave i d e n t i c a l l y . Thus, t o ensure unique i d e n t i f i c a t i o n of the j o i n t s , the submodel j o i n t i d e n t i f i e r s must be m o d i f i e d b e f o r e the submodels can be connected t o the t o r s o . C o n s i d e r the sta t e m e n t : arm := JOINT 2, humerus, (1.0, 5.0, 1.0), forearm <TRANS JOINTS BY 10>, (0.0, 0.5, 1.0), (0°, 135°), (0°, 180°) which c r e a t e s a model of an arm c o n s i s t i n g of a forearm and backarm (humerus) j o i n e d a t the elbow. The secondary l i n k ( f o r e a r m ) , which was p r e v i o u s l y d e f i n e d , i s an a r t i c u l a t e model whose j o i n t i d e n t i f i e r s have been t r a n s l a t e d by a v a l u e , o f t en onto a new range of i d e n t i f i e r s . 3.4 MODEL DEFINITION BY CONSTRUCT The submodel approach has one d i s a d v a n t a g e . I t can produce temporary models u n n e c e s s a r i l y . C o n s e q u e n t l y , an a l t e r n a t i v e t e c h n i q u e f o r c r e a t i n g models i s p r o v i d e d t h a t assumes none of the model's subcomponents i s s u b s e q u e n t l y r e q u i r e d . The method c r e a t e s o n l y the r e s u l t a n t model w i t h no i n t e r m e d i a t e a r t i c u l a t e models. The c o n s t r u c t 26 STARTMODEL arm JOINT 1, humerus, (0.0, 5.0, 1.0), u l n a , (0.0, 0.5, 1.0), (0°, 35°), ( 0 C , 180°) JOINT 2, u l n a , (0.0, -5.0, 1.0), palm, (0.0, 3.0, 1.0), (-90°, 0°), (-25°, 25°) JOINT 3, palm, (0.0, -3.0, 1.0), l i t t l e , (0.0, 1.5, 0.5), (-90°, 45°), (-45°, 45°) JOINT 4, palm, (0.0, -3.0, 2.0), r i n g , (0.0, 1.5, 0.5), (-90°, 45°), (-45°, 45°) JOINT 5, palm, (0.0, -3.0, 3.0), m i d d l e , (0.0, 1.5, 0.5), (-90°, 45°), (-45°, 45°) JOINT 6, palm, (0.0, -3.0, 4.0), in d e x , (0.0, 1.5, 0.5), (-90°, 45°), (-45°, 45°) JOINT 7, palm, (0.0, -3.0, 5.0), thumb, (0.0, 1.5, 0.5), (-90°, 45°), (-45°, 45°) ENDMODEL c r e a t e s a n o n - t r i v i a l model 'arm' w i t h a s i n g l e c o n s t r u c t . The p r i m a r y l i n k s , s p e c i f i e d w i t h i n the c o n s t r u c t a r e r e s t r i c t e d t o g r a p h i c a l o b j e c t s , however, the secondary l i n k s may be e i t h e r g r a p h i c a l o b j e c t s or submodels. I f t he model 'hand' c o m p r i s i n g the l a s t f i v e j o i n t s has been d e f i n e d p r i o r t o the use of the MODEL c o n s t r u c t , then the model d e f i n i t i o n can be f u r t h e r s i m p l i f i e d : STARTMODEL arm JOINT 1, humerus, (0.0, 5.0, 1.0), u l n a , (0.0, 0.5, 1.0), (0°, 35°), (0°, 180°) JOINT 2, u l n a , (0.0, -5.0, 1.0), hand, (0.0, 3.0, 1.0), (-90°, 0°), (-25°, 25°) ENDMODEL The o r d e r of the JOINT s t a t e m e n t s p r e s e n t w i t h i n the MODEL 27 c o n s t r u c t i s a r b i t r a r y . The j o i n t s t a t ements need not be s p e c i f i e d i n the same o r d e r as t h e i r appearance i n the i n t e r n a l s t r u c t u r e . The system s o r t s the s p e c i f i c a t i o n s and assembles the model i n the a p p r o p r i a t e o r d e r , p r o v i d e d the segment i d e n t i f i e r s a r e u n ique. I f the segment i d e n t i f i e r s a r e not u n i q u e , the JOINT s t a t e m e n t s must be p l a c e d i n the same o r d e r as they appear i n the i n t e r n a l s t r u c t u r e . The u s e r i s r e s p o n s i b l e f o r c r e a t i n g a non-ambiguous model s p e c i f i c a t i o n . A l l the p r e c e d i n g model d e f i n i t i o n s produce models unambiguously. The f o l l o w i n g i s an example of an ambiguous model: STARTMODEL hand JOINT 1, palm, f i n g e r , .., JOINT 2, palm, f i n g e r , JOINT 3, f i n g e r , .., f i n g e r n a i 1 , .., ENDMODEL The s p e c i f i c a t i o n of JOINT 3 causes the d i f f i c u l t y . W i t h t h i s model d e f i n i t i o n , the system cannot d e t e r m i n e t o which f i n g e r the f i n g e r n a i l b e l o n g s . The r e s u l t of such a s p e c i f i c a t i o n depends c o m p l e t e l y on the i m p l e m e n t a t i o n of the p r e p r o c e s s o r , hence, i t s h o u l d be assumed t h a t ambiguous s p e c i f i c a t i o n s produce u n p r e d i c t a b l e models. 28 3.5 MODEL TRANSFORMATIONS Once a model has been d e f i n e d , i t can be t r e a t e d as a u n i t . As p r e v i o u s l y shown, a model can f u n c t i o n as a b u i l d i n g b l o c k f o r the d e f i n i t i o n of more complex models. C u r r e n t l y , no c o n s t r u c t s a re p r o v i d e d t h a t p e r m i t the user d i r e c t a c c e s s t o the model's d a t a b a s e , however, s e v e r a l t r a n s f o r m a t i o n s have been p r o v i d e d t h a t p e r m i t model m o d i f i c a t i o n by the u s e r . Model elements on the r i g h t hand s i d e of a model assignment statement r e p r e s e n t i n s t a n c e s of p r e v i o u s l y d e f i n e d model i d e n t i f i e r s . Such i n s t a n c e s can be m o d i f i e d c r e a t i n g d i f f e r e n t i n s t a n c e s of a model i d e n t i f i e r w i t h d i f f e r e n t r e s u l t s . C u r r e n t l y , the m o d i f i c a t i o n s p e r m i t t e d a r e the t r a n s f o r m a t i o n s j o i n t i d e n t i f i e r t r a n s l a t i o n , model segment s c a l i n g , and model j o i n t extreme s c a l i n g . They f o l l o w a model i n a l i s t s e p a r a t e d by commas and surrounded by a n g l e b r a c k e t s ("<", ">") and have the s y n t a c t i c form TRANS JOINTS [ BY ] <integer> SCALE MODEL <real> SCALE EXTREMES <real> where b r a c k e t s ("[" and " ] " ) i n d i c a t e an o p t i o n and "<type>" r e p r e s e n t c o n s t a n t s of the type " t y p e " . Model t r a n s f o r m a t i o n s a re independent, c o n s e q u e n t l y , they a r e commutative. They may be a p p l i e d i n any o r d e r and may be r e p e a t e d . I f the TRANS JOINTS t r a n s f o r m a t i o n i s r e p e a t e d , 29 the r e s u l t i n g t r a n s f o r m a t i o n i s the sum of a l l the i n s t a n c e s . R e p e a t i n g e i t h e r the SCALE MODEL or SCALE EXTREMES t r a n s f o r m a t i o n s produces a t r a n s f o r m a t i o n c o n s i s t i n g of the pr o d u c t of the i n s t a n c e s . The TRANS JOINTS t r a n s f o r m a t i o n t r a n s l a t e s the j o i n t i d e n t i f i e r s p r e s e n t i n the model. The statement b :- a <TRANS JOINTS BY 10> c r e a t e s a new model whose j o i n t i d e n t i f i e r s have been t r a n s l a t e d by a v a l u e of ten onto a new range of i d e n t i f i e r s . T h i s t r a n s f o r m a t i o n i s used p r i m a r i l y whenever submodels p r e s e n t i n a model d e f i n i t i o n c o n t a i n an o v e r l a p i n the j o i n t i d e n t i f i e r range. The SCALE MODEL t r a n s f o r m a t i o n s c a l e s a l l of a model's segments. The statement a :- a <SCALE MODEL 2.0> r e d e f i n e s model A such t h a t i t s p h y s i c a l s i z e i s t w i c e i t s o r i g i n a l s i z e . I f the s c a l i n g f a c t o r i s n e g a t i v e , the system w i l l c r e a t e a new model i n s t a n c e which i s a m i r r o r image of the p r e v i o u s model. The SCALE EXTREMES t r a n s f o r m a t i o n s c a l e s a l l of a model's j o i n t extremes. The statement 30 b :- a <SCALE EXTREMES 2.0> c r e a t e s a new model whose j o i n t extremes have been m u l t i p l i e d by the f a c t o r 2.0, thus d o u b l i n g the range through which the j o i n t s can t r a v e l . I f the s c a l i n g f a c t o r i s n e g a t i v e , m i r r o r images of the e x i s t i n g j o i n t ranges are c r e a t e d , i n a d d i t i o n t o the change i n the j o i n t movement's magnitudes. The statement b :- a <SCALE MODEL 1.5, SCALE EXTREME 0.7> c r e a t e s a model 'b' which i s l a r g e r than model 'a', and whose movements a r e more r e s t r i c t e d than t h o s e of model 'a'. Model t r a n s f o r m a t i o n s a r e u s e f u l i n c r e a t i n g models whose s i z e and movement ranges a r e d i f f e r e n t , but whose i n t e r n a l s t r u c t u r e a r e the same. I f the p r e c e d i n g statement was e x e c u t e d , w i t h 'a' p r e d e f i n e d as a model of a r o b o t , the c o r r e s p o n d i n g models i n F i g u r e 10a and 10b would be g e n e r a t e d . F i g u r e 10a and 10b r e p r e s e n t models 'a' and 'b', r e s p e c t i v e l y , and the extremes by which they can s q u a t . O f t e n i t i s d e s i r a b l e t o have a model p e r f o r m a range of m o t i o n s . I f these m o tions i n v o l v e the movement of a model w i t h r e s p e c t t o d i f f e r e n t main l i n k s , a t e c h n i q u e must be a v a i l a b l e t o change the main l i n k w i t h which a movement i s p erformed. T h e r e f o r e , a second method e x i s t s f o r the t r a n s f o r m a t i o n of a model. The t r a n s f o r m a t i o n has the 31 F i g u r e 10a F i g u r e 10b a) Model s q u a t t i n g b) M o d i f i e d model s q u a t t i n g s y n t a c t i c form: FIGURE model_name MAIN [ LINK l i n k _ i d ] [ JOINT j o i n t _ i d ] E x e c u t i o n of the FIGURE statement a s s i g n s a new l i n k as the model's main l i n k . The new main segment may be s p e c i f i e d by the l i n k ' s name or by the j o i n t i d e n t i f i e r i n which the l i n k i s p r e s e n t . I f the j o i n t i d e n t i f i e r i s used, the j o i n t ' s secondary l i n k i s d e f i n e d as the main segment. E x e c u t i n g the FIGURE statement w i t h o u t any o p t i o n s a s s i g n s the model's o r i g i n a l main l i n k as the c u r r e n t main segment. F i g u r e s 11 and 12 demonstrate the d i f f e r e n c e the main l i n k can make t o a movement. In F i g u r e 11, the model has s q u a t t e d c o r r e c t l y . The t o r s o has descended towards the 32 ground because the main segment i s a f o o t . In F i g u r e 12, the main l i n k i s the t o r s o and the s q u a t t i n g movement produced i s q u i t e d i f f e r e n t ; the f e e t have r i s e n away from the ground. T h i s o c c u r s s i n c e the t o r s o i s kept s t a t i o n a r y d u r i n g the s q u a t t i n g m o t i o n . F i g u r e 11 Model s q u a t t i n g w i t h the f o o t as main l i n k F i g u r e 12 Model s q u a t t i n g w i t h the t o r s o as main l i n k The i n t e r n a l s t r u c t u r e s of the models a r e s e t up such t h a t the s t r u c t u r e i s independent of the main segment. Y e t , the s t r u c t u r e e n a b l e s the system t o det e r m i n e the o r i g i n a l 33 o r i e n t a t i o n of the s t r u c t u r e . T h i s a b i l i t y a l l o w s the system t o o r i e n t ' a model c o r r e c t l y whenever a new main l i n k i s d e f i n e d . A r e l a t i o n s h i p e x i s t s between the s i g n of a j o i n t ' s c u r r e n t a n g l e and the p r i o r i t y of i t s two segments. In F i g u r e 13, both j o i n t s have the same a n g l e magnitude, however, t h e s i g n of the a n g l e s between the l i n k s i s r e v e r s e d . The s i g n of the a n g l e depends upon which l i n k i s viewed as the p r i m a r y or secondary l i n k . Whenever a new main segment i s d e f i n e d , s e v e r a l of a model's l i n k s r e v e r s e t h e i r r o l e s ( i . e . p r i m a r y l i n k s become secondary and secondary l i n k s become p r i m a r y ) . By comparing the model's c u r r e n t main segment w i t h the o r i g i n a l l y d e f i n e d main l i n k , the system can a u t o m a t i c a l l y d e t e r m i n e which j o i n t a n g l e s need t h e i r s i g n s r e v e r s e d . In F i g u r e 14, the model has s q u a t t e d . The t o r s o has descended towards the ground because the main segment i s the l e f t f o o t . The model was o r i g i n a l l y d e f i n e d w i t h the t o r s o as the main l i n k , c o n s e q u e n t l y , the r o l e s of the l e f t f o o t and l e g have changed. The s i g n s of the j o i n t a n g l e s , however, have not been r e v e r s e d thus the l e f t l e g became c o n t o r t e d . 34 Primary Link Secondary Link F i g u r e 13 J o i n t s w i t h same ang l e but d i f f e r e n t s i g n F i g u r e 14 Model i m p r o p e r l y s q u a t t i n g Chapter 4 MOTION PRIMITIVES Once the model has been d e f i n e d , motions f o r the model can be c r e a t e d . T h i s c h a p t e r d i s c u s s e s the problems a s s o c i a t e d w i t h motion s p e c i f i c a t i o n , p r e s e n t s two c o n s t r u c t s f o r d e f i n i n g m o t i o n s , and examines a method f o r motion m a n i p u l a t i o n . C o n v e n t i o n a l t w o - d i m e n s i o n a l a n i m a t i o n r e l i e s h e a v i l y on the use of keyframe and i n t e r p o l a t i o n ("in-betweening") t e c h n i q u e s . Keyframes a r e a s e t of im p o r t a n t drawings t h a t show f i g u r e s a t c r u c i a l p o i n t s (extremes) i n a g i v e n a c t i o n . In a n i m a t i o n s t u d i o s , keyframes a r e drawn by head a n i m a t o r s ; the m i s s i n g frames r e q u i r e d t o c r e a t e smooth a n i m a t i o n a re produced by i n - b e t w e e n i n g a r t i s t s . One of the e a r l i e r approaches t o c o m p u t e r - a s s i s t e d a n i m a t i o n a l l o w e d the animator t o e n t e r keyframe drawings i n t o the computer's memory and had the computer assume the r o l e of the in- b e t w e e n e r s [ 7 ] , A l t h o u g h some v e r y e f f e c t i v e a n i m a t i o n s have been a c h i e v e d , keyframe drawings a r e two- d i m e n s i o n a l p r o j e c t i o n s of t h r e e - d i m e n s i o n a l f i g u r e s v i s u a l i z e d by the a n i m a t o r , hence the i n f o r m a t i o n a v a i l a b l e i s l i m i t e d i n c r e a t i n g r e a l i s t i c a n i m a t i o n . A l s o , i n - 35 36 between frames a r e f r e q u e n t l y l i n e a r l y i n t e r p o l a t e d , r e s u l t i n g i n temporal d i s c o n t i n u i t i e s and movements t h a t a c t u a l l y deform f i g u r e s d u r i n g the a n i m a t i o n . For example, i f a f i g u r e ' s l e g o b s c u r e s the o t h e r , the l o s s of i n f o r m a t i o n l i m i t s the a u t o m a t i c i n - b e t w e e n i n g of the keyframe d r a w i n g s . An a n i m a t o r can deduce the o r i g i n a l o b j e c t from the drawings because he i s f a m i l i a r w i t h the o r i g i n a l model. In o r d e r f o r a program t o u n d e r s t a n d a drawing i t must c o n t a i n a model of the f i g u r e t h a t c o r r e s p o n d s t o the model i n the a n i m a t o r ' s head [ 9 ] , Use of t h r e e - d i m e n s i o n a l computer m o d e l l i n g i n f i g u r e r e p r e s e n t a t i o n e l i m i n a t e s s e v e r a l problems a s s o c i a t e d w i t h t w o - d i m e n s i o n a l a n i m a t i o n , however, the problem of motion s p e c i f i c a t i o n f o r a t h r e e - d i m e n s i o n a l model i s i n t r o d u c e d . One p o p u l a r t e c h n i q u e i s t o e x p r e s s a model's p o s i t i o n s and v e l o c i t i e s as f u n c t i o n s of t i m e . The t e c h n i q u e i s f r e q u e n t l y used on a p i e c e w i s e b a s i s ( i . e . the motion of each model segment i s computed s e p a r a t e l y ) . F u n c t i o n s of time a r e e v a l u a t e d on a frame-by-frame b a s i s which i n v o l v e s s p e c i f y i n g a path over t i m e . The method has the advantage of p r o d u c i n g motion w i t h few t e m p o r a l d i s c o n t i n u i t i e s , n e v e r t h e l e s s , the d e s c r i p t i o n of a t h r e e - d i m e n s i o n a l p a t h as a - f u n c t i o n of time i s g e n e r a l l y a d i f f i c u l t t a s k . 37 4.1 MOTION SPECIFICATION The proposed approach f o r motion s p e c i f i c a t i o n combines the b est a s p e c t s of both the keyframe and f u n c t i o n a l t e c h n i q u e s . Whereas t w o - d i m e n s i o n a l keyframe a n i m a t i o n views a f i g u r e w i t h an e x t e r n a l p e r s p e c t i v e and the f u n c t i o n a l approach views a f i g u r e from a p i e c e w i s e p e r s p e c t i v e , the proposed t e c h n i q u e t r e a t s a model as a u n i t and views i t from an i n t e r n a l p e r s p e c t i v e ( i . e . from the model's p o i n t of v i e w ) . C o n s e q u e n t l y , a model's p o s i t i o n a l o r i e n t a t i o n can be u n i q u e l y s p e c i f i e d t h roughout t i m e . The method i s s i m i l a r t o keyframe a n i m a t i o n because keyframes or p o s i t i o n a l extremes a r e used throughout t i m e , however, a t h r e e - d i m e n s i o n a l model i s employed and d e a l t w i t h on a h i g h l e v e l of a b s t r a c t i o n , thus a l l o w i n g more f l e x i b i l i t y and a c c u r a c y i n a f i g u r e ' s a n i m a t i o n . The motion s p e c i f i c a t i o n of a s i n g l e j o i n t i s s i m i l a r t o an a n i m a t i o n s c r i p t used i n e e l a n i m a t i o n . As shown i n F i g u r e 15, the s p e c i f i c a t i o n c o n t a i n s a j o i n t i d e n t i f i e r , an i n i t i a l s t a r t i n g p o s i t i o n ( a n g l e ) , and a s e t of movements ( k e y f r a m e s ) . Every keyframe c o n t a i n s the frame i d e n t i f i e r d u r i n g which the movement i s completed, t h e j o i n t p o s i t i o n at the c u r r e n t frame, and the i n t e r p o l a t i o n method used t o r e a c h the p o s i t i o n a l extreme ( F i g u r e 16). 38 Joint # Starting Position Movement 1 Movement 2 F i g u r e 15 Mo t i o n s p e c i f i c a t i o n f o r a s i n g l e j o i n t Frame # Angular Position Interpolation Method F i g u r e 16 Keyframe i n f o r m a t i o n The a n g u l a r p o s i t i o n i s g i v e n r e l a t i v e t o the j o i n t ' s n e u t r a l p o s i t i o n of (0°, 0°, 0°). The n e u t r a l p o s i t i o n i s de t e r m i n e d by the d e f i n i t i o n of the g r a p h i c a l o b j e c t s used i n the j o i n t . The frame i d e n t i f i e r s r e p r e s e n t the number of t i c k s ( u n i t s of time) t h a t have passed d u r i n g the motion sequence. The frame i d e n t i f i e r s a r e g i v e n w i t h r e s p e c t t o the s t a r t of the motion s p e c i f i c a t i o n . The i n i t i a l frame i d e n t i f i e r i s a s s i g n e d the v a l u e of z e r o . The i n t e r p o l a t i o n t e c h n i q u e s c u r r e n t l y a v a i l a b l e a r e : l i n e a r , a c c e l e r a t i o n , d e c e l e r a t i o n , and a c o m b i n a t i o n of both a c c e l e r a t i o n and d e c e l e r a t i o n . The keyframe i n f o r m a t i o n i s s u f f i c i e n t t o s p e c i f y a s i n g l e j o i n t ' s movement thro u g h o u t an a n i m a t i o n sequence. The i n t e r p o l a t i o n r o u t i n e s have been d e s i g n e d t o reduce the 39 e f f e c t s of temporal d i s c o n t i n u i t i e s . Such r e d u c t i o n s are p o s s i b l e because the system s t o r e s e v e r y j o i n t ' s i n s t a n t a n e o u s v e l o c i t y and a c c e l e r a t i o n . The i n t e r p o l a t i o n r o u t i n e s t a k e advantage of the i n f o r m a t i o n and make i n t e r p o l a t i o n a d j u s t m e n t s . For example, the l i n e a r i n t e r p o l a t i o n r o u t i n e a l l o w s s e v e r a l frames f o r a j o i n t t o a c h i e v e an optimum v e l o c i t y b e f o r e the j o i n t t r a v e l s l i n e a r l y . S i m i l a r m o d i f i c a t i o n s have been made t o a l l the i n t e r p o l a t i o n r o u t i n e s , t h e r e f o r e d e c r e a s i n g the i r r e g u l a r motion which i s n o r m a l l y caused by d i s c o n t i n u i t i e s i n the d i r e c t i o n of motion at every keyframe. Joint 1 Starting Position Movement 1 Movement 2 Joint 2 Starting Position Movement 1 Movement 2 Joint 3 Starting Position Movement 1 Movement 2 Joint 4 Starting Position Movement 1 Movement 2 F i g u r e 17 Moti o n t e m p l a t e A complete motion d e f i n i t i o n f o r a model c o n s i s t s of motion s p e c i f i c a t i o n s f o r a l l of the j o i n t s p r e s e n t i n the model. A motion t e m p l a t e i s g i v e n i n F i g u r e 17. The motion s p e c i f i c a t i o n s a r e e n t i r e l y independent, c o n s e q u e n t l y , 40 d i f f e r e n t numbers of keyframes may e x i s t f o r each j o i n t and the keyframes may end on d i f f e r e n t frame i d e n t i f i e r s . Any j o i n t t h a t f i n i s h e s p r o c e s s i n g i t s keyframes remains f r o z e n at i t s c u r r e n t a n g u l a r p o s i t i o n f o r the remainder of the mot i o n . 4.2 EXPLICIT DEFINITION A motion can be s p e c i f i e d u s i n g two b a s i c approaches, an e x p l i c i t and i m p l i c i t approach. The i m p l i c i t approach i s d i s c u s s e d i n S e c t i o n 4.3. The e x p l i c i t approach a l l o w s an ex a c t motion s p e c i f i c a t i o n f o r a model, however, the d e t a i l s of e very j o i n t ' s o r i e n t a t i o n must be s u p p l i e d t o the LIG ANIMATE language. The e x p l i c i t s p e c i f i c a t i o n of a model's motion can be approached w i t h e i t h e r of two t e c h n i q u e s . The f i r s t t e c h n i q u e assumes t h a t the d e s i r e d motion c o n t a i n s r e l a t i o n s h i p s between each j o i n t ' s keyframes t h a t can be e x p r e s s e d i n the form of a m a t h e m a t i c a l f o r m u l a . A t y p i c a l statement d e f i n i n g one keyframe f o r a s i n g l e j o i n t i s motion_name [ j o i n t _ i d , k e y _ f r a m e _ i d ] := FRAME f r a m e _ i d POSITION a n g l e _ x , a n g l e _ y , a n g l e _ z INTERPOLATE i n t e r p o l a t i o n _ t e c h n i q u e where 'motion_name' i s a v a r i a b l e of the type MOTION; ' j o i n t _ i d ' i s a j o i n t i d e n t i f i e r i n the model f o r which the movement b e l o n g s . A motion may not have more j o i n t 41 s p e c i f i c a t i o n s than the maximum a l l o w a b l e j o i n t s per model. C u r r e n t l y t h i s number i s t h i r t y . ' k e y _ f r a m e _ i d ' i s the r e l a t i v e l o c a t i o n of the keyframe from the b e g i n n i n g of the motion. A motion may have a t most n keyframes. T h i s v a l u e i s t h e o r e t i c a l l y u n l i m i t e d , however, LIG ANIMATE c u r r e n t l y r e s t r i c t s motions t o a maximum of f i f t y keyframes. ' f r a m e _ i d ' i s the frame l o c a t i o n i n the a n i m a t i o n sequence a t which the keyframe s p e c i f i e s the f i g u r e ' s movement extreme. ' f r a m e _ i d i s s p e c i f i e d r e l a t i v e t o the b e g i n n i n g of the mo t i o n . ' a n g l e _ x ' , ' a n g l e _ y ' , and ' a n g l e _ z ' r e p r e s e n t the a n g u l a r p o s i t i o n of the j o i n t ' s secondary l i n k w i t h r e s p e c t t o the p r i m a r y l i n k . ' i n t e r p o l a t i o n _ t e c h n i q u e ' i s the i n t e r p o l a t i o n method (LINEAR, ACCELERATE, or ACCDCC) used from the p r e v i o u s keyframe t o the c u r r e n t keyframe. I f ' k e y f r a m e _ i d ' i s s p e c i f i e d as z e r o then the v a l u e f o r FRAME i s s e t t o z e r o r e g a r d l e s s of the v a l u e a c t u a l l y s p e c i f i e d by ' f r a m e _ i d ' ; the i n t e r p o l a t i o n _ t e c h n i q u e i s a l s o i g n o r e d . The approach a l l o w s d i r e c t a c c e s s t o a motion v a r i a b l e . I t can be employed w i t h i n o t h e r c o n s t r u c t s and p e r m i t s the use of i t e r a t i o n t o produce the motion s p e c i f i c a t i o n s . The t e c h n i q u e reduces the number of sta t e m e n t s and the amount of work needed t o d e f i n e the s p e c i f i c a t i o n s . S i n c e the c o n s t r u c t a l l o w s the s p e c i f i c a t i o n of a model's motion w i t h the use of a f o r m u l a , the i d e n t i f i e r s 42 may be e i t h e r v a r i a b l e s or c o n s t a n t s . I f v a r i a b l e s a r e used, the v a r i a b l e v a l u e a t the time of the statement e x e c u t i o n w i l l be s t o r e d i n the c u r r e n t keyframe. The f o l l o w i n g i s an example of a motion d e f i n i t i o n and a c o r r e s p o n d i n g model d e f i n i t i o n . DO 10 hand = 1 , 2 DO 20 minute = 0, 120 IF hand = 1 THEN BEGIN { C a l c u l a t e the minute hand's c u r r e n t } { a n g l e } a n g l e z = (360 / 60) * minute END ELSE BEGIN { C a l c u l a t e the hour hand's c u r r e n t a n g l e } a n g l e z = (360 / 12) * (minute / 60) END a n g l e z = a n g l e z MOD 360 a n g l e = (0, 0, a n g l e z ) frame_num = 24 * minute TIME[hand, minute] = FRAME frame_num POSITION a n g l e - INTERPOLATION l i n e a r 20 CONTINUE 10 CONTINUE c l o c k :- JOINT 1, c l o c k _ b o d y , minute hand, ..., (0°, 0"*), (0°, 0°), (0°, 360°) c l o c k :- JOINT 2, c l o c k , hour_hand, ..., (0°, 0°), (0°, 0°), (0°, 360°) The d e f i n e d motion animates a c l o c k f o r two m i n u t e s . To show an ex a g g e r a t e d movement of t i m e , the c l o c k runs a t the r a t e of one minute per second. T h e r e f o r e , i n a two minute scene, two hours w i l l have e l a p s e d . F i g u r e 18 shows 43 s i x s e l e c t e d frames from the a n i m a t i o n sequence. In the sequence, the c l o c k ' s n e u t r a l p o s i t i o n was d e f i n e d a t t w e l v e o ' c l o c k . I f a c l o c k i s t o be animated over a d i f f e r e n t two hour range, t h i s motion can animate a d i f f e r e n t c l o c k d e f i n e d w i t h a n e u t r a l p o s i t i o n a t the s t a r t of the new range. O t h e r w i s e , t h i s c l o c k can be used, but w i t h a motion d e f i n e d over the new range. For example, a motion d e f i n e d from 150 t o 270 would animate the c l o c k from 2:30 - 4:30. F i g u r e 18 Frames from t h e c l o c k a n i m a t i o n 44 In the p r e c e d i n g example, the r e l a t i o n s h i p between the j o i n t s and motion can be d e f i n e d m a t h e m a t i c a l l y . But the r e l a t i o n s h i p can not always be d e f i n e d m a t h e m a t i c a l l y , c o n s e q u e n t l y , an a l t e r n a t e method f o r c r e a t i n g motions i s p r o v i d e d . The method assumes t h a t the d e s i r e d motion does not c o n t a i n a m a t h e m a t i c a l r e l a t i o n s h i p between the j o i n t s and keyframes. I t can be t e d i o u s t o use, n e v e r t h e l e s s , i t a l l o w s the d e s c r i p t i o n of complex motions t h a t can not e a s i l y be d e s c r i b e d m a t h e m a t i c a l l y . The c o n s t r u c t STARTMOTION motion_name JOINT j o i n t _ i d [ POSITION a n g l e _ x , a n g l e _ y , a n g l e _ z ] FRAME f r a m e _ i d POSITION a n g l e _ x , a n g l e _ y , a n g l e _ z INTERPOLATE i n t e r p o l a t i o n _ t e c h n i q u e FRAME f r a m e _ i d POSITION a n g l e _ x , a n g l e _ y , a n g l e _ z INTERPOLATE i n t e r p o l a t i o n _ t e c h n i q u e • • • ENDJOINT JOINT j o i n t _ i d FRAME ... • • • ENDJOINT • • • ENDMOTION a l l o w s an ex a c t motion d e f i n i t i o n . 'motion_name' i s a v a r i a b l e of the type MOTION which c o n t a i n s the j o i n t - m o t i o n s p e c i f i c a t i o n s . The j o i n t i d e n t i f i e r s c o r r e s p o n d t o those d e f i n e d i n the animated model. The c o n s t r u c t p e r m i t s a 45 s t r u c t u r e d approach t o produce a motion s p e c i f i c a t i o n . I t does not a l l o w the use of o t h e r c o n t r o l c o n s t r u c t s . The v a l u e s of the i d e n t i f i e r s must a l l be c o n s t a n t s ; no v a r i a b l e s a r e a l l o w e d . The keyframe i d e n t i f i e r i s not used because the c o n s t r u c t assumes t h a t the keyframes are p l a c e d i n an a s c e n d i n g s e q u e n t i a l o r d e r . The s t a r t i n g p o s i t i o n f o r each j o i n t i s s p e c i f i e d i n the POSITION st a t e m e n t . I f the statement i s not p r e s e n t i n a j o i n t ' s motion s p e c i f i c a t i o n , the s t a r t i n g p o s i t i o n i s assumed t o be the n e u t r a l p o s i t i o n . 4.3 IMPLICIT DEFINITION Once a motion has been d e f i n e d , the s p e c i f i c a t i o n can be viewed as a u n i t (motion p r i m i t i v e ) and i t can f u n c t i o n as a b u i l d i n g b l o c k f o r the d e f i n i t i o n q,t more complex motions. A p r i m i t i v e motion a l g e b r a has been i n t r o d u c e d f o r t h i s use. The a l g e b r a a l l o w s the c r e a t i o n of new motions t h a t have been t e m p o r a l l y compounded from p r e d e f i n e d m o t i o n s. For example, t o c r e a t e a motion t h a t e n a b l e s a human model t o hop, s k i p , and jump t e n t i m e s , the f o l l o w i n g statement can be used: new_walk = 10 * (hop + s k i p + jump) In the s t a t e m e n t , the symbols 'new_walk', 'hop', ' s k i p ' , and 'jump' r e p r e s e n t v a r i a b l e s of the type MOTION. The symbol '=' i s the motion assignment o p e r a t o r . I t s t o r e s a motion e x p r e s s i o n on the r i g h t hand s i d e t o the motion 46 v a r i a b l e on the l e f t hand s i d e . 'new_walk' i s the r e s u l t i n g a c t i o n . 'hop', ' s k i p ' , and 'jump' a r e p r e v i o u s l y d e f i n e d motions which a l l o w a model t o hop, s k i p and jump r e s p e c t i v e l y . The c o n s t a n t 10 i s the r e p e t i t i o n f a c t o r t h a t i s a p p l i e d t o the a c t i o n s 'hop', ' s k i p ' , and 'jump'. The symbols '+' and '*' a r e the o p e r a t o r s p r e s e n t i n the motion a l g e b r a . The '+' a d d i t i o n o p e r a t o r t e m p o r a l l y merges two motions i n t o a new mot i o n . The '*' r e p e t i t i o n o p e r a t o r c r e a t e s a new motion by r e p e a t i n g an e x p r e s s i o n on the r i g h t hand s i d e of the '*' by the f a c t o r on the l e f t hand s i d e . The '+' and '*' o p e r a t o r s can be used i n t e r c h a n g e a b l y . Both of the s t a t e m e n t s new_walk = (hop + s k i p ) + (hop + s k i p ) + (hop + s k i p ) new_walk = 3 * (hop + s k i p ) produce the same mo t i o n . The a d d i t i o n and r e p e t i t i o n a re independent o p e r a t i o n s , however, the r e p e t i t i o n o p e r a t o r t a k e s precedence over the a d d i t i o n o p e r a t o r . In the statement motion = 10 * hop + s k i p the motion 'hop' i s r e p e a t e d 10 ti m e s b e f o r e the s k i p p i n g motion i s added. The motion a l g e b r a a l l o w s motion e x p r e s s i o n s of a g e n e r a l form on the r i g h t hand s i d e of the '=' assignment 47 o p e r a t o r . The p r o d u c t i o n f o r the e x p r e s s i o n i s c a l l e d <motion express>. The Backus-Naur form d e f i n i t i o n f o r the p r o d u c t i o n i s <motion express> ::= <motion term> | <motion term> + <motion express> •emotion term> ::= <motion f a c t o r > | <motion f a c t o r > < m o d i f i c a t i o n l i s t > <motion f a c t o r > ::= <simple> | <simple l i s t > <simple l i s t > ::= (<motion express>) <simple> ::= <motion p r i m i t i v e > | < r e p e t i t i o n > < r e p e t i t i o n > :.:= < i n t e g e r c o n s t a n t > * < r e p e t i t i o n l i s t > | < i n t e g e r v a r i a b l e > * < r e p e t i t i o n l i s t > < r e p e t i t i o n l i s t > ::= <motion p r i m i t i v e > | <simple l i s t > The motion a l g e b r a r e l i e s h e a v i l y on the a v a i l a b i l i t y of p r e d e f i n e d motion p r i m i t i v e s . I t i s r e c o g n i z e d t h a t the e x p l i c i t d e f i n i t i o n of such p r i m i t i v e s can be both d i f f i c u l t and time consuming, t h e r e f o r e , o p e r a t i o n s have been i n t r o d u c e d t h a t a l l o w a more c o n v e n i e n t d e f i n i t i o n of the motion p r i m i t i v e s . For example, i f a motion p r i m i t i v e (walk) e x i s t s which a l l o w s a model t o walk, i t may be d e s i r a b l e t o employ the a c t i o n of the l e g s i n a d i f f e r e n t m o t i o n . The o p e r a t i o n STRIP has been i n t r o d u c e d , which c r e a t e s a p a r t i a l motion from a g i v e n m o t i o n . In the statement w a l k i n g _ l e g s = STRIP walk, 5, 6, 7, 8, 48 ' w a l k i n g _ l e g s ' i s a new motion p r i m i t i v e t h a t animates a model's l e g s . The v a l u e s 5, 6, 7, 8, a r e the j o i n t i d e n t i f i e r s p r e s e n t i n the model's l e g s . U s i n g the method, s e v e r a l motion p r i m i t i v e s can be c r e a t e d t h a t animate o n l y p o r t i o n s of a g i v e n model. I f the p r e c e d i n g statement i s e x e c u t e d , the motions i n F i g u r e 19 would be p r e s e n t . MOTION: Walk Jo in t 1 S ta r t ing Pos i t i on Key f rame 1 Keyf rame 2 Keyf rame 3 Jo in t 2 S ta r t ing Pos i t i on Key f rame 1 Keyf rame 2 Keyf rame 3 Jo in t 3 S ta r t ing Pos i t i on Key f rame 1 Key f rame 2 Keyf rame 3 Jo in t 4 S ta r t i ng Pos i t i on Keyf rame 1 Key f rame 2 Keyf rame 3 Jo in t 5 S ta r t ing Pos i t i on Key f rame 1 Key f rame 2 Keyf rame 3 Jo in t 6 S ta r t ing Pos i t i on Key f rame 1 Key f rame 2 Keyf rame 3 Jo in t 7 S ta r t ing Pos i t i on Keyf rame 1 Keyf rame 2 Keyf rame 3 Jo in t 8 S ta r t ing P o s i t i o n Key f rame 1 Key f rame 2 Keyf rame 3 MOTION: Walkingjegs Jo in t 5 S ta r t ing Pos i t i on Keyf rame 1 Keyf rame 2 Keyf rame 3 Jo in t 6 S ta r t ing Pos i t i on Keyf rame 1 Keyf rame 2 Keyf rame 3 Jo in t 7 S ta r t i ng Pos i t i on Key f rame 1 Key f rame 2 Keyf rame 3 Jo in t 8 S ta r t i ng Pos i t i on Key f rame 1 Key f rame 2 Keyf rame 3 F i g u r e 19 S t r i p o p e r a t i o n The o p e r a t i o n SYNCHRONIZE has a l s o been i n t r o d u c e d . When g i v e n a s e t of p a r t i a l m o t i o n s , SYNCHRONIZE c r e a t e s a new motion t h a t animates p o r t i o n s of a model c o n c u r r e n t l y . The statement 49 my_walk := SYNCHRONIZE w a l k i n g _ l e g s , swinging_arms d e f i n e s a motion p r i m i t i v e (my_walk) which a l l o w s a f i g u r e t o walk w h i l e s w i n g i n g i t s arms. I f the p r e c e d i n g statement i s e x e c u t e d , the motions i n F i g u r e 20 would be p r e s e n t . The use of the STRIP and SYNCHRONIZE o p e r a t i o n s a l l o w an i n c r e a s e i n the number of motion p r i m i t i v e s w i t h o u t e x p l i c i t l y d e f i n i n g the m o t i o n s . MOTION: Walk ingjegs J o i n t 5 S t a r t i n g P o s i t i o n K e y f r a m e 1 K e y f r a m e 2 K e y f r a m e 3 J o i n t 6 S t a r t i n g P o s i t i o n K e y f r a m e 1 K e y f r a m e 2 K e y f r a m e 3 J o i n t 7 S t a r t i n g P o s i t i o n K e y f r a m e 1 K e y f r a m e 2 K e y f r a m e 3 J o i n t 8 S t a r t i n g P o s i t i o n K e y f r a m e 1 K e y f r a m e 2 K e y f r a m e 3 MOTION: Swinging_arms J o i n t 1 S t a r t i n g P o s i t i o n K e y f r a m e 1 K e y f r a m e 2 K e y f r a m e 3 J o i n t 2 S t a r t i n g P o s i t i o n K e y f r a m e 1 K e y f r a m e 2 K e y f r a m e 3 MOTION: My_walk J o i n t 1 S t a r t i n g P o s i t i o n K e y f r a m e 1 K e y f r a m e 2 K e y f r a m e 3 Jo in t 2 S t a r t i n g P o s i t i o n K e y f r a m e 1 K e y f r a m e 2 K e y f r a m e 3 J o i n t 5 S t a r t i n g P o s i t i o n K e y f r a m e 1 K e y f r a m e 2 K e y f r a m e 3 J o i n t 6 S t a r t i n g P o s i t i o n K e y f r a m e 1 K e y f r a m e 2 K e y f r a m e 3 J o i n t 7 S t a r t i n g P o s i t i o n K e y f r a m e 1 K e y f r a m e 2 K e y f r a m e 3 J o i n t 8 S t a r t i n g P o s i t i o n K e y f r a m e 1 K e y f r a m e 2 K e y f r a m e 3 F i g u r e 20 S y n c h r o n i z e o p e r a t i o n 50 4.4 MOTION TRANSFORMATIONS In a d d i t i o n t o the use of the motion a l g e b r a , a method has been p r o v i d e d t h a t a l l o w s a user t o t a i l o r motion p r i m i t i v e s t o the needs of an a n i m a t i o n sequence w i t h o u t knowing d e t a i l s of the u n d e r l y i n g m o t i o n . M o t i o n elements on the r i g h t hand s i d e of the motion assignment r e p r e s e n t i n s t a n c e s of p r e v i o u s l y d e f i n e d motion i d e n t i f i e r s . These i n s t a n c e s can be m o d i f i e d t o c r e a t e d i f f e r e n t i n s t a n c e s of the same motion w i t h d i f f e r e n t r e s u l t s . C u r r e n t l y , the m o d i f i c a t i o n s p e r m i t t e d a r e the t r a n s f o r m a t i o n s t e m p o r a l s c a l i n g , and keyframe extreme s c a l i n g . They f o l l o w a motion i n a l i s t s e p a r a t e d by a n g l e b r a c k e t s ('<', '>'). The s y n t a c t i c form of the t r a n s f o r m a t i o n s i s g i v e n by SCALE FRAMES <real> SCALE EXTREMES <real> The t r a n s f o r m a t i o n s a re independent, c o n s e q u e n t l y , they a r e commutative. They may be a p p l i e d i n any o r d e r and may be r e p e a t e d . I f a t r a n s f o r m a t i o n i s r e p e a t e d , the r e s u l t i n g t r a n s f o r m a t i o n i s the pro d u c t of a l l the i n s t a n c e s . The SCALE FRAMES t r a n s f o r m a t i o n t e m p o r a l l y s c a l e s a mot i o n . Thus, the statement b = a <SCALE FRAMES 2.0> a s s i g n s t o motion 'b' an i n s t a n c e of motion 'a' t h a t has 51 been t e m p o r a l l y s t r e t c h e d t o t w i c e i t s o r i g i n a l l e n g t h . The number of keyframes p r e s e n t i n 'b' i s the same as i n 'a', however, the number of i n t e r m e d i a t e frames between each keyframe has been d o u b l e d . In a d d i t i o n , i f the s c a l i n g f a c t o r i s n e g a t i v e , the system w i l l r e v e r s e the keyframe o r d e r , p r o d u c i n g a t e m p o r a l l y r e v e r s e d i n s t a n c e of the motion ( F i g u r e 21 and 2 2 ) . F i g u r e 21 Sample motion a F i g u r e 22 Motion b from b = a <SCALE FRAMES -2.0> 52 The SCALE EXTREMES t r a n s f o r m a t i o n s c a l e s the keyframe extremes p r e s e n t i n a motio n . Thus, the statement b = a <SCALE EXTREMES 0.5> a s s i g n s t o motion 'b' an i n s t a n c e of motion 'a' which has had ev e r y keyframe extreme s c a l e d by a f a c t o r of 0.5. The number of keyframes p r e s e n t i n 'b' remains the same as i n 'a', and the number of i n t e r m e d i a t e frames between each keyframe i s unchanged ( F i g u r e 21 and 2 3 ) . F i g u r e 23 Mot i o n b from b = a <SCALE EXTREMES 0.5> Such an approach t o motion m o d i f i c a t i o n g i v e s r i s e t o many t r a n s f o r m a t i o n s t h a t can t a i l o r motion p r i m i t i v e s t o the needs of an a n i m a t i o n sequence. These t r a n s f o r m a t i o n s , as w e l l "as the o p e r a t i o n s '*' and '+', have the advantage t h a t an i n t i m a t e knowledge of a model's s t r u c t u r e and motion d e f i n i t i o n s a r e not n e c e s s a r y . They a l l o w motion m a n i p u l a t i o n a t a h i g h l e v e l of a b s t r a c t i o n . Chapter 5 CREATING ANIMATION 5.1 TOOLS FOR ANIMATION Once a model i s d e f i n e d and motions f o r the model have been c r e a t e d , the model can be animated. A t y p i c a l a n i m a t i o n statement i s ANIMATE model_name FROM s t a r t _ f r a m e TO end_frame USING motion_name [ REPEAT ] where 'model_name' i s a p r e d e f i n e d a r t i c u l a t e model; 'motion_name' i s a p r e v i o u s l y s p e c i f i e d motion t h a t i s a p p l i e d t o the model. The frame i d e n t i f i e r s ' sta>rt_f rame' and 'end_frame' a r e te m p o r a l e n d p o i n t s of the model's a n i m a t i o n . They a r e d e f i n e d r e l a t i v e t o the b e g i n n i n g of a scene. The REPEAT keyword i s o p t i o n a l . I f the REPEAT i s u n s p e c i f i e d , the motion i s assumed t o span the e n t i r e a n i m a t i o n sequence; the model remains f r o z e n a t i t s l a s t s p e c i f i e d o r i e n t a t i o n , i f the motion used does not d e f i n e movement f o r the e n t i r e time span. The REPEAT i s used whenever the motion does not span the e n t i r e model a n i m a t i o n sequence; the motion i s a u t o m a t i c a l l y r e p e a t e d u n t i l the 53 54 time span i s c o v e r e d . Care must be taken i n c r e a t i n g m otions t h a t a re r e p e a t e d . Severe d i s c o n t i n u i t i e s can a r i s e as t h e motion i s f i n i s h e d and r e s t a r t e d . For be s t r e s u l t s , a model's p o s i t i o n a l o r i e n t a t i o n s h o u l d be s i m i l a r at both e n d p o i n t s of the m o t i o n . Once the ANIMATE statement i s e x e c u t e d , a g r a p h i c a l o b j e c t of the name 'model_name' i s a v a i l a b l e t o the host language ( i . e . the hos t language t r e a t s each model i n s t a n c e p r e s e n t i n a frame as a g r a p h i c a l o b j e c t ) . The ANIMATE statement produces a n i m a t i o n w i t h r e s p e c t t o a model's main l i n k . I t i s the r e s p o n s i b i l i t y of the h o s t language t o p r o v i d e the c a p a b i l i t i e s t o t r a n s l a t e the r e s u l t i n g g r a p h i c a l o b j e c t throughout a scene. LIG ANIMATE p r o v i d e s a set of t o o l s which c o n t r o l the complex motions a s s o c i a t e d w i t h a r t i c u l a t e models, but i t does not r e p l a c e the f u n c t i o n of t h e hos t language. Models of the same c l a s s ( i . e . models of i d e n t i c a l s t r u c t u r e ) and models w i t h d i f f e r e n t - s i z e d segments r e a c t i d e n t i c a l l y when animated by the same m o t i o n . Models c o n t a i n i n g an e q u a l number but d i f f e r e n t t y p e s of j o i n t s can s t i l l be d r i v e n by the same motion s p e c i f i c a t i o n s , however, the r e s u l t i n g model movements may be d i f f i c u l t t o p r e d i c t . Models p l a c e r e s t r i c t i o n s on t h e i r movements. For example, i f a r o t a t i o n i s employed t h a t v i o l a t e s a j o i n t ' s extremes, the j o i n t w i l l e n f o r c e i t s extreme r o t a t i o n l i m i t over the 55 motion s p e c i f i c a t i o n g i v e n . T h i s r e s t r i c t i o n p e r m i t s two models of the same c l a s s , but d i f f e r e n t r e s t r i c t i o n s , t o behave r e a l i s t i c a l l y u s i n g the same motion. Once the elements f o r a scene have been d e f i n e d , the scene can be e x p l i c i t l y s p e c i f i e d w i t h s t a t i c and dynamic components. A t y p i c a l statement c r e a t i n g a scene i s INITIALIZE SCENE s c e n e _ i d e n t i f i e r i n i t i a l i z e scene environment STARTSCENE LENGTH s c e n e _ l e n g t h [ SAMEFRAME imagesperframe ] ANIMATE model_name FROM .... ANIMATE any dynamic models movements which v a r y w i t h time (camera movements, p a n n i n g , zooming, e t c . ) ENDSCENE where ' s c e n e _ i d e n t i f i e r ' i s a unique i d e n t i f i e r f o r the scene i n s t a n c e ; ' s c e n e _ l e n g t h ' i s the number of frames d i s p l a y e d d u r i n g the scene. The INITIALIZE s e c t i o n of the scene p e r m i t s a user t o s p e c i f y s t a t i c i n f o r m a t i o n t h a t i n i t i a l i z e s the environment p r i o r t o the e x e c u t i o n of a scene. By d e f a u l t , the s t a t e m e n t s p r e s e n t between the STARTSCENE and ENDSCENE a r e e x e c u t e d once f o r each frame g e n e r a t e d d u r i n g the scene. The d e f a u l t can be changed by the SAMEFRAME o p t i o n ; i t a l l o w s a user t o d i s p l a y s e v e r a l 56 images of each model on the frame. T h i s o p t i o n i s u s e f u l when r e a l - t i m e output c a p a b i l i t i e s a r e u n a v a i l a b l e . Each model produces s e v e r a l images per frame, thus a l l o w i n g e a s i e r e x a m i n a t i o n of a model's movements when u s i n g hardcopy d e v i c e s . The scenes d e f i n e d a re d i s p l a y e d by the st a t e m e n t : SHOOTSCENES The scenes a r e d i s p l a y e d i n s e q u e n t i a l o r d e r b e g i n n i n g from the l o w e s t scene i d e n t i f i e r t o the h i g h e s t one. The use of scene c o n s t r u c t s i s advantageous because the a n i m a t i o n sequence can be broken i n t o a s e t of independent scenes. Animated f i l m s can be c r e a t e d on a p i e c e w i s e b a s i s , t h u s s i m p l i f y i n g the a n i m a t i o n p r o c e s s . The c r e a t i o n of independent scenes a l s o p e r m i t s changes i n the scene o r d e r i n g w i t h o u t any knowledge of the frame i d e n t i f i e r s i n v o l v e d . A statement has been i n t r o d u c e d f o r use p r i m a r i l y w i t h i n the SCENE c o n s t r u c t . The statement BACKGROUND o b j e c t l , o b j e c t 2 , o b j e c t 3 , ... d e f i n e s a l i s t of g r a p h i c a l o b j e c t s t h a t a r e d i s p l a y e d as the background of a scene. P l a c i n g the BACKGROUND d e f i n i t i o n i n the scene i n i t i a l i z a t i o n s e c t i o n d e f i n e s a s t a t i c background. I f the BACKGROUND statement i s p l a c e d 57 between the STARTSCENE and ENDSCENE, the user can d e f i n e a new or m o d i f i e d background f o r each scene's frame by u s i n g g r a p h i c a l o b j e c t s t h a t a r e m o d i f i e d throughout the l i f e of a scene. LIG ANIMATE r e s t r i c t s user a c c e s s t o the i n t e r n a l s t r u c t u r e of v a r i a b l e s of the type MODEL, however, i t i s p o s s i b l e t o observe a model's i n t e r n a l r e l a t i o n s h i p s . The statement PRINT v a r i a b l e l , v a r i a b l e 2 , ... d i s p l a y s the i n t e r n a l s t a t u s of v a r i a b l e s . V a r i a b l e s of e i t h e r MODEL or MOTION type may be d i s p l a y e d . S p e c i f y i n g a model's name i n a PRINT statement produces a l i s t i n g of the model's i n t e r n a l node r e l a t i o n s h i p s . P r e c e d i n g the model's name w i t h the symbol '$' produces a s t a t u s r e p o r t of the model's symbol t a b l e . S p e c i f y i n g a motion's name produces a l i s t i n g of the keyframe i n f o r m a t i o n c u r r e n t l y s t o r e d i n the mot i o n . A model's i n t e r n a l r e l a t i o n s h i p s a re d i s p l a y e d when LIG ANIMATE p r o c e s s e s i t s sour c e code because the model's database i s s t o r e d i n the p r e p r o c e s s o r . The motion and symbol t a b l e i n f o r m a t i o n i s not d i s p l a y e d u n t i l t he o b j e c t code i s c o m p i l e d and run because t h i s i n f o r m a t i o n i s s t o r e d a t the hos t language l e v e l . The PRINT statement i s n o r m a l l y used i n d e p e n d e n t l y of c o n s t r u c t s , however, the statement may 58 be used w i t h i n the SCENE c o n s t r u c t t o o b t a i n the s t a t u s of a model's symbol t a b l e a t each scene frame. 5.2 MODEL TRAVERSAL A model's i n t e r n a l t r e e s t r u c t u r e i s c o m p l e t e l y t r a v e r s e d each time a model i s d i s p l a y e d ( i . e . once each f r a m e ) . A model's symbol t a b l e i s updated w i t h each j o i n t ' s c u r r e n t p o s i t i o n a l a n g l e , c u r r e n t v e l o c i t y , and a c c e l e r a t i o n p r i o r t o the t r a v e r s a l of the model. The symbol t a b l e i n f o r m a t i o n i s o b t a i n e d from both the motion s p e c i f i c a t i o n and the i n t e r p o l a t i o n r o u t i n e s . The t r a v e r s a l a l g o r i t h m i s a r e c u r s i v e p o s t - o r d e r r o u t i n e . I t assembles each model's i n s t a n c e (f,rom the e x t r e m i t i e s inward) w i t h r e s p e c t t o the main l i n k i n the model. The r e s u l t i n g model i n s t a n c e i s a g r a p h i c a l o b j e c t t h a t i s s u b s e q u e n t l y d i s p l a y e d by the host g r a p h i c a l language. R e c u r s i v e r o u t i n e s a r e employed i n the t r e e t r a v e r s a l because they a l l o w s t o r a g e of the model's p r i m a r y - secondary l i n k r e l a t i o n s h i p i n the r e c u r s i o n s t a c k . The use of r e c u r s i o n a l s o s i m p l i f i e s the model t r a v e r s a l on models whose main l i n k s ( r o o t s ) have been changed. 59 5.3 LEVELS OF LANGUAGE USAGE The LIG ANIMATE language may be used a t t h r e e d i f f e r e n t l e v e l s of a b s t r a c t i o n . The motion a l g e b r a , STRIP and SYNCHRONIZE f u n c t i o n s , and e x p l i c i t motion d e f i n i t i o n r e s i d e on d i f f e r e n t a b s t r a c t l e v e l s w i t h each l e v e l more f l e x i b l e t h a t the l e v e l d i r e c t l y below i t . The f i r s t l e v e l i s a subset of the second which i s , i n t u r n , a subset of the t h i r d l e v e l . The d i f f e r e n t i a t i o n by l e v e l s a l l o w s programmers w i t h d i f f e r e n t l e v e l s of s o p h i s t i c a t i o n t o use the language. Each l e v e l i s c h a r a c t e r i z e d by the amount of i n f o r m a t i o n known by the programmer. The f i r s t l e v e l e n t a i l s the use of the motion a l g e b r a . At t h i s l e v e l , the u s e r need not know the s t r u c t u r e of the motion p r i m i t i v e s or the model, b e i n g animated. The user assumes a model i s p r e s e n t which meets the d e s i r e d need and t h a t a s e t of motions e x i s t which animate the model. The user may then expand on t h i s motion s e t t o c r e a t e motions s p e c i f i c t o the a n i m a t i o n sequence d e s i r e d . Usage a t t h i s l e v e l assumes the user has had a programmer c r e a t e the model and b a s i c motions n e c e s s a r y or t h a t a l i b r a r y of models and motions i s a c c e s s i b l e . The second l e v e l i n c o r p o r a t e s the use of the JOINT, STRIP and SYNCHRONIZE o p e r a t i o n s . At t h i s l e v e l , the user must have knowledge of both the motion p r i m i t i v e s b e i n g used 60 and the model b e i n g animated. The user need not know the d e t a i l s of the movements p r e s e n t i n each motion's j o i n t s p e c i f i c a t i o n , however, knowledge of t h e i r o v e r a l l e f f e c t i s needed. A l s o , the u s e r must know the j o i n t i d e n t i f i e r s used i n both the model and the m o t i o n s . The programmer i s removed one s t e p from the d e t a i l s n e c e s s a r y i n e x p l i c i t motion d e f i n i t i o n . At t h i s l e v e l , the user can b u i l d on e x i s t i n g submodels t o c r e a t e more complex models and c r e a t e new motion p r i m i t i v e s from p o r t i o n s of t h o s e a l r e a d y p r e s e n t . The t h i r d and h i g h e s t l e v e l e n t a i l s the e x p l i c i t d e f i n i t i o n of models and motion; the user knows d e t a i l e d i n f o r m a t i o n of the model's s t r u c t u r e and each keyframe of the j o i n t - m o t i o n s p e c i f i c a t i o n s . The t h i r d l e v e l i s the most f l e x i b l e and a l l o w s the d e f i n i t i o n of the most d e t a i l e d models and m o t i o n s . The user knows the extremes of each motion and d e c i d e s on the n a t u r e of the i n t e r p o l a t i o n used t o c r e a t e the i n t e r m e d i a t e frames. T h i s l e v e l i s used e i t h e r d i r e c t l y or i n d i r e c t l y by a l l u s e r s . Chapter 6 CONCLUSION T h r e e - d i m e n s i o n a l computer a n i m a t i o n , i n some r e s p e c t s , i s s i m i l a r t o c l a y , puppet, or model a n i m a t i o n . In t h r e e - d i m e n s i o n a l a n i m a t i o n , the model, p r o p s , and backgrounds a r e b u i l t and p a i n t e d . A motion p i c t u r e camera i s p r e p a r e d and one frame of the f i l m i s exposed. The ani m a t o r moves the model a l i t t l e and another frame i s exposed. R e p e a t i n g t h i s p r ocedure i s the p r o c e s s of c r e a t i n g a n i m a t i o n . As a r e s u l t of the p e r s i s t e n c e of v i s i o n , when these s i n g l e frames a r e p r o j e c t e d a t an a p p r o p r i a t e r a t e they appear t o b l e n d i n t o movement [ 2 1 ] . The o b j e c t of t h i s t h e s i s i s t o g i v e a programmer a s e t of t o o l s f o r m o d e l l i n g complex a r t i c u l a t e f i g u r e s and f o r c o n t r o l l i n g t h e i r movements. In a d d i t i o n , movement s y n t h e s i z i n g t o o l s a r e s u p p l i e d t h a t decrease much of the work a s s o c i a t e d w i t h g e n e r a t i n g e x p l i c i t motion d e s c r i p t i o n s f o r a r t i c u l a t e f i g u r e s . LIG ANIMATE a l l o w s the c r e a t i o n of computer models of f i g u r e s , props and backgrounds. Many c o p i e s or i n s t a n c e s of a model can be used and they can be m a n i p u l a t e d by c h a n g i n g t h e i r s i z e , p o s i t i o n and o r i e n t a t i o n i n space. LIG ANIMATE removes the burden of r e p r e s e n t i n g a f i g u r e ' s segment r e l a t i o n s h i p s from the host language. Y e t , 61 62 the host language i s a l l o w e d a c c e s s t o the g r a p h i c a l o b j e c t produced by the model a t each a n i m a t i o n frame. The LIG ANIMATE system does not r e p l a c e the f u n c t i o n of the host language. The system i s r e s p o n s i b l e f o r a model's movement w i t h r e s p e c t t o i t s e l f ; the host language remains r e s p o n s i b l e f o r the model's movement as a u n i t . LIG ANIMATE s i m p l i f i e s the work of the h o s t language but s t i l l a l l o w s the f l e x i b i l i t i e s a s s o c i a t e d w i t h the host language. Many computer a n i m a t i o n systems a l l o w a user t o d e s c r i b e motions f o r t h r e e - d i m e n s i o n a l o b j e c t s by ge o m e t r i c d e s c r i p t i o n s . D e f i n i n g a r e a l i s t i c w a l k i n g sequence i s d i f f i c u l t because the g r a p h i c s must be c o n t r o l l e d by the motion dynamics of the w a l k i n g o b j e c t [ 1 ] . Other systems approach the problem by a s s i g n i n g c o n s t r a i n t s t o the l i m b s t h a t r e l a t e t o the c o n s t r a i n t s found i n n a t u r e and by u s i n g g o a l - d i r e c t e d t e c h n i q u e s t o c r e a t e s e p a r a t e movements which are p a r t of the f i n a l motion [ 2 3 ] . These methods tend t o be c o m p u t a t i o n a l l y e x p e n s i v e and u s u a l l y i s o l a t e the user from both the models and mo t i o n s . LIG ANIMATE has a s i m p l e r approach t o the problem of a n i m a t i o n s p e c i f i c a t i o n which f a l l s between the extremes of motion dynamics and g o a l d i r e c t i o n . I t a t t e m p t s t o r a i s e the l e v e l of a n i m a t i o n s p e c i f i c a t i o n by e x t e n d i n g the s t r u c t u r e p r e s e n t i n h i g h - l e v e l g r a p h i c a l languages. One s t r e n g t h a s s o c i a t e d w i t h LIG ANIMATE's approach i s 63 f l e x i b i l i t y . For example, the i n t e r p o l a t i o n s a r e d e f i n e d i n d e p e n d e n t l y of the LIG ANIMATE p r e p r o c e s s o r . A programmer can use e x i s t i n g i n t e r p o l a t i o n s u b r o u t i n e s , or can add new ones. I n t e r p o l a t i o n s u b r o u t i n e s t h a t a re more s o p h i s t i c a t e d can e a s i l y be added t o LIG ANIMATE, thus a l l o w i n g more r e a l i s t i c a l model movement. I n t e r p o l a t i o n s can a l s o be c r e a t e d t h a t check f o r s p e c i f i c e v e n t s , thus a l l o w i n g a n i m a t i o n s y n c h r o n i z a t i o n by message p a s s i n g between models, w i t h o u t m o d i f y i n g the LIG ANIMATE p r e p r o c e s s o r . S e v e r a l a n i m a t i o n systems have attempted t o approach a n i m a t i o n from a h i g h l e v e l of a b s t r a c t i o n . D i r e c t o r s and s c r i p t s a r e employed [ 5 , 14], however, the a r t i c u l a t e models ar e implemented as p r o c e d u r e s ( i . e . the model and motion a r e i n s e p a r a b l e ) . Such systems l a c k the a b i l i t y t o add a n i m a t i o n sequences, or t o change the motions a s s o c i a t e d w i t h a model. They a l s o do not p e r m i t the t r a n s f o r m a t i o n of model i n s t a n c e s . For example, i f a proce d u r e has been c r e a t e d which animates a man w a l k i n g , a s e p a r a t e p r o c e d u r e must be w r i t t e n t o animate a c h i l d w a l k i n g , even though the s t r u c t u r e of both models i s i d e n t i c a l . LIG ANIMATE a l l o w s a s t r u c t u r e d approach t o the c r e a t i o n of both models and m o t i o n s . Models and motions can be c o a r s e l y d e f i n e d and s u b s e q u e n t l y r e f i n e d t o a d e s i r e d l e v e l . For example, a w a l k i n g motion can i n i t i a l l y be s p e c i f i e d t h a t p r i m a r i l y r e l i e s on the use of a model's h i p 64 and s h o u l d e r j o i n t s ; the r e s t of the model remains r i g i d . Once the h i p and s h o u l d e r movements a r e c o r r e c t , the movements a s s o c i a t e d w i t h the secondary j o i n t s (elbows, knees, e t c . ) can be s p e c i f i e d . T h i s approach s i m p l i f i e s the c r e a t i o n of motion because i t i s p o s s i b l e t o d e a l w i t h a motion's movements i n d i v i d u a l l y . The same approach can be a p p l i e d t o model . development. A model may be d e f i n e d w i t h o n l y the major j o i n t s and as the development proceeds more j o i n t s can be added. Another approach t o model development i s a l s o p o s s i b l e . A model's i n t e r n a l s t r u c t u r e can be s p e c i f i e d i n d e p e n d e n t l y of the g r a p h i c a l o b j e c t s t h a t r e p r e s e n t the segments, t h e r e f o r e , the g r a p h i c a l o b j e c t s can be m o d i f i e d t o r e d e f i n e a model's appearance. For example, a b l o c k may i n i t i a l l y r e p r e s e n t a segment; the segment can s u b s e q u e n t l y be r e p r e s e n t e d by mote complex p o l y g o n a l s t r u c t u r e s . T h i s segment development can proceed i n d e p e n d e n t l y of a model's d e f i n i t i o n , p r o v i d e d the dime n s i o n s of the g r a p h i c a l o b j e c t s remain e s s e n t i a l l y the same. LIG ANIMATE's approach t o d e f i n i n g motion i s f l e x i b l e because d a t a g e n e r a t i o n s o f t w a r e can c r e a t e motion s p e c i f i c a t i o n s . Human motion s p e c i f i c a t i o n can be s i m p l i f i e d by d e r i v i n g r e a l time d a t a from i n s t r u m e n t a t i o n . A human can be w i r e d w i t h d e v i c e s ( e l e c t r o g o n i o m e t e r s ) t h a t measure p o s i t i o n a l o r i e n t a t i o n [ 8 ] . The movements performed 65 by the human can be r e c o r d e d and s u b s e q u e n t l y used t o animate human models. As i s the case w i t h most p r o j e c t s , f u r t h e r work would be b e n e f i c i a l . LIG ANIMATE c u r r e n t l y r e s t r i c t s j o i n t s t o r o t a t i o n a l j o i n t s ( i . e . the secondary segment r o t a t e s about a p i v o t a l p o i n t l o c a t e d on the p r i m a r y segment). P r i s m a t i c j o i n t s ( i . e . a j o i n t i n which the secondary l i n k s l i d e s w i t h i n the p r i m a r y l i n k ) a r e commonly used i n r o b o t i c arms. LIG ANIMATE c o u l d be extended t o p e r m i t the use of a l l j o i n t s , r a t h e r than p e r m i t t i n g o n l y r o t a t i o n a l j o i n t s . F u r t h e r work c o u l d p e r m i t the system t o use segments which change i n s i z e and shape throughout a model's a n i m a t i o n sequence. The segment's shape and s i z e c o u l d be d e f i n e d u s i n g a, keyframe t e c h n i q u e ; the language woul'd in-between the a p p r o p r i a t e segments d u r i n g the a n i m a t i o n . Such an a b i l i t y would a l l o w the metamorphosis of models (e.g. a m a i l box c o u l d change i n t o a human d u r i n g a s c e n e ) . LIG ANIMATE i s d e s i g n e d as an e x t e n s i o n t o a hos t language, and t o be e x e c u t e d i n a b a t c h environment. A p r e p r o c e s s o r t r a n s l a t e s a l l extended language statements i n t o p r o c e d u r e c a l l s . Other i m p l e m e n t a t i o n s , such as a command language t h a t i s i n t e r p r e t e d by an e x e c u t i v e k e r n e l , a r e p o s s i b l e . The b a t c h environment c o m p l i c a t e s the use of p r e d e f i n e d models and m o t i o n s . At p r e s e n t , these d e f i n i t i o n s must be made a t the b e g i n n i n g of an a p p l i c a t i o n 66 program b e f o r e they can be employed. Most computer a n i m a t i o n s t u d i o s b u i l d up the e q u i v a l e n t of a shopping c a t a l o g of models t h a t are a v a i l a b l e f o r f u t u r e work [ 1 0 ] . I d e a l l y , t h e r e s h o u l d be a method t o a r c h i v e the models and motions d e f i n e d i n a program. The models and motions would be a s s i g n e d names and s t o r e d i n a l i b r a r y . Subsequent programs would need o n l y l o a d d e f i n i t i o n s f o r the models and m otions b e f o r e u s i n g them. Such an approach would i n c r e a s e the f l e x i b i l i t y and speed a s s o c i a t e d w i t h the c r e a t i o n of a n i m a t i o n u s i n g LIG ANIMATE. The use of l i b r a r y d e f i n i t i o n s c r e a t e s a new problem. U n l e s s a user has s p e c i f i e d a model and the a s s o c i a t e d m o t i o n s , or has p r e v i o u s l y worked w i t h them, i t i s d i f f i c u l t t o d e termine a model's p o t e n t i a l movements. I t would be u s e f u l t o have a v i e w i n g u t i l i t y t h a t p e r m i t s the v i e w i n g of> p r e d e f i n e d models and motions i n an i n t e r a c t i v e environment. T h i s t e c h n i q u e would a l l o w the user t o d e t e r m i n e e x a c t l y what had been p r e v i o u s l y d e f i n e d and what f u r t h e r d e f i n i t i o n s must be made i n the a p p l i c a t i o n program. LIG ANIMATE has s e v e r a l advantages over e x i s t i n g systems. I t p e r m i t s the m o d e l l i n g and a n i m a t i o n of f i g u r e s a t a h i g h l e v e l of a b s t r a c t i o n from w i t h i n a programming language thus a l l o w i n g the i m p l e m e n t a t i o n of s o p h i s t i c a t e d a p p l i c a t i o n programs t h a t a r e easy t o read and u n d e r s t a n d . Where many systems can not e a s i l y work w i t h r o t a t i o n s , LIG 67 ANIMATE d e a l s w i t h r o t a t i o n s e f f e c t i v e l y . The use of r o t a t i o n s e n a b l e s the c r e a t i o n of g e n e r a l i z e d motions which can be a p p l i e d t o models of the same j o i n t s t r u c t u r e ; motion s p e c i f i c a t i o n s u s i n g paths and f o r c e s can o n l y be used on the s p e c i f i c models f o r which they were d e s i g n e d . A r t i c u l a t e f i g u r e s a r e f r e q u e n t l y i n t e r p o l a t e d a t the p o i n t l e v e l because a t w o - d i m e n s i o n a l p r o j e c t i o n of the f i g u r e i s used. The approach p r e s e n t e d p e r m i t s the m o d e l l i n g of t h r e e - d i m e n s i o n a l f i g u r e s and t h e i r subsequent i n t e r p o l a t i o n on a r o t a t i o n a l b a s i s ( i . e . the r o t a t i o n a l extremes c o r r e s p o n d t o the keyframe drawings i n t w o - d i m e n s i o n a l i n t e r p o l a t i o n ) , t h u s a l l o w i n g f o r e a s i e r s p e c i f i c a t i o n of t h r e e - d i m e n s i o n a l a n i m a t i o n . BIBLIOGRAPHY [ I ] Armstrong, W.W., and M. Green, The Dynamics of A r t i c u - l a t e d R i g i d B o d i e s f o r Purposes of A n i m a t i o n , G r a p h i c s I n t e r f a c e '85, 1985, pp. 407-415. [2] B a d l e r , N.I., J . O'Rourke, and B. Kaufman, S p e c i a l Problems i n Human Movement S i m u l a t i o n , Computer G r a p h i c s , V o l . 14, No. 3, 1980, pp. 189-197. [3] B a d l e r , N.I., and S.W. S m o l i a r , D i g i t a l R e p r e s e n t a t i o n s of Human Movement, ACM Computing S u r v e y s , V o l . 11, No. 1, 1979, pp. 19-38. [4] Baecker, R.M., P i c t u r e - D r i v e n A n i m a t i o n , AFIPS Confer e n c e P r o c e e d i n g s , V o l . 34, 1969, pp. 273-288. [5] B e r g e r o n , P., A S t r u c t u r e d M o t i o n S p e c i f i c a t i o n i n 3D Computer A n i m a t i o n , G r a p h i c s I n t e r f a c e '83, 1983, pp. 215-222. [6] Booth, K.S., D.H. Kochanek, and M. Wein, Computers Animate F i l m s and V i d e o , IEEE Spectrum, V o l . 20, No. 2, 1983, pp. 44-51. [7] B u r t n y k , N., and M. Wein, Computer-Generated Key-Frame A n i m a t i o n , S o c i e t y of Mot i o n P i c t u r e + TV E n g i n e e r s , V o l . 80, 1971, pp. 149-153. [8] C a l v e r t , E., J . Chapman, and A. P a t l a , The S i m u l a t i o n of Human Movement, G r a p h i c s I n t e r f a c e '82, 1982, pp. 227-234. [9] C a t m u l l , E., The Problems of C o m p u t e r - A s s i s t e d Anima- t i o n , Computer G r a p h i c s , V o l . 12, No. 3, 1978, pp. 348-353. [10] Chuang, R., G. E n t i s , 3D Shaded Computer A n i m a t i o n , S t e p - b y - S t e p , Computer G r a p h i c s - Theory and A p p l i c a t i o n s , S p r i n g e r - V e r l a g , Tokyo, 1983. [ I I ] Horn, B.K.P., K i n e m a t i c s , S t a t i c s , and Dynamics of Two- D i m e n s i o n a l M a n i p u l a t o r s , A r t i f i c i a l I n t e l l i g e n c e : An MIT P e r s p e c t i v e , V o l . 2, 1979. 68 69 [12] K o r e i n , J.U., and N.I. B a d l e r , Techniques f o r G e n e r a t i n g the Goal D i r e c t e d M otion of A r t i c u l a t e d S t r u c t u r e s , IEEE Computer G r a p h i c s and A p p l i c a t i o n s , V o l . 2, No. 9, 1982, pp. 71-81. [13] Magnenat-Thalmann, N., and D. Thalmann, A c t o r and Camera Data Types i n Computer A n i m a t i o n , G r a p h i c s I n t e r f a c e '83, 1983, pp. 203-207. [14] Magnenat-Thalmann, N., and D. Thalmann, D i r e c t o r - O r i e n t e d 3D Shaded Computer A n i m a t i o n , G r a p h i c s I n t e r f a c e '84, 1984, pp. 1-7. [15] McGhee, R.M., C o n t r o l of Legged Locomotion Systems, P r o c . 1977 J o i n t A u tomatic C o n t r o l C o n f e r e n c e , V o l . 1, pp. 205-213. [16] McKeeman, W.M., J . J . H o r n i n g , and D.B. Wortman, A C o m p i l e r G e n e r a t o r , P r e n t i c e - H a l l , Englewood C l i f f s , 1970. [17] P a u l , R.P., Robot M a n i p u l a t o r s , MIT P r e s s , Cambridge, Mass., 1981. [18] P e r e z , L., and M.A. Wesley, An A l g o r i t h m f o r P l a n n i n g C o l l i s i o n - F r e e Paths Among P o l y h e d r a l O b s t a c l e s , Communications of the ACM, V o l . 22, 1979, pp. 560-570. [19] Ross, R., A H i g h - l e v e l G r a p h i c s Programming Language S u p p o r t i n g the I n q u i r y of G r a p h i c a l O b j e c t s , M.A.Sc• T h e s i s , The U n i v e r s i t y of B r i t i s h Columbia, 1982, 88 pp. [20] Ross, R., LIG6: Language f o r I n t e r a c t i v e G r a p h i c s , U s e r ' s Manual, Department of E l e c t r i c a l E n g i n e e r i n g , The U n i v e r s i t y of B r i t i s h C o lumbia, 1982, 55 pp. [21] S a c h t e r , J . , 3-D Computer Generated A n i m a t i o n , P r o c . 4th Symposium on S m a l l Computers i n the A r t s , 1984, pp. 42-49. [22] S c h r a c k , G.F., D e s i g n , Implementation and E x p e r i e n c e s w i t h H i g h - l e v e l G r a p h i c s Language f o r I n t e r a c t i v e Computer-Aided Design P u r p o s e s , Computer G r a p h i c s , V o l . 10, No. 1, 1976, pp. 10-17. [23] Z e l t z e r , D., Motor C o n t r o l Techniques f o r F i g u r e A n i m a t i o n , IEEE Computer G r a p h i c s and A p p l i c a t i o n s , V o l . 2, No. 9, 1982, pp. 53-59. [24] Z e l t z e r , D., R e p r e s e n t a t i o n of Complex A n i m a t i o n F i g u r e s , G r a p h i c s I n t e r f a c e '82, 1982, pp. 205-211. APPENDIX A A LIG ANIMATE PROGRAM The LIG ANIMATE program shown on the f o l l o w i n g pages was used t o c r e a t e the a n i m a t i o n sequence p r e s e n t i n F i g u r e 11. PRIMITIVE BOX i s a LIG6 g r a p h i c a l subprogram which c r e a t e s g r a p h i c a l o b j e c t s f o r the f i g u r e ' s segments. The st a t e m e n t s f l a g g e d w i t h an a s t e r i s k i n the f i r s t column are p r o c e s s e d by the LIG ANIMATE p r e p r o c e s s o r . The host s t a t e m e n t s a r e c o p i e d t o the p r e p r o c e s s o r t a r g e t f i l e . T h i s program demonstrates the a b i l i t y of LIG ANIMATE t o animate an a r t i c u l a t e f i g u r e w h i l e a l l o w i n g the host language a c c e s s t o the f i g u r e as a u n i t . 7 0 71 PRIMITIVE BOX produces a 3D r e c t a n g l e of a r b i t r a r y h e i g h t , w i d t h and de p t h . The r e c t a n g l e i s d e f i n e d about the o r i g i n . Width i s a l o n g the X a x i s . H e i g h t i s a l o n g the Y a x i s . Depth i s a l o n g the Z a x i s . PRIMITIVE BOX REAL HEIGHT, WIDTH, DEPTH, LIGHT, LIGHT2 VECTOR CENTRE, FTR, FTL, FBR, FBL, BTR, BTL, BBR, BBL BOX ::= 'BOX' ['AT' CENTRE ' , ' ] <CENTRE = (0.0, 0.0, 0.0)> 'WIDTH' WIDTH ' , ' 'HEIGHT' HEIGHT ' , ' 'DEPTH' DEPTH [',' 'LIGHTNESS' LIGHT]<LIGHT = 40.0> ; LIGHT2 = LIGHT * 1.5 FTR = CENTRE + (WIDTH/2, HEIGHT/2, DEPTH/2) FTL = FTR - (WIDTH, 0.0, 0.0) FBL = FTL - (0.0, HEIGHT, 0.0) FBR = FTR - (0.0, HEIGHT, 0.0) BTR = FTR - (0.0, 0.0, DEPTH) BTL = BTR - (WIDTH, 0.0, 0.0) BBL = BTL - (0.0, HEIGHT, 0.0) BBR = BTR - (0.0, HEIGHT, 0.0) Set the drawing parameters DRAW WITH <LIGHTNESS LIGHT> Back DRAW POLY FROM (BTR) TO (BTL) TO (BBL) TO (BBR) TO (BTR) Set the drawing parameters DRAW WITH <LIGHTNESS LIGHT2> Top DRAW POLY FROM (FTR) TO (BTR) TO (BTL) TO (FTL) TO (FTR) Bottom DRAW POLY FROM L e f t DRAW POLY FROM TO (FTL) (FBR) TO (BBR) TO (BBL) TO (FBL) TO (FBR) (FTL) TO (BTL) TO (BBL) TO (FBL) R i g h t DRAW POLY FROM (FTR) TO (BTR) TO (BBR) TO (FBR) TO (FTR) Set the drawing parameters DRAW WITH <LIGHTNESS LIGHT> F r o n t DRAW POLY FROM (FTR) TO (FTL) TO (FBL) TO (FBR) TO (FTR) RETURN END GRAPHICAL HEAD, BODY, TORSO GRAPHICAL FARM, BARM, FLEG, BLEG, FOOT VECTOR LOCATN, DISTAN REAL VUWID, TORWID, FRMNUM MODEL HUMAN, LARM, RARM, LLEG, RLEG MOTION SQUAT D e f i n e the model's HEAD HEAD :- BOX WIDTH 0.30, HEIGHT 0.30, DEPTH 0.16 D e f i n e the model's TORSO BODY :- BOX WIDTH 0.56, HEIGHT 0.86, DEPTH 0.36 TORSO :- (HEAD + BODY<TRANS(0.0, -0.58, 0.0)>) <TRANS(0.0, 0.58, 0.0)> D e f i n e the model's l i m b s (Forearm, Backarm, F o r e l e g , B a c k l e g ) FARM :- BOX WIDTH 0.22, HEIGHT LIGHTNESS 25.0 0. 48, DEPTH 0. 14, BARM :- BOX WIDTH 0.22, HEIGHT LIGHTNESS 25.0 0. 48, DEPTH 0. 14, FLEG :- BOX WIDTH 0.30, HEIGHT LIGHTNESS 25.0 0. 58, DEPTH 0. 18, BLEG :- BOX WIDTH 0.30, HEIGHT LIGHTNESS 25.0 0. 40, DEPTH 0. 18, D e f i n e the model's FOOT FOOT :- BOX WIDTH 0.42, HEIGHT LIGHTNESS 25.0 0.13, DEPTH 0.10, 73 C D e f i n e the model's r i g h t and l e f t arms * RARM :- JOINT 1, BARM, (0.0, -0.24, 0.0), * FARM, (0.0, 0.24, 0.0), * (0.0, 0.0), (0.0, 0.0), (0.0, 135.0) * LARM :- RARM <TRANS JOINTS BY 1> C D e f i n e the model's r i g h t and l e f t l e g s * STARTMODEL RLEG * JOINT 3, BLEG, ( 0.00, -6.20, 0.0), * FLEG, ( 0.00, 0.29, 0.0), * (0.0, 0.0), (0.0, 0.0), (-150.0, 0.0) * JOINT 4, FLEG, (-0.05, -0.29, 0.0), * FOOT, (-0.11, 0.06, 0.0), * (0.0, 45.0), (-25.0, 25.0),(-50.0, 50.0) * ENDMODEL * LLEG :- RLEG <TRANS JOINTS BY 2> C Add the e x t r e m i t i e s t o the model HUMAN * HUMAN :- JOINT 7, TORSO, (0.00, 0.40,-0.18), * RARM, (0.0, 0.24, 0.0), * (0.0, 180.0), (-20.0, 20.0), * (-90.0, 180.0) * HUMAN :- JOINT 8, HUMAN, (0.00, 0.40, 0.18), * LARM, (0.0, 0.24, 0.0), * (0.0, 180.0), (-20.0, 20.0), * » (-90.0, 180.0) * HUMAN :- JOINT 9, HUMAN, (0.00,-0.40,-0.18), * RLEG, (0.0, 0.24, 0.0), * (-45.0, 45.0), (-45.0, 45.0), * (-90.0, 135.0) * HUMAN :- JOINT 10, HUMAN, (0.00,-0.40, 0.18), * LLEG, (0.0, 0.24, 0.0), * (-45.0, 45.0), (-45.0, 45.0), * (-90.0, 135.0) C D e f i n e the motion SQUAT * STARTMOTION SQUAT * JOINT 1 POSITION 0.0, 0.0, 135.0 * JOINT 2 POSITION 0.0, 0.0, 135.0 * JOINT 3 POSITION 0.0, 0.0, 0.0 * FRAME 5 POSITION 0.0, 0.0,-135.0 * INTERPOLATE ACCELERATE * JOINT 4 POSITION 0.0, 0.0, 0.0 * FRAME 5 POSITION 0.0, 0.0, 45.0 * INTERPOLATE ACCELERATE * JOINT 5 POSITION 0.0, 0.0, 0.0 * FRAME 5 POSITION 0.0, 0.0,-135.0 * INTERPOLATE ACCELERATE JOINT 6 POSITION 0 . 0 , 0 . 0 , 0 . 0 FRAME 5 POSITION 0 . 0 , 0 . 0 , 4 5 . 0 INTERPOLATE ACCELERATE JOINT 9 POSITION 0 . 0 , 0 . 0 , 0 . 0 FRAME 5 POSITION 0 . 0 , 0 . 0 , 9 0 . 0 INTERPOLATE ACCELERATE JOINT 10 POSITION 0 . 0 , 0 . 0 , 0 . 0 FRAME 5 POSITION 0 . 0 , 0 . 0 , 9 0 . 0 INTERPOLATE ACCELERATE ENDMOTION FIGURE HUMAN MAIN LINK FOOT INITIALIZE SCENE 1 VIEW POINT = ( 0 . 0 , 0 . 0 , 4 . 0 ) VIEW WIDTH = 7 . 5 DISTAN = ( 6 . 0 , 0 . 0 , 0 . 0 ) LOCATN = ( - 2 . 0 , 0 . 0 , 0 . 0 ) STARTSCENE LENGTH 6 SAMEFRAME 6 ANIMATE HUMAN FROM 0 TO 5 USING SQUAT HUMAN :- HUMAN <TRANS (LOCATN)> LOCATN = LOCATN + (DISTAN / 5 . 0 ) ENDSCENE SHOOTSCENE STOP END APPENDIX B IMPLEMENTATION NOTES The language LIG ANIMATE i s implemented on the U n i v e r s i t y of B r i t i s h Columbia Computing C e n t r e ' s Amdahl 5850 computer under the M i c h i g a n T e r m i n a l System. The f o l l o w i n g MTS commands w i l l e x e c u t e a LIG ANIMATE program c o n t a i n e d i n the f i l e LIGPROGRAM. $RUN LIGANIMATE.0 SCARDS=LIGPROGRAM SPRINT=-OUTPUT SPUNCH=-LIGCODE PAR=NEW=35 LIST=-LIST $RUN LIG6:LIG6 SCARDS=-LIGCODE SPUNCH=-FTN $RUN *FTN SCARDS=-FTN SPUNCH=-FTNOBJ $RUN -FTNOBJ+LIG6:LIB+LIGANIMATE.LIB S e v e r a l s t a t i s t i c s r e g a r d i n g the i m p l e m e n t a t i o n of LIG ANIMATE have been o b t a i n e d . The p r e p r o c e s s o r was w r i t t e n i n PASCAL u s i n g a top-down C o m p i l e r W r i t i n g System. The r e s u l t i n g p r e p r o c e s s o r c o n s i s t s of 229 p r o c e d u r e s t o t a l l i n g 6,312 l i n e s of code. T h i s r e p r e s e n t s a l i s t i n g of 124 pages and o c c u p i e s a d i s k f i l e c o n t a i n i n g 56 pages (each d i s k page c o n t a i n s 4096 b y t e s ) . The o b j e c t code r e s u l t i n g from the c o m p i l a t i o n of the p r e p r o c e s s o r source code r e q u i r e s a d i s k f i l e of 50 pages and i t t a k e s 0.334 seconds of CPU time t o l o a d . 75 76 The ru n - t i m e l i b r a r y was w r i t t e n i n LIG6; i t c o n t a i n s 28 s u b r o u t i n e s c o n s i s t i n g of 1,151 l i n e s of code. T h i s r e p r e s e n t s a l i s t i n g of 22 pages and o c c u p i e s a d i s k f i l e of 12 pages. The r e s u l t i n g o b j e c t code r e q u i r e s a 12 page d i s k f i l e and t a k e s 0.083 seconds of CPU time t o l o a d . The t r a n s l a t i o n of a LIG ANIMATE program i n t o an e q u i v a l e n t LIG6 program i n v o l v e s the replacement of e x t e n s i o n c o n s t r u c t s w i t h LIG6 statements and c a l l s t o s u b r o u t i n e s i n a run-time l i b r a r y . The a c t u a l expansion t h a t o c c u r s depends upon the program b e i n g p r o c e s s e d . In the program shown i n Appendix A, the 99 statement program took 1.139 CPU seconds and c o s t $0.29 f o r the p r e p r o c e s s o r t o a n a l y s e the program, c r e a t e an e q u i v a l e n t 234 statement LIG6 program, and produce a l i s t i n g . The e x p a n s i o n f a c t o r f o r the LIG ANIMATE program was 2.4. The HUMAN model was d e f i n e d u s i n g 11 s t a t e m e n t s . The e q u i v a l e n t LIG6 code c o n t a i n s 75 s t a t e m e n t s , an e x p a n s i o n f a c t o r of 6.8. The SQUAT motion was d e f i n e d u s i n g 16 s t a t e m e n t s . The e q u i v a l e n t LIG6 code c o n t a i n s 29 s t a t e m e n t s , an e x p a n s i o n f a c t o r of 1.8.

Cite

Citation Scheme:

    

Usage Statistics

Country Views Downloads
United States 3 0
China 1 8
Japan 1 0
City Views Downloads
Ashburn 2 0
San Mateo 1 0
Beijing 1 0
Tokyo 1 0

{[{ mDataHeader[type] }]} {[{ month[type] }]} {[{ tData[type] }]}
Download Stats

Share

Embed

Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                        
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            src="{[{embed.src}]}"
                            data-item="{[{embed.item}]}"
                            data-collection="{[{embed.collection}]}"
                            data-metadata="{[{embed.showMetadata}]}"
                            data-width="{[{embed.width}]}"
                            async >
                            </script>
                            </div>
                        
                    
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:
http://iiif.library.ubc.ca/presentation/dsp.831.1-0051891/manifest

Comment

Related Items

Admin Tools

To re-ingest this item use button below, on average re-ingesting will take 5 minutes per item.

Reingest

To clear this item from the cache, please use the button below;

Clear Item cache