rsanchezsaez / CardboardSDK-iOS

iOS port of Google's CardboardSDK (mobile VR toolkit)
Other
334 stars 104 forks source link

What about smaller screens? e.g. not 50/50 split #7

Open stefkeB opened 9 years ago

stefkeB commented 9 years ago

I have an iPhone 4S and with the Durovis SDK I tried earlier on, I had to adapt to the smaller 3,5 screen on my phone. Instead of setting the left/right cameras to each take 50% of the screen, I had to adjust them as follows: left camera = 25% width, aligned to the left (x=0) right camera = 25% width, aligned to the right (x=0.75) Height can stay at 100%

This reconstructed the stereo view, albeit with a smaller view (the middle of the screen stays empty).

With the CardboardSDK-iOS, I did set both left/right camera's that way, but the rendering of the two cameras to the main camera does not take this into account.

Any hints on where do I have to adjust this? I was looking at CopyCameraAndMakeSideBySide in CardboardEye.cs but not sure how to adapt it.

If there is a simpler method, that would also be fine. Maybe the stereo-setting? Maybe the spacing between the two camera's?

With bigger screens, your eye center is nicely in the middle of half the screen, but we have to adapt this for smaller (e.g. iPhone 4S) or bigger (iPad) screens.

rsanchezsaez commented 9 years ago

Hey @stefkeB, sorry for my super late reply.

I didn't/don't have the time to look into this, did you have any luck fixing this? I'd welcome a PR with this as an off-by-default option.

When I originally did this, I only tested on iPhone 6 and 5s.

andr3wmac commented 8 years ago

I'm running into a similar issue. On iPhone 5 and iPhone 5s the eyes are cut off by the edge of the screen. Looks to show about 60-70% of the eyes then the rest is cut off. On iPad I can see fully see both eyes. Any advice on correcting this? If I figure out I'll PR it.

Edit: Cancel that. Should have done more testing, tried googles official sdk and the eyes are still off. I guess it's just a limitation of the phones size.