3d glock function.