ARKit Basic Methodology

Get Started. It's Free
or sign up with your email address
ARKit Basic Methodology by Mind Map: ARKit Basic Methodology

1. Ground Plane

1.1. Attach the debugPlanePrefab component

1.2. Reset object transformation

2. Build&Run the program on an iOS phone

3. using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.XR.iOS; public class SpawnPoint : MonoBehaviour{ public GameObject spherePrefab; public float force = 5.0f; private Rigidbody rb; void Update(){ var touch = Input.GetTouch (0); if (touch.phase = TouchPhase.Began) { GameObject sphere = Instantiate (spherePrefab, transform.position, transform.rotation); sphere.GetComponent<Rigidbody> ().velocity = transform.forward * force; } } }

4. Importing the UnityARKit plugin

5. Camera

5.1. "Clear Flags" as "Depth Only" to delete the default null background

5.2. Clipping Planes

5.2.1. Near: 1

5.2.2. Far: 30

5.3. "Unity AR Video" component

5.3.1. Is responsible for filling the "Depth Only" option

5.3.2. "Clear Material" as YUVMaterial, a shader that fills the background buffer with real-world video

5.4. "Unity AR Camera Near Far" component

5.4.1. An intermediary component between ARSession and Camera. Gathers and converts world data.

6. Camera Manager Object

6.1. Manages the Camera Object: Alignment, plane detection orientation, point cloud data, and light estimation.

6.2. "Unity AR Camera Manager" component

6.2.1. Manages "Camera". Need to set the variable that refers to the main camera created above.

7. User

7.1. Spawn point

7.1.1. Create an empty object, and attach the spawn point to the main camera created above.

7.2. Object prefab

7.2.1. Set three-dimensional scales, Xy, Y and Z, to 0.1. This value is arrived at through trial and error

7.2.2. Create a RigidBody component

7.2.3. Set this object as the prefab of Spawn point

7.2.4. Delete the sphere, as its prefab is stored as a reference