BoundingBox — Aspose.3D FOSS for Java

Example

BoundingBox predstavuje axis-aligned bounding box (AABB) definovanú dvoma Vector3 rohov – minimálnymi a maximálnymi rozmermi. Je vrátený Node.getBoundingBox() a používa sa pre spatial queries, frustum culling a výpočty veľkosti.

Example: com.aspose.threed

import com.aspose.threed.*;

Example

ExampleExampleExampleExample
minimumVector3getMinimum()Roh s najmenšími hodnotami x, y, z
maximumVector3getMaximum()Roh s najväčšími hodnotami x, y, z

Example

ExampleNávratový typExample
merge(Vector3 point)voidRozšíriť ohraničovaciu krabicu tak, aby zahŕňala daný bod
merge(BoundingBox other)voidRozšíriť ohraničovaciu krabicu tak, aby obklopila ďalšiu ohraničovaciu krabicu

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

Pozri tiež

 Slovenčina