BoundingBox — Aspose.3D FOSS for Java
Example
BoundingBox predstavlja okvir poravnat s osima (AABB) definiran dvjema Vector3 kutovima – minimalnim i maksimalnim ekstenzijama. Vraća ga Node.getBoundingBox() i koristi se za prostorne upite, culling frustuma i izračune veličine.
Example: com.aspose.threed
import com.aspose.threed.*;Example
| Example | Example | Example | Example |
|---|---|---|---|
minimum | Vector3 | getMinimum() | Kut s najmanjim vrijednostima x, y, z |
maximum | Vector3 | getMaximum() | Kut s najvećim vrijednostima x, y, z |
Example
| Example | Vrsta povratne vrijednosti | Example |
|---|---|---|
merge(Vector3 point) | void | Proširi okvir da uključi zadanu točku |
merge(BoundingBox other) | void | Proširi okvir da obuhvati drugi okvir |
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));
}