lzosi

用心,才能做出最好吃的菜!

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
 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;



posted on 2012-02-23 13:26  lzosi  阅读(374)  评论(0编辑  收藏  举报