Generates affine transform for proper scaling