Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/10/2010, 09:44
laaz13
 
Fecha de Ingreso: marzo-2009
Mensajes: 87
Antigüedad: 15 años, 1 mes
Puntos: 1
De acuerdo Flash + Webcam + QRcode Solucionado Otra duda.. dtecte varios marker.

Buen dia hace poco escribi un post preguntando como hacerlo he conseguido como hacerlo... correo flv y no 3D como yo queria XD

ahora mi consulta es como poner varios markers (qrcode)

marker1.pat me corra movie2.flv
marker2.pat me corra movie3.flv

este es el .AS que tengo hasta horita

Código actionscript:
Ver original
  1. package {
  2.    
  3.     import org.papervision3d.materials.BitmapFileMaterial;
  4.     import org.papervision3d.objects.DisplayObject3D;
  5.     import flash.events.Event;
  6.     import flash.events.MouseEvent;
  7.     import flash.media.Video;
  8.     import flash.net.NetConnection;
  9.     import flash.net.NetStream;
  10.     import flash.events.NetStatusEvent;
  11.    
  12.     import org.papervision3d.core.proto.DisplayObjectContainer3D;
  13.     import org.papervision3d.objects.primitives.Sphere;
  14.    
  15.     import org.papervision3d.lights.PointLight3D;
  16.     import org.papervision3d.materials.WireframeMaterial;
  17.     import org.papervision3d.materials.shadematerials.FlatShadeMaterial;
  18.     import org.papervision3d.materials.VideoStreamMaterial;
  19.     import org.papervision3d.materials.utils.MaterialsList;
  20.     import org.papervision3d.objects.primitives.Cube;
  21.     import org.papervision3d.objects.primitives.Plane;
  22.     import org.papervision3d.objects.parsers.Collada;
  23.  
  24.  
  25.     [SWF(width=700,height=700,frameRate=30,backgroundColor=0x0)]
  26.  
  27.     public class SimpleVideo extends PV3DARApp {
  28.        
  29.         private static const PATTERN_FILE:String = "resources/vni_marker.pat";
  30.         private static const CAMERA_FILE:String = "resources/camera_para.dat";
  31.        
  32.         protected var plane:Plane;
  33.         protected var objectsContainer:DisplayObject3D;
  34.         protected var quality:uint = 16;
  35.         protected var netConnection:NetConnection;
  36.         protected var video:Video;
  37.         protected var netStream:NetStream;
  38.  
  39.         protected var cube:Cube;
  40.         protected var imageMat:BitmapFileMaterial;
  41.         protected var video_cube:Cube;
  42.         protected var vni_logo_cube:Collada;
  43.         protected var videoMat:VideoStreamMaterial;
  44.         protected var fmat:FlatShadeMaterial;
  45.         protected var wmat:WireframeMaterial;
  46.        
  47.         public function SimpleVideo()
  48.         {
  49.             addEventListener(Event.INIT, onInit);
  50.             init(CAMERA_FILE, PATTERN_FILE);
  51.         }
  52.        
  53.         private function onInit(e:Event):void
  54.         {
  55.             removeEventListener(Event.INIT, onInit);
  56.            
  57.             //Create light source for shade material
  58.             var light:PointLight3D = new PointLight3D();
  59.             light.x = 1000;
  60.             light.y = 1000;
  61.             light.z = 1000;
  62.            
  63.             // create client for netStream object
  64.             var customClient:Object = new Object();
  65.             customClient.onMetaData = metaDataHandler;
  66.  
  67.             netConnection = new NetConnection();
  68.             netConnection.connect(null);
  69.            
  70.             netStream = new NetStream(netConnection);
  71.             netStream.client = customClient;
  72.             netStream.play("resources/minicoca.flv");
  73.             // add listener for net status to control video looping
  74.             netStream.addEventListener(NetStatusEvent.NET_STATUS, statusHandler);
  75.  
  76.             video = new Video();
  77.             video.width = 500;
  78.             video.height = 500;
  79.             video.smoothing = true;
  80.             //video.deblocking = 5;
  81.             video.attachNetStream(netStream);
  82.  
  83.             //Create Materials
  84.             videoMat = new VideoStreamMaterial(video, netStream, true, true);
  85.             fmat = new FlatShadeMaterial(light, 0x214fa1, 0x18347b);
  86.             wmat = new WireframeMaterial(0xff0000);
  87.             wmat.doubleSided = true;
  88.            
  89.             //Create objects
  90.             objectsContainer = new DisplayObject3D();
  91.             plane = new Plane(wmat, 100, 100,1,1);
  92.             video_cube = new Cube(new MaterialsList( { front: videoMat } ), 250, 1, 250, quality, quality, quality, 0);
  93.             vni_logo_cube = new Collada("", new MaterialsList ( {all : fmat } ), .1, true);
  94.            
  95.             //Position elements
  96.            
  97.             vni_logo_cube.z = 0;
  98.             //vni_logo_cube.rotationZ = -90;
  99.             //video_cube.rotationZ = -90;
  100.             video_cube.x = -40;
  101.             video_cube.z += 30;
  102.             video_cube.y = -50;
  103.             objectsContainer.z = 0;
  104.            
  105.             //Add objects to my container
  106.             objectsContainer.addChild(vni_logo_cube)
  107.             objectsContainer.addChild(video_cube)
  108.            
  109.             //Add to base
  110.             //_baseNode.addChild(plane);
  111.             _baseNode.addChild(objectsContainer);
  112.  
  113.         }
  114.        
  115.         override protected function _onEnterFrame(e:Event = null):void
  116.         {
  117.             super._onEnterFrame(e);
  118.         }
  119.                
  120.         private function metaDataHandler(infoObject:Object):void
  121.         {
  122.             trace('metaDataHandler= ',infoObject);
  123.         }
  124.        
  125.         private function statusHandler(eventObject:Object):void
  126.         {
  127.             if(eventObject.info.code == "NetStream.Play.Stop")
  128.             {
  129.                 // loop video
  130.                 netStream.seek(0)
  131.             }      
  132.         }
  133.            
  134.     }
  135.    
  136. }

Gracias por su apollo

Última edición por laaz13; 19/10/2010 a las 17:54