Hi i have a very simple scene that contains 3 nodes:
- Light
- Camera
- Stl
When placing the STL it is very small so the user has to zoom the camera an aweful lot. What i would like to do is to zoom the camera to the fit STL node programatically but im not sure how.
This is wat i have so far:
stlNode = .... // Custom node
lightNode = scene?.rootNode.childNode(withName: "omni", recursively: true)
cameraNode = scene?.rootNode.childNode(withName: "camera", recursively: true)
cameraNode.constraints = [SCNLookAtConstraint(target: stlNode)]
// Zoom to fit the stlNode here.
scene?.rootNode.addChildNode(stlNode)