The reason that a cork drifts to the side of a glass is that it floats to the highest point. Since water “clings” to the glass, the highest point is around the edge of the water. To get the cork to float in the middle of the glass, all you have to do is fill the glass as much as possible. The water will form a convex shape above the glass, with the highest point at its center. This is where the cork will settle.
Source…