anchor.diff:    double polar;
     Vector lookAt = new Vector();
   
  -  double ma=0.0; // mouse azimuth
  -  double mp=0.0; // mouse polar
  +  double ma = 0.0; // mouse azimuth
  +  double mp = 0.0; // mouse polar
   
     Map<int, bool> cpk = currentlyPressedKeys;
     Map<String, bool> cpmb = currentlyPressedMouseButtons;
   
  -  OrbitCamera(this.camera, this.radius, [this.azimuth=0.0, this.polar=0.0]) {
  -    HTML.document.onMouseWheel.listen( (HTML.WheelEvent e) {
  +  OrbitCamera(this.camera, this.radius, [this.azimuth = 0.0, this.polar = 0.0]) {
  +    HTML.document.onMouseWheel.listen((HTML.WheelEvent e) {
         try {
  -        double d = e.wheelDeltaY*0.1;
  -        if(radius-d>0)
  -          radius -= d;
  -      } catch(e) {
  +        double d = e.wheelDeltaY * 0.1;
  +        if (radius - d > 0) radius -= d;
  +      } catch (e) {
           print(e);
         }
       });
  -    HTML.document.onMouseMove.listen( (HTML.MouseEvent e) {
  +    HTML.document.onMouseMove.listen((HTML.MouseEvent e) {
         e.preventDefault();
  -      if( cpmb['left'] != null) {
  -        azimuth += e.movement.x*0.01;
  -        polar += e.movement.y*0.01;
  +      if (cpmb['left'] != null) {
  +        //azimuth += e.movement.x*0.01;
  +        //polar += e.movement.y*0.01;
  +        azimuth += (mouseX - mouseDownX)*0.01;
  +        polar += (mouseDownY - mouseY)*0.01;
  +        mouseDownX = mouseX;
  +        mouseDownY = mouseY;
  +
         }
       });
     }
  -  
  +
     void setLookAt(dynamic x, [double y, double z]) {
  -    if( x is Vector ){
  +    if (x is Vector) {
         lookAt[0] = x[0];
         lookAt[1] = x[1];
         lookAt[2] = x[2];
  
positive.code: 
    Vector traceStart = new Vector();
    Vector traceEnd = new Vector();
    
    Vector up = new Vector(0.0,0.0,1.0);
    
    int movementX=0;
    int movementY=0;
    
    FPSCamera( this.camera) {
  
      HTML.document.onMouseDown.listen( (HTML.MouseEvent e) {
        e.preventDefault();
        HTML.document.body.requestPointerLock();
      });
      
      HTML.document.body.onMouseMove.listen( (HTML.MouseEvent e) {
        e.preventDefault();
        movementX += e.movement.x;
        movementY += e.movement.y;
      });
  
    }
    
    void animate( double elapsed)
    {
      Map<int, bool> cpk = currentlyPressedKeys;
      Map<String, bool> cpmb = currentlyPressedMouseButtons;
      
      movement.scale(0);
      
      if (cpk[Key.W] != null) {
        movement.subtract( camera.getBack() );
      }
      if (cpk[Key.A] != null) {
        movement.subtract( camera.getRight() );
      }
      if (cpk[Key.S] != null) {
        movement.add( camera.getBack() );
      }
      if (cpk[Key.D] != null) {
        movement.add( camera.getRight() );
      }
      
      movement.z = 0.0;
      movement.normalize();
      momentum.add(movement);
      tmp.set(momentum);
      tmp.scale(0.02);
      
      traceStart.set(camera.getPos());
      traceEnd.set(camera.getPos());
      traceEnd.add(tmp);
      
      //Output output = level.trace( traceStart, traceEnd, 10.0);
      //if( output.fraction == 1.0 || output.startSolid || output.allSolid )
  
        camera.translateFromVec(tmp);
      momentum.scale( 0.85);
      
      if( cpk[Key.SPACE] != null) {
      }
      
      if( movementY!=0)
        camera.transform.rotate( movementY*0.006, camera.getRight());
      if( movementX!=0)
        camera.transform.rotate( movementX*0.006, up);
      
      movementX=0;
      movementY=0;
    }
  }
  
  // this class lets a Camera fly through a TorusKnot like through a tunnel
  class TorusKnotCamera extends Animatable
  {
    Camera camera;
    
    TorusKnotCamera( this.camera);
    
    Vector p1 = new Vector();
    Vector p2 = new Vector();
    
    int p = 2;
    int q = 3;
    double radius=20.0;
    
    double time=0.0;
    Vector up = new Vector();
    
    void animate( double elapsed)
    {
     time += elapsed;
     getTorusKnotPos( time/1500, q, p, radius, 1.0, p1 );
     getTorusKnotPos( (time/1500)+0.1, q, p, radius, 1.0, p2 );
     up..set(p2)..normalize();
     camera.setPosFromVec(p1);
     camera.lookAt(p2);
    }
  }
  
negative.code:       lookAt[2] = z;
      }
    }
  
    void setPosFromSpherical(double radius, double azimuth, double polar) {
      camera.setPosFromSpherical(radius, azimuth, polar);
      camera.addPosFromVec(lookAt);
      camera.lookAt(lookAt);
    }
  
    void animate(double elapsed) {
      if (cpk[Key.LEFT] != null) {
        azimuth += (0.03);
      } else if (cpk[Key.RIGHT] != null) {
        azimuth -= (0.03);
      }
      if (cpk[Key.UP] != null) {
        polar += (0.03);
      } else if (cpk[Key.DOWN] != null) {
        polar -= (0.03);
      }
      if (cpk[Key.SPACE] != null) {
        azimuth = 0.0;
        polar = 0.0;
      }
      polar = polar.clamp(-Math.PI / 2 + 0.1, Math.PI / 2 - 0.1);
      setPosFromSpherical(radius, azimuth, polar);
    }
  }
  
  class FlyingCamera extends Animatable {
    Camera camera;
    Vector momentum = new Vector();
  
    FlyingCamera(this.camera);
  
    void animate(double elapsed) {
      Map<int, bool> cpk = currentlyPressedKeys;
      Map<String, bool> cpmb = currentlyPressedMouseButtons;
  
      if (cpk[Key.A] != null) {
        moveLeft(0.03);
      } else if (cpk[Key.D] != null) {
  