Node — Aspose.3D FOSS for .NET

Overview

The Node class represents a named element in the Aspose.3D scene graph. Each node can hold one Entity (such as a Mesh, Camera, or Light), maintains parent-child relationships with other nodes, and carries a local transform. Nodes are the primary way to organize 3D objects in a scene hierarchy.

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

Properties

NameTypeAccessDescription
Namestringget/setHuman-readable identifier for the node
EntityEntityget/setThe primary entity attached to this node
EntitiesList<Entity>getAll entities attached to this node
ChildNodesList<Node>getChild nodes in the scene hierarchy
ParentNodeNodegetParent node in the hierarchy
TransformTransformgetLocal transformation (translation, rotation, scale)
GlobalTransformGlobalTransformgetComputed world-space transformation
PropertiesPropertyCollectiongetCustom properties

Methods

MethodReturn TypeDescription
CreateChildNode(string name)NodeCreates a new child node with the given name
CreateChildNode(string name, Entity entity)NodeCreates a child node with an attached entity

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

See Also