SceneKit Changing Center of Rotation and Camera

I am using MBS SceneKit quire successfully for a current project, but I’ve run into something I think should be simple, but it’s escaping me.

Generally I have an object that I the tap and drag rotates in the center of the frame. Side to side dragging just rotates it, it doesn’t move it side to side.

Now I have several other object near it visually. I’d like to shift my camera to point to one of them as the center of the scene, rotate around it like it’s the origin. Then I need to be able to switch back.

I can think of several approaches, but I’m sure there is something much more simple than what I’ve been attempting.

Any help?

I would have thought that simply assigning a SCNLookAtConstraintMBS of the desired node would have been enough.
While it does look at that, it doesn’t resented the rotation about that point.
Do I have to transform the camera’s position?

you saw the camera example project?

you can change camera’s position and angles.

I did. It’s not quite what I need.

I don’t mind if the camera stays in the same position or moves. It needs to point at something other than the xyz=0,0,0
The problem is that the rotation still occurs around the xyz 0,0,0 point and I need it to rotate around the newly selected node.

Imagine a scene with two spheres: one at 0,0,0, one at 100, 0,0
When you drag the mouse from side to side it looks like the 2nd is rotating around the 1st.
Now I want to have the 2nd become the center and the first to rotate around it.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.