I have working on ARKit and it's my beginning. I have added 3D model to display on my ARSCNView. I'm following this tutorial: https://www.appcoda.com/arkit-3d-object/
I'm using same car model which are available in this tutorial. When I add scene node to rootNode. The position of model not proper.
My code as follow:
@IBOutlet weak var sceneView: ARSCNView!
func addCar(x: Float = 0, y: Float = 0, z: Float = -0.5) {
// Safely initialize car.dae scene
guard let carScene = SCNScene(named: "car.dae") else { return }
// Initialize a SCNNode object for the car node
let carNode = SCNNode()
let carSceneChildNodes = carScene.rootNode.childNodes
carSceneChildNodes.forEach { carNode.addChildNode($0) }
carNode.position = SCNVector3(x, y, z)
carNode.scale = SCNVector3(0.5, 0.5, 0.5)
sceneView.scene.rootNode.addChildNode(carNode)
}
I want to display car in proper position as display in following screenshot:
Expected:
Output:
Can anyone explain what is my mistake ?? Help will be appreciate.

