BoundingBox — Aspose.3D FOSS for Java

Example

BoundingBox iki köşe tarafından tanımlanan eksen hizalı bir sınırlayıcı kutuyu (AABB) temsil eder Vector3 köşeler – minimum ve maksimum uzantılar. Şu tarafından döndürülür Node.getBoundingBox() ve uzamsal sorgular, frustum elenmesi ve boyut hesaplamaları için kullanılır.

Example: com.aspose.threed

import com.aspose.threed.*;

Example

ExampleExampleExampleExample
minimumVector3getMinimum()En küçük x, y, z değerlerine sahip köşe
maximumVector3getMaximum()En büyük x, y, z değerlerine sahip köşe

Example

ExampleDönüş TipiExample
merge(Vector3 point)voidVerilen noktayı içerecek şekilde sınırlayıcı kutuyu genişlet
merge(BoundingBox other)voidBaşka bir sınırlayıcı kutuyu kapsayacak şekilde sınırlayıcı kutuyu genişlet

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

Ayrıca Bakınız

 Türkçe