我试图以编程方式在ARKit中使我的节点(对象)变红,但它仍然以白色显示在我的场景中。我哪里错了?
let object = SCNScene(named: "art.scnassets/abc.stl")
let node = SCNNode()
let nodeArray = object!.rootNode.childNodes
for childNode in nodeArray {
node.addChildNode(childNode)
}
let material = SCNMaterial()
material.diffuse.contents = UIColor.red
//material.diffuse.contents = UIImage(named: "art.scnassets/Metal.jpg")
node.geometry?.materials = [material]
答案 0 :(得分:0)
我猜“node.geometry?”是零。