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

added configurable parentElem and preventButton #77

Closed
wants to merge 3 commits into from

Conversation

bumblehead
Copy link

added configurable parentElem and preventButton

#68
#66

if defined, parentElem is used in place of window to obtain width and height. preventButton prevents button construction.

    var manager = new WebVRManager(renderer, effect, {
      parentElem : videoElem.parentNode,
      preventButton : true
    });

this.renderer = renderer;
this.effect = effect;
this.distorter = new CardboardDistorter(renderer);
this.button = new ButtonManager();
this.button = !preventButton && new ButtonManager();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this conditionally created ButtonManager. Let's keep it always created.

@bumblehead
Copy link
Author

@borismus thank you for reviewing and considering my PR with your agreeable response.

Changes I made are motivated by subjectiveness. For example, window is defined with innerWidth and document elements are defined with offsetWidth which in my experience is more consistently handled by browsers than outerWidth.

In my full preference an element (not window) would always be used as the parent because this would be simpler than supporting both window or element. The parent element would always be accessed from the DOM with an id value to ensure the parent element is still present in the document at each time reference is needed.

For those who would build their own system of video player controls, it would be best if the boilerplate ui were separated and more easily bypassed.

@borismus
Copy link
Owner

Please address my inline comments, and rebase against latest changes.

@bumblehead
Copy link
Author

I rebased my branch named parentElem-configure, https://github.com/bumblehead/webvr-boilerplate/tree/parentElem-configure

I removed the button related changes, but added a new change which I hope you will agree with. this.parentEl is params.parentEl or document.body (window is no longer used).

@borismus
Copy link
Owner

Outdated

@borismus borismus closed this Jan 22, 2016
@abuisine
Copy link

abuisine commented Feb 3, 2016

Hi there :)
I was pretty much interested in this PR (manager sized to a parent div for instance)
can I give an hand on this ?
what is the plan ?

@borismus
Copy link
Owner

borismus commented Feb 9, 2016

Please rebase and make small focused changes. The original PR here had a lot of seemingly unrelated changes.

@edsilv
Copy link

edsilv commented Apr 24, 2016

Hi,

I'm also interested in this issue and agree with what @bumblehead says about always using a dom element as the parent and separating out the UI.

As mentioned by @pindiespace in immersive-web/webvr-polyfill#23 it sounds like a significant overhaul is needed. To second @abuisine, what is the plan? Perhaps if we can split it up into sub-tasks we can each take one on?

@borismus
Copy link
Owner

This is in large part solved with 1.0 WebVR polyfill.

@edsilv
Copy link

edsilv commented Apr 25, 2016

Cool, do you mean on this branch?

https://github.com/borismus/webvr-polyfill/tree/webvr-1.0

Should I be using the webvr-1.0 branch of webvr-boilerplate as well?

Presumably I can specify a parent element somehow?

This is the main roadblock I've run into for my 'virtex' viewer. I will be demonstrating this at the MoMA in a couple of weeks and would love to be able to show people webvr-boilerplate-enabled VR.

@borismus
Copy link
Owner

The webvr branch was merged to master for a while, so no need for the other
branch.
You could use the polyfill directly rather than using the boilerplate. Let
me know if you need help.

On Mon, Apr 25, 2016 at 8:15 AM Edward Silverton notifications@github.com
wrote:

Cool, do you mean on this branch?

https://github.com/borismus/webvr-polyfill/tree/webvr-1.0

Should I be using the webvr-1.0 branch of webvr-boilerplate as well?

Presumably I can specify a parent element somehow?

This is the main roadblock I've run into for my 'virtex' viewer. I will be
demonstrating this at the MoMA in a couple of weeks and would love to be
able to show people webvr-boilerplate-enabled VR.


You are receiving this because you modified the open/close state.

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

@edsilv
Copy link

edsilv commented Apr 25, 2016

I've commented all uses of webvr-boilerplate, just using the polyfill now.

Based on your example I've tried to recreate the setup in Viewport.ts. If I uncomment this line:

https://github.com/edsilv/virtex/blob/webvr/src/Viewport.ts#L406

the camera location seems to be shifted to 0, 0, 0.

Any idea what I'm doing wrong?

@edsilv
Copy link

edsilv commented Apr 25, 2016

to clarify, the camera should be offset like this:

http://universalviewer.io/examples/?manifest=http%3A%2F%2Ffiles.universalviewer.io%2Fmanifests%2Ffoundobjects%2Fthekiss.json

uncommenting

this._vrControls.update();

puts the camera into the center of the object

@edsilv
Copy link

edsilv commented Apr 25, 2016

@edsilv
Copy link

edsilv commented Apr 27, 2016

That seems to be working now:

http://edsilv.github.io/virtex/test/

Ignore the broken loading bar, it works, it just doesn't like gzipped content coming from github.

This has external controls and can toggle between vr/normal mode. One hack I had to put in is this:

https://github.com/edsilv/virtex/blob/gh-pages/test/js/VREffect.js#L72

(forced isPresenting = true)

I need to figure out how to debug this on my android phone (I have a Google Cardboard). Any tips gratefully received :-)

@borismus
Copy link
Owner

I recommend chrome:inspect. Why did you need the hack? Are you calling
requestPresent?

On Wed, Apr 27, 2016 at 1:57 AM Edward Silverton notifications@github.com
wrote:

That seems to be working now:

http://edsilv.github.io/virtex/test/

Ignore the broken loading bar, it works, it just doesn't like gzipped
content coming from github.

This has external controls and can toggle between vr/normal mode. One hack
I had to put in is this:

https://github.com/edsilv/virtex/blob/gh-pages/test/js/VREffect.js#L72

(forced isPresenting = true)

I need to figure out how to debug this on my android phone (I have a
Google Cardboard). Any tips gratefully received :-)


You are receiving this because you modified the open/close state.

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

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

Successfully merging this pull request may close these issues.

None yet

4 participants