1

I have imported a .dae file from SketchUp:

https://i.stack.imgur.com/s3Rqa.png

1: How can I change the size of the bounding box?
2: Why isn't the pivot in the center of the SCNNode and how can I change this. (I would prefer a solution thats not programmatically.)

1 Answers1

2

If you want to change those properties without code you need to change them in SketchUp. Position and scale your model there and these changes should apply in Xcode as well. To change the size of the model in Xcode you can set the models scale to a small value.

Changing a nodes pivot is not supported in the SceneKit editor. You can either

  • add your model as a subnode of an empty 'parent' node and position your model relative to this parent. Later you change the position of the parent node to move the node around.

  • just change the pivot in code, it is really easy. Add the boundingBox.min and max vectors and divide them by 2. Then you set the pivot to a translation matrix (via SCNMatrix4MakeTranslation from the vector you have computed.

jlsiewert
  • 3,494
  • 18
  • 41
  • Thanks this helped me a lot. – Steple Steple Jul 21 '17 at 11:11
  • 1
    Also note that while the SceneKit editor in Xcode may not have UI for setting a pivot, the `.scn` file format still supports it. So you could write a trivial app that loads an asset, sets the pivot, and saves out the file... – rickster Jul 23 '17 at 04:45