Reputation: 4589
I have allowsCameraControl property set to true. I need my camera to tell me what it's position and rotation is, while I move it around with pinch and pan gestures so I can later update my camera to that position. Is there some function that is called every rendering moment so I can put println: statement in it? The other option I could think was to set a didSet statement at camera's position and rotation property but I have no idea how to do that if I'm not the one defining the property in the first place.
Upvotes: 2
Views: 200
Reputation: 4589
Found a way around it using custom buttons(moveLeft,moveRight,rotateLeft etc..) to move the camera(and report current position) around 3D space. Works great. Can't tell if mnuages's suggestion works, but it looks allright.
Upvotes: 1
Reputation: 13462
you can use delegation methods such as SCNSceneRendererDelegate
's -renderer:didRenderScene:atTime:
and you can access the "free" camera by using the view's pointOfView
.
Upvotes: 0