チェンジセット 3901: as3/FLARToolKit
- コミット日時:
- 2010/05/15 01:41:23 (3 年前)
- ファイル:
-
- as3/FLARToolKit/trunk/src/examples/FLARTK_Example_Single_SimpleCube_Away3DLite.as (更新) (5 diffs)
- as3/FLARToolKit/trunk/src/org/libspark/flartoolkit/support/away3d_lite/FLARBaseNode.as (更新) (1 diff)
- as3/FLARToolKit/trunk/src/org/libspark/flartoolkit/support/away3d_lite/FLARCamera3D.as (更新) (2 diffs)
- as3/FLARToolKit/trunk/src/org/libspark/flartoolkit/support/away3d_lite/FLARLens.as (削除)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
as3/FLARToolKit/trunk/src/examples/FLARTK_Example_Single_SimpleCube_Away3DLite.as
r3747 r3901 311 311 this.scene3d = new Scene3D(); 312 312 313 // 3Dモデル表示時の視点を設定 314 var _viewportToSourceWidthRatio:Number = this.canvasWidth/this.captureWidth; 315 trace("viewRatio :"+_viewportToSourceWidthRatio+"/width"+this.captureWidth); 316 this.camera3d = new FLARCamera3D(this.cameraParam, _viewportToSourceWidthRatio); 317 318 313 319 // PV3DのViewport3Dと似たようなもの 314 this.view3d = new View3D(this.scene3d, camera3d);320 this.view3d = new View3D(this.scene3d, this.camera3d); 315 321 316 322 // 微調整 317 this.view3d.x = this.captureWidth; 318 this.view3d.y = this.captureHeight; 323 this.view3d.scaleX = this.canvasWidth; 324 this.view3d.scaleY = this.canvasHeight; 325 // this.view3d.x = this.canvasWidth/_viewportToSourceWidthRatio ; 326 // this.view3d.y = this.canvasHeight/_viewportToSourceWidthRatio; 327 this.view3d.z = 0; 328 319 329 this.addChild(this.view3d); 320 321 // 3Dモデル表示時の視点を設定322 this.camera3d = new FLARCamera3D(this.cameraParam, this.view3d.width/this.captureWidth);323 330 324 331 this.markerNode = new FLARBaseNode(); … … 340 347 _plane.height = 80; 341 348 _plane.material = wmat; 342 _plane.rotationX = 90;343 349 344 350 // Cube 345 351 var mat:WireColorMaterial = new WireColorMaterial(0xFF1919, 1, 0x730000); 346 352 var _cube:Cube6 = new Cube6( mat, 40, 40, 40); 347 _cube. z =0353 _cube.y = -20 348 354 349 355 // _container に 追加 … … 361 367 // モデル格納用のコンテナ作成 362 368 this.container = new ObjectContainer3D(); 369 363 370 // 3Dオブジェクト生成 364 371 this.createObject(); … … 387 394 this.detector.getTransformMatrix(this.resultMat); 388 395 this.markerNode.setTransformMatrix(this.resultMat); 389 this. markerNode.visible = true;396 this.view3d.visible = true; 390 397 } 391 398 … … 404 411 public function onMarkerRemoved(e:Event=null):void 405 412 { 406 this. markerNode.visible = false;413 this.view3d.visible = false; 407 414 } 408 415 as3/FLARToolKit/trunk/src/org/libspark/flartoolkit/support/away3d_lite/FLARBaseNode.as
r3747 r3901 50 50 51 51 public function setTransformMatrix(r:FLARTransMatResult):void { 52 var m:Matrix3D = new Matrix3D (Vector.<Number>([ 52 // var m:Matrix3D = new Matrix3D(Vector.<Number>([ 53 // r.m00, r.m10, r.m20, 0, 54 // -r.m01, -r.m11, -r.m21, 0, 55 // -r.m02, -r.m12, -r.m22, 0, 56 // r.m03, r.m13, r.m23, 1 57 // ])); 58 var m:Matrix3D = new Matrix3D(Vector.<Number>([ 53 59 r.m00, r.m10, r.m20, 0, 54 -r.m01, -r.m11, -r.m21, 0,55 60 -r.m02, -r.m12, -r.m22, 0, 61 r.m01, r.m11, r.m21, 0, 56 62 r.m03, r.m13, r.m23, 1 57 63 ])); as3/FLARToolKit/trunk/src/org/libspark/flartoolkit/support/away3d_lite/FLARCamera3D.as
r3748 r3901 58 58 public function FLARCamera3D (flarParams:FLARParam, viewportToSourceWidthRatio:Number) :void { 59 59 super(); 60 61 60 this.x = 0; 62 61 this.y = 0; … … 71 70 ])); 72 71 73 // TODO: once Away3DLite main branch is using lenses, uncomment this and remove projectionMatrix3D() override.74 // lens = new FLARLens(this.flarProjectionMatrix);75 72 } 76 73 77 74 /** 78 * TODO: once Away3DLite main branch is using lenses, remove this override and use FLARLens above instead.79 *80 75 * Returns the 3d matrix representing the camera projection for the view. 81 *82 76 * @see away3dlite.containers.View3D#render() 83 77 */

