Picking and get the X Y Z

Hi i  implemented the code to perform picking but i can't figure out how to calculete the x,y,z coordinate in 3d space where the mouse clicked any clue? thanks in advance!