我正在尝试访问/修改SCNSphere
我在SCNScene
. 我将场景预设为一个名为“spaceScene.scn”的文件。我正在加载场景
self.sceneView.scene = [SCNScene sceneNamed:@"spaceScene.scn"];
self.sceneView.allowsCameraControl = YES;
self.sceneView.scene.rootNode.camera = [SCNCamera camera];
SCNSphere *earth = (SCNSphere *)[self.sceneView.scene.rootNode childNodeWithName:@"earth" recursively:NO];
NSMutableArray *materials = earth.materials;
NSLog(@"Materials of earth from scene: %@", materials);
我似乎无法通过阅读地球的材料属性。我不断收到一个实例错误:SCNSphere
-[SCNNode materials]: unrecognized selector sent to instance 0x1701c5550
对这个问题感觉有点傻,但请有人告诉我如何访问球体属性?谢谢