BoundingBox — Aspose.3D FOSS for Java

Example

BoundingBox מייצג תיבה תוחמת מיושרת לציר (AABB) המוגדרת על‑ידי שני Vector3 קצוות – הממדים המינימליים והמקסימליים. היא מוחזרת על‑ידי Node.getBoundingBox() והיא משמשת לשאילתות מרחביות, סינון פרסטרום, וחישובי גודל.

Example: com.aspose.threed

import com.aspose.threed.*;

Example

ExampleExampleExampleExample
minimumVector3getMinimum()הקצה עם ערכי x, y, z הקטנים ביותר
maximumVector3getMaximum()הקצה עם ערכי x, y, z הגדולים ביותר

Example

Exampleסוג החזרהExample
merge(Vector3 point)voidהרחב את התיבה התוחמת כך שתכלול את הנקודה הנתונה
merge(BoundingBox other)voidהרחב את התיבה התוחמת כך שתכיל תיבה תוחמת אחרת

Example

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


Scene scene = Scene.fromFile("model.obj");

for (Node node : scene.getRootNode().getChildNodes()) {
    BoundingBox bbox = node.getBoundingBox();
    Vector3 min = bbox.getMinimum();
    Vector3 max = bbox.getMaximum();

    System.out.println("Node '" + node.getName() + "':");
    System.out.println("  Min: " + min);
    System.out.println("  Max: " + max);
    System.out.println("  Size X: " + (max.x - min.x));
    System.out.println("  Size Y: " + (max.y - min.y));
    System.out.println("  Size Z: " + (max.z - min.z));
}

ראה גם

 עברית