Saludos,
Gracias a todas las personas que hacen de la Web un real espacio del conocimiento.
Soy novato en el tema y deseo saber a partir de este código, ¿como tener varios vídeos con varios Marker que no esten al mismo tiempo?
Actionscript:
- package
- {
- import com.transmote.flar.FLARManager;
- import com.transmote.flar.marker.FLARMarker;
- import com.transmote.flar.marker.FLARMarkerEvent;
- import com.transmote.flar.utils.geom.FLARPVGeomUtils;
- import com.transmote.utils.time.FramerateDisplay;
- import flash.display.Sprite;
- import flash.events.Event;
- import org.libspark.flartoolkit.support.pv3d.FLARCamera3D;
- import org.papervision3d.materials.MovieMaterial;
- import org.papervision3d.objects.DisplayObject3D;
- import org.papervision3d.objects.primitives.Plane;
- import org.papervision3d.render.LazyRenderEngine;
- import org.papervision3d.scenes.Scene3D;
- import org.papervision3d.view.Viewport3D;
- [SWF(width='640', height='480', backgroundColor='#000000', frameRate='40')]
- public class HelloFLAR extends Sprite
- {
- private var fm:FLARManager;
- private var scene:Scene3D;
- private var view:Viewport3D;
- private var camera:FLARCamera3D;
- private var lre:LazyRenderEngine;
- private var p:Plane;
- private var con:DisplayObject3D;
- private var marker:FLARMarker;
- private var v:Vid;
- public function HelloFLAR()
- {
- initFLAR();
- v = new Vid();
- v.vid.source = "kramer.m4v";
- v.vid.stop();
- }
- private function initFLAR():void
- {
- fm = new FLARManager("flarConfig.xml");
- fm.addEventListener(FLARMarkerEvent.MARKER_ADDED, onAdded);
- fm.addEventListener(FLARMarkerEvent.MARKER_REMOVED, onRemoved);
- fm.addEventListener(Event.INIT, init3D);
- addChild(Sprite(fm.flarSource));
- }
- private function onAdded(e:FLARMarkerEvent):void
- {
- marker = e.marker;
- p.visible = true;
- v.vid.play();
- }
- private function onRemoved(e:FLARMarkerEvent):void
- {
- marker = null;
- p.visible = false;
- v.vid.stop();
- }
- private function init3D(e:Event):void
- {
- scene = new Scene3D();
- camera = new FLARCamera3D(fm.cameraParams);
- camera.z = -30;
- view = new Viewport3D(640, 480, true);
- lre = new LazyRenderEngine(scene, camera, view);
- var mat:MovieMaterial = new MovieMaterial(v, false, true);
- p = new Plane(mat, 320, 240, 2, 2);
- p.scaleY = -1;
- p.rotationZ = 90;
- p.visible = false;
- con = new DisplayObject3D();
- con.addChild(p);
- scene.addChild(con);
- addChild(view);
- addChild(new FramerateDisplay());
- addEventListener(Event.ENTER_FRAME, loop);
- }
- private function loop(e:Event):void
- {
- if(marker != null)
- {
- con.transform = FLARPVGeomUtils.convertFLARMatrixToPVMatrix(marker.transformMatrix);
- }
- lre.render();
- }
- }
- }
Y el XML
Actionscript:
- < !-- this file specifies configurations for FLARManager. -- >
- < !-- to use this file to initialize FLARManager, pass its path into FLARManager.initFromFile(). -- >
- < !-- note that all relative paths listed here must be relative to the .swf location; absolute paths may also be used. -- >
- < flar_config >
- < !-- source settings -- >
- < flarSourceSettings
- sourceWidth="320"
- sourceHeight="240"
- displayWidth="640"
- displayHeight="480"
- framerate="30"
- downsampleRatio="1" / >
- < !-- miscellaneous FLARManager settings -- >
- < flarManagerSettings
- mirrorDisplay="true"
- smoothing="3" >
- < smoother className="FLARMatrixSmoother_Average" / >
- < thresholdAdapter className="DrunkWalkThresholdAdapter" speed="0.3" bias="-0.1" / >
- < /flarManagerSettings >
- < !-- location of camera parameters file, e.g. FLARCameraParams.dat or camera_para.dat. -- >
- < cameraParamsFile path="FLARCameraParams.dat" / >
- < !-- list of file paths of patterns for FLARToolkit to detect. -- >
- < !-- @resolution specifies the resolution at which the patterns were generated. -- >
- < patterns resolution="8" patternToBorderRatio="0.5" minConfidence="0.5" >
- < pattern path="a.pat" / >
- < /patterns >
- < /flar_config >
Agradezco a quien me colabore


está resuelto