// Calculates original position by inverting the current matrix.
// As the matrix incorporates that position, it stores every transformation, even though
// the matrix is created anew.
PMatrix3D invMatrix = new PMatrix3D();
invMatrix.apply(matrix);
invMatrix.invert();
float origX = invMatrix.multX(x, y);
float origY = invMatrix.multY(x, y);
matrix = new PMatrix3D();