How to make a Mixed Reality app for the Quest 3 - Part 3: Plane Visualization

Поділитися
Вставка
  • Опубліковано 5 лют 2025

КОМЕНТАРІ • 43

  • @BillBaker-l9l
    @BillBaker-l9l Рік тому +4

    I keep coming back to your channel to see when part 4 will be out. Looking forward to it. Don't keep us waiting too long.

  • @garyhildebrandt5300
    @garyhildebrandt5300 Рік тому +1

    Best videos on Mixed_Reality Application Developing on UA-cam. Super clear, perfect speed, exhaustive explanation. Thank you and keep up the good work! I am thrilled to learn more :)

    • @LudicWorlds
      @LudicWorlds  Рік тому +1

      Thanks for the kind words! Working on the next MR tutorial right now. :)

  • @Sangwoo_ka
    @Sangwoo_ka Рік тому +1

    THE BEST TUTORIAL FOR MR SO FAR

  • @Royvcent
    @Royvcent 11 місяців тому

    I've checked Udemy but I couldn't find a course explaining all this like the way you do it, your format is great. Would also like to read additional documentation on all the options you're showing us. Instant buy for me if you would create a full course on this.

    • @LudicWorlds
      @LudicWorlds  11 місяців тому +1

      Thanks for the encouragement! I'm actually seriously considering creating a Udemy course (which would certainly go into more detail than I do here).

  • @edusukofilms
    @edusukofilms Рік тому +2

    Great tutorial. Thank you.

  • @danamuise4117
    @danamuise4117 11 місяців тому

    I love this series, thank you!!

  • @3laps2p1simracing9
    @3laps2p1simracing9 Рік тому +1

    Great videos, im using this info on my current app. I do have one question. You know when you put the headset on and a message comes up and says it has noticed new obstacles in your area? And it shows the red lines of the new objects, is that data available to use as well?

    • @LudicWorlds
      @LudicWorlds  Рік тому +1

      Unfortunately, I don't think that this 'obstacle detection' data is accessible (through the 'Unity OpenXR Meta' package or the 'Meta SDK'). At least, I'm not aware of any way to get this data.

    • @3laps2p1simracing9
      @3laps2p1simracing9 Рік тому

      Thanks for the reply. I appreciate your time.

  • @Kingdomax
    @Kingdomax Рік тому

    Well explained as usual. Maybe Spatial Anchor could be next ?

    • @LudicWorlds
      @LudicWorlds  Рік тому +3

      Thanks! :) I'm currently making a short tutorial about physics interactions. But the next one will be 'Spatial Anchors' for sure!

  • @康博-y7e
    @康博-y7e Місяць тому

    Is this code file something that requires payment to access?

  • @TheRealHalt
    @TheRealHalt Місяць тому

    i need the script for plane detection mine wont work :(

  • @bbbbbbbb3158
    @bbbbbbbb3158 Рік тому

    Very well made video!

  • @william0405
    @william0405 Рік тому

    This tutorial is very useful.Thank you

  • @Filmblanc
    @Filmblanc 9 місяців тому

    How can I make it so that the planes are off when i first run the game? Instead of having them on and having to push a button to turn them off?

  • @andrewj22
    @andrewj22 11 місяців тому

    All this is great, but the big question is if there's a way to develop an MR app for both the Quest and Vision Pro. If you want to develop for both platforms, what's the best approach?

  • @christiantoffalori5355
    @christiantoffalori5355 Рік тому

    With Oculus Quest it is possible to achieve exact plane detection, automatically obtaining the angles of the physical object?

  • @samuelguillot4894
    @samuelguillot4894 Рік тому

    Thank you, well explained !

  • @giannissotiropoulos2040
    @giannissotiropoulos2040 9 місяців тому

    Thank you for the great tutorial. I have a question. I followed along line by line from your script, but after I save and close, I don't see any "Toggle Planes Action" field. Instead I get this error message from unity: "error CS0246: The type or namespace name 'InputActionReference' could not be found (are you missing a using directive or an assembly reference?)". I also tried making the variable public but that did'n work as well. Would you happen to know what did I do wrong?

    • @LudicWorlds
      @LudicWorlds  9 місяців тому

      Check the 'using' statements at the top of file. Make sure they include the following using directive:
      using UnityEngine.InputSystem;

    • @SwopSlogan
      @SwopSlogan 9 місяців тому

      Same problem here. Checked my using statements, no problem there. I restarted the project, had to open it in safe mode, closed it again, opened it again and my scene was completly empty. It only made it worse, bc now most of the work is gone

    • @AndrewTSq
      @AndrewTSq 5 місяців тому

      I have the same problem :/ edit : i had a missing ; on a line.. when I started in safe mode, it showed the line where the compilation error occured., after changing and saved the file it worked.

  • @JoseAfsharipour
    @JoseAfsharipour 11 місяців тому

    Thanks for the great work! I have a question. I tried to follow along line by line from your script, but after I save and close, I don't see any "Toggle Planes Action" field. Maybe I have done something wrong in the script?

    • @JoseAfsharipour
      @JoseAfsharipour 11 місяців тому

      This is everything I have:
      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      using UnityEngine.InputSystem;
      using UnityEngine.XR.ARFoundation;
      [RequireComponent(typeof(ARPlaneManager))]
      public class SceneController : MonoBehaviour
      {
      [SerializeField]
      private InputActionReference _togglePlanesAction;

      private ARPlaneManager _planeManager;
      private bool _isVisible = true;
      private int _numPlanesAddedOccured = 0;
      // Start is called before the first frame update
      void Start()
      {
      Debug.Log("-> SceneController::Start()")
      _planeManager = GetComponent();
      if (_planeManager is null)
      {
      Debug.LogError("-> Cannot find 'ARPlaneManager' :( ");
      }
      _togglePlanesAction.action.performed += OnTogglePlanesAction;
      _planeManager.planesChanged += OnPlanesChanged;
      }
      // Update is called once per frame
      void Update()
      {

      }
      private void OnTogglePlanesAction(InputAction.CallbackContext obj)
      {
      _isVisible = !_isVisible;
      float fillAlpha = _isVisible ? 0.3f : 0f;
      float lineAlpha = _isVisible ? 1.0f : 0f;
      Debug.Log("-> OnTogglePlanesAction() - trackables.count: " + _planeManager.trackables.count);
      foreach (var plane in _planeManager.trackables)
      {
      SetPlaneAlpha(plane, fillAlpha, lineAlpha)
      }
      }
      private void SetPlaneAlpha(ARPlane plane, float fillAlpha, float lineAlpha)
      {
      var meshRenderer = plane.GetComponentInChildren();
      var lineRenderer = plane.GetComponentInChildren();
      if (meshRenderer != null)
      {
      Color color = meshRenderer.material.color;
      color.a = fillAlpha;
      meshRenderer.material.color = color;
      }
      if (lineRenderer != null)
      {
      // Get the current start and end colors
      Color startColor = lineRenderer.startColor;
      Color endColor = lineRenderer.endColor;

      // Set the alpha component
      startColor.a = lineAlpha;
      endColor.a = endColor;
      //Apply the new colors with updated alpha
      lineRenderer.startColor = startColor;
      lineRenderer.endColor = endColor;
      }
      }
      private void OnPlanesChanged(ARPlanesChangedEventArgs args)
      {
      if (args.added.count >0)
      {
      _numPlanesAddedOccured++;
      foreach (var plane in _planeManager.trackables)
      {
      PrintPlaneLabel(plane);
      }
      Debug.Log("-> Number of planes: " + _planeManager.trackables.count)
      Debug.Log("-> Num planes added Occurred: " + _numPlanesAddedOccured)
      }
      }
      private void PrintPlaneLabel(ARPlane plane)
      {
      string label = plane.classification.ToString();
      string log = $"Plane ID: {plane.trackableId}, Label:{label}";
      Debug.Log(log);
      }
      void OnDestroy()
      {
      Debug.Log("-> SceneController::OnDestroy()");
      _togglePlanesAction.action.performed -= OnTogglePlanesAction;
      _planeManager.planesChanged -= OnPlanesChanged;
      }
      }

    • @LudicWorlds
      @LudicWorlds  11 місяців тому

      Thankyou! Did you precede the '_togglePlanesAction' variable with the [SerializeField] attribute? Like this:
      [SerializeField]
      private InputActionReference _togglePlanesAction;
      Alternatively, you can also make the variable 'public' (as this should also expose the variable in Unity's Inspector)
      public InputActionReference _togglePlanesAction;
      Also, ensure that Unity is not in 'Play Mode' while editing scripts (or components in general). Hope this helps!

  • @samanthaah263
    @samanthaah263 Рік тому

    When I double click the Scene controller script it doesn’t open like yours. It asks me to select an app to open the file and gives me options such as notepad, word or windows media player. Do I have to add something to my project to get it to open in the project like yours?

    • @LudicWorlds
      @LudicWorlds  Рік тому +1

      Did you opt to install Visual Studio when you first installed Unity? If not, go back into 'Unity Hub', go to the 'Installs' section, click the 'cog' icon next to the Unity version that you are using, and select 'Add modules'. From there you can install 'Microsoft Visual Studio Community' Edition.
      If Visual Studio IS installed: In the Unity Editor, go to the top menu-bar and select: 'Edit' -> 'Preferences'. In the 'Preferences' window select 'External Tools'. Make sure that 'External Script Editor' is set to 'Visual Studio'.

    • @samanthaah263
      @samanthaah263 Рік тому

      Thank you so much I didn’t have it installed. I got it now. I don’t know anything about coding literally learning from scratch. I added the second line the “[serializefield] and “inputactionreference “ isn’t turning green. Does it need to?

    • @LudicWorlds
      @LudicWorlds  Рік тому +1

      ​@@samanthaah263 Its important to type variable Types exactly as shown in the example. For instance, make sure you type "InputActionReference" not just “inputactionreference“. Whether it turns green specifically, will depends on the color scheme you have set in Visual Studio (which could be different from mine).

  • @eBautistaBau
    @eBautistaBau Рік тому

    Thanks for your tutorials, are very useful and clear, excuse me, I am overload 3d models using MRUK, I am having a little issues, the 3D models are moving to the left and the front (compared to the phyisical space (Passthrough)), they move very slow but it will make the app does not work well, do you had similar isssue? thanks in advance.

    • @LudicWorlds
      @LudicWorlds  11 місяців тому

      Are these animated characters? With static 3d models I've not noticed drifting while the app is running.

    • @eBautistaBau
      @eBautistaBau 11 місяців тому

      @@LudicWorlds No, actually they are static, but thanks for your feedback. I will keep trying.

  • @bbbbbbbb3158
    @bbbbbbbb3158 Рік тому

    One question, after creating the Scene Controller Script I dont have the Toggle Planes Action inside the Inspector. Would you happen to know what did I do wrong?

    • @bbbbbbbb3158
      @bbbbbbbb3158 Рік тому +1

      nvm, got it

    • @JoseAfsharipour
      @JoseAfsharipour 11 місяців тому

      Having the same issue here. Could you please explain what went wrong, and how you solved the problem?

    • @bbbbbbbb3158
      @bbbbbbbb3158 11 місяців тому

      @@JoseAfsharipour The problem is inside the script, once you have 100% what he has, it will work!

  • @salah4501
    @salah4501 Рік тому

    👍

  • @underbelly69
    @underbelly69 Рік тому

    is there any mask plane component that can mask virtual geometry behind it (or perhaps a stencil component)? eg. lets put a virtual door in a real room - wearing a quest3, we see thru the door into another room - a virtual 3d environment - but to the left or right of the door we see our room.. and when we enter the door - we enter a virtual space wider than the door.. looking back we see the door is now a portal back into the real room
    so how to mask the virtual room so only the door is seen when standing in the real room?

    • @LudicWorlds
      @LudicWorlds  Рік тому

      Maybe this tutorial can help? (AR Portal Setup With URP) ua-cam.com/video/Y1lzXWD8NN8/v-deo.html

  • @康博-y7e
    @康博-y7e Місяць тому

    Is this code file something that requires payment to access?