BoundingBox — Aspose.3D FOSS for Java
Example
BoundingBox rappresenta un axis-aligned bounding box (AABB) definito da due Vector3 angoli – le estensioni minima e massima. Viene restituito da Node.getBoundingBox() ed è usato per query spaziali, frustum culling e calcoli delle dimensioni.
Example: com.aspose.threed
import com.aspose.threed.*;Example
| Example | Example | Example | Example |
|---|---|---|---|
minimum | Vector3 | getMinimum() | L’angolo con i valori x, y, z più piccoli |
maximum | Vector3 | getMaximum() | L’angolo con i valori x, y, z più grandi |
Example
| Example | Tipo di ritorno | Example |
|---|---|---|
merge(Vector3 point) | void | Espandi il bounding box per includere il punto fornito |
merge(BoundingBox other) | void | Espandi il bounding box per racchiudere un altro bounding box |
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));
}