0

I have a scene with an explicit camera in it, and with allowsCameraControl enabled. Before the user modifies the camera, I can programmatically set aspects of the camera and camera node. For example fieldOfView, position. But once the user interacts with the camera, eg pan or rotate, those fields no longer have any effect. I've walked through the scene and verified that there's still only a single camera, and I'm verifying that the values I'm applying programmatically are not being stomped by something. It's as if, once the user started interaction, a copy of my camera node was made, and that's now the active camera. However a recursive search from the root reveals only one camera.

orion elenzil
  • 4,484
  • 3
  • 37
  • 49
  • This is by design. SceneKit creates internal camera objects on the fly, when the user starts to rotate the main Camera using the allowsCameraControl = true option. When you i.Ex. double tap the screen, the camera returns to it's initial camera. – ZAY Sep 13 '22 at 09:20
  • thanks @ZAY. So if I wanted a Button in the app like "Reset View" or something, that's not going to cohabitate with `allowCameraControl` ? – orion elenzil Sep 13 '22 at 16:33
  • I had the same problem once, and I found unfortunatly no solution to do this in an other way other than double-tapping the screen. (this is all internal stuff, that goes along with this Boolian value, that includes also the Double Tap Recognizer). You could implement your very own mechanism to achive Camera rotation and zooming... then you would have full-control. – ZAY Sep 14 '22 at 08:30
  • Seems it's answered, but a basic camera class starter kit here [68506605]. – Voltan Oct 12 '22 at 03:58
  • @Voltan - I think there may be a broken / missing link in your comment. – orion elenzil Oct 14 '22 at 15:34
  • 1
    Sorry, put 68506605 in the Stack O search bar. – Voltan Oct 14 '22 at 15:59

0 Answers0