问题
Is it possible to get the intersection co-ords of two shapes3d's?
(One is a Line and the other is a QuadArray)
Just wondering if there is a simple way before I try a hack and slash method?
-I'm pretty new to Java 3D so I may have missed a function which does exactly what I need.
回答1:
The Easy way is to use Bounds and intersect method :
Bounds quadArrayBounds = quadArrayShape.getBounds();
if (quadArrayBounds.intersect(new Point3d(startLine.x, startLine.y, startLine.z),
new Vector3d(endLine.x, endLine.y, endLine.z))){
// Action to do if Intesect is true
}
来源:https://stackoverflow.com/questions/8463833/java-3d-get-intersection-of-two-shape3ds