Light — Aspose.3D FOSS for .NET

名前空間: Aspose.ThreeD.Entities

Methods

Methods Light クラスはシーンノードに取り付けられた光源を表します。extends Entity そして4つの光タイプをサポートします:directional、point、spot、ambient。光は子ノードを作成し、そこにentityをアタッチすることでシーンに配置されます。 Light entityをそれにアタッチします。.

using Aspose.ThreeD;
using Aspose.ThreeD.Entities;
using Aspose.ThreeD.Utilities;

var scene = new Scene();

// Add a point light to the scene
var light = new Light(LightType.POINT, "SunLight");
light.Color = new Vector3(1.0f, 0.95f, 0.8f);
light.Intensity = 2.0f;
light.Range = 10.0f;

scene.RootNode.CreateChildNode("sun", light);

Methods

MethodsMethods
Light()デフォルト名でpoint lightを作成します "Light", 白色、強度 1.0, 範囲 1.0
Light(LightType type)指定されたタイプのlightをデフォルト名で作成します "Light"
Light(LightType type, string name)指定されたタイプの名前付きライトを作成します

Methods

MethodsMethodsMethodsMethods
TypeLightType取得ライトのタイプ (POINT、SPOT、DIRECTIONAL、または AMBIENT)。構築時に設定され、以降は読み取り専用です。.
ColorVector3取得/設定ライトの RGB カラー。デフォルト: Vector3.One (白)
Intensityfloat取得/設定明るさの乗数。デフォルト: 1.0
Rangefloat取得/設定ポイントライトとスポットライトの影響範囲の最大距離。デフォルト: 1.0

Methods

Methods戻り値の型Methods
GetBoundingBox()BoundingBox空のバウンディングボックスを返します(ライトには幾何学的な範囲がありません)

LightType

LightType は、4つのパブリック static インスタンスを持つ値型クラスです::

MethodsMethods
LightType.POINT空間内の一点から全方向に等しく光を放射します
LightType.SPOTノードが向いている方向に光の円錐を放射します
LightType.DIRECTIONAL無限に遠い光源からのように平行光線を放射します
LightType.AMBIENT均一な環境光を追加します;範囲と方向は使用されません

LightType 1つのプロパティがあります::

MethodsMethodsMethodsMethods
Namestring取得光のタイプの表示名("Point", "Spot", "Directional", "Ambient")

Methods

シーンに方向光と点光を追加し、FBX に保存します:

using Aspose.ThreeD;
using Aspose.ThreeD.Entities;
using Aspose.ThreeD.Utilities;

var scene = new Scene();

// Directional light — positioned and oriented via the node Transform
var dirLight = new Light(LightType.DIRECTIONAL, "Sun");
dirLight.Color = new Vector3(1.0f, 1.0f, 0.9f);
dirLight.Intensity = 1.5f;
scene.RootNode.CreateChildNode("dirLight", dirLight);

// Point light with limited range
var pointLight = new Light(LightType.POINT, "Lamp");
pointLight.Color = new Vector3(1.0f, 0.6f, 0.3f);
pointLight.Intensity = 3.0f;
pointLight.Range = 5.0f;
scene.RootNode.CreateChildNode("lamp", pointLight);

scene.Save("lit_scene.fbx");

関連項目

 日本語