Following the mouse coordinates in Z when I drag a line in space

Hello, I am trying to program a gizmo with translation what I want is from the point I click on an axis (point of a line) to keep the same position while I drag the line while I move the mouse. The problem comes with Z the world coordinates are not properly translated in Z even keeping the depth so the mouse move forward and the polydata does not translate in depth correctly. If I translate or drag in x (1,0,0) or y (0,1,0) it works properly but the problem comes with Z. If I move the camera in the way z gets visible in the camera then it works again.

Screenshot_1

For example, in the image the translation in the green arrow would be the problem. There is as a delay in the translation. The mouse goes faster than the translation of the green line and it should follow the mouse position as other axis do. Any suggestion?. The code is as follows: Thanks

//get current mouse position
vtkSmartPointer
    <vtkRenderWindowInteractor>    
     interactor = GetInteractor();
interactor->
    GetEventPosition
    (currentMousePosition2D);


// re-use the initial z value 
vtkSmartPointer<vtkRenderer> 
  renderer = interactor->
 GetRenderWindow()-> 
 GetRenderers()->GetFirstRenderer();
double worldPt[4];
ComputeDisplayToWorld(renderer,
	currentMousePosition2D[0], 
         currentMousePosition2D[1], 
     InitialClickPosition2DZ_, worldPt);

double freeMouseMovement3D[3];
vtkMath::Subtract(worldPt,  
      InitialClickPosition3D_.data(),        
       freeMouseMovement3D);

//We project the vector of movement to 
   //the axis (1,0,0 or 0,1,0, or 0,0,1);
//As axis vectors modules are 1, this    
    //projection into 
//the axis can be simplified 
//Obtain how much amount of free mouse 
double projectedMouseMovement3D =        
   vtkMath::Dot(
    freeMouseMovement3D,        
   AxisOfMovement_.data());

//Update the axis
double appliedMovement3D[3] = {
	AxisOfMovement_[0] * 
      projectedMouseMovement3D,
	AxisOfMovement_[1] *  
         projectedMouseMovement3D,
	AxisOfMovement_[2] * 
       projectedMouseMovement3D
};


    ApplyTranslationToManipulated
      Object(appliedMovement3D);

In scale it works properly in all axis.
Thanks