I made a utility class for FLARToolKit.
FLARCodeImage is a child of Sprite.
This class makes FLARCode an image. And, you can use it as a substitute of the marker.
How to use
- Create a instannce of FLARCode and load .pat file.
1 2 3 4 5 6
[Embed(source = "assets/patt.hiro", mimeType = "application/octet-stream")]private var CodeData:Class; //... var code:FLARCode = new FLARCode(16, 16); var codeFile:ByteArray = new CodeData() as ByteArray; code.loadARPatt(codeFile.readMultiByte(codeFile.length, "shift-jis"));
- Create a instance of FLARCodeImage.
1
var codeImg:FLARCodeImage = new FLARCodeImage(code, 300, 300);
- Create a instance of MovieMaterial(Papervision3D’s material classs), and create a instance of Plane using it as material.
1 2 3 4
var mat:TriangleMaterial = new MovieMaterial(codeImg); mat.doubleSided = true; var plane:Plane = new Plane(mat, 300, 300, 4, 4); this._modelView = new PV3DPanel(this.stage.stageWidth, this.stage.stageHeight, plane);
- Use its image as a input for FLARToolKit instead of WebCamera.
