When I try to give the geometry a material with the diffuse.contents of red, I get a white object instead.
Here is the code I have used to create the node:
let geo = SCNBox(width: 1, height: 1, length: 1, chamferRadius: 0.1)
let mat = SCNMaterial()
mat.diffuse.contents = Color.red
mat.diffuse.intensity = 1
geo.materials = [mat]
let node = SCNNode(geometry: geo)
SomeClass.scene!.rootNode.addChildNode(node)
And here is the code I have used to create the SceneView
SceneView(scene: SomeClass.scene,
pointOfView: nil,
options: [.allowsCameraControl, .autoenablesDefaultLighting],
preferredFramesPerSecond: 60,
antialiasingMode: .multisampling2X,
delegate: sceneDelegate,
technique: nil)
SomeClass
is just a basic class that holds the scene property. I have made this class for a reason I don't know.
I have tried to set the diffuse.contents
to a CGColor instead of a "normal" Color and did some research on the internet, but couldn't find anybody with a similar issue.