WWDC 2014 演示文稿展示了只有线框的轨道立方体。该技术是使用具有绿色边缘但内部透明的图像作为材料。来自 AAPLSlideScenegraphSummary.m:
// A node that will help visualize the position of the stars
_wireframeBoxNode = [SCNNode node];
_wireframeBoxNode.rotation = SCNVector4Make(0, 1, 0, M_PI_4);
_wireframeBoxNode.geometry = [SCNBox boxWithWidth:1 height:1 length:1 chamferRadius:0];
_wireframeBoxNode.geometry.firstMaterial.diffuse.contents = [NSImage imageNamed:@"box_wireframe"];
_wireframeBoxNode.geometry.firstMaterial.lightingModelName = SCNLightingModelConstant; // no lighting
_wireframeBoxNode.geometry.firstMaterial.doubleSided = YES; // double sided
Run Code Online (Sandbox Code Playgroud)
对于与 SCNCylinder 类似的效果,您可能需要传递一系列材料,有些有边框,有些没有。
编辑
对于 High Sierra/iOS 11 及更高版本,@mnuages 的答案是一种更简单/更好的方法。