Unformatted text preview:

ELMO Loves Manipulating Objects ELMO A Graphics Object Manipulation Language Jeffrey Cua Stephen Lee Erik Peterson jmc2108 columbia edu sl2285 columbia edu edp2002 columbia edu John Waugh jrw2005 columbia edu December 21 2004 Contents 1 Introduction 1 1 Capabilities 1 2 Implementation 1 2 1 Input Output 1 2 2 Types 1 2 3 Functions 1 2 4 Random Numbers 1 2 5 Flow Control 2 Tutorial 3 Language Reference Manual 3 1 Lexical Conventions 3 1 1 Comments 3 1 2 Identifiers Names 3 1 3 Keywords 3 1 4 Constants 3 2 Meaning of Identifiers 3 2 1 Types 3 3 Declarations 3 4 Statements 3 4 1 Compound Statements 3 4 2 Iteration Statements 3 4 3 Selection Statements 3 4 4 Interrupt Statements 3 4 5 Group Statements 3 5 Expressions 3 5 1 Constant Expressions 3 5 2 Random Number Expressions 3 5 3 Primary Expressions 3 5 4 Parentheses Expressions 3 5 5 Vector Length Expressions 3 5 6 Function Invokation 3 5 7 Suffix Expression 3 5 8 Prefix Expressions 3 5 9 Postfix Expressions 3 5 10 Power Expressions 3 6 External Declarations 3 6 1 Function Defintion 3 3 4 4 4 4 4 5 6 1 8 8 8 8 8 8 9 9 10 10 10 10 11 11 11 12 12 12 12 12 12 13 13 13 13 13 14 14 4 Project Plan 4 1 Planning and Development 4 2 Style 4 3 Timeline 4 4 Roles and Responsibilites 4 5 Software Development Environment 4 6 Project Log 16 16 16 17 17 17 18 5 Architectural Design 5 1 Walker Stephen John 5 1 1 Data Types Stephen John Erik 5 1 2 Expressions Stephen John 5 1 3 Groups Erik 19 19 23 23 23 6 Testing 7 Lessons Learned 7 1 Jeffrey Cua 7 2 Stephen Lee 7 2 1 Advice for Future Groups 7 3 Erik Peterson 7 4 John Waugh 7 4 1 What Went Right 7 4 2 Room for Improvement 25 A Ant Project Build Stephen John 28 28 29 29 29 29 29 30 31 B ANTLR 34 B 1 Lexer Erik 34 B 2 Parser John 37 B 3 Walker Stephen 43 C Java C 1 Generic ELMO Type Exception C 2 Walker Operator AST Classes Stephen John C 3 ELMO Data Types and ELMO Functions John Stephen C 3 1 Function specific Classes Stephen C 4 Group and Objects Classes Erik C 5 Front Ends John D CVS Logs 52 52 52 58 73 74 85 90 2 Chapter 1 Introduction Many programmers invest substantial effort into expressing three dimensional objects using API s like OpenGL in C C Java3D and Direct3D also in C C Languages like C C and Java are Swiss Army knives which work well for a wide variety of applications but can still become unwieldy OpenGL is enormously powerful but it can become quite cumbersome for something as simple as a rotation The objective of ELMO is not to augment the functionality offered by OpenGL but provide an additional way to express the same set of operations and primitives that OpenGL grafts on to C C Likewise Java3D which may be easier to use than OpenGL suffers from the same fundamental flaw it is grafted onto an existing general purpose language ELMO abstracts many of the details related to the matrix manipulation that OpenGL or other 3D API s reveal to the programmer When a programmer wants to do a simple rotation the programmer might call glRotate3f a function in OpenGL which initializes a 4x4 matrix that is placed on one of the various transformation stacks that OpenGL employs to keep track of the various operations conducted on the 3D objects in the program ELMO aims to be intuitive to the lay programmer allowing him or her to quickly express everything from simple spheres to more complex objects 1 1 Capabilities 3D Geometry The core of ELMO is its manipulation of three dimensional graphical objects While supporting a wealth of options and user defined properties ELMO aims to be easy to code and understand conceptually Basic Transformations All the primitive transformations you d expect are supported within the language Translation rotation and scaling are all handled under the surface with no need to learn matrix multiplication fret over vectors or understand homogeneous coordinate systems Grouping and Cloning On top of its primitive operations ELMO allows for convenient creation of more complex objects from simpler ones through an amalgamation process more readily known as grouping This allows basic cylinders and spheres to become more impressive graphical creations such as dendritic growths it trees Having created these complex objects ELMO also allows for their convenient cloning through an internal process of copying such that an initial conceptual model can be instatiated time and time again as fits the programmer s intentions Parameterized Objects An important feature that differentiates ELMO from OpenGL and Java3D is the ability to quickly 3 script and generate complex and unique objects using OBJ input from OBJ files directly By giving the user the ability to involve random numbers easily into object manipulation projects like generating complex yet unique structures such as a forest of trees becomes much less of a hassle Now all a modeler needs to do is create a tree script and include randomness Run the script as many times as you need unique trees and voila A diverse forest emerges 1 2 1 2 1 Implementation Input Output Essentially an ELMO program will take some building block geometry perform various transformations on these objects or copies of these objects and output the resultant 3D scene to a file We have chosen the Alias Wavefront OBJ file format to describe both the inputs and the outputs of an ELMO program Thus the operation of an ELMO program will look like the following OBJ input s ELMO execution OBJ output 1 2 2 Types ELMO will support several built in types and automatic conversions between them where applicable The list of built in types with a short description of each is as follows For types with attributes those attributes are referenced with C Java style dot syntax Examples myvector x Note that any operation performed on a group can also be performed on an object Objects are inherently groups and thus the same group operations can be applied to objects Internally an implicit group containing only myobject would be used 1 2 3 Functions Applying functions to variables takes the following general form action target preposition input For instance rotate myobject around 1 1 1 move myobject along myvector Several built in functions will enable the easy use of geometric transformations These include rotate move scale copy 1 2 4 Random Numbers In the automatic generation of fractals and interesting 3D objects in general it is often desirable to use random numbers for some inputs In ELMO writing 5 10 means a random number between 5 and 10 inclusive 4 1 2 5 Flow Control


View Full Document

Columbia COMS W4115 - A Graphics Object Manipulation Language

Documents in this Course
YOLT

YOLT

13 pages

Lattakia

Lattakia

15 pages

EasyQL

EasyQL

14 pages

Photogram

Photogram

163 pages

Espresso

Espresso

27 pages

NumLang

NumLang

6 pages

EMPATH

EMPATH

14 pages

La Mesa

La Mesa

9 pages

JTemplate

JTemplate

238 pages

MATVEC

MATVEC

4 pages

TONEDEF

TONEDEF

14 pages

SASSi

SASSi

16 pages

JTemplate

JTemplate

39 pages

BATS

BATS

10 pages

Synapse

Synapse

11 pages

c.def

c.def

116 pages

TweaXML

TweaXML

108 pages

Load more
Loading Unlocking...
Login

Join to view A Graphics Object Manipulation Language and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view A Graphics Object Manipulation Language and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?