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

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");

参照

 日本語