Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Position object in Scene Editor in Xcode 9 beta

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.

like image 687
yaali Avatar asked Jun 28 '17 07:06

yaali


1 Answers

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.

like image 131
yaali Avatar answered Oct 04 '22 15:10

yaali