【发布时间】:2017-05-12 08:18:21
【问题描述】:
我有一个“附加节点”,它有 2 个子节点,它们是 Blender 模型。我已经向这个附加节点添加了第三个节点,它是一个 SCNCone。出于某种原因,我无法更改圆锥节点的颜色,只能更改透明度。我似乎看不出代码有什么问题,但是在运行期间,无论我将其设置为哪种颜色,锥体始终为黑色。
let coneGeo = SCNCone(topRadius: 0.1, bottomRadius: 0.7, height: 4)
let coneMaterial = SCNMaterial()
coneMaterial.diffuse.contents = UIColor(red: 255.0/255.0, green: 108.0/255.0, blue: 91.0/255.0, alpha: 0.2)
coneGeo.materials = [coneMaterial]
let coneNode = SCNNode(geometry: coneGeo)
coneNode.position = SCNVector3(0, -1.5, 0)
coneNode.name = "coneNode"
AttachNode.addChildNode(coneNode)
【问题讨论】: