The increased acceptance of sensor networks into everyday pervasive environments has lead to the creation of abundant distributed resource constrained data sources. In this paper, we propose an intelligent mobile data collector-based K-Nearest Neighbor query processing algorithm namely 3D-KNN. The K-Nearest Neighbor query is an important class of query processing approach in sensor networks. The proposed algorithm is employed over a sensor network that is situated within a 3 dimensional space. We propose a novel boundary estimation algorithm which computes an energy efficient sensor boundary that encloses at least k nearest nodes. We then propose a 3D plane rotation algorithm that maps selected sensor nodes on different planes onto a reference plane and a novel k nearest neighbor selection algorithm based on node distance and signal-to-noise ratio parameters. We have implemented the 3D-KNN algorithm in GlomoSim and validate the proposed algorithm's cost efficiency by extensive performance evaluation over well defined system criteria