Light3D
(1)首先:设置舞台背景的默认光色
scene.clearColor.setTo( 0, 0, 0 ); //舞台的背景色
scene.lights.ambientColor.setTo( 0, 0, 0 ); //场景光色
scene.defaultLight = null; //关闭引擎默认灯光
(2)注册灯光:a.可以获得模型内已有的灯 b.也可以自己new一个Light3D
var light1:Light3D = new Light3D();
scene.addChild( light );
light2 = scene.getChildByName( "Omni032" ) as Light3D;
light.setPosition( 1000, 1000, -1000 );
(3)要确定灯光的类型: PointLight 或者 DirectionalLight
scene.lights.maxPointLights = 0;
scene.lights.maxDirectionalLights = 0;
(4)// swith between diferent light configurations.
if ( Input3D.keyHit( Input3D.NUMBER_1 ) ) scene.lights.techniqueName = LightFilter.NO_LIGHTS;
if ( Input3D.keyHit( Input3D.NUMBER_2 ) ) scene.lights.techniqueName = LightFilter.PER_VERTEX;
if ( Input3D.keyHit( Input3D.NUMBER_3 ) ) scene.lights.techniqueName = LightFilter.LINEAR;
if ( Input3D.keyHit( Input3D.NUMBER_4 ) ) scene.lights.techniqueName = LightFilter.SAMPLED;