Material.Diffuse

Diffuse プロパティ

使用例

  • デバイスのマテリアル プロパティの設定

ディフューズ色を指定する値を取得または設定する。

定義

Visual Basic Public Property Diffuse As Color
C# public Color Diffuse { get; set; }
Managed C++ public: __property Color get_Diffuse();
public: __property void set_Diffuse(Color);
JScript public function get Diffuse() : Color
public function set Diffuse(Color);

プロパティ値

System.Drawing.Color.

これは読み取り/書き込み可能プロパティである。 

使用例

デバイスのマテリアル プロパティの設定

この例では、Microsoft® Direct3D® オブジェクトのマテリアル プロパティを設定する方法を示す。

次のコードでは、最初に Material 構造体を作成する。次に、構造体の Diffuse プロパティおよび Ambient プロパティを、システム定義の白色に設定する。最後に、Device.Material プロパティが白色の Diffuse および Ambient カラー プロパティを受け取る。

using Microsoft.DirectX.Direct3D;

public class Lights : Form
{
    // Global variables for this project
    Device device = null; // Rendering device
    .
    .
    .
    private void SetupLights() //  Method to set up lighting of the object
    {
        // Set col to system-defined white color
        System.Drawing.Color col = System.Drawing.Color.White; 

        // Set up a material.
        // The material here has the diffuse and ambient colors set to white.
        // Note that only one material can be used at a time.
        Direct3D.Material mtrl = new Direct3D.Material();
        mtrl.Diffuse = col;
        mtrl.Ambient = col;
        device.Material = mtrl;
    }
}

対象

Material

© 2002 Microsoft Corporation. All rights reserved. Terms of use.