0

I want to create a material for my object to be appeared like below, How should I config my material object? This is what I've done but didn't work:

let colors = [UIColor.green,
                  UIColor.red,
                  UIColor.blue,
                  UIColor.yellow,
                  UIColor.purple,
                  UIColor.gray]

let materials = colors.map { color -> SCNMaterial in
    let material = SCNMaterial()
    material.diffuse.contents = color
    return material
}

myObject.geometry.materials = materials

enter image description here

Hossein
  • 797
  • 1
  • 8
  • 24

0 Answers0