stalgiag / p5.xr

a library that helps turn p5.js sketches into immersive experiences using WebXR
GNU Lesser General Public License v2.1
117 stars 25 forks source link

examples not working on mobile device #210

Open sophiadeak opened 4 months ago

sophiadeak commented 4 months ago

Nature of issue?

Which area does this problem relate to?

Details about the bug:

I've tried these examples from the p5.xr website. As well as the examples included in this repo

The examples load, but i'm only able to move the camera angle by touching the screen and 'moving' the scene around. When I move my phone around, the view does not change.

I was expecting behaviour similar to google-cardboard style VR, but if that's not how these examples should work, then please delete the issue

TiborUdvari commented 3 months ago

Did you build the project yourself or are you using the provided examples? I think my pull request should have fixed this but it has not been packaged up into a new release yet: https://github.com/stalgiag/p5.xr/pull/205

TiborUdvari commented 3 months ago

On the other hand, this should technically work in inline mode

Inline: Requested with the mode enum 'inline'. Inline sessions do not have the ability to display content on the XR device, but may be allowed to access device tracking information and use it to render content on the page. (This technique, where a scene rendered to the page is responsive to device movement, is sometimes referred to as “Magic Window” mode.) https://immersive-web.github.io/webxr/explainer.html#inline-sessions

This might be related to new permissions requirements, on iOS at least permissions for accelerometer data need to be requested as well. Here is an example: https://editor.p5js.org/mark-turpen@tamu.edu/sketches/eUJ-6wT0t

For example the accelerometer demos don't work for me anymore from the from the official p5 website: https://p5js.org/reference/#/p5/accelerationX

stalgiag commented 3 months ago

This should work with an Android phone. It is possible it isn't detecting the support for VR on the device. Curious does this example work on your device?