Here's a script from Martin:
If you want to do this, but only with a camera? Here is the script again from Martin: