Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not correct distance between eyes in iPhone #105

Closed
iRomano opened this issue Jan 18, 2016 · 15 comments
Closed

Not correct distance between eyes in iPhone #105

iRomano opened this issue Jan 18, 2016 · 15 comments

Comments

@iRomano
Copy link

iRomano commented Jan 18, 2016

Hi

When i'm watching your samples on iPhone, it have not correct distance between eyes.

How fix it?

@borismus
Copy link
Owner

Please elaborate. Which phone? How do you know the eye distance is incorrect? Which viewer?

@iRomano
Copy link
Author

iRomano commented Jan 20, 2016

@borismus
iPhone 5s
Image is double

I seen your samples.
And i used your webvr-manager in my project.

And double image in cardboard.app. If used custom profile - it's ok. But in other apps image is good.

How can fix in webvr-manager?

@brianchirls
Copy link
Contributor

I can confirm this and offer some insight:

determineIPhone_ only checks against the device width, and the iPhone 4 and iPhone 5 both have the same pixel width. So you have to match both the height and the width. But before we implement this, I'm not sure if there are any other phone models with vague screen dimensions where this might cause a problem.

That said, having tested that solution, it's not a sufficient fix. The source of specs for DeviceInfo code says iPhone 5 screen is 640 x 1136. If I simulate iPhone 5 in Chrome Dev Tools, it matches and the solution works fine. But when I try it on a real iPhone 5 and the one in the simulator that comes with xcode, the resolution is 640 x 1096. It's missing 20 pixels (times the pixel ratio of 2).

I suspect this is related to #102.

@brianchirls
Copy link
Contributor

@borismus Have you considered using screen.height instead of screen.availHeight? It seems to make up the 20px discrepancy.

@borismus
Copy link
Owner

Would avail* solve the problem? You mention in your other post that there
were detection problems using availWidth.

On Wed, Jan 20, 2016 at 1:40 PM Brian Chirls notifications@github.com
wrote:

@borismus https://github.com/borismus Have you considered using
screen.height instead of screen.availHeight? It seems to make up the 20px
discrepancy.


Reply to this email directly or view it on GitHub
#105 (comment)
.

@brianchirls
Copy link
Contributor

No, I don't think availHeight or availWidth is working because I'm seeing that 20px discrepancy that shows up. According to MDN, screen.availWidth is "amount of horizontal space in pixels available to the window" and screen.width is width of the screen. The latter gives the full screen dimension, which is unlikely to change, while the former is affected by whatever junk the OS decides to add.

I think we need to check both screen.width and screen.height. I wanted to check with you before making a PR in case there was a specific reason you picked availWidth instead of width in the first place.

@iRomano
Copy link
Author

iRomano commented Jan 21, 2016

Hi!

Yes, i fixed this part:
var width = screen.width;
var height = screen.height;
var pixelWidth = width * window.devicePixelRatio;
var pixelHeight = height * window.devicePixelRatio;
// Match the screen dimension to the correct device.
for (var id in iOSDevices) {
var device = iOSDevices[id];
// Expect an exact match on width.
if (device.width == pixelWidth && device.height == pixelHeight) {

Detect device = iPhone5

Whatever.

I see double image if i used: CardboardV1 or CardboardV2

@brianchirls brianchirls mentioned this issue Jan 22, 2016
@brianchirls
Copy link
Contributor

It looks to me like #103 fixed this. It's using screen.width and screen.height, and my own code with #103 incorporated seems to look okay on my iPhone 5. (Though it's very slow, but that's a whole batch of other issues.)

@iRomano can you confirm?

@borismus Perhaps this is a good time to update the gh-pages branch?

@iRomano
Copy link
Author

iRomano commented Jan 22, 2016

@brianchirls
Excellent, it's working!
Thanks a lot!

P.S.
If use the dev version of the Three.js, stereo picture - don't work.
If take Three.js from your build - it's ok.

@brianchirls
Copy link
Contributor

@iRomano: Thank @btco for this one.

Getting three.js r74 to work here is a whole other project. There is an ongoing discussion here:
mrdoob/three.js#7732

@iRomano
Copy link
Author

iRomano commented Jan 22, 2016

@brianchirls Thank you for the link.
@btco Thanks a lot!

@iRomano iRomano closed this as completed Jan 22, 2016
@iRomano
Copy link
Author

iRomano commented Feb 18, 2016

Hi!

I downloaded new version webvr-boilerplate.
And i have same troubles:
iPhone 5s
Image is double

@btco
@borismus

@iRomano iRomano reopened this Feb 18, 2016
@crookookoo
Copy link

@iRomano @borismus
Probably this: #115

@borismus
Copy link
Owner

borismus commented Mar 1, 2016

Assuming it's related to r74 and closing.

@borismus borismus closed this as completed Mar 1, 2016
@brianchirls
Copy link
Contributor

@borismus: I don't believe this is specifically related to r74. It was mostly fixed by #103, but there are at least a couple outstanding cases, including iPhones with Display Zoom turned on (see #102). And I think the default iPhone and Android devices are sometimes way off because the distortion is not centered...or something. Not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants