Node — Aspose.3D FOSS for .NET

Example

Example Node clasa reprezintă un element denumit în graficul de scenă Aspose.3D. Fiecare nod poate conține unul Entity (cum ar fi un Mesh, Camera, sau Light), menține relații părinte-copil cu alte noduri și poartă o transformare locală. Nodurile sunt modalitatea principală de a organiza obiecte 3D într-o ierarhie de scenă.

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/setIdentificator lizibil pentru om al nodului
EntityEntityget/setEntitatea principală atașată acestui nod
EntitiesList<Entity>obțineToate entitățile atașate acestui nod
ChildNodesList<Node>obțineNoduri copil în ierarhia scenei
ParentNodeNodeobțineNod părinte în ierarhie
TransformTransformobțineTransformare locală (translație, rotație, scară)
GlobalTransformGlobalTransformobțineTransformare calculată în spațiul lumii
PropertiesPropertyCollectionobțineProprietăți personalizate

Example

ExampleTip de returnareExample
CreateChildNode(string name)NodeCreează un nod copil nou cu numele dat
CreateChildNode(string name, Entity entity)NodeCreează un nod copil cu o entitate atașată

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

Vezi și

 Română