Direct3D ライティングのオフ
Direct3D ライティングのオフ
この例では、ポリゴン モデルのライティングをオフにして、アプリケーションで定義した頂点色を表示する方法を示す。
この例では、アプリケーションは Device レンダリング特性をリセットする OnResetDevice メソッドを宣言する。次に、OnResetDevice を呼び出す EventHandler デリゲートを、DeviceReset イベントに追加する。
ライティングをオフにするには、Lighting プロパティを false に設定する。
using Microsoft.DirectX.Direct3D;
Device device = null; // Create rendering device
// Declare reset procedure
public void OnResetDevice(object sender, EventArgs e)
{
Device dev = (Device)sender;
// Turn off Direct3D lighting, to provide specified vertex colors
dev.RenderState.Lighting = false;
}
// Call reset procedure using event handler
device.DeviceReset += new System.EventHandler(this.OnResetDevice);
© 2002 Microsoft Corporation. All rights reserved. Terms of use.