I have 3 points in a 3D space of which I know the exact locations. Suppose they are: (x0,y0,z0), (x1,y1,z1) and (x2,y2,z2).
Al
What you are looking for is called a Pose Estimation algorithm. Have a look at the POSIT implementation in OpenCV: http://opencv.willowgarage.com/documentation/c/calib3d_camera_calibration_and_3d_reconstruction.html#posit
You will need four or more points, and they may not lie in the same plane.
A tutorial for this implementation is here: http://opencv.willowgarage.com/wiki/Posit
Do take care though: in the tutorial a square viewport is used, so all view-coordinates are in the -1,-1 to 1,1 range. This leads one to assume that these should be in the camera coordinate system (before aspect-ratio correction). This is not the case, so if you use a viewport with e.g. a 4:3 aspect ratio then your input coordinates should be in the -1.3333,-1 to 1.3333,1 range.
By the way, if your points must lie in the same plane, then you can also look at the CameraCalibration algorithm from OpenCV, but this is more involved to set up and requires more points as input. However it will also yield you the distortion information and intrinsic parameters of your camera.