BoundingBox — Aspose.3D FOSS for Java
Example
BoundingBox predstavlja okvir usklađen s osama (AABB) definisan sa dva Vector3 ugla – minimalnim i maksimalnim ekstenzijama. Vraća se od Node.getBoundingBox() i koristi se za prostorne upite, frustum culling i izračunavanje veličina.
Example: com.aspose.threed
import com.aspose.threed.*;Example
| Example | Example | Example | Example |
|---|---|---|---|
minimum | Vector3 | getMinimum() | Ugao sa najmanjim vrednostima x, y, z |
maximum | Vector3 | getMaximum() | Ugao sa najvećim x, y, z vrednostima |
Example
| Example | Tip povratne vrednosti | Example |
|---|---|---|
merge(Vector3 point) | void | Proširi ograničavajući okvir da uključi zadatu tačku |
merge(BoundingBox other) | void | Proširi ograničavajući okvir da obuhvati drugi ograničavajući 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));
}