Light — Aspose.3D FOSS for .NET
네임스페이스: Aspose.ThreeD.Entities
Methods
Methods Light 클래스는 씬 노드에 부착된 광원을 나타냅니다. It extends Entity 그리고 네 가지 광원 유형을 지원합니다: 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) | 주어진 유형의 이름이 지정된 light를 생성합니다 |
Methods
| Methods | Methods | Methods | Methods |
|---|---|---|---|
Type | LightType | get | light 유형 (POINT, SPOT, DIRECTIONAL, 또는 AMBIENT). 생성 시 설정되며, 이후에는 읽기 전용입니다. |
Color | Vector3 | get/set | light의 RGB 색상. 기본값: Vector3.One (흰색) |
Intensity | float | get/set | 밝기 배수. 기본값: 1.0 |
Range | float | get/set | 점광원 및 스포트라이트에 대한 영향의 최대 거리. 기본값: 1.0 |
Methods
| Methods | 반환 유형 | Methods |
|---|---|---|
GetBoundingBox() | BoundingBox | 빈 경계 상자를 반환합니다 (조명은 기하학적 범위가 없습니다) |
LightType
LightType 는 네 개의 public static 인스턴스를 가진 값 타입 클래스입니다:
| Methods | Methods |
|---|---|
LightType.POINT | 공간의 한 점에서 모든 방향으로 균등하게 빛을 방출합니다 |
LightType.SPOT | 노드가 바라보는 방향으로 빛의 원뿔을 방출합니다 |
LightType.DIRECTIONAL | 무한히 먼 광원에서 나오는 것처럼 평행한 빛 광선을 방출합니다 |
LightType.AMBIENT | 균일한 주변 조명을 추가합니다; 범위와 방향은 사용되지 않습니다 |
LightType 하나의 속성을 가집니다:
| Methods | Methods | Methods | Methods |
|---|---|---|---|
Name | string | get | 빛 유형의 표시 이름 ("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");