An optical positioning sensor is realized by combining optical projection and a virtual camera model. This technique provides a low cost and non-contact measurement and has the potential to provide real-time 6 DOF measurements of an object. The optical sensor first generates a projection pattern that is observable on the surrounding walls, cameras are used to track the motion of the projected optical pattern, and the motion of the optical sensor can thus be tracked indirectly. In this technique, the optical sensor itself is treated as a virtual pinhole camera. A virtual image is generated that carries the angular characteristics of the optical pattern. The virtual image and the images of the projected optical pattern on the walls taken by real cameras are then processed through a photogrammetry-based bundle adjustment to give a position and orientation estimate of the optical sensor. Experiment is performed to calibrate the angular information of the optical pattern. Monte-Carlo simulation is performed to analyse the measurement uncertainty. The simulation result has good agreement with the experimental result for 0.9 m translation test along a precision rail. The optical sensor with the virtual camera model solution is preferable to provide real time measurements for simple-to-complex environments.