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

Resetting correct CSS size when exiting VR mode on mobile #138

Closed
pindiespace opened this issue Jul 8, 2016 · 1 comment
Closed

Resetting correct CSS size when exiting VR mode on mobile #138

pindiespace opened this issue Jul 8, 2016 · 1 comment

Comments

@pindiespace
Copy link

The current polyfill example always sets the size of the canvas element to the window dimensions, and adjusts CSS size as described at https://github.com/borismus/webvr-polyfill/issues/98. Are there any examples where the CSS size of the canvas is not the same size as document.body (i.e. it is initially embedded in the DOM)?

I built an example using the most recent version of polyfill and libraries at http://plyojump.com/projects/webvr-feature-detector. You trigger VR via orientation to landscape on mobile. If you flip back and forth, you get the canvas correctly resizing itself back into the page DOM. But it only works on iOS,counterclockwise orientation only, is delicate to CSS changes, and requires clumsy logic in the window resizing function.

Clearly, I'm fighting a battle that must have a simpler solution. Is there a simpler way using one of the following?

  1. renderer param
  2. effect effect
  3. polyfill parameter

If not, what is the best strategy for showing active scenes in the DOM, e.g. for a VR slideshow with elements blowing up? Finally, there's no way to do this, can the "return" arrow in VR optionally be pointed to a different window location?

@jsantell
Copy link
Contributor

It's been awhile since this has been updated, and think it may no longer be an issue in >=0.10.0 and suspect it was related to the deprecated HMD displays, or the MouseKeyboardVRDisplay.

Anyways, I did make a sample of using magic window in WebVR with the underlying CardboardVRDisplay. That should get you the result you're looking for if I understand correctly. Please reopen if I misunderstand!

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

2 participants