チェンジセット 1356

差分発生行の前後
無視リスト:
コミット日時:
2008/09/22 15:34:05 (4 ヶ月前)
コミッタ:
tarotarorg
ログメッセージ:

--

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/FLARToolKit/trunk/samples/org/tarotaro/flash/ar/FLARAnotherWorldWindow.as

    r1342 r1356  
    1313 *  See the License for the specific language governing permissions and 
    1414 *  limitations under the License. 
    15  */  
     15 */ 
    1616package org.tarotaro.flash.ar  
    1717{ 
     
    2727        import org.libspark.flartoolkit.core.FLARParam; 
    2828        import org.libspark.flartoolkit.core.raster.FLARBitmapData; 
     29        import org.libspark.pv3d.Metasequoia; 
     30        import org.papervision3d.core.culling.FrustumTestMethod; 
     31        import org.papervision3d.core.proto.MaterialObject3D; 
     32        import org.papervision3d.lights.PointLight3D; 
     33        import org.papervision3d.materials.BitmapFileMaterial; 
     34        import org.papervision3d.materials.BitmapMaterial; 
     35        import org.papervision3d.materials.ColorMaterial; 
     36        import org.papervision3d.materials.shadematerials.FlatShadeMaterial; 
     37        import org.papervision3d.materials.utils.MaterialsList; 
     38        import org.papervision3d.materials.WireframeMaterial; 
     39        import org.papervision3d.objects.DisplayObject3D; 
     40        import org.papervision3d.objects.primitives.Cube; 
     41        import org.papervision3d.objects.primitives.Sphere; 
    2942         
    3043        /** 
    3144         * ... 
    32          * @author 太郎(tarotaro.org
     45         * @author DefaultUser (Tools -> Custom Arguments...
    3346         */ 
    3447        public class FLARAnotherWorldWindow extends Sprite 
     
    3952                [Embed(source = "../../../../Data/patt.hiro", mimeType = "application/octet-stream")] 
    4053                private var CodeData:Class; 
    41                 //panorama.jpgはFlickrなどから調達して、Data以下に格納してください。 
    4254                [Embed(source = '../../../../Data/panorama.jpg')]private var PanoBitmap:Class; 
     55 
    4356                private var _capture:Bitmap; 
    4457                private var _video:Video; 
    45                 private var _windowLayer:FLARPanoramaSphereLayer; 
    46                 private var _arSprite:Sprite; 
     58                private var _layer:FLARAnotherWorldWindowLayer; 
    4759 
    4860                public function FLARAnotherWorldWindow()  
     
    6274                        this._video = new Video(); 
    6375                        this._video.attachCamera(webcam); 
     76 
     77                        var model:DisplayObject3D = new DisplayObject3D(); 
     78                        model.frustumTestMethod = FrustumTestMethod.NO_TESTING; 
     79                        var mqo:Metasequoia = new Metasequoia(); 
     80                        mqo.load("Data/miku_mahou.mqo", 2); 
     81                        model.addChild(mqo); 
    6482                         
    65  
    66                         var panoBMP:Bitmap = new PanoBitmap() as Bitmap; 
    67                          
    68                         this._windowLayer = new FLARPanoramaSphereLayer(raster, param, code, 80,panoBMP.bitmapData); 
    69                         this.addChild(this._windowLayer); 
     83                        var mt:MaterialObject3D = new BitmapFileMaterial("Data/tex3.jpg", true); 
     84                        // 
     85                        mt.doubleSided = true; 
     86                        var list:MaterialsList = new MaterialsList(); 
     87                        list.addMaterial(mt, "all"); 
     88                        var size:int = 2500; 
     89                        var cube:Cube = new Cube(list, size, size * 1.5, size / 2, 1, 1, 4, Cube.ALL, Cube.BACK); 
     90                        cube.frustumTestMethod = FrustumTestMethod.NO_TESTING; 
     91                        model.addChild(cube); 
     92                        this._layer = new FLARAnotherWorldWindowLayer(raster, param, code, 80, model); 
     93                        this.addChild(this._layer); 
    7094                         
    7195                        this._capture.scaleX = this._capture.scaleY = 0.5; 
     
    7397 
    7498                        this.addEventListener(Event.ENTER_FRAME, onEnterFrame); 
    75                         } 
     99 
     100                } 
    76101 
    77102                private function onEnterFrame(e:Event):void  
    78103                { 
    79104                        this._capture.bitmapData.draw(this._video); 
    80                         this._windowLayer.update(); 
     105                        this._layer.update(); 
    81106                } 
    82107        } 
  • as3/FLARToolKit/trunk/samples/org/tarotaro/flash/ar/FLARAnotherWorldWindowLayer.as

    r1341 r1356  
    1616package org.tarotaro.flash.ar  
    1717{ 
     18        import flash.events.Event; 
     19        import flash.geom.Point; 
     20        import org.libspark.flartoolkit.core.FLARCode; 
     21        import org.libspark.flartoolkit.core.FLARParam; 
     22        import org.libspark.flartoolkit.core.FLARSquare; 
     23        import org.libspark.flartoolkit.core.raster.FLARBitmapData; 
     24        import org.papervision3d.cameras.CameraType; 
     25        import org.papervision3d.core.culling.FrustumTestMethod; 
    1826        import org.papervision3d.objects.DisplayObject3D; 
    1927        import org.papervision3d.view.BasicView; 
     
    5159 
    5260                        //Viewの作成 
    53                         this._view = new BasicView(windowWidth, windowHeight, true, false); 
     61                        this._view = new BasicView(windowWidth, windowHeight, true, false, CameraType.TARGET); 
     62                        model.frustumTestMethod = FrustumTestMethod.NO_TESTING; 
     63 
    5464                        this.addChild(this._view); 
    5565 
     
    5969 
    6070                        //カメラのセッティング 
    61                         this._view.camera.focus = 300; 
     71                        this._view.camera.focus = 500; 
    6272                        this._view.camera.zoom = 1; 
    63                         this._view.camera.z = -100; 
     73                        this._view.camera.z = -500; 
    6474                         
    6575                        //4.レンダリング開始 
    6676                        this._view.startRendering(); 
    6777                } 
     78                 
    6879 
    6980                override public function update():void  
     
    8293                                var center:Point = new Point((Mx + mx)/2, (My+my)/2); 
    8394 
    84                                 this._view.camera.x = (center.x - this._source.getWidth() / 2); 
    85                                 this._view.camera.y = (center.y - this._source.getHeight() / 2); 
    86                                 this._view.camera.z = -100 - (45000 - square.area); 
     95                                this._view.camera.x = -(center.x - this._source.getWidth() / 2) * 1; 
     96                                this._view.camera.y = -(center.y - this._source.getHeight() / 2) * 1; 
     97                                //this._view.camera.z = -100 - (45000 - square.area); 
     98                                //this._view.camera.zoom = 1 + square.area / 9000; 
     99                                 
     100                                trace(this._view.camera); 
    87101                        } else { 
    88102                                 
    89103                        } 
    90104                } 
     105                 
     106                 
    91107 
    92108        } 
  • as3/FLARToolKit/trunk/samples/org/tarotaro/flash/ar/URLSample.mxml

    r1334 r1356  
    1010                import flash.events.Event; 
    1111                import flash.net.URLRequest; 
    12                 import org.libspark.pv3d.Metasequoia; 
     12                import org.tarotaro.flash.pv3d.Metasequoia; 
    1313                import org.papervision3d.materials.WireframeMaterial; 
    1414                import org.papervision3d.objects.DisplayObject3D;