I have worked on the Kinect and its hardware and I have written code for recovering 3D depth using similar techniques.
The Kinect uses an infra red laser speckle projector to project a dense pattern of dots on the whole scene which are infra red and therefore invisible to the eye. The Kinect has a camera that can pick up the IR pattern. The hardware is able to recover the 3D depth because there is a distance between the center of projection of the speckle pattern and the optical center of the camera. This means that the location of the spots changes in the camera image as the object moves further away. In fact the pattern of dots is a known thing to the hardware. The camera is sensitive to the displacement of the dots from the known location that they would be for planes at infinity when a close object is imaged.
There is also an RGB color camera that allows color images also to be extracted.
One can use a speckle projector and two infra cameras to reconstruct the depth information in an ad hoc configuration without using a kinect. The cameras should be sensitive to IR but the also need an IR filter whose purpose is to just let IR light through and not visible light. This increases the contrast of the dots and removes general scene illumination. Using stereo algorithms it is possible to detect the locations of the dots in the two camera images and match them together. From these point matches and the known camera geometry it is possible to infer the depth of these points and to obtain a 3D point cloud. I have personally implemented this setup a few years ago.