チェンジセット 470

差分発生行の前後
無視リスト:
コミット日時:
2008/05/22 01:13:52 (4 年前)
コミッタ:
saqoosha
ログメッセージ:

いらんファイルとかとりあえず削除した。
FLARParam の値をちゃんと使う、FLARCamera3D つくった。ズレテナーイ。

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/FLARToolKit/trunk/samples/FLARToolKitTest2.as

    r407 r470  
    11package { 
    22         
     3        import caurina.transitions.Equations; 
     4        import caurina.transitions.Tweener; 
     5         
    36        import com.libspark.flartoolkit.core.FLARTransMatResult; 
     7        import com.libspark.flartoolkit.core.raster.FLARBitmapData; 
     8        import com.libspark.flartoolkit.scene.FLARCamera3D; 
    49         
     10        import flash.display.BitmapData; 
    511        import flash.display.StageQuality; 
    612        import flash.display.StageScaleMode; 
    713        import flash.events.Event; 
    814         
     15        import mx.core.BitmapAsset; 
     16         
     17        import org.papervision3d.cameras.Camera3D; 
    918        import org.papervision3d.cameras.FrustumCamera3D; 
     19        import org.papervision3d.core.geom.renderables.Vertex3D; 
     20        import org.papervision3d.core.geom.renderables.Vertex3DInstance; 
    1021        import org.papervision3d.core.math.Matrix3D; 
     22        import org.papervision3d.core.proto.CameraObject3D; 
    1123        import org.papervision3d.core.proto.MaterialObject3D; 
    1224        import org.papervision3d.lights.PointLight3D; 
     
    2234         
    2335 
    24         [SWF(width=320,height=240,frameRate=60,backgroundColor=0x0)] 
     36        [SWF(width=640,height=480,frameRate=60,backgroundColor=0x0)] 
    2537 
    2638        public class FLARToolKitTest2 extends ARAppBase { 
     
    3042                 
    3143                private var _scene:Scene3D;; 
    32                 private var _camera3d:FrustumCamera3D; 
     44                private var _camera3d:FLARCamera3D; 
    3345                private var _viewport:Viewport3D; 
    3446                private var _renderer:LazyRenderEngine; 
     
    3951                 
    4052                private var _resultMat:FLARTransMatResult = new FLARTransMatResult(); 
     53                 
    4154                 
    4255                public function FLARToolKitTest2() { 
     
    5164                        this.removeEventListener(Event.INIT, this._onInit); 
    5265                         
     66                        this._capture.width = 640; 
     67                        this._capture.height = 480; 
     68                        this._capture.scaleX *= -1; 
     69                        this._capture.x = 640; 
    5370                        this.addChild(this._capture); 
    5471                         
    55                         this._viewport = this.addChild(new Viewport3D(320, 240)) as Viewport3D; 
    56                         this._camera3d = new FrustumCamera3D(this._viewport, 37.5, 10, 10000); 
    57                         this._camera3d.z = 0; 
     72                        this._viewport = this.addChild(new Viewport3D(320, 240, false, false, false, false)) as Viewport3D; 
     73                        this._viewport.scaleX = -2; 
     74                        this._viewport.scaleY = 2; 
     75                        this._viewport.x = 644; // +4pix ??? 
     76                         
     77                        this._camera3d = new FLARCamera3D(this._viewport, this._param); 
    5878                         
    5979                        this._scene = new Scene3D(); 
    6080                        this._transGrp = this._scene.addChild(new DisplayObject3D()) as DisplayObject3D; 
    61                                 this._basePlane = new Plane(new WireframeMaterial(0xff0000, 1, 2), 80, 80); 
     81                                var wmat:WireframeMaterial = new WireframeMaterial(0xff0000, 1, 2); 
     82                                wmat.doubleSided = true; 
     83                                this._basePlane = new Plane(wmat, 80, 80); 
    6284                        this._transGrp.addChild(this._basePlane); 
    6385                                var light:PointLight3D = new PointLight3D(); 
    6486                                light.z = -1000; 
    65                                 var fmat:FlatShadeMaterial = new FlatShadeMaterial(light, 0xffcc66, 0x0); 
     87                                var fmat:FlatShadeMaterial = new FlatShadeMaterial(light, 0xff22aa, 0x0); 
    6688                                fmat.opposite = true; 
    67                                 var wmat:WireframeMaterial = new WireframeMaterial(0xffcc66, 1, 3); 
    6889                                this._cube = new Cube(new MaterialsList({ all: fmat }), 40, 40, 40); 
    6990                                this._cube.z += 20; 
     
    7394                         
    7495                        this.addEventListener(Event.ENTER_FRAME, this._onEnterFrame); 
     96                        this._onEnterFrame(); 
    7597                         
    7698                        this.addChild(new FPSMeter()); 
     
    86108                                mtx.n21 = -a[1][0];     mtx.n22 = -a[1][1];     mtx.n23 = -a[1][2];     mtx.n24 = -a[1][3]; 
    87109                                mtx.n31 =  a[2][0];     mtx.n32 =  a[2][1];     mtx.n33 =  a[2][2];     mtx.n34 =  a[2][3]; 
     110                                this._renderer.render(); 
    88111                        } 
    89                         this._renderer.render(); 
    90112                } 
    91113