Managed directx的光照问题
Mesh mesh = Mesh.Box(device, 40, 40, 40);
//投影设置
device.Transform.Projection = Matrix.PerspectiveFovLH((float)Math.PI / 8, 1.0f, 0.0f, 1000.0f);
//观察点设置
device.Transform.View = Matrix.LookAtLH(new Vector3(0f, 0f, -250f),
new Vector3(0.0f, 0.0f, 0.0f),
new Vector3(0.0f, 1.0f, 0.0f));
device.Transform.World = Matrix.RotationAxis(new Vector3(1, 1, 1), (float)Math.PI/3);
//灯光设置
device.Lights[1].Enabled = true;
device.Lights[1].Type = LightType.Directional;
device.Lights[1].Direction = new Vector3(0, 0, 0);
device.Lights[1].Diffuse = System.Drawing.Color.White;
device.Lights[1].Attenuation0 = 0.1f;
device.Lights[1].Range = 1000.0f;
device.Lights[1].Update();
//开始画画
device.BeginScene();
mesh.DrawSubset(0);
device.EndScene();
//结束画画
//刷新
device.Present();
这是代码 为什么光照没有作用呢 画的立方体全是黑的 ,高手帮忙啊 !!!!1
------解决方案--------------------
灯光设置里的代码好像写的有问题