Sirop4ik
Sirop4ik

Reputation: 5243

How to disable Camera Framing that enframes all the content in the scene?

I try to build the scene where I have 2 nodes. They have different size: one is 10 times bigger than the other. The problem is that the camera tries to cover (zoom out) all the objects on the scene, so a user can see a full picture on the screen.

I know there is an option to disable this feature, so the camera will remain in the same position where it was before without trying to zoom out in order to cover all the objects on the screen.

Upvotes: 1

Views: 164

Answers (2)

Sirop4ik
Sirop4ik

Reputation: 5243

What I was need to do is to save pointOfView.worldTransform before substitute the scene and after that return it back.

...
let trans: SCNMatrix4 = pointOfView.worldTransform
scnView.pointOfView!.setWorldTransform(trans)
...

Upvotes: 0

Andy Jazz
Andy Jazz

Reputation: 58113

It's easy to achieve:

sceneView.pointOfView?.position.z = 2.0

Upvotes: 1

Related Questions