因为版本更新大。之前看了3.6的版本,与现在4.0.9的版本相差很大。就比如new一个view3d 属性也全变了
这次笔记就硬性规定自己以一种固定方式去写。不再考虑是否有两种写法。
一、view3d
1 view3d = new View3D() ; 2 3 view3d.camera.z = -800; 4 view3d.camera.y = 15; 5 //场景精度 6 view3d.antiAlias = 10; 7 //camera属性 8 /*view3d.camera.lens.far = 800;*/ 9 view3d.camera.lens.near = 1; 10 //视口颜色 11 view3d.backgroundColor = 0xccddff; 12 addChild( view3d ); 13 addChild( new AwayStats( view3d )); 14 15 dlight = new DirectionalLight ; 16 dlight.position = new Vector3D(-1000,1500,-500); 17 dlight.lookAt( new Vector3D ); 18 dlight.color = 0xffffff; 19 //灯光漫反射 20 dlight.diffuse = 1.5; 21 //灯光反射 22 dlight.specular = 0.1; 23 //灯光环绕范围 24 dlight.ambient = 0.3; 25 view3d.scene.addChild( dlight ); 26 27 //实例化自己的场景,向场景中添加东西同理 28 scene = new MyScene(); 29 //讲自己的场景添加view的场景中 30 view3d.scene.addChild( scene );
Question :
3.6中视口的设置
import away3d.core.clip.RectangleClipping;
4.0.9的视口设置要如何设置?
二、AwayStats类
AwayStats(view3d:View3D = null, minimized:Boolean = false, transparent:Boolean = false, meanDataLength:uint = 0, enableClickToReset:Boolean = true, enableModifyFrameRate:Boolean = true)
重点:view3d:View3D
(default = null
) — 添加view3d可查看模型面数