BoundingBox — Aspose.3D FOSS for Java
Example
BoundingBox 두 개에 의해 정의된 축에 정렬된 경계 상자(AABB)를 나타냅니다 Vector3 코너 — 최소 및 최대 범위. 이는 ~에 의해 반환됩니다 Node.getBoundingBox() 그리고 공간 쿼리, 프러스텀 컬링 및 크기 계산에 사용됩니다.
Example: com.aspose.threed
import com.aspose.threed.*;Example
| Example | Example | Example | Example |
|---|---|---|---|
minimum | Vector3 | getMinimum() | x, y, z 값이 가장 작은 코너 |
maximum | Vector3 | getMaximum() | 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));
}