Away3D提供了三种类型的相机:Camera3D, TargetCamera3D 和HoverCamera3D.每种照相机都可以进行zoom(缩放)focus(焦距)、depth of field(景深)、pan(y轴旋转)、tilt(x轴旋转)、position(机位)的设置。三类相机都可以直接在构造函数里对这些特性进行设置,就象这样:
1 var cam:Camera3D = new Camera3D({zoom:5,focus:200});
当然也可以这样设置属性:
1 var cam:Camera3D = new Camera3D({zoom:5,focus:200});
1.private var View:View3D; private var swfStage:Stage; private var cover:Cover;
2.// HoverCam controls 。 private var camera:HoverCamera3D; 3.private var lastMouseX:Number; private var lastMouseY:Number; 4.private var lastPanAngle:Number; private var lastTiltAngle:Number; 5.private var move:Boolean = false;我们增加一个旋转相机并且将它交付与视口使用,这比使用视口的默认相机根子的多。
1.camera = new HoverCamera3D({zoom:2, focus:100, distance:250}); 2.View = new View3D({camera:camera,x:250, y:200}); 然后设置下pan与tilt的值让它们初始值与默认的不一样,这样可以让相机初始时就有一个角度。