AR Object Visualizer

A Unity ARFoundation Android Application

This is an Augmented Reality application that uses plane detection to provide a way for the user to place Virtual 3D objects on a plane. It also features some basic functionality with on-screen gestures to scale, rotate, and move virtual objects.

  • Using ARCore, ARKit, ARFoundation
  • Places a Virtual 3D object on a plane
  • FocusSquare to place on the plane
  • 3D UI for changing car color
  • On-screen gestures to scale, rotate, and move the virtual object
  • Supported on Android

Project Demo:



Screenshots:









Code Sample:

    private void UpdatePlacementPose()                      
        {
            var screenCenter = Camera.current.ViewportToScreenPoint(new Vector3(0.5f, 0.5f));
            var hits = new List();                                
            
            arOrigin.GetComponent().Raycast(screenCenter, hits, UnityEngine.XR.ARSubsystems.TrackableType.PlaneEstimated);
            
            placementPoseIsValid = hits.Count > 0;
            if (placementPoseIsValid)
            {
                placementPose = hits[0].pose;
            
                var cameraForward = Camera.current.transform.forward;
                var cameraBearing = new Vector3(cameraForward.x, 0, cameraForward.z).normalized;
                placementPose.rotation = Quaternion.LookRotation(cameraBearing);
            }
        }