There are many tasks that require keeping a constant distance apart from the object, such as scanning with a hand-held metal detector or spray painting. In order for robots to perform such works properly, it is indispensable to observe and control the distance between the robot and the target object. This paper proposes a method for generating a trajectory to follow the surface of the object while keeping an arbitrary distance apart from the object. The trajectory is generated in real-time using three-dimensional point cloud data under the condition that there is no model of the object in advance. This is one demanding method for contactless surface tracking works. Firstly, the effectiveness of the proposed distance control method is verified by the teleoperation control experiment. The experiment of the teleoperation clearly shows the usefulness of the proposed method. However, it also reveals that human errors can not be compensated in the teleoperation even with the implementation of the proposed distance control method. Then, this paper proposes a framework for the automation of contactless surface tracking works using the distance control method. Finally, the experiment by the actual humanoid robot is carried out to verify the usefulness of the proposed automation framework.