An approach for direct triangulation of 3D surfaces has been outlined in this paper. The octree is used to control the mesh gradation and to efficiently perform spatial localization. To make the algorithm capable of dealing with a wide variety of surfaces the class of tensor product polynomial surfaces has been considered. The feedback to the parametric space of these surfaces is used to efficiently resolve some local problems. Meshes of various gradation consisting of well shaped elements are produced. The presented approach is of nearly linear computational complexity for the reasonable mesh density which makes it very competitive for practical use.