The previous code was applying translation to a direction vector making the thickness dependant on the object position.