Node — Aspose.3D FOSS for .NET
Example
Example Node class は Aspose.3D シーン グラフ内の名前付き要素を表します。各ノードは 1 つ保持できます 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
| Example | Example | Example | Example |
|---|---|---|---|
Name | string | 取得/設定 | ノードの人間が読みやすい識別子 |
Entity | Entity | 取得/設定 | このノードに添付された主要エンティティ |
Entities | List<Entity> | 取得 | このノードに添付されたすべてのエンティティ |
ChildNodes | List<Node> | 取得 | シーン階層の子ノード |
ParentNode | Node | 取得 | 階層内の親ノード |
Transform | Transform | 取得 | ローカル変換(平行移動、回転、スケール) |
GlobalTransform | GlobalTransform | 取得 | 計算されたワールド空間変換 |
Properties | PropertyCollection | 取得 | カスタムプロパティ |
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");