public void mouseDragged(MouseEvent me)
    {
        Point newMouse = me.getPoint();
        
        // compute the angle of rotation in relation with the size of the canvas
        float thetaX = (float) ((newMouse.getX() - prevMouse.getX())*(Math.PI/this.getSize().width));
        float thetaY = (float) ((newMouse.getY() - prevMouse.getY())*(Math.PI/this.getSize().height));
        
        // transformation along z axis
        if (MCApplet.shift)
        {
            // computes the transformation
            MCMatrix4 dummy = new MCMatrix4();
            if (this.tfMode == TF_MODE_ROTATION)
                dummy.rotateZ(thetaX);
            if (this.tfMode == TF_MODE_TRANSLATION)
                dummy.translate(0, 0, 50*thetaX);
            dummy.mult(this.mesh.modelView);
            
            // modifies the model view of the mesh
            this.mesh.modelView = dummy;
        }
        // transformation along x & y axis
        else
        {
            // computes the transformation
            MCMatrix4 dummy = new MCMatrix4();
            if (this.tfMode == TF_MODE_ROTATION)
            {
                dummy.rotateY(-thetaX);
                dummy.rotateX(thetaY);
            }
            if (this.tfMode == TF_MODE_TRANSLATION)
                dummy.translate(50*thetaX, 50*thetaY, 0);
            dummy.mult(this.mesh.modelView);
            
            // modifies the model view of the mesh
            this.mesh.modelView = dummy;
        }
        
        prevMouse = newMouse;
        
        this.repaint();
    }