Using a webcam in Molehill

I’ve created a sample project on github that demonstrates how to use a webcam in Molehill. It’s not really any different than using a static texture, except for these lines:

    snapshot.draw(video, snapshotTransform);
    texture.uploadFromBitmapData(snapshot);

The performance is very impressive, and you can see from the code, it was simple to do. Hooray for Molehill.

Edit: Updated to work in Flash Player 11 beta 2.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s