-
Notifications
You must be signed in to change notification settings - Fork 11
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
Encapsulation with Custom Elements #61
Comments
I don't think this repo is the place for enhancements to the samples.
There are no current and afaik no upcoming implementations to enable magic windows. |
@cabanier , thank you. For any interested in implementing their own custom element for "magic windows", I found this example from two years ago: https://github.com/immersive-web/webxr-polyfill/blob/master/examples/magic-window.html . There is a subtopic here which I hope is both relevant and interesting: styling the XR 3D content. One might look at the <xr-image src="teapot.gltf" style="width:300px; height:300px; border:1px solid black" /> and wonder: what precisely should that look like? Is the 3D teapot supposed to appear behind the document, in front of the document, or half-way through the document? How should the bounding cuboid be positioned relative to the document plane? What is the desired position of the teapot relative to its bounding cuboid? How might we specify the dimensions of the bounding cuboid, color the walls of the bounding cuboid, or style the bounding cuboid with a border? How might we precisely describe or style the custom element for XR "magic window" scenarios? After some preliminary exploration, I found that we can use custom CSS properties for purposes including to style custom elements. Custom CSS properties are prefixed by For example: <xr-image src="teapot.gltf" style="width:300px; height:300px; --depth:300px; border:1px solid black" /> One could then use the CSSOM getComputedStyle and getPropertyValue to obtain the values of CSS properties including the custom properties. That said, one could define custom CSS properties to answer the questions presented above. One could also extrapolate a CSS "cuboid model" from the CSS "box model". Hopefully, these preliminary thoughts about styling XR 3D content, in particular "magic window" custom elements, are of some interest and use to other WebXR participants. |
I would like to propose that the WebXR samples include one or more samples which involve the encapsulation of WebXR with Web components custom elements.
The following example markup shows a custom element (
xr-image
) which intends to be utilized for declaring one or more 3D images in HTML documents. As envisioned, the 3D images would be stereoscopic 3D, utilizing XR viewer tracking, and could fallback to monoscopic 3D and then to 2D images.See also:
The text was updated successfully, but these errors were encountered: