【发布时间】:2021-01-31 12:20:36
【问题描述】:
我正在尝试在 ARKit 中绘制带圆角的 3D 纸飞机,但我做不到。
我用更糟糕的路径做到了:
// create bezeir path
let path = UIBezierPath()
// A bezier path
path.move(to: CGPoint(x: 0, y: 0.025))
path.addLine(to: CGPoint(x: 0.02, y: -0.005))
path.addLine(to: CGPoint(x: 0, y: 0))
path.addLine(to: CGPoint(x: -0.02, y: -0.005))
path.close()
// create arrow shape
let arrowShape = SCNShape(path: path, extrusionDepth: 0.001)
arrowShape.chamferRadius = 50
// create new node
arrownode = SCNNode(geometry: arrowShape);
// set arrow color
arrownode!.geometry?.firstMaterial?.diffuse.contents = UIColor.yellow
结果:
我确实需要这样,但有圆角。
【问题讨论】:
标签: swift augmented-reality scenekit arkit uibezierpath