When I drew on SceneKit View, I wanted to change the drawing color, so I checked it.
Execution environment | version |
---|---|
Swift | 5 |
Xcode | 12.0 |
I am creating a ball node as an example.
python
let ball = SCNSphere(radius: 0.01)
let node = SCNNode(geometry: ball)
//Color change code
ball.firstMaterial?.diffuse.contents = UIColor.red
You can change the color by putting your favorite color in the UIColor.Red </ code> part.
Recommended Posts