Here is the exmaple of implementing 3d object picking with using FBO object.