듀얼모니터에 출력하기

Unity3D.VR 2017. 7. 11. 12:27

유니티에서 듀얼모니터에 두가지 오브젝트를 각각 출력하는 방법에 대해 구글링.


참고1)

- 한 씬 안에 카메라를 두개 둔다.

http://blog.naver.com/PostView.nhn?blogId=tramper2&logNo=100201063607&parentCategoryNo=&categoryNo=174&viewDate=&isShowPopularPosts=false&from=postView



참고2)

http://answers.unity3d.com/questions/14720/dual-monitor-support.html

- project.exe -popwindow



Screen.SetResolution( 가로 픽셀, 세로 픽셀, full screen 여부 );

ex ) 1920 * 1080 일 경우 > Screen.SetResolution( 1920 * 2, 1080, true )

로 해결해보려 했는데 잘안됨.



참고3)

https://alastaira.wordpress.com/2015/05/15/creating-a-unity-game-stretched-over-two-monitors/




참고 1, 3에서 단서를 얻어서 해결한 방법은.


1. 오브젝트들을 위치시키고 2개의 Orthographic(projection타입은 상관없는듯) 카메라를 적당히 세팅한다.

2. 각각의 카메라의 Target Display는 Display 1(디폴트값), Display 2로 설정함.

3. 카메라가 세팅되어있다면 activate 되도록 스크립팅. (code 1)


// ----------- code 1

using System.Collections;

using System.Collections.Generic;

using UnityEngine;


public class Test : MonoBehaviour {


    void Awake() {

        //Screen.SetResolution(1920 * 2, 1080, false);

        //Screen.SetResolution(600, 600, false);

    }


// Use this for initialization

void Start () {

        Debug.Log("displays connected: " + Display.displays.Length);

        // Display.displays[0] is the primary, default display and is always ON.

        // Check if additional displays are available and activate each.

        if (Display.displays.Length > 1)

            Display.displays[1].Activate();

        if (Display.displays.Length > 2)

            Display.displays[2].Activate();

    }

// Update is called once per frame

void Update () {

}

}

// ----------- code 1 end



4. 빌드하고 실행.




참고한 글들의 글쓴이 여러분 감사합니다.



: