Your Face, My Head: Webcam and Papervision Demo (with source, eventually)

Paperhead!I wanted to see just how difficult rigging up one of these would be. Found a good COLLADA file on the internet and I think it looks real purty (though I couldn’t say the same about the subject). Anyway if you have a webcam check it out! It’s fun.

Make sure to line your face up with the guide, and then click the red rectangle in the upper left hand corner. Wait a bit, and surprise!

I’ll be putting an instructional post up soon, documenting every last step 😉

Papervision Webcam Head

Quick AS3 Webcam Capture Class

If you are feeling lazy and don’t want to look up exactly how to instantiate a webcam and use it to take a snapshot of the user… just download this and use like so. It also flips the image so the user is not completely disoriented.

The default camera size is 600 x 400, you can pass two optional params to the constructor to specify different dimensions.

var webcam:CamGrabber= new CamGrabber();
btnToPress.addEventListener(MouseEvent.CLICK, onPictureSnap, false, 0, true);

function onPictureSnap(e:MouseEvent):void{
      var userpic:Bitmap=new Bitmap(webcam.snap());

Get Adobe Flash player