implementing gain and offset for eye position