Node — Aspose.3D FOSS for .NET

Example

Example Node 클래스는 Aspose.3D 씬 그래프에서 이름이 지정된 요소를 나타냅니다. 각 노드는 하나를 보유할 수 있습니다 Entity (예를 들어 Mesh, Camera, 또는 Light), 다른 노드와 부모‑자식 관계를 유지하고 로컬 변환을 보유합니다. 노드는 씬 계층 구조에서 3D 객체를 조직하는 주요 방법입니다.

using Aspose.ThreeD;

var scene = new Scene();

// Access the root node
Node root = scene.RootNode;

// Create a child node
Node child = root.CreateChildNode("my_node");

// Iterate child nodes
foreach (var node in root.ChildNodes)
{
    Console.WriteLine(node.Name);
}

Example

ExampleExampleExampleExample
Namestring읽기/쓰기노드에 대한 사람이 읽을 수 있는 식별자
EntityEntity읽기/쓰기이 노드에 연결된 주요 엔터티
EntitiesList<Entity>읽기이 노드에 연결된 모든 엔터티
ChildNodesList<Node>읽기씬 계층 구조의 자식 노드
ParentNodeNode읽기계층 구조의 부모 노드
TransformTransform읽기로컬 변환(이동, 회전, 스케일)
GlobalTransformGlobalTransform가져오기계산된 월드 공간 변환
PropertiesPropertyCollection가져오기사용자 정의 속성

Example

Example반환 유형Example
CreateChildNode(string name)Node주어진 이름으로 새로운 자식 노드를 생성합니다
CreateChildNode(string name, Entity entity)Node첨부된 엔터티와 함께 자식 노드를 생성합니다

Example

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

var scene = new Scene();

// Build a hierarchy with entities
var parent = scene.RootNode.CreateChildNode("Parent");
parent.Transform.Translation = new FVector3(10, 0, 0);

var box = new Box(2, 2, 2);
var child = parent.CreateChildNode("BoxChild", box);
child.Transform.Translation = new FVector3(5, 0, 0);

scene.Save("hierarchy.gltf");

참고

 한국어