• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by Chromega · May 18, 2014 at 10:00 PM · oculusdisplayoculusriftmultiple-monitorsmonitor

Multiple Game Cameras with the Oculus Rift

Hey folks,

Here's what I want to do: A game I'm working on is an asymmetric two player game, where one player is in the Rift (w/controller), and one player uses a normal monitor (w/mouse & keyboard). I've been doing this networked on 2 machines, but for a variety of reasons, I want to make a version where both players can play on one machine.

I've done some researching and I've been able to get this working on my machine. I have 3 cameras with appropriate viewport rects, I have the game running with the -popupwindow flag to remove borders, and I'm setting the screen's resolution to the appropriate resolution.

However, I want something more robust. I'm making a lot of assumptions in my prototype scene. I'm assuming that:

  • I'm running Windows (-popupwindow is marked as working on Windows only)
  • I know the resolution of my main monitor and my Rift and their layout ahead of time
  • The game window will always position itself in the right place

Anyone have any tips as to how I can make this more robust? Are there (preferable graphics card/OS invariant) ways I can get individual display information? I've played around with the Display class, but it's not quite what I want (it reads my 2 normal monitors as one really wide display, when I really want the information on the displays separately). Any way to get behavior like -popupwindow on Mac? I've found ways to move the Unity window on Windows (http://forum.unity3d.com/threads/84252-Window-manipulation-in-unity), but I have no idea how to do so on Mac.

I know there are a lot of questions here, but I'm hoping that there are others who have attempted this that may have answers. I think these types of games are very exciting, I would just love to make something I can easily share, and not require users to manually enter in their display configuration in some batch file/pre-game screen, for instance.

Thanks.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image alcamedes · Aug 16, 2014 at 07:24 AM 0
Share

Hi Chromega! Very good questions. I'd be happy to even get this work at the level you say you do in your post. Any chance you'd be able to share how you did this? I'm using unity in my graduate thesis for play based procedural mesh generation and I'm going to need several displays. $$anonymous$$eep up the good work!

avatar image mdespault · Jan 09, 2015 at 10:23 PM 0
Share

How were you able to prevent the oculus cameras from hijacking the entire window, regardless of the viewport rect settings? In my OVRCameraRig, I've set my viewports for both left and right eyes to be X=0.5, Y=0, W=0.5, H=1.

I'd expect that camera to be using 50% of the window, split between the two views required for stereoscopic vision. Ins$$anonymous$$d, it will always span the entire window.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by MikeNewall · May 19, 2014 at 02:45 AM

There is a mono dll (System.windows.forms.dll) if you add it to a plugins folder in unity you should be able to get info about the primary screen using Screen.primaryScreen or Screen.Allscreens to access all of them.

The dll is located here: C:\Program Files (x86)\Unity\Editor\Data\MonoBleedingEdge\lib\mono\gac\System.Windows.Forms

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

23 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I output to Oculus Rift on Unity 4.6? 1 Answer

My multi-monitor support is broken. How can I fix this? 2 Answers

How can integrate Oculus camera script in unity project? 0 Answers

How to complete camera space? 0 Answers

unity Display.displays[].setParams Problem 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges