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
| Methods | Methods |
|---|---|
Light() | デフォルト名でpoint lightを作成します "Light", 白色、強度 1.0, 範囲 1.0 |
Light(LightType type) | 指定されたタイプのlightをデフォルト名で作成します "Light" |
Light(LightType type, string name) | 指定されたタイプの名前付きライトを作成します |
Methods
| Methods | Methods | Methods | Methods |
|---|---|---|---|
Type | LightType | 取得 | ライトのタイプ (POINT、SPOT、DIRECTIONAL、または AMBIENT)。構築時に設定され、以降は読み取り専用です。. |
Color | Vector3 | 取得/設定 | ライトの RGB カラー。デフォルト: Vector3.One (白) |
Intensity | float | 取得/設定 | 明るさの乗数。デフォルト: 1.0 |
Range | float | 取得/設定 | ポイントライトとスポットライトの影響範囲の最大距離。デフォルト: 1.0 |
Methods
| Methods | 戻り値の型 | Methods |
|---|---|---|
GetBoundingBox() | BoundingBox | 空のバウンディングボックスを返します(ライトには幾何学的な範囲がありません) |
LightType
LightType は、4つのパブリック static インスタンスを持つ値型クラスです::
| Methods | Methods |
|---|---|
LightType.POINT | 空間内の一点から全方向に等しく光を放射します |
LightType.SPOT | ノードが向いている方向に光の円錐を放射します |
LightType.DIRECTIONAL | 無限に遠い光源からのように平行光線を放射します |
LightType.AMBIENT | 均一な環境光を追加します;範囲と方向は使用されません |
LightType 1つのプロパティがあります::
| Methods | Methods | Methods | Methods |
|---|---|---|---|
Name | string | 取得 | 光のタイプの表示名("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");