In order to complete his course on Advanced Mechatronics class at Penn State University the YouTube user kss5095 has built an excellent version of the Turret from Portal, it is fully working by that we mean it tracks and fires upon specific targets. The good thing is that it only fires NERF darts instead of a high powered laser.
According to the YouTube user kss5095 here are the details on the excellent and working Portal Turret;
This is the final project for my Advanced Mechatronics class at Penn State University. The robot is the skeleton of a turret from the game Portal that uses an IP webcam to track a target and fire nerf bullets at them. This is the current state of the robot as of 5/9/12, but I am currently molding a shell for the frame to make it look like the Portal turret, along with improving my code to make the tracking faster. All programming is done with MATLAB and Arduino. Enjoy!
Source [Nerd Approved]