ARKit Basic Methodology

Começar. É Gratuito
ou inscrever-se com seu endereço de e-mail
ARKit Basic Methodology por Mind Map: ARKit Basic Methodology

1. 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; } } }

2. Importing the UnityARKit plugin

3. Camera

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

3.2. Clipping Planes

3.2.1. Near: 1

3.2.2. Far: 30

3.3. "Unity AR Video" component

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

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

3.4. "Unity AR Camera Near Far" component

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

4. Camera Manager Object

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

4.2. "Unity AR Camera Manager" component

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

5. User

5.1. Spawn point

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

5.2. Object prefab

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

5.2.2. Create a RigidBody component

5.2.3. Set this object as the prefab of Spawn point

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

6. Ground Plane

6.1. Attach the debugPlanePrefab component

6.2. Reset object transformation

7. Build&Run the program on an iOS phone