I have a node camera in my SceneKit scene, which is configured to allow the user to enter orbit, compensating for its rotation:
self.cameraNode.pivot = SCNMatrix4MakeTranslation(0, 0, -100);
Then the user rotates the node into the orbit of the camera.
What I would like to solve is
A) how to get the direction of the world space that the camera collides with at any given time
and then
B) how to convert this direction to the x, y, z components, which I can use to move the camera node relative to how the camera is facing (forward / backward / left / right from the camera perspective).
Thank!
source
share