Unformatted text preview:

Physical Simulation Language PSL John Hamer hamer John Rodriguez jr534 Danian Martinez djm188 Taino Ortiz tjo22 Background Info PSL is a language intended for the convenient analysis of motion and objects in a 2D space Other languages such as Direct X make even the simplest simulation a bother Window management issues Efficient memory handling message queueing Purpose PSL was created for two reasons To facilitate the creation of simple polygonal shapes using a simple language To feature interaction among these objects for the demonstration of physical principles Key Features Key Features of PSL Graphical Display Immediate response to what he programmed in PSL Collision Detection and Reaction Attempts to simulate how real world objects handle collisions in the environment Slightly costly O n2 algorithm PSL Data Flow This diagram shows the process a PSL file is put through to become an executable Compiler ANTLR v2 7 2 was used to develop PslParser and PslLexer via our languagespecific CFG We decided to implement our own treewalker which assisted ANTLR in performing semantic analysis of the resultant ASTs PSL Objects Possible objects in PSL Circle Circle double center x double center y double radius Rectangle Rectangle double x double y double length double width Square Square double x double y double length Polygon convex AND concave Poly double x1 double y1 double x2 double y2 Line Line double x1 double y1 double x2 double y2 Abstract Syntax Tree Each statement is composed of a subtree known as a child with the first token as the root and all proceeding tokens its children Value list become children of the Object that is being created of altered The AST that ANTLR generates is read as a list and using the API provided by their AST files they are processed one child at a time Intermediate Code Generator Takes in One vector of all objects All global variables defined Abides by PSL specific C template to generate appropriate environment and object specifications Writes the corresponding C source file PSL bytecode Backend Graphics programming already has a commonly used API OpenGL Often complicated and error prone Complicates the simplest demo Not for rookies PSL implements its powerful capabilities while eliminating the learning curve Backend continued The backend of the PSL language implemented a carefully structured OO environment using C OpenGL PslEnvironment the rendering environment PslPolygon PslSquare etc For windowing the GLUT toolkit was used on Windows XP Mesa on Redhat Linux Set using PSL Global setter methods Design of Backend P s lO b je c t P s lT im e r P s lS h a p e P s lP o in t P s lE n v ir o n m e n t P s lP o ly g o n P s l R e c t a n g le P s lS q u a re P s lC ir c l e Simple psl def circle1 Circle 3 3 3 Creates a circle circle1 color 255 0 0 Sets color to red circle1 points 20 def poly1 Polygon 5 5 3 5 Creats a square Poly1 addpoint 2 5 2 5 poly color 0 0 255 Sets color to blue Global zoom 15 Set the camera zoom Sets window size Global windowSize 300 300 Simple psx Testing Plan Modular Testing Tested each module before integrating Regression Testing Tested new modules to verify that they worked with the other modules Integration Testing Integration of front and Backend This Test verified that the language worked Error Testing Used to verify that the compiler threw errors for incorrect syntax and or semantics Conclusion PSL is a valuable asset To the graphics designer executive or engineer who must incorporate graphical displays into their everyday assignments A lecture given by a high school physics professor will be much more effective with PSL designed presentations in his or her arsenal Lessons Three very important properties of a good team Trust Communication Commitment


View Full Document

Columbia COMS W4115 - Physical Simulation 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 Physical Simulation 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 Physical Simulation 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?