Trick: Auto-select mac iSight in flash.

If you’ve been messing around with Augmented Reality (or any webcam stuff in flash for that matter), you may have come to the realization that many mac users may not have their proper webcams (i.e. iSights) set by default. In a commercial setting, you want to avoid a person having to select their webcam at almost all costs — it’s another barrier to entry, and can be confusing, too. Especially if you have video editing software installed, there can be a lot of options, as you can see below.

camerasettings

However, it’s easy to check and see if the person has an iSight installed and, if so, automatically choose that one.

var index : int = 0;

for ( var i : int = 0 ; i < Camera.names.length ; i++ ) {

if ( Camera.names[ i ] == "USB Video Class Video" ) {

index = i;

}

}

//Oddly, Camera.getCamera needs a string of the camera index, NOT the name of the camera.

_webcam = Camera.getCamera( String( index ) );

VoilĂ . You’re now covered for mac users and windows users won’t notice a thing.

FLAR how-to: Multiple instances of multiple markers.

kingofthetinycubes

UPDATE: We’re be remiss not to also point you to Eric’s excellent FLARManager class. He took some of the stuff we’ve covered here and put a far more delicious topping on it.

One of the big things we’ve been wrasslin’ with recently here at Squidder is how to handle multiple instances of multiple markers using FLARToolKit. Well we haven’t totally nailed it — close, but there are still a few niggling issues. So we’re looking to you, dear Squiddite, to help us out.

Before reading on, you can get our source code here.

It contains all the libraries (FLARToolKit, Papervision, even some of our own) you need to get going, even if this your first FLAR project. It’s as simple as extending a single class, creating an array of the markers you want to load in, and rocking and rolling. It also works great even if you’re only dealing with a single symbol.

Read on for more thrilling details!

Read the rest of this entry »

Twitter