Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After updating device to iOS 11 3D model color changed

I am working with application using scene kit. And eveything is working fine until iOS 10.

I can see 3D model correct but after I updated my device to iOS 11 the colors of the model changed.

-(void)applyColor:(SCNNode*)node{
    NSArray *materials = node.geometry.materials;
    for (SCNMaterial *material in materials) {
        material.diffuse.contents = [UIColor purpalColor];
    }
}

iOS 9 and iOS 10: enter image description here

iOS 11: enter image description here

like image 949
DeveshM Avatar asked Apr 10 '18 15:04

DeveshM


1 Answers

According to Apple, the default color is white for meterial.diffuse.contents.

By default, the diffuse property’s contents object is a white color.

Not seeing your code, I do wonder about this line since this appears to be an obvious typo:

[UIColor purpalColor];

Presumably, it builds, so I assume it is a valid name.

Have you been able to verify that the color above is providing the desired value? Since it appears that iOS is expecting something, not getting it, and sending back the default color here.

like image 110
CodeBender Avatar answered Oct 07 '22 02:10

CodeBender