👋
NRSDK(Old)
v1.10.2
v1.10.2
  • NRSDK Fundamentals
    • NRSDK Overview
    • XREAL Devices
      • XREAL Glasses
      • Controller
      • Compatibility
    • Getting Started with NRSDK
    • Sample Code
    • Tutorials
    • Release Note
      • NRSDK 1.10.2
      • NRSDK 1.9.5
      • NRSDK 1.9.3
      • NRSDK 1.9.1
      • NRSDK 1.8.0
      • NRSDK 1.7.0
      • NRSDK 1.6.0
  • Development
    • Input and Camera
      • NRInput
      • Interact with Unity UI (Tutorial)
      • Customize Controller UI
      • NRCameraRig
    • Hand Tracking
    • Image Tracking
    • Plane Detection (Tutorial)
      • Overview
      • Import the package
      • Detect planes in the real world
      • Perform a hit test against detected planes
      • Add a car
      • Add gems
      • Wrap up
    • Depth Mesh
      • Meshing Manager Overview
      • Use Meshes in the Editor
      • Tutorial: Mesh Collision
    • Tools
      • First Person View
      • Emulator
      • Notification popup
      • Reset Camera
    • MRTK Integration
  • Advanced
    • Access RGB Camera
    • NRSDK Coordinate Systems
  • XR Streaming
  • Frequently Asked Questions
Powered by GitBook
On this page
  • Add a PlaneDetector component
  • Run the app

Was this helpful?

  1. Development
  2. Plane Detection (Tutorial)

Detect planes in the real world

PreviousImport the packageNextPerform a hit test against detected planes

Last updated 1 year ago

Was this helpful?

Now that a basic scene has been set up, you can start on developing the game. In this step, you will detect planes and draw them to the scene.

Add a PlaneDetector component

A PlaneDetector detects and creates, updates, and removes game objects when the device's understanding of the environment changes.

1.Using the Hierarchy pane, create an empty GameObject.

2. Rename it to PlaneDetector. This component will display planes until one is selected by the player.

3. Select the new game object. Within the Inspector pane, click Add Component to add a PlaneDetector

4. Configure the PlaneDetectorby setting the Detected Plane Prefab field:

  • Click the button next to None to bring up the Select GameObject window.

  • Select the Assets tab and search for WoodenPlaneVisualizer.

This prefab from the starter package provides a wooden floor texture that will be used as the plane decoration.

Run the app

2. Point your glasses at a horizontal real-world surface and move your glasses around to improve NRSDK's understanding of the world.

3. When NRSDK has detected a plane, you should see a wood texture cover real-world surfaces. The Plane Detector instantiates the given Detected Plane Prefab for each detected plane.

1.Build and deploy your app as described in Step 7 and 8 in to test your changes

Getting Started with NRSDK