How to defocus the object in 3D space?

Hi
I have one object (the red line) in 3D space (XYZ). I would like to focus and defocus it. I do it when I move the object for and back along the XY plane. My second task is to defocus the object in 3D space. The red object has 3 points (A1, A2, A3). A1 has to be in focus. A2 has to be defocus a little bit. A3 has to be defocused more.
Could you please help to resolve the task?

82639-defocusobj.jpg

Is it possible to resolve this task using any of the effect assets from the standart package?

Which ones have you tried already?

Off the top of my head - depth of field is basically what you are describing.