Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Trouble interpreting the environment with surface observer

Discussion in 'VR' started by Lostlogic, Sep 11, 2017.

  1. Lostlogic

    Lostlogic

    Joined:
    Sep 6, 2009
    Posts:
    693
    So, in my application I want a blob to expand and cover an area. I figured I would start by reading the vertices of the observed surfaces and use those to first determine the extents of the room and then second, for the origin point of the blob to search for neighboring areas to spread to.

    The problem is, when I parse the meshes of all observed surfaces, the extent point are nowhere near the edges of the room. Does anyone have a better way to interpret a room?

    foreach (Vector3 theVert in m_theList)
    {
    if (theVert.x < m_MinVertice.x)
    {
    Debug.LogWarningFormat("---> FOUND NEW X-MIN POINT: {0}", theVert);
    m_MinVertice.x = theVert.x;
    }
    }

    This example does not work. The minimum points are not near the extents of the room.

    Thoughts?