I am new to SceneKit and not able to get a hold of the Xcode Scene Editor. I am doing some research on iOS ARKit which was introduced recently. I created a sample project with SceneKit template. It comes with a default ship.scn.
I deleted this ship.scn and created a new SCN, drag and dropped a sample .DAE model into this SCN. I am able to view the object that I placed in .SCN file clearly with all the textures.
But when I run it in the device, the object appears on top of camera and zoomed in and not positioning properly in the camera frame.
I had to give the position of the object as x: 0
, y: -60
, z: -60
in Xcode Scene Editor to make it available in the center of the camera frame. But if I do this, the object will always be -60
degree from camera and I will not be able to move/resize it correctly with touch gestures.
Anyone please help me on how to make the object available at the center of camera frame such that the object also supports rotation/resize/movement etc.
I created the scene like below and added it to scene view:
let scene = SCNScene(named: "art.scnassets/Lowpoly_Notebook_2.scn")!
I have used Apple's link as reference for moving/resizing objects.
As orangenkopf quoted, My problem was with the model size. It was huge and hence didn't get rendered properly. When i change the scale of the object in Xcode Scene editor to a minimum value, i am able to view the object correctly and place it anywhere needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With