borismus / webvr-boilerplate

A starting point for web-based VR experiences that work on all VR headsets.
Apache License 2.0
1.8k stars 451 forks source link

Alternate suggestion for Ui via Player #83

Closed pindiespace closed 8 years ago

pindiespace commented 8 years ago

Here's some ideas for using the manager to load a separate Player object, encapsulating the canvas in a

element. It also switches resize events to the standard browser resizes. Finally, it handles CSS nonlocal styles so one can run the scene in the window, or as a guest inside a regular DOM (see test/dom_test.html.

The fullscreen required some hacks to keep aspect ratio, since css styles cause reflows during resizing.

Significant modification to the ButtonManager necessary to integrate into the Player. Some changes in index.html, including an initial 'resizeifneeded' since we don't test for resize on every loop. However, calling the resize in the animate loop still works.

Mildly tested in Chrome, Edge, mobile Chrome and Safari. Firefox has problems in fullscreen.

borismus commented 8 years ago

Wow, thanks. This is a large change!

Unfortunately I think it's an overly sweeping change that I cannot accept. Nearly every file has changed! Please split this into smaller pieces and critically: state clearly what problem each pull request is solving. Keep in mind that the point of the boilerplate is to be a starting point for any WebVR project, not just yours.

pindiespace commented 8 years ago

OK. Had to build it out to confirm it was a reasonable approach. I'll break it out after some more testing.