I have a series of SCNPlane-type objects set to revolve around a central SCNPlane with width and height set to 0. When loading the view in my app, I get the below, which shows that my planes are being loaded correctly. Rotating them left to right with my cursor works, too. It looks like this:
However, if my cursor moves in the y-direction, the view ends up shifting so that the display is shown from another angle. Basically, the view could end up looking like this:
I don't want that to happen; I want the first image to be what I want. When I move the cursor, it should move either left or right, and not up or down.
Here is what I have tried doing:
- setting the pivot to
SCNMatrix4MakeRotation(Float(CGFloat(M_PI_2)), 0, 0, 0)
- setting the rotation to
SCNVector4(1, 0, 1, Float(CGFloat(M_PI_2))
- setting the orientation to
SCNQuaternion(0, 0, 0, Float(CGFloat(M_PI_2))
- using the
SCNLookAtConstraint
function to center all the planes around a central coordinate and face outward - using the
SCNTransformConstraint
function with a block that takes in the node and a matrix (newMatrix = incomingMatrix
) variable. If it detects that the position of an object has a value of y, thennewMatrix.m42 = 0
.newMatrix
is returned either way.
None of the above have fixed my issue. Is it even possible for me to restrict the camera to the x and z-axes only?