ANIMO Character Animation Language Alexei Masterov Natasha Shamis Joshua Poritz Table of Contents 1 Introduction 1 1 Overview 1 1 1 Summary 1 1 2 Applications 1 1 3 BVH File Format 1 1 4 Compiler Inputs and Outputs 1 2 Language Elements 1 2 1 Data Types Operators Loops and Conditionals 1 2 2 Basic Commands rotate and move 1 2 3 Blending 1 2 4 User Defined Functions 1 3 Examples 1 3 1 Sample User Defined Functions 1 3 2 Sample Program 4 4 4 4 4 6 6 6 7 7 7 7 7 8 2 Language Tutorial 2 1 Writing an ANIMO Program 2 1 1 BVH Files 2 1 2 Internal Functions 2 1 3 User Defined Functions 2 1 4 Loops and Conditionals 2 2 Compiling an ANIMO Program 2 3 Running an ANIMO Program 10 10 10 10 11 11 11 12 3 Language Reference Manual 3 1 Introduction 3 2 Lexical Conventions 3 2 1 Tokens 3 2 2 Comments 3 2 3 Identifiers 3 2 4 Keywords and Built in Functions 3 2 5 Constants 3 3 Expressions 3 3 1 Primary Expressions 3 3 2 Unary Operators 3 3 3 Multiplicative Operators 3 3 4 Additive Operators 3 3 5 Relational and Equality Operators 3 3 6 Operator 3 3 7 Operator 3 3 8 Assignment Operators 3 4 Functions 13 13 13 13 13 13 14 14 14 15 15 15 15 15 15 15 15 16 2 3 5 Statements 3 5 1 Expression Statement 3 5 2 Compound Statement 3 5 3 Conditional Statement 3 5 4 For Statement 3 5 5 Return Statement 3 5 6 Include Statement 3 6 Scope 16 16 16 16 17 17 17 17 4 Project Plan 4 1 Team Responsibilities 4 2 Project Timeline 4 3 Software Development Environment 4 4 Programming Style Guide 4 4 1 Java Coding Style 4 4 2 Antlr Coding Style 4 5 Project Log 19 19 20 20 20 20 21 21 5 Architectural Design 5 1 Compiler Structure 5 2 Front end 5 3 Back end 5 4 Implementation 22 22 23 23 23 6 Testing Plan 6 1 Testing Scoping 6 2 Testing Move and Rotate 24 24 26 7 Lessons Learned 7 1 Natasha s Learning Experience 7 2 Alexei s Learning Experience 7 3 Joshua s Learning Experience 7 4 Advice for Future Teams 29 29 29 29 30 Appendix Complete Code Listing 31 3 Chapter 1 Introduction 1 1 Overview 1 1 1 Summary ANIMO is a language that is designed to control an animated character It allows a programmer to compose instructions specifying a series of body movements enabling a character to perform a variety of motions ANIMO has an easy to use syntax combining numerous features characteristic of higher level languages with unique functions of its own 1 1 2 Applications There are three major domains in which our language would likely be employed a Computer Animation Computer animation is used very widely in the movie industry ANIMO may become a standard for animators and an alternative for visual interfaces because it allows the reuse of code while providing the flexibility by means of parameters b Computer Games Computer games and virtual environments is another domain where our language can be used by both programmers and players In places like the Metaverse http en wikipedia org wiki Snow Crash users can learn to dance by writing an ANIMO program and use it to impress their friends The creators of such environments can use ANIMO for animating crowds by re using the same code with different parameters c Robot Control Finally ANIMO can be used in a real world for operating toy robots It should be relatively easy to port it to allow control for a humanoid robot that has a set of joints arranged in a hierarchical fashion 1 1 3 BVH File Format The BVH file format was originally developed by Biovision a motion capture services company as a way to provide motion capture data to their customers The name BVH stands for Biovision hierarchical data It contains the hierarchical structure of joints and end effectors the motion capture data as a list of figure coordinates in space and a list of joint rotation angles over a sequence of frames 4 Sample BVH file HIERARCHY ROOT Hips OFFSET 0 00 0 00 0 00 CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation JOINT Chest OFFSET 0 00 5 21 0 00 CHANNELS 3 Zrotation Xrotation Yrotation MOTION Frames 2 Frame Time 0 033333 8 03 35 01 88 36 3 41 14 78 164 35 13 09 40 30 24 60 7 81 35 10 86 47 3 78 12 94 166 97 12 64 42 57 22 34 The first three columns correspond to the X Y and Z coordinate of the root joint position in space and the rest of the columns define the local rotation angle of each joint in the hierarchy along the X Y and Z axis Joints are rigidly attached therefore they can only rotate and not move in space If one rotates the joint in the hierarchy all the joints in the hierarchy below get rotated with it 5 The Frame time parameter specifies the time interval between frames The rendering software then interpolates all the joint positions in between frames So how do we make the figure move in a consistent fashion The hierarchy in the BVH file specifies the initial position of the figure k0 Then each row specifies what will happen to the figure at the next time interval k1 k2 kN Each movement is a combination of joint rotations In our language we allow the user to specify each joint rotation individually indicating the time at which the rotation should begin and the duration for which it lasts this allows several movements to be performed simultaneously This operation of combining different movements is called blending By blending different joint rotations the user can make the figure perform arbitrary complex movements through space 1 1 4 Compiler Inputs and Outputs Motion will be simulated through the use of BVH files which contain hierarchical information for the skeletal structure of the animated characters Our compiler will accept an ANIMO file s and a BVH file or still BVH file containing the character s initial position and output a new BVH file containing a set of instructions in the form of joint movements for the character 1 2 Language Elements 1 2 1 Data Types Operators Loops and Conditionals ANIMO uses conditionals such as if and loops such as for Since all of our data represents joint rotations we limited our data types to doubles and have addition 6 subtraction division multiplication and modulus operators defined for them with standard mathematical precedence 1 2 2 Basic Commands rotate and move The most basic commands in ANIMO s default library are rotate joint start time duration x y z which maps nicely to the 3 columns that correspond to a given joint rotation move start time duration x y z which maps to the figure s position in …
View Full Document
Unlocking...