Search code examples
swiftios11arkit

ARKit camera initial position?


override func viewDidLoad() {
    super.viewDidLoad()

    // Set the view's delegate
    sceneView.delegate = self

    // Show statistics such as fps and timing information
    sceneView.showsStatistics = true

    // Create a new scene
    let scene = SCNScene(named: "art.scnassets/exemple.dae")!


    // Set the scene to the view
    sceneView.scene = scene

}

I have this model that I imported but I can not place the camera as I want, how can I connect the camera to the camera of my 3D model? or how can I manage the initial camera of the AR?


Solution

  • To change the default orientation of your model, first select your model file from Xcode navigator then set camera Point of view to Front (from the bottom bar). This will show the exact view of your model when it is loaded in your scene.

    Then, to change the position and orientation of the model, select the Node inspector from the right side menu (the cube icon) and change the Euler x, y, z values.