Exemplo n.º 1
0
    private void ReDrawUI3D()
    {
        DestroyUI3D();

        //Draw points with "axis"
        if (spawnedWalls.Count >= 3)
        {
            for (int i = 0; i < spawnedWalls.Count - 2; i++)
            {
                for (int j = i + 1; j < spawnedWalls.Count - 1; j++)
                {
                    for (int k = j + 1; k < spawnedWalls.Count; k++)
                    {
                        DrawOneCorner(spawnedWalls[i], spawnedWalls[j], spawnedWalls[k]);
                    }
                }
            }
        }

        foreach (List <Vector3> vs in wallPointsList.Values)
        {
            GameObject go = new GameObject("Wall");

            //Draw lines between points
            int count = vs.Count;
            for (int i = 0; i < count - 1; i++)
            {
                for (int j = i; j < count; j++)
                {
                    Math3DUtils.CreateLine(vs[i], vs[j]).transform.parent = go.transform;
                }
            }

            //Draw quad
            if (vs.Count == 4)
            {
                GameObject goQuad = Math3DUtils.CreateQuad(vs.ToArray(), matWall, true);
                wallsQuads.Add(goQuad);
                goQuad.transform.parent = go.transform;
            }

            ui3dGOs.Add(go);
        }

        //Draw photo frame from photo taken // also load fov ?
        foreach (GameObject go in spawnedPhotos)
        {
            projectors.Add(DrawProjector(dirname + "/" + go.name, go.transform.position, go.transform.rotation));
        }

        // Add Projector to dropdown
        if (dropdownCamera)
        {
            //Draw photo frame and add them to dropdown
            dropdownCameraValues.Add("All", null);
            foreach (GameObject projector in projectors)
            {
                dropdownCameraValues.Add(projector.name.Substring(14), projector);
            }
            dropdownCamera.AddOptions(dropdownCameraValues.Keys.ToList <string>());
        }
    }