I am trying to set the SCNNode color to a custom RGBA color, however when I try to check this box it will be white:
let box = SCNBox(width: 4, height: 1, length: 4, chamferRadius: 0)
let boxNode = SCNNode(geometry: box)
myScene.rootNode.addChildNode(boxNode)
boxNode.castsShadow = true
box.firstMaterial?.diffuse.contents = UIColor(red: 30, green: 150, blue: 30, alpha: 1)
This makes the field white, however, does something like this:
box.firstMaterial?.diffuse.contents = UIColor.greenColor()
How can I make a box with custom RGBA color?
-Thank
source
share