ペーパービジョンのクラス構成・設計を勉強して自分のスキル向上を狙いたい。サンプルコードを書いてみる。
1.コンテナを作る。Scene3d
this.hoge = new Sprite();
addChild(this.hoge);
scene = new Scene3D( container );
2.カメラの設定。Camera3d
camera = new Camera3D();
camera.z = -300
camera.y = -300
camera.x = 300
camera.focus = 100;
camera.zoom = 1;
this.scene.renderCamera( camera );//描画!
3.シーンにオブジェクトを追加。例としてplaneObj
var planeObj:DisplayObject3D
= scene.addChild( new Plane( material, 100, 80, segment, segment) );
planeObj.x=0
planeObj.y=0
planeObj.z=0
planeObj.rotationX=0
planeObj.rotationY=0
planeObj.rotationZ=0
--
cameraのプロパティとして
x,y,z,focus,zoom
があった。cameraのrotationXとかをいじっても値が変わらない。
うーむ。rotationいらないのかな?
x,y,zだけじゃカメラがドッチを向いているか分からないじゃないか。
それともカメラは常にある1点を見つめている、という設定なのだろうか。