/// <summary>
    /// Draws the Unity GUI.
    /// </summary>
    public void OnGUI()
    {
        GUI.color = Color.white;
        if (GUI.Button(new Rect(Screen.width - 160, 20, 140, 80), "<size=30>Clear</size>"))
        {
            m_dynamicMesh.Clear();
            m_tangoApplication.Tango3DRClear();
        }

        string text = m_isEnabled ? "Pause" : "Resume";

        if (GUI.Button(new Rect(Screen.width - 160, 120, 140, 80), "<size=30>" + text + "</size>"))
        {
            m_isEnabled = !m_isEnabled;
            m_tangoApplication.Set3DReconstructionEnabled(m_isEnabled);
        }

        if (GUI.Button(new Rect(Screen.width - 160, 220, 140, 80), "<size=30>Export</size>"))
        {
            var    fileName = Guid.NewGuid().ToString();
            string filepath = string.Format("/sdcard/{0}.obj", fileName);
            m_dynamicMesh.ExportMeshToObj(filepath);
            Debug.Log(filepath);
        }
    }
    /// <summary>
    /// Draws the Unity GUI.
    /// </summary>
    public void OnGUI()
    {
        GUI.color = Color.white;
        if (GUI.Button(new Rect(Screen.width - 160, 20, 140, 80), "<size=30>Clear</size>"))
        {
            m_dynamicMesh.Clear();
            m_tangoApplication.Tango3DRClear();
        }

        string text = m_isEnabled ? "Pause" : "Resume";

        if (GUI.Button(new Rect(Screen.width - 160, 120, 140, 80), "<size=30>" + text + "</size>"))
        {
            m_isEnabled = !m_isEnabled;
            m_tangoApplication.Set3DReconstructionEnabled(m_isEnabled);
        }

        if (GUI.Button(new Rect(Screen.width - 160, 220, 140, 80), "<size=30>Export</size>"))
        {
            string filepath = "/sdcard/DemoMesh.obj";
            m_dynamicMesh.ExportMeshToObj(filepath);
            Debug.Log(filepath);

            /*
             *  switch scene to car design scene here
             */
        }
    }
Beispiel #3
0
    public void onExportBtn()
    {
        string filepath = "/sdcard/DemoMesh.obj";

        m_dynamicMesh.GetComponent <MeshHandler> ().CutMesh();

        m_dynamicMesh.ExportMeshToObj(filepath);
        Debug.Log(filepath);
    }
Beispiel #4
0
    /// <summary>
    /// Draws the Unity GUI.
    /// </summary>
    public void OnGUI()
    {
        GUI.color = Color.white;
        if (GUI.Button(new Rect(Screen.width - 160, 20, 140, 80), "<size=30>Clear</size>"))
        {
            m_dynamicMesh.Clear();
            m_tangoApplication.Tango3DRClear();
        }

        string text = m_isEnabled ? "Pause" : "Resume";

        if (GUI.Button(new Rect(Screen.width - 160, 120, 140, 80), "<size=30>" + text + "</size>"))
        {
            m_isEnabled = !m_isEnabled;
            m_tangoApplication.Set3DReconstructionEnabled(m_isEnabled);
        }

        if (GUI.Button(new Rect(Screen.width - 160, 220, 140, 80), "<size=30>Export</size>"))
        {
            string filepath = dataWriter.exportPath + "/" + exportName + ".obj";
            m_dynamicMesh.ExportMeshToObj(filepath);
            Debug.Log(filepath);
        }

        string poseStatus = m_poseEnabled ? "Pose is on" : "Pose is off";

        if (GUI.Button(new Rect(Screen.width - 160, 320, 140, 80), "<size=24>" + poseStatus + "</size>"))
        {
            // Toggle
            m_poseEnabled = !m_poseEnabled;
            dataWriter.poseIsRecording = m_poseEnabled;
        }

        string depthStatus = m_depthEnabled ? "Depth is on" : "Depth is off";

        if (GUI.Button(new Rect(Screen.width - 160, 420, 140, 80), "<size=24>" + depthStatus + "</size>"))
        {
            // Toggle
            m_depthEnabled = !m_depthEnabled;
            dataWriter.depthIsRecording = m_depthEnabled;
        }

        string imageStatus = m_imageEnabled ? "Image is on" : "Image is off";

        if (GUI.Button(new Rect(Screen.width - 160, 520, 140, 80), "<size=24>" + imageStatus + "</size>"))
        {
            // Toggle
            m_imageEnabled = !m_imageEnabled;
            dataWriter.imageIsRecording = m_imageEnabled;
        }
    }
    /// <summary>
    /// Draws the Unity GUI.
    /// </summary>
    public void OnGUI()
    {
        GUI.color = Color.white;
        if (GUI.Button(new Rect(Screen.width - 160, 20, 140, 80), "<size=30>Clear</size>"))
        {
            m_dynamicMesh.Clear();
            m_tangoApplication.Tango3DRClear();
        }

        string text = m_isEnabled ? "Pause" : "Resume";

        if (GUI.Button(new Rect(Screen.width - 160, 120, 140, 80), "<size=30>" + text + "</size>"))
        {
            m_isEnabled = !m_isEnabled;
            m_tangoApplication.Set3DReconstructionEnabled(m_isEnabled);

            GameObject smode = GameObject.FindGameObjectsWithTag("ScanMode")[0];
            smode.active = false;

            GameObject pmode = GameObject.FindGameObjectsWithTag("PlayMode")[0];
            pmode.active = true;
        }

        if (GUI.Button(new Rect(Screen.width - 160, 220, 140, 80), "<size=30>Export</size>"))
        {
            string filepath = "/sdcard/CourierDropMap.obj";
            m_dynamicMesh.ExportMeshToObj(filepath);
            Debug.Log(filepath);

            /*
             *  switch scene to car design scene here
             */

            Application.LoadLevel(m_mainMapScene);
        }
    }