0

I am new to SceneKit and I could use your help with the following: I have two SCNViews - a large one (skView) showing the scene for the user which can be manipulated by the user with the standard allowsCameraControl option enabled - another small one (coordinateCrossView) in the left corner which shows a coordinate cross that I would like to mirror any camera navigation the user performs in the large SCNView

coordinate cross SCNView

I implemented it by making the ViewController which holds both SCNViews a SCNRendererDelegate and by updating the cross' orientation in the renderer: updateAtTime: method like so:

- (void)renderer:(id<SCNSceneRenderer>)renderer updateAtTime:(NSTimeInterval)time {

    [self.coordinateCrossView.scene.rootNode childNodeWithName:@"cross" recursively:YES].orientation = self.skView.pointOfView.orientation;
    [self.coordinateCrossView setNeedsDisplay];
}

So far so good. However, this only works when the user is manipulating the large SCNView with a finger on the screen. After as swipe gesture when the finger leaves the screen the object in the large SCNView continues to rotate a bit - but the coordinate cross is not updated. Any ideas why this behavior is not captured by the pointOfView.orientation changes?

Wyetro
  • 8,439
  • 9
  • 46
  • 64
user1612877
  • 391
  • 1
  • 5
  • 19

1 Answers1

0

I found out what the problem was: the small coordinateCrossView was not continuously updated and therefore even though the coordinate cross' orientation was changed, the view didn't show it - even though setNeedsDisplay was called. I fixed the issue by setting the isPlaying property of the coordinateCrossView which forces it to be updated.

user1612877
  • 391
  • 1
  • 5
  • 19