Getting to know Legacy

In this tutorial, you will learn how to paint walls using the Remodel-AR library's Lidar Scanner approach.

Before starting this tutorial, make sure you've completed Setting up Remodel-AR in UIKit. A link to the starting project is provided here for your convenience.

Step 1

To get started, add a new ViewController in Main.storyboard. Next create a new UIViewController file and name it LegacyViewController. Now set the ViewController's class to LegacyViewController in Main.storyboard.

Step 2

Open LidarViewController.swift and import the RemodelAR and ARKit frameworks.

import ARKit
import RemodelAR

Step 3

Open the Main.storyboard file and add ARSCNView in the storyboard. Next, connect the ARSCNView outlet to LegacyViewController.swift file.

Step 4

In LegacyViewController.swift create a lazy ARController property and assign it using RemodelARLib.makeLegacyARController(with: arscnView).

Note:

  • makeLegacyARController(with: arscnView) is a method that takes ARSCNView's instance as an argument.

  • You have to provide an ARSCNView instance that you have connected from the storyboard in this method or one you created and added programmatically.

private lazy var arController: ARController = {
    return RemodelARLib.makeLidarARController(with: arscnView)
}()

Step 5

Create a method for Configuring UI and call this method in LegacyViewController’s ViewDidLoad() method. Also create a function for creating an ARController object.

override func viewDidLoad() {
    super.viewDidLoad()

    configureUI()
}

private func createARView() {
    // Creates an ARController that uses lidar to compute geometry 
    // and occlusions. Supports devices that have a LiDAR scanner.
    arController = RemodelARLib.makeLegacyARController(with: arscnView)
}

private func configureUI() {
    createARView()
}

If at any point you need help from the Passio team, please reach out to us at support@passiolife.com

Last updated