Reputation: 476
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];
}
}
Upvotes: 8
Views: 316
Reputation: 36670
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.
Upvotes: 6
Reputation: 1213
Just a thought, try using a non-custom color just to see if that gets you back on track. Possibly a clamping issue iOS 10 Wide Color? Try searching this post: iOS 10 Wide Color: Do I need to be concerned?. It specifically says UIKit and I didn't see anything specific to scenekit but again, just a thought.
Upvotes: -2