UI使用了MinimalComps,代码如下:
private function initGui():void{ Style.fontSize = 11; gui = new SimpleGUI(this, ""); gui.addColumn("摄像机位置"); gui.addSlider("cameraX",-100,100,{lable:"Camera X",tick:10}); gui.addSlider("cameraY",100,200,{lable:"Camera Y",tick:10}); gui.addSlider("cameraZ",-400,-200,{lable:"Camera Z",tick:10}); gui.addColumn("摄像机旋转"); gui.addSlider("cameraRX",0,10,{lable:"Rotation X",tick:1}); gui.addSlider("cameraRY",-20,20,{lable:"Rotation Y",tick:5}); gui.addColumn("太阳光位置"); gui.addSlider("sunX", -1,1, {label:"X",tick:0.1}); gui.addSlider("sunY", -1,1, {label:"Y",tick:0.1}); gui.addSlider("sunZ", -1,1, {label:"Z",tick:0.1}); gui.addColumn("光线颜色"); gui.addColour("sunColor",{label:"方向光颜色"}); gui.addColour("skyColor",{label:"点光源颜色"}); gui.addColumn(""); gui.addButton("清晨",{callback:toMorning}); gui.addButton("正午",{callback:toNoon}); gui.addButton("黄昏",{callback:toEvening}); gui.addColumn(""); gui.addButton("实时模拟太阳光线",{callback:toSun}); gui.addToggle("toggleSensor",{label:"传感器控制光线"}); gui.addSlider("lightX", -1500,1500, {label:"X",tick:10}); gui.addSlider("lightY", -1500,1500, {label:"Y",tick:10}); gui.addSlider("lightZ", -1500,1500, {label:"Z",tick:10}); gui.show(); }
传感器控制光线部分采用了Arduino的空间传感器来控制
转载请注明:陈童的博客 » Away3d室内场景及光线模拟