SceneKit - Colored material based on environment light or rotation

50 Views Asked by At

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

0

There are 0 best solutions below