The accurate matching of 3D anatomical surfaces with sensory data such as 2D X-ray projections is a basic problem in Computer and Robot Assisted Surgery. In model-based vision, this problem can be formulated as the estimation of the spatial pose (position and orientation) of a 3D smooth object from 2D video images. We present a new method for determining the rigid body transformation that describes this match. Our method perform a least squares minimization of the energy necessary to bring the set of the camera-contour projection lines tangent to the surface. To correctly deal with projection lines that penetrate the surface, we consider the minimum signed distance to the surface along each line (i.e., distances inside the object are negative), To quickly and accurately compute distances to the surface, we introduce a precomputed distance map represented. using an octree spline whose resolution increases near the surface. This octree structure allows us to quickly find the minimum distance along each line using best-first search. Experimental results for 3D surface to 2D projection matching are presented for both simulated and real data. The combination of our problem formulation in 3D, our computation of line to surface distances with the octree-spline distance map, and our simple minimization technique based on the Levenberg-Marquardt algorithm results in a method that solves the 3D/2D matching problem for arbitrary smooth shapes accurately and quickly.