Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
Question by Paul Graystone · Jan 26, 2013 at 02:29 PM · screenraystereoscopic

WorldToScreenPoint / Rays with stereoscopic 3D

In a stereoscopic scene you need to have two different cameras (according to the left and right eye). Hence you have two differing points when using WorldToScreenPoint (at least as far as I understand).

Will camera.WorldToScreenPoint(transform.position) still work or do I have to use another command to get the result? Or can Unity cope with stereoscopic set up and still give a correct result?

Further: What is the effect on Rays?

Even further: may the result differ when using MiddleVR?

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Paul Graystone · Mar 26, 2013 at 09:42 AM

Since I did enough trying/ testing I came up with a quite simple but effective solution. I think this solution only works with MiddleVR, but I do not know for sure since I could not test any other set up.

In the case of MiddleVR two cameras are needed to render a stereoscopic image. But nevertheless you can place a third camera, which can be located between the camera for the left and right eye. This third camera can be used as the ray-perfoming and WorldToScreenPoint-performing camera. It will not render any image. Hence one does not need to rewrite code to fit a game to stereoscopic 3D.

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
avatar image
0

Answer by FatWednesday · Jan 26, 2013 at 02:35 PM

WorldToScreenPoint would still work...in a way, since its a method of a camera instance, the result would simply depend on which of the two cameras you when calling the function.

Depending on the separation distance between the cameras, it may be perfectly acceptable for you to just pick one of the cameras and go for it, but if accuracy is a key importance, then you may be better off performing the function on both cameras, and using both results to then work out where on the screen the point is (so the midpoint between the two results).

Never used/looked at MiddleVR though so i cant offer any input there.

Comment
Add comment · Show 3 · 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
avatar image Paul Graystone · Jan 26, 2013 at 02:41 PM 0
Share

Thank you for your answers. That calms me :).

$$anonymous$$aybe calculating the midpoint between the two cameras provide the necessary precision.

avatar image FatWednesday · Jan 26, 2013 at 03:03 PM 0
Share

The midpoint of the two results approach is definitely the way I would go off the top of my head. As for how well that works in practice as opposed to theory, best way to find that out is just dive in a test it :).

avatar image Paul Graystone · Mar 26, 2013 at 09:44 AM 0
Share

@FatWednesday: Your answer led me to an effective solution. I used a third camera, that is placed between the two other cameras. Please check my answer for further information.

Thank you for your help!

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.

Follow this Question

Answers Answers and Comments

10 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

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Change screen resolution button in pause menu? 0 Answers

Raycasting to turn varible on and OFF 1 Answer

Getting the Furthest Point on a Ray 1 Answer

Find Location 0 Answers


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