【发布时间】:2018-02-22 00:41:57
【问题描述】:
我是 ARKit 的新手,在检查了一些示例代码(如 https://developer.apple.com/sample-code/wwdc/2017/PlacingObjects.zip)之后,我想知道是否有任何可能性以“联合/交叉/差异”的方式从基元构造几何图形。
以下伪代码应说明:
SCNBox *boxGeometry = [SCNBox boxWithWidth:1.0 height:1.0 length:1.0];
SCNSphere *sphereGeometry = [SCNSphere sphereWithRadius:0.6];
SCNGeometry *sphereUnionBox = [SCNGeometry union:sphereGeometry with:boxGeometry];
SCNGeometry *sphereAndBoxIntersection = [SCNGeometry intersect:sphereGeometry and:boxGeometry];
SCNGeometry *sphereSubstractedFromBox = [SCNGeometry substract:sphereGeometry from:boxGeometry];
SCNGeometry *boxSubstractedFromSphere = [SCNGeometry substract:boxGeometry from:sphereGeometry];
这应该导致(在从这些几何图形构建节点并将它们添加到场景之后)到众所周知和熟悉的组合:
任何广泛的提示将不胜感激,我真的被困在这里了。
【问题讨论】: