PointLightBase.ConstantAttenuation 屬性

定義

取得或設定常數值,光線強度會隨著距離依這個值減少。

public:
 property double ConstantAttenuation { double get(); void set(double value); };
public double ConstantAttenuation { get; set; }
member this.ConstantAttenuation : double with get, set
Public Property ConstantAttenuation As Double

屬性值

Double,光線強度會隨著距離依這個值減少。

範例

下列範例會在程式碼中設定這個屬性。

public MyLights()
{
    for (int i = 0; i < nbrDirLights; i++)
    {
        _dirLight[i] = new DirectionalLight();
        _dirLight[i].Color = _dirLightColor[i];
        _dirLight[i].Direction = _dirVector[i];
    }

    _ptLight.Position = new Point3D(-3, -7, 10);
    _ptLight.Color = System.Windows.Media.Brushes.White.Color;
    _ptLight.Range = 15.0;
    _ptLight.ConstantAttenuation = 3.0;
}
Public Sub New()
    For i As Integer = 0 To nbrDirLights - 1
        _dirLight(i) = New DirectionalLight()
        _dirLight(i).Color = _dirLightColor(i)
        _dirLight(i).Direction = _dirVector(i)
    Next i

    _ptLight.Position = New Point3D(-3, -7, 10)
    _ptLight.Color = System.Windows.Media.Brushes.White.Color
    _ptLight.Range = 15.0
    _ptLight.ConstantAttenuation = 3.0
End Sub

備註

相依性屬性資訊

識別碼欄位 ConstantAttenuationProperty
中繼資料屬性設定為 true

適用於