immersive-web / dom-overlays

A feature incubation repo for layering DOM content on/in WebXR content. Feature lead: Piotr Bialecki
https://immersive-web.github.io/dom-overlays/
Other
69 stars 9 forks source link

Request for Examples #8

Closed raviramachandra closed 4 years ago

raviramachandra commented 4 years ago

Can we have a hello world DOM Overlay example ?

klausw commented 4 years ago

Yes, we need to add these, I'm currently working on examples matching the proposed spec.

In the meantime, I have some simple examples that originally worked with the older prototype API as currently implemented in Chrome, but I've added support for the proposed spec's API also. This isn't ideal as a reference due to the mix of APIs, but may be useful for testing:

klausw commented 4 years ago

The examples at https://storage.googleapis.com/chromium-webxr-test/latest.html?target=proposals/index.html now include DOM Overlay support for "AR Hit Test" and "AR Plane Detection & Anchors", including a visualization of XR input events when using this link.

These are intended to exercise the recently updated APIs as of Chrome Canary 81.0.4029.2 which should match the current draft spec, and won't work as expected on older Chrome versions.

(The two examples from my previous comment should continue to work, though they have some backwards compatibility code as well to work with the previous API.)

I'll keep this issue open since I think it would still be useful to have a very basic standalone example.

klausw commented 4 years ago

I modified the "XR barebones" sample to work with AR mode and an optional DOM Overlay.

Live: https://storage.googleapis.com/chromium-webxr-test/latest.html?target=proposals/ar-barebones-dom-overlay.html

Source: https://cs.chromium.org/chromium/src/third_party/webxr_test_pages/webxr-samples/proposals/ar-barebones-dom-overlay.html

@toji - as a more general question, how would you feel about adding some basic AR samples such as this one on https://immersive-web.github.io/webxr-samples/ ? The current "proposals/" directory is a bit confusing, it started out as tests for inline AR on phones and the names reflect that, while they are actually using "immersive-ar" and could also work on AR headsets. Maybe delete ones using less-stable APIs (they aren't actively maintained at that location and likely don't currently work), but keep some basic ones using reasonably-stable APIs?

toji commented 4 years ago

I'd be happy to move the this sample and the rest of the AR samples to the main samples page, since they have definitely moved beyond what I had envisioned the proposals directory to be used for.