// import the physics model import uk.ac.soton.grophysics.PhysicsModel; // global variables int time; PhysicsModel pm; module Dummy(super.angle) extends RL(angle); protected void init () [ { time = 0; pm = new PhysicsModel(); // pm[debugText] =true; // pm[debugRendering] =true; } Axiom ==> [Dummy(0) Translate(0, 1.5, 3.5) b:Sphere(0.5) { b.setShader(BLUE); pm.add("Ball", b, 2.0); } ] [Dummy(0) Translate(0, -1, 3) RL(-45) RU(5) c:Cylinder(2,0.5) { c.setShader(YELLOW); pm.add("Cyl", c, 1.0); } ] ; ] public void run () { if (pm.isActive()) { time++; pm.step(); // fool GroIMP into updating the display after changing the transforms [d:Dummy ::> d[angle]=0;] } else { println("Done."); } } private void info() { println("Time="+time); [s:Sphere(r) ::> { println("Sphere radius "+r+" location "+Library.location(s)); // println(" transformation "+Library.transformation(s).toMatrix4d()); } ]; [c:Cylinder ::> { println("Cylinder location "+Library.location(c)); // println(" transformation "+Library.transformation(c).toMatrix4d()); } ]; }