Node — Aspose.3D FOSS for Java

Enumerations

Enumerations Node class Aspose.3D सीन ग्राफ़ में एक नामित तत्व का प्रतिनिधित्व करती है। प्रत्येक नोड एक रख सकता है Entity (जैसे कि एक Mesh या Camera).

import com.aspose.threed.Scene;
import com.aspose.threed.Node;

Scene scene = new Scene();

// Access the root node via getter
Node root = scene.getRootNode();

// Create a child node
Node child = root.createChildNode("my_node");

// Iterate child nodes via getter
for (Node node : root.getChildNodes()) {
    System.out.println(node.getName());
}

Enumerations

Enumerations Node अन्य नोड्स के साथ पैरेंट‑चाइल्ड संबंध बनाए रखता है, और एक स्थानीय ट्रांसफ़ॉर्म ले जाता है। नोड्स सीन पदानुक्रम में 3D वस्तुओं को व्यवस्थित करने का प्राथमिक तरीका हैं।.

EnumerationsEnumerationsEnumerations
nameStringconstructor एक नोड को वैकल्पिक नाम के साथ प्रारंभ करता है।

Enumerations

सभी नोड एट्रिब्यूट्स को getter/setter मेथड्स के माध्यम से एक्सेस किया जाता है।.

EnumerationsEnumerationsEnumerationsEnumerationsEnumerations
nameStringgetName()setName(String)नोड के लिए वैकल्पिक नाम
entityEntitygetEntity()setEntity(Entity)नोड के लिए मानव‑पठनीय पहचानकर्ता., Mesh, Cameraइस नोड से जुड़ी मुख्य इकाई (उदाहरण के लिए, getEntities().
entitiesList<Entity>getEntities())। पहला तत्व का शॉर्टकट
materialMaterialgetMaterial()setMaterial(Material)इस नोड से जुड़ी सभी इकाइयाँ (केवल‑पढ़ने योग्य)
materialsList<Material>getMaterials()इस नोड को सौंपा गया मुख्य सामग्री
childNodesList<Node>getChildNodes()इस नोड को सौंपे गए सभी सामग्री (केवल‑पढ़ने योग्य)
parentNodeNodegetParentNode()setParentNode(Node)चाइल्ड नोड्स की सूची
parentNodesList<Node>getParentNodes()सीन पदानुक्रम में तत्काल पैरेंट नोड Entity;सभी पैरेंट नोड्स (से विरासत में मिला; इंस्टेंसिंग का समर्थन करता है)
visiblebooleangetVisible()setVisible(boolean)Enumerations false, नोड और उसका सबट्री छिपे हुए हैं
excludedbooleangetExcluded()setExcluded(boolean)Enumerations true, इस नोड को रेंडरिंग से बाहर रखा गया है
transformTransformgetTransform()स्थानीय ट्रांसफ़ॉर्म (अनुवाद, घूर्णन, स्केल)
globalTransformGlobalTransformgetGlobalTransform()वर्ल्ड-स्पेस ट्रांसफ़ॉर्मेशन मैट्रिक्स
assetInfoAssetInfogetAssetInfo()setAssetInfo(AssetInfo)इस नोड से जुड़ी एसेट मेटाडेटा, यदि कोई हो
propertiesPropertyCollectiongetProperties()इस नोड से जुड़ी कस्टम प्रॉपर्टीज़

Enumerations

Enumerationsरिटर्न टाइपEnumerations
createChildNode(String name)Nodeदिए गए नाम के साथ एक नया चाइल्ड नोड बनाता है और उसे संलग्न करता है
createChildNode(String name, Entity entity)Nodeएक चाइल्ड नोड बनाता है और उसमें एक एंटिटी असाइन करता है
addChildNode(Node node)voidएक मौजूदा नोड को इस नोड का चाइल्ड के रूप में जोड़ता है
getChild(String name)Nodeनाम से सीधे चाइल्ड नोड को खोजता है
addEntity(Entity entity)voidइस नोड से एक अतिरिक्त एंटिटी संलग्न करता है
merge(Node node)voidदूसरे नोड के चाइल्ड और एंटिटीज़ को इस नोड में मर्ज करता है
evaluateGlobalTransform(boolean withGeometricTransform)Matrix4वर्ल्ड-स्पेस ट्रांसफ़ॉर्म मैट्रिक्स लौटाता है; पास true ज्यामितीय ऑफ़सेट्स शामिल करने के लिए
getBoundingBox()BoundingBoxवर्ल्ड स्पेस में नोड का एक्सिस-एलाइन्ड बाउंडिंग बॉक्स गणना करता है
getProperty(String name)Objectनाम द्वारा प्रॉपर्टी मान प्राप्त करता है
findProperty(String name)Propertyनाम द्वारा प्रॉपर्टी खोजता है

Enumerations

एक सीन बनाएं, एक mesh को नोड से संलग्न करें, और सीन ग्राफ़ को ट्रैवर्स करें:

import com.aspose.threed.Scene;
import com.aspose.threed.Node;
import com.aspose.threed.*;


Scene scene = new Scene();
Mesh mesh = new Mesh();
mesh.getControlPoints().add(new Vector4(0, 0, 0, 1));
mesh.getControlPoints().add(new Vector4(1, 0, 0, 1));
mesh.getControlPoints().add(new Vector4(0.5, 1, 0, 1));
mesh.createPolygon(0, 1, 2);

// Attach mesh to a child node
Node node = scene.getRootNode().createChildNode("triangle", mesh);

// Traverse child nodes using getter
for (Node child : scene.getRootNode().getChildNodes()) {
    Entity entity = child.getEntity();
    if (entity != null) {
        System.out.println("Node '" + child.getName() + "': " + entity.getClass().getSimpleName());
        System.out.println("  Excluded: " + child.getExcluded());
    }
}

संबंधित देखें

 हिन्दी