我尝试将 ScenKit 场景添加到 WKInterfaceController,创建了 IBOutlet WKInterfaceSCNScene* sceneInterface;(如记录)并将场景属性放入刚刚创建的 SceneKit 场景的界面构建器中,但我没有在手表上看到该场景。
我也尝试过使用 presentScene 方法并以编程方式坐在场景中,如下所示:
SCNScene *scene = [SCNScene sceneNamed:@"circleScene.scn"];
// create and add a camera to the scene
SCNNode *cameraNode = [SCNNode node];
cameraNode.camera = [SCNCamera camera];
[scene.rootNode addChildNode:cameraNode];
// place the camera
cameraNode.position = SCNVector3Make(0, 0, 15);
// create and add a light to the scene
SCNNode *lightNode = [SCNNode node];
lightNode.light = [SCNLight light];
lightNode.light.type = SCNLightTypeOmni;
lightNode.position = SCNVector3Make(0, 10, 10);
[scene.rootNode addChildNode:lightNode];
// create and add an ambient light to the scene
SCNNode *ambientLightNode = [SCNNode node];
ambientLightNode.light = [SCNLight light];
ambientLightNode.light.type = SCNLightTypeAmbient;
ambientLightNode.light.color = [UIColor darkGrayColor];
[scene.rootNode addChildNode:ambientLightNode];
[self.sceneInterface presentScene:scene withTransition:[SKTransition fadeWithDuration:1] incomingPointOfView:lightNode completionHandler:nil];
我做错了什么?