Node — Aspose.3D FOSS for .NET

Example

Example 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),.

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
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)
GlobalTransformGlobalTransformzískaťVypočítaná transformácia vo svetovom priestore
PropertiesPropertyCollectionzískaťVlastné vlastnosti

Example

ExampleNávratový typExample
CreateChildNode(string name)NodeVytvorí nový podriadený uzol s daným názvom
CreateChildNode(string name, Entity entity)NodeVytvorí podriadený uzol s pripojenou entitou

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

Pozri tiež

 Slovenčina