Node — Aspose.3D FOSS for .NET

Properties

Properties Node class đại diện cho một phần tử có tên trong Aspose.3D scene graph. Mỗi nút có thể chứa một Entity (chẳng hạn như một Mesh, Camera, hoặc 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);
}

Properties

PropertiesPropertiesPropertiesProperties
Namestringget/setĐịnh danh có thể đọc được cho nút
EntityEntityget/setThực thể chính được gắn vào nút này
EntitiesList<Entity>getTất cả các thực thể được gắn vào nút này
ChildNodesList<Node>getCác nút con trong phân cấp cảnh
ParentNodeNodegetNút cha trong phân cấp
TransformTransformgetBiến đổi cục bộ (dịch chuyển, quay, tỉ lệ)
GlobalTransformGlobalTransformlấyBiến đổi không gian thế giới đã tính toán
PropertiesPropertyCollectionlấyThuộc tính tùy chỉnh

Properties

PropertiesKiểu trả vềProperties
CreateChildNode(string name)NodeTạo một nút con mới với tên đã cho
CreateChildNode(string name, Entity entity)NodeTạo một nút con với thực thể đính kèm

Properties

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

Xem thêm

 Tiếng Việt