stream: Guerilla Standardisation
area: Internet
status: informational
author: Leon van Kammen
-date: 2023-04-12T00:00:00Z
workgroup: Internet Engineering Task Force
-value: draft-XRFRAGMENTS-leonvankammen-00
-
-
-
-
-Abstract
- --- -Version: 0.5
-
-NOTE: A more updated/pretty version can be read at https://xrfragment.org -
- -An open specification for hyperlinking & deeplinking 3D fileformats.
-This draft is a specification for interactive URI-controllable 3D files, enabling hypermediatic navigation, to enable a spatial web for hypermedia browsers with- or without a network-connection.
-XR Fragments allows us to better use implicit metadata inside 3D scene(files), by mapping it to proven technologies like URI Fragments.
--Almost every idea in this document is demonstrated at https://xrfragment.org
-
Quick reference
- --
-
- Abstract -
- Index -
- Introduction -
- How does it work -
- What does it solve -
- HFL (Hypermediatic Feedback Loop) for XR Browsers -
- Conventions and Definitions - - -
- Spatial Referencing 3D -
- Level0: Files - - -
- Level1: URI - - -
- Level2: href links - - -
- Level3: Media Fragments - - -
- Level4: prefix operators - - -
- Level5: URI Templates (RFC6570) -
- Top-level URL processing
-
-
-
-
- UX -
- - Example: Navigating content href portals - - -
- Example: Virtual world rings -
- Additional scene metadata -
- Accessibility interface - - -
- XRF microformat -
- Vendor Prefixes -
- Security Considerations -
- FAQ -
- Authors -
- IANA Considerations -
- Acknowledgments -
- Appendix: Definitions -
Introduction
- -- -
How can we add more control to existing text and 3D scenes, without introducing new dataformats?
-Historically, there’s many attempts to create the ultimate 3D fileformat.
-The lowest common denominator is: designers describing/tagging/naming things using plain text.
-XR Fragments exploits the fact that all 3D models already contain such metadata:
XR Fragments allows deeplinking of 3D objects by mapping objectnames to URI fragments
- -How does it work
- -- -
XR Fragments utilizes URLs:
- --
-
- for 3D viewers/browser to manipulate the camera or objects (via URI fragments) -
- implicitly: by mapping 3D objectnames (of a 3D scene/file) to URI fragments (3D deeplinking) -
- explicitly: by scanning
hrefmetadata inside 3D scene-files to enable interactions
- - externally: progressively enhance a 3D (file) into an experience via sidecarfiles -
-- -Aspect 1 was pioneered and implemented by JanusXR / James Baicoianu via janusweb well before the formal specification was established. As a key architect of these early concepts, Jamesโs work laid the groundwork for the standard we use today. We owe him a great deal of thanks for his early contributions.
-
What does it solve
- -It solves:
- --
-
- addressibility and hypermediatic navigation of 3D scenes/objects: URI Fragments using src/href spatial metadata -
- Interlinking text & spatial objects by collapsing space into a Word Graph (XRWG) to show visible links -
- unlocking spatial potential of the (originally 2D) hashtag (which jumps to a chapter) for navigating XR documents -
- refraining from introducing scripting-engines for mundane tasks (and preventing its inevitable security-headaches) -
- the gap between text an 3d objects: object-names directly map to hashtags (=fragments), which allows 3D to text transcription. -
-- -NOTE: The chapters in this document are ordered from highlevel to lowlevel (technical) as much as possible
-
XR Fragments views XR experiences through the lens of 3D deeplinked URI’s, rather than thru code(frameworks) or protocol-specific browsers (webbrowser e.g.).
-To aid adoption, the standard comprises of various (optional) support-levels, which incorporate existing standards like W3C Media Fragments and URI Templates (RFC6570) to promote spatial addressibility, sharing, navigation, filtering and databinding objects for (XR) Browsers.
-- -XR Fragments is in a sense, a heuristical 3D format or meta-format, which leverages heuristic rules derived from any 3D scene or well-established 3D file formats, to extract meaningful features from scene hierarchies.
-
-These heuristics, enable features that are both meaningful and consistent across different scene representations, allowing higher interop between fileformats, 3D editors, viewers and game-engines.
HFL (Hypermediatic Feedback Loop) for XR Browsers
- -for XR Browsers)
- -href metadata traditionally implies click AND navigate, however XR Fragments adds stateless click (xrf://....) via the xrf:// scheme, which does not change the top-level URL-adress (of the browser).
-This allows for many extra interactions via URLs, which otherwise needs a scripting language.
-These are called hashbus-only events/
-- -Being able to use the same URI Fragment DSL for navigation (
-href: #foo) as well as interactions (href: xrf://#foo) greatly simplifies implementation, increases HFL, and reduces need for scripting languages.
This opens up the following benefits for traditional & future webbrowsers:
- --
-
- hypermediatic loading/clicking 3D assets (gltf/fbx e.g.) natively (with or without using HTML). -
- potentially allowing 3D assets/nodes to publish XR Fragments to themselves/eachother using the
xrf://hashbus (xrf://#person=walkto triggerwalk-animation for objectperson)
- - potentially collapsing the 3D scene to an wordgraph (for essential navigation purposes) controllable thru a hash(tag)bus -
- completely bypassing the security-trap of loading external scripts (by loading 3D model-files, not HTML-javascriptable resources) -
XR Fragments itself are hypermediatic and HTML-agnostic, though pseudo-XR Fragment browsers can be implemented on top of HTML/Javascript.
- -| principle | -3D URL | -HTML 2D URL | -
|---|---|---|
| the XRWG | -wordgraph (collapses 3D scene to tags) | -Ctrl-F (find) | -
| the hashbus | -hashtags alter camera/scene/object-projections | -hashtags alter document positions | -
| src metadata | -renders content and offers sourceportation | -renders content | -
| href metadata | -teleports to other XR document | -jumps to other HTML document | -
| href metadata | -triggers predefined view | -Media fragments | -
| href metadata | -triggers camera/scene/object/projections | -n/a | -
| href metadata | -draws visible connection(s) for XRWG ‘tag’ | -n/a | -
| href metadata | -filters certain (in)visible objects | -n/a | -
| href metadata | -href=“xrf://#-foo&bar” | -href=“javascript:hideFooAndShowBar()` | -
| - | (this does not update topLevel URI) | -(this is non-standard, non-hypermediatic) | -
-- -An important aspect of HFL is that URI Fragments can be triggered without updating the top-level URI (default href-behaviour) thru their own ‘bus’ (
-xrf://#.....). This decoupling between navigation and interaction prevents non-standard things like (href:javascript:dosomething()).
Conventions and Definitions
- -- -
See appendix below in case certain terms are not clear.
- -XR Fragment URL Grammar
- -- -
For typical HTTP-like browsers/applications:
- -reserved = gen-delims / sub-delims
-gen-delims = "#" / "&"
-sub-delims = "," / "="
+value: XRFRAGMENTS-leonvankammen-00
-
+Abstract
-- -Example:
+://foo.com/my3d.gltf#room1&prio=-5&t=0,100Version: 0.6 +
| Demo | -Explanation | -
|---|---|
room1 |
-vector/coordinate argument e.g. | -
room1&cam1 |
-combinators | -
An open specification for hyperlinking & deeplinking 3D fileformats.
+This is a specification for interactive URI-controllable 3D files, to enable spatial webs for local-first XR hypermedia browsers.
+XR Fragments allows us to better use implicit metadata inside 3D scene(files), by mapping it to proven technologies like URI Fragments.
+
-- -this is already implemented in all browsers
+Almost every idea in this document is demonstrated at https://xrfragment.org +
Pseudo (non-native) browser-implementations (supporting XR Fragments using HTML+JS e.g.) can use the ? search-operator to address outbound content.
-In other words, the URL updates to: https://me.com?https://me.com/other.glb when navigating to https://me.com/other.glb from inside a https://me.com WebXR experience e.g.
-That way, if the link gets shared, the XR Fragments implementation at https://me.com can load the latter (and still indicates which XR Fragments entrypoint-experience/client was used).
Spatial Referencing 3D
- -- -
3D files contain an hierarchy of objects.
-XR Fragments assumes the following objectname-to-URI-Fragment mapping, in order to deeplink 3D objects:
Introduction
+How can we add more control to existing text and 3D scenes, without introducing new dataformats?
+Historically, there's many attempts to create the ultimate 3D fileformat.
+The lowest common denominator is: designers describing/tagging/naming things using plain text.
+XR Fragments exploits the fact that all 3D models & markuplanguages already contain such metadata:
+
** Deeplinking 3D objects by mapping objectnames to URI fragments** +
+++For a better-readable, better-updated spec see the website https://xrfragment.org +
+
How does it work
+XR Fragments utilizes URLs on various levels: +
+-
+
- for 3D viewers/browser to manipulate the camera or objects of a 3D scene (via URI fragments) +
- implicitly: by mapping 3D objectnames (of a 3D scene/file) to URI fragments (3D deeplinking) +
- explicitly: by scanning
hrefmetadata inside 3D scene-files to enable interactions
+ - explicitly: by scanning for XR hints metadata inside 3D scene-files to distinguish contextual rendering (AR vs VR e.g.) +
- externally: progressively enhance a 3D (file) into an experience via sidecarfiles +
++Aspect 1 was pioneered and implemented by JanusXR / James Baicoianu via janusweb well before the formal specification was established. As a key architect of these early concepts, Jamesโs work laid the groundwork for the standard we use today. We owe him a great deal of thanks for his early contributions. +
+
Applications can adopt XR Fragments at various levels, depending on application needs. +However, Level1 is considered the soul of XR fragments: other levels are optional and not required to consider something 'XR Fragment compatible' (3D objects & camera reference-able via URL). +
+Spatial Referencing 3D objects
+3D files/scenes contain an hierarchy of objects.
+XR Fragments assumes the following objectname-to-URI-Fragment mapping, in order to deeplink 3D objects:
+
- my.io/scene.fbx
+ my.io/scene.fbx (or my.io/scene.html delivering a three.js scene)
+
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+
โ sky โ src: http://my.io/scene.fbx#sky (includes building,mainobject,floor)
โ +โโโโโโโโโโโโโโโโโโโโโโโโโ+ โ
@@ -402,95 +6040,207 @@ XR Fragments assumes the following objectname-to-URI-Fragment mapping, in order
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+
-
-- -Every 3D fileformat supports named 3D object, and this name allows URLs (fragments) to reference them (and their children objects).
+Every 3D fileformat supports named 3D objects, and this name allows URLs (fragments) to reference them (and their children objects). +
Clever nested design of 3D scenes allow great ways for re-using content, and/or previewing scenes.
-For example, to render a portal with a preview-version of the scene, create an 3D object with:
In case of the href-attribute (see level2: explicit hyperlinks) we use this reference to teleport the player/camera to that location (of the referenced object). +
+What does it solve
+It solves: +
+-
+
- addressibility and hypermediatic navigation of 3D scenes/objects: URI Fragments using src/href spatial metadata +
- unlocking spatial potential of the (originally 2D) hashtag (which jumps to a chapter) for navigating XR documents +
- refraining from introducing an opiniated scripting-engine for mundane tasks (and preventing its inevitable security-headaches) +
XR Fragments views XR experiences through the lens of 3D deeplinked URI's, rather than thru a specific scripting- or game-engine, or protocol-specific browsers (https webbrowser e.g.).
+To aid adoption, the standard comprises of various (optional) support-levels, which incorporate existing standards like W3C Media Fragments and URI Templates (RFC6570) to promote spatial addressibility, sharing, navigation, filtering and databinding objects for (XR) Browsers.
+
++XR Fragments is in a sense, a heuristical 3D format or meta-format, which leverages heuristic rules derived from any 3D scene or well-established 3D file formats, to extract meaningful features from scene hierarchies.
+
+These heuristics, enable features that are both meaningful and consistent across different scene representations, allowing higher interop between fileformats, 3D editors, viewers and game-engines. +
Level0: file
+Capable 3D fileformats
+glTF, usdz, obj, collada, THREE.json, X3D e.g. are capable of XR Fragments.
+
+The requirements of any 3D file is: a scenegraph with 1 or more named objects.
+
XR Fragment Compatible
+A 3D scene-file can be considered XR Fragment-compatible when it matches one of these heuristics
+
-
+
- implicit: it has at least one sidecar-file
- explicit: an object has an href extra. +
- explicit: it has at least one system folder (one objectname starting with underscore) +
-
-
- href:
https://scene.fbx
+ - = last wins in case of non-unique names
Loading a file
+ +-- -It also allows sourceportation, which basically means the enduser can teleport to the original XR Document of an
+srcembedded object, and see a visible connection to the particular embedded object. Basically an embedded link becoming an outbound link by activating it.When an XR player (
myplayer.exee.g.) is launched (without a specific file), it should poll for a default file (myplayer.glbe.g.). +
Level0: Files
- --
- -Compatible 3D fileformats: glTF, usdz, obj, collada, THREE.json, X3D e.g.
-
A 3D scene-file can be considered XR Fragment-compatible when it contains metadata: -1. implicit: there’s at least one object with a name (*) -2. explicit: (optional) object(s) have (level2) href extras.
- --- -* = last wins in case of non-unique names
-
There are optional auto-loaded side-car files to enable hasslefree XR Movies.
-they can accomodate developers or applications who (for whatever reason) must not modify the 3D scene-file (a .glb e.g.).
Timelines
- -when a loaded file contains a timeline (animations/subtitles e.g.), then:
- --- -All timelines must play (looped) by default (to enable [[XR Movies]])
-
Unless an object has multiple animations (actions e.g.), then just play the first or with name default.
via href metadata
- -scene.glb <--- 'href' extra [heuristic] detected inside!
-scene.png (preview thumbnail)
-scene.ogg (soundtrack to plays when global 3D animation starts)
-scene.vtt (subtitles for accessibility or screenreaders)
-scene.json (sidecar JSON-file with explicit metadata)
+Sidecar files
+These are optional auto-loaded files to enable hasslefree publishing of XR Movie applications.
+The application should poll for only those 3D file-formats it supports.
+
+
+Webviewer example
+
+https://my.org/demo.html loads demo.glb
+https://my.org/demo.html?file=foo.glb loads foo.glb
+
+Linux/Mac example
+$ ls -la
+myplayer
+myplayer.glb
+$ ./myplayer <-- automatically loads myplayer.glb
+$ ./myplayer foo.glb <-- no sidecar logic
-
-heuristics:
-
-
-- if at least one
href custom property/extra is found in a 3D scene
-- The viewer should poll for the above mentioned sidecar-file extensions (and present accordingly)
-
-
-via chained extension
-
-scene.xrf.glb <--- '.xrf.' sidecar file heuristic detected!
-scene.xrf.png (preview thumbnail)
-scene.xrf.ogg (soundtrack to plays when global 3D animation starts)
-scene.xrf.vtt (subtitles for accessibility or screenreaders)
-scene.xrf.json (sidecar JSON-file with explicit metadata)
+Windows example
+> dir
+myplayer.exe
+myplayer.glb
+> myplayer.exe <-- automatically loads myplayer.glb
+> myplayer.exe foo.glb <-- no sidecar logic
-
-A fallback-mechanism to turn 3D files into XR Movies without editing them.
+NOTE: after loading a file the usual sidecar file-logic applies
+
-
-heuristics:
-
-
-- the chained-extension heuristic
.xrf. should be present in the filename (scene.xrf.glb e.g.)
-
-
-via subdocuments/xattr
-
-More secure protocols (Nextgraph e.g.) don’t allow for simply polling files.
-In such case, subdocuments or extended attributes should be polled:
-
+
Slideshow
-+NOTE: in the examples below we use the href-heuristic, but also the
+.xrf.chained-extension applies here.when a loaded file ends with a number (
foo1.glb) automatically check for the existence offoo2.glb) +
This will allow simple 3D slideshows: +
+foo1.glb
+foo2.glb
+foo3.glb
+foo4.glb
+
+But with [sidecar files](#sidecar files) this also allows for XR movie series: +
+foo-episode1.glb
+foo-episode1.vtt
+foo-episode1.ogg
+foo-episode2.glb
+foo-episode2.vtt
+foo-episode2.ogg
+
+and so on
+
+F3D
+The opensource F3D 3D viewer supports level0 'next file' by invoking: +
+$ f3d --animation-autoplay foo-episode*.glb
+
+++In a similar spirit of the XR Fragment spec: F3D supports multiple 3D file formats, so the 3D slideshow can exist of different 3D fileformats. +
+
Sidecar files
+These are optional auto-loaded files to enable hasslefree XR Movies:
+
+
via href metadata
+scene.glb <--- 'href' extra [heuristic] detected inside!
+scene.png <--- then poll preview thumbnail
+scene.ogg <--- then poll soundtrack to plays when global 3D animation starts)
+scene.vtt <--- then poll fallback subtitles for accessibility or screenreaders
+scene.json <--- then poll sidecar JSON-file with explicit metadata
+
+heuristics
+-
+
- if at least one `href` custom property/extra is found in a 3D scene +
- The viewer should poll for the above mentioned sidecar-file extensions (and present accordingly) +
+
via chained extension
+scene.xrf.glb <--- 'href' extra [heuristic] detected inside!
+scene.xrf.png <--- then poll preview thumbnail
+scene.xrf.ogg <--- then poll soundtrack to plays when global 3D animation starts)
+scene.xrf.vtt <--- then poll fallback subtitles for accessibility or screenreaders
+scene.xrf.json <--- then poll sidecar JSON-file with explicit metadata
+
+++A fallback-mechanism to turn 3D files into XR Movies without editing them. +
+
heuristics
+the chained-extension heuristic .xrf. should be present in the filename (scene.xrf.glb e.g.)
+
+
JSON sidecar-file
+++NOTE: the following approach is only recommended for archivist/userupload scenarios where the 3D file itself should not be altered. +
+
For developers, a json-sidecar-file can allow for defining explicit XR Fragments metadata (>level1), outside of the 3D file. +This can be done via (objectname/metadata) key/value-pairs in a JSON sidecar-file: +
+{
+ "aria-description": "description of scene",
+ "button": {
+ "href": "#roomB",
+ "aria-description": "description of room"
+ }
+}
+
+This will make object button clickable, and teleport the user to object roomB.
+
+
++So after loading experience.glb the existence of experience.json is detected, to apply the explicit metadata.
+
The sidecar will define (or override already existing) extras, which can be handy for multi-user platforms (offer 3D scene customization/personalization to users). +
In THREE.js-code this would boil down to: +
+ scene.userData['aria-description'] = "description of scene"
+ scene.getObjectByName("button").userData.href = "#roomB"
+
+++now the XR Fragments parser can process the XR Fragments userData 'extras' in the scene +
+
multilanguage example
+Applications or webservers can use symbolic links or (webpaths) for language-directories: +
+scene.glb
+scene.json
+es/scene.glb --> ../scene.glb
+es/scene.png
+es/scene.ogg
+es/scene.vtt
+es/scene.json --> ../scene.json
+
+++However, embedding the multilanguage postfixes are preferred for portability reasons: see multilangual +
+
via subdocuments/xattr
+More secure protocols (Nextgraph e.g.) don't allow for simply polling files. +In such case, subdocuments or extended attributes should be polled: +
++NOTE: in the examples below we use the href-heuristic, but also the
+.xrf.chained-extension applies here. +
myspreadsheet.ods
โโโ explainer.glb <--- 'href' extra [heuristic] detected inside!
โโโ explainer.ogg (soundtrack to play when global 3D animation starts)
@@ -498,1361 +6248,869 @@ In such case, subdocuments or extended attributes should be polled:
โโโ explainer.json (sidecar JSON-file with explicit metadata)
โโโ explainer.vtt (subtitles for accessibility or screenreaders)
-
-If only extended attributes (xattr) are available, the respective referenced file can be embedded:
- -$ setfattr -n explainer.ogg -v "soundtrack.ogg" explainer.glb
-$ setfattr -n explainer.png -v "thumbnail.png" explainer.glb
-$ setfattr -n explainer.vtt -v "subtitles.vtt" explainer.glb
+If only extended attributes (xattr) are available, the respective referenced file can be embedded:
+
+$ setfattr -n explainer.ogg -v "soundtrack.ogg" explainer.glb
+$ setfattr -n explainer.png -v "thumbnail.png" explainer.glb
+$ setfattr -n explainer.vtt -v "subtitles.vtt" explainer.glb
-
-NOTE: Linux’s setfattr/getfattr is xattr on mac, and Set-Content/Get-content on Windows. See pxattr for lowlevel access.
+NOTE: Linux's setfattr/getfattr is xattr on mac, and Set-Content/Get-content on Windows. See pxattr for lowlevel access.
+
-
-JSON sidecar-file
-
-For developers, sidecar-file can allow for defining explicit XR Fragments links (>level1), outside of the 3D file.
-This can be done via (objectname/metadata) key/value-pairs in a JSON sidecar-file:
-
+when a loaded file contains a timeline (animations/subtitles e.g.), then:
All timelines must play (looped) by default (to enable XR Movies)
Unless an object has multiple animations (actions e.g.), then just play the first or with name default.
URLs are the heart of XR Fragment-based 3D Hypermedia: +
-
-
- experience.glb -
- experience.json
<----
+ - it allows navigating the XR browser to a (different) 3D scene (
world.glbe.g.)
+ - it allows teleporting the user to a different location (
room2e.g.)
+ - it allows back/forward navigation +
- it allows addressibility (for 3d objects inside a file)
Examples:https://linux.world/#roomF&t=1,100linuxapp://conference/nixworkshop?newuser#roomC&t=2,200androidapp://page1?tutorial#roomB&t=1,100
+
Implicit and Explicit adressibility is the core of the XR Fragments spec, as well as user teleportation: +
+ +Software uses level1 for deeplinking objects, or to teleport the user: here's pseudocode for a level1 XR Fragments browser in THREE.js: +
+// by default the (VR) user gets position at 0,0,0 at the loaded scene (+VR userheight)
-{
- "aria-description": "description of scene",
- "button": {
- "href": "#roomB",
- "aria-description": "description of room"
- }
+url = 'world.glb#roomB&car'
+file = url.split("#")[0]
+xrf = new URLSearchParams( url.split("#")[1] )
+refs = ([...xrf.keys()]).filter( (k) => !k.match(/(t)/) ) // skip mediafrags
+
+// set last (nonoperator) objectname as camera-location
+for( i in refs ){
+ scene.setActiveCameraByName(refs[i]) // teleport
+ obj = extractObject(scene,refs[i]) // or purely deeplink
}
-
-This will make object button clickable, and teleport the user to object roomB.
+for robust parsing of XR Fragments use a http query-language parser, or the polyglot parser
+
-
-So after loading experience.glb the existence of experience.json is detected, to apply the explicit metadata.
-The sidecar will define (or override already existing) extras, which can be handy for multi-user platforms (offer 3D scene customization/personalization to users).
-
+
+
+Below is the related section of the spec (full spec here: HTML, TXT)
+
+
+
+For more info see How it works
+
+Every 3D object, material or camera can be adressed by URI fragments (#myobject e.g.) which are derived from the 3D scene objectnames (implicit metadata).
+These are inferred at runtime from the 3D scene-nodes (object names, object metadata etc).
+Free fragments and features generated for you..How great is that? ๐
+
+
+
+
+ my.io/scene.usdz Embeddable as:
+ +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+
+ โ sky โ src: http://my.io/scene.udsz#sky (includes building,mainobject,floor)
+ โ +โโโโโโโโโโโโโโโโโโโโโโโโโ+ โ
+ โ โ building โ โ src: http://my.io/scene.udsz#building (includes mainobject,floor)
+ โ โ +โโโโโโโโโโโโโโโโโโโโโ+ โ โ
+ โ โ โ mainobject โ โ โ src: http://my.io/scene.udsz#mainobject (includes floor)
+ โ โ โ +โโโโโโโโโโโโโโโโโ+ โ โ โ
+ โ โ โ โ floor โ โ โ โ src: http://my.io/scene.udsz#floor (just floor object)
+ โ โ โ โ โ โ โ โ
+ โ โ โ +โโโโโโโโโโโโโโโโโ+ โ โ โ href: http://my.io/scene.udsz#-mainobject (hides mainobject when clicked)
+ โ โ +โโโโโโโโโโโโโโโโโโโโโ+ โ โ
+ โ +โโโโโโโโโโโโโโโโโโโโโโโโโ+ โ
+ +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+
+
+
-- -In THREE.js-code this would boil down to:
+Fragments (
#buildinge.g.) allow for very convenient, guess-able filters to reference/show/hide objects within a 3D scene. +
scene.userData['aria-description'] = "description of scene"
- scene.getObjectByName("button").userData.href = "#roomB"
-
- // now the XR Fragments parser can process the XR Fragments userData 'extras' in the scene
-
-
-Level1: URI
- -- +
For more examples see filters and the reference-menu (by feature) +
-- -XR Fragments allows deeplinking of 3D objects by mapping objectnames to URI fragments
+Below is the related section of the spec (full spec here: HTML, TXT) +
XR Fragments tries to seek to connect the world of text (semantical web / RDF), and the world of pixels.
-Instead of forcing authors to combine 3D/2D objects programmatically (publishing thru a game-editor e.g.), XR Fragments integrates all which allows a universal viewing experience.
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+
- โ โ
- โ U R N โ
- โ U R L | โ
- โ | |-----------------+--------| โ
- โ +--------------------------------------------------| โ
- โ | โ
- โ + https://foo.com/some/foo/scene.glb#someview <-- http URI (=URL and has URN) โ
- โ | โ
- โ + ipfs://cfe0987ec9r9098ecr/cats.fbx#someview <-- an IPFS URI (=URL and has URN) โ
- โ โ
- โ ec09f7e9cf8e7f09c8e7f98e79c09ef89e000efece8f7ecfe9fe <-- an interpeer URI โ
- โ โ
- โ โ
- โ |------------------------+-------------------------| โ
- โ | โ
- โ U R I โ
- โ โ
- +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+
-
-
-
-Fact: our typical browser URL’s are just a possible implementation of URI’s (for untapped humancentric potential of URI’s see interpeer.io or NextGraph )
- --- -XR Fragments does not look at XR (or the web) thru the lens of HTML or URLs.
-
But approaches things from a higherlevel local-first 3D hypermedia browser-perspective.
Below you can see how this translates back into good-old URLs:
- - +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+
- โ โ
- โ the soul of any URL: ://macro /meso ?micro #nano โ
- โ โ
- โ 2D URL: ://library.com /document ?search #chapter โ
- โ xrf:// โ
- โ 4D URL: ://park.com /4Dscene.fbx โ> ?other.glb โ> #object โ> hashbus โ
- โ โ #filter โ โ
- โ โ #tag โ โ
- โ โ (hypermediatic) #material โ โ
- โ โ ( feedback ) #animation โ โ
- โ โ ( loop ) #texture โ โ
- โ โ #variable โ โ
- โ โ โ โ
- โ XRWG <โโโโโโโโโโโโโโโโโโโโโ<โโโโโโโโโโโโโ+ โ
- โ โ โ โ
- โ โโ objects โโโโโโโโโโโโโโ>โโโโโโโโโโโโโ+ โ
- โ โ
- โ โ
- +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+
-
-
-
--- -?-linked and #-linked navigation are JUST one possible way to implement XR Fragments: the essential goal is to allow a Hypermediatic FeedbackLoop (HFL) between external and internal 4D navigation.
-
List of URI Fragments
- -| fragment | -type | -example | -info | -
|---|---|---|---|
#...... |
-vector3 | -#room1 #room2 #cam2 |
-positions/parents camera(rig) (or XR floor) to xyz-coord/object/camera and upvector | -
| Media Fragments | -media fragment | -#t=0,2&loop |
-play (and loop) 3D animation from 0 seconds till 2 seconds | -
List of *explicit metadata
- -These are the possible ‘extras’ for 3D nodes and sidecar-files
- -| key | -type | -example (JSON) | -function | -existing compatibility | -
|---|---|---|---|---|
href |
-string | -"href": "b.gltf" |
-XR teleport | -custom property in 3D fileformats | -
Level2: href links
- -- -
Explicit href metadata (‘extras’) in a 3D object (of a 3D file), hint the viewer that the user “can interact” with that object :
- -| fragment | -type | -example value | -
|---|---|---|
href |
-string (uri or predefined view) | -#pyramid, #lastvisit, xrf://#-someobject, ://somefile.gltf#foo |
-
Interaction behaviour
- -When clicking an “href”-value, the user(camera) is teleport to the referenced object.
- -The imported/teleported destination can be another object in the same scene-file, or a different file.
- -XR Viewer implementation
- -| spec | -action | -feature | -
|---|---|---|
| level0+1 | -hover 3D file href | -show the preview PNG thumbnail (if any). | -
| level0+1 | -launch 3D file href | -replace the current scene with a new 3D file (href: other.glb e.g.) |
-
| level2 | -click internal 3D file href (#roomB e.g.) |
-teleport the camera to the origin of object(name roomB). See [[teleport camera]]. |
-
| level2 | -click external 3D file href (foo.glb e.g.) |
-replace the current scene with a new 3D file (href: other.glb e.g.) |
-
| level2 | -hover external 3D file href | -show the preview PNG thumbnail (if any sidecar, see level0) | -
| level2 | -activate animation | -clicking href-value #foo will select animation foo (if exist) |
-
| level2 | -click href | -hashbus: execute without changing the toplevel URL location (href: xrf://#someObjectName e.g.) |
-
| level3 | -click href | -set the global 3D animation timeline to its Media Fragment value (#t=2,3 e.g.) |
-
-- -NOTE: hashbus links (
- -xrf://#foo&bar) don’t change the toplevel URL, which makes it ideal for interactions (in contrast to typical#roomCnavigation, which benefit back/forward browser-buttons), see hashbus for more info.default camera (spawn) location: When a 3D file is loaded, it will position the user/camera at xyz: 0,0,0 OR to the location of (an object called) “spawn”.
-
Basically:
- -https://my.org/foo.glb
-
-
-will load as default:
- -https://my.org/foo.glb#spawn
-
-
-Level3: Media Fragments
- -- -
-- -these allow for XR Movies with a controllable timeline using
-hrefURI’s with Media Fragments
Just like with 2D media-files, W3C mediafragments (#t=1,2) can be used to control a timeline via the #t primitive.
-XR Fragments Level3 makes the 3D timeline, as well as URL-referenced files controllable via Media Fragments like:
-
-
- level2 hrefs (
href: #t=4e.g. to control 3D timeline)
- - level4:
xrf:URI scheme: - --
-
href: xrf:foo.wav#t=0to play a wav
-href: xrf:news.glb?clone#t=0to instance and play another experience
-
-
Animation(s) timeline
- -controls the animation(s) of the scene (or src resource which contains a timeline)
| fragment | -type | -functionality | -
|---|---|---|
| #t=start,stop | -[vector2] | -start,stop (in seconds | -
| Example Value | -Explanation | -
|---|---|
#t=1 |
-play (3D) animations from 1 seconds till end (and stop) | -
#t=1,100 |
-play (3D) animations from 1 till 100 seconds (and stop) | -
Specify playback loopmode
- -This compensates a missing element from Media Fragments to enable/disable temporal looping. .
- -| fragment | type | functionality | -| #loop | string | enables animation/video/audio loop | -| #-loop | string | disables animation/video/audio loop |
- -Controlling embedded content
- -use [[URI Templates]] to control embedded media, for example a simple video-player:
- - foo.usdz
- โ
- โโโ โป loopbutton_enable
- โ โ href: #loop <-- enable global loop
- โ
- โโโ โป loopbutton_enable
- โ โ href: #-loop <-- disable global loop
- โ
- โโโ โป playbutton
- โ โ href: #t=10&loop <-- play global 3D timeline (all anims) (looped)
- โ
- โโโ โป playbutton_external
- โ href: https://my.org/animation.glb#!&t=3,10 <-- import & play external anim
-
-
-
-Level4: prefix operators
- -- -
Prefixing objectnames with the following simple operators allow for extremely powerful XR interactions:
- --
-
- #! -
- #* -
- #+ or #- -
- #| -
- xrf: URI scheme -
-- -Examples:
-#+menuto show a object,#-menuto hide a menu,#!menuto teleport a menu,#*blockto clone a grabbable block,#|objectto share an object
Object teleports (!)
- -Prefixing an object with an exclamation-symbol, will teleport a (local or remote) referenced object from/to its original/usercamera location.
[img[objecteleport.png]]
- -Usecases: -* show/hide objects/buttons (menu e.g.) in front of user -* embed remote (object within) 3D file via remote URL -* instance an interactive object near the user regardless of location -* instance HUD or semi-transparent-textured-sphere (LUT) around the user
- -+ +
default portals
To render a portal, the easiest way is JanusXR-style portals:
clickable planes which teleport the user to a different position or file. This is the whole idea behind href and XRF microformat metadata.
In blender you can create a plane, and attach a href hyperlink to it
non-euclidian portals
NOTE: this **extension** is optional, and can be used in a progressive enchanched way across (non)supporting viewers.
+
Portals avoid XR clutter. Rinsema's effect: "To observe much is to absorb little"
A materialless mesh with the following heuristics will render as an immersive portal:
| Portaltype | Heuristics | Result |
| XR lens | child objects in materialless mesh | objects are only visible in mesh |
| XR portal | href value | the other mesh will be used as camera-point (location will have 1.6m camera-height added) |
NOTE: in 3D engines this is refererred to as rendering to a designated stencil.
You can see this demonstrated in index.glb or the demo-video & viewer below:
NOTE: designers are adviced to always accompany a button to the portal (see video), to keep things backwards compatible with barebones (non-portal-supporting) XRF viewers.
Examples
Example scene hierarchy:
-Clicking the href-value above will:
+ my.io/scene.usdz
+ +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+
+ โ world1 โ
+ โ +โโโโโโโโโโโโโโโโโโโโโโโโโ+ โ
+ โ โ myportalmesh------------------+ href: #portalpoint
+ | | | |
+ โ +โโโโโโโโโโโโโโโโโโโโโโโโโ+ โ myportalmesh renders world2
+ โ world2 โ inside from portalpoint's of view
+ โ +โโโโโโโโโโโโโโโโโโโโโโโโโ+ โ (if myportalmesh has no material)
+ โ โ cube โ โ
+ | | portalpoint | |
+ โ +โโโโโโโโโโโโโโโโโโโโโโโโโ+ โ
+ +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+
-
-- reposition the referenced object (menu) to the usercamera’s-coordinates.
-- zoom in case of (non-empty) mesh-object: rescale to 1 mยณ, and position 1m in front of the camera
-- toggle behaviour: revert values if 1⁄2 were already applied
-#+ is always implied (objects are always made visible)
-
+Lenses
Will render objects inside of the portal (children) ONLY inside of the portal.

Example scene hierarchy:
-This tiny but powerful symbol allows incredible interactive possibilities, by carefully positioning re-usable objects outside of a scene (below the usercamera’s floor e.g.).
-
-
-- href:
#whiteroom&!explainer&!exitmenu
-
+ my.io/scene.usdz
+ +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+
+ โ world1 โ
+ โ +โโโโโโโโโโโโโโโโโโโโโโโโโ+ โ
+ โ โ myportal | | myportal renders someinfo inside
+ | | +โโโโโโโโโโ+ | | as portal
+ | | | someinfo | | | (if myportal has no material)
+ | | +โโโโโโโโโโ+ | |
+ โ +โโโโโโโโโโโโโโโโโโโโโโโโโ+ โ
+ +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+
+Demo viewer
Press the 'Teleport down there'-button (in the lens) and witness the portals afterwards yourself:
set the position of the camera.
+
+
level1 spawnpoints
Spawn user at object (with name)barafter loading (and replacing the current scene with)world.glb
level2 href spawnpoints
| objectname | optional | functionality |
| spawn | yes | Specifies default camera-position (if exist). Detected after loading scene (world.glb e.g.), if no URI hashtag is present (world.glb#roomC e.g.) |
| URI fragment | type | functionality |
| #roomB | string | position camera to position of object with name roomB |
| #cam2 | string | position camera to position of camera with name cam02, and make it active camera [follow animation e.g.] |
| https://my.org/worldX.glb#roomY | string | position camera to position of object roomC after replacing the current scene with worldX.glb |
the usercamera (usually default at0,0,0or at objectnamespawn) is repositioned to the origin and upvector of the target object, and only in VR/AR its height gets adjusted (~1.6m height is subtracted, to compensate for camera-rig )
To enable VR elevators e.g., make sure:
the camera is attach/parented to that object (so it animates along with the object)
You can add this URI Fragment to the top-level URLbar, or as href value (to trigger via click) in a 3D model Editor (Blender e.g.):
IMPORTANT: please respect collidable floor / objects. Also notice that#pos=roomBhas been deprecated in favor of#roomBto simplify the spec.
Developers only:
ยป example implementation
+ยป discussion
Spec
Below is the related section of the spec (full spec here: HTML, TXT)
+
How can applications discover 3D experiences on a network? +
-- -This will teleport the user to
+whiteroomand moves objectexplainerandexitmenuin front of the user.Answer: spatial microformats +
-
-
- href: `https://my.org/foo.glb#! -
Clicking the href-value above will:
- --
-
- import
foo.glbfrommy.org’s webserver
- - show it in front of the user (because
#!indicates object teleport)
-
-
-
- href:
https://foo.glb#roomB&!bar
-
Clicking the href-value above will:
- --
-
- replace the current scene with
foo.glb
- - teleport the user to #roomB inside
foo.glb
- - instance the referenced object (bar inside foo.glb) in front of the user. -
- it will update the top-Level URL (because
xrf:was not used)
- - hide the instanced object when clicked again (toggle visibility) -
-- -NOTE: level2 teleportation links, as well as instancing mitigates the ‘broken embedded image’-issue of HTML: always attaching the href-values to a 3D (preview) object (that way broken links will not break the design).
-
Example: clicking a 3D button with title ‘menu’ and href-value xrf:menu.glb?instance#t=4,5 would instance a 3D menu (menu.glb) in front of the user, and loop its animation between from 4-5 seconds (t=4,5)
-- -NOTE: combining instance-operators allows dynamic construction of 3D scenes (
-#london&!welcomeMenu&!fadeBoxe.g.)
Object multipliers (*)
- -The star-prefix will clone a (local or remote) referenced object to the usercamera’s location, and make it grabbable.
-Usecases:
-* object-picker (build stuff with objects)
-- -NOTE: this is basically the #! operator which infinitely clones the referenced object (instead of repositioning the object).
-
De/selectors (+ and -)
- --- -How to show/hide/group material- or object- or animations by name?
-
Clicking href-values below will show/hide the targeted material- or animation or object-name (incl. children):
- --
-
#-welcome
-#+welcome
-#-VR*
-https://foo.glb#bar&-welcome
-
Matching logic:
- --
-
- - and + prefix for exact matches (welcome e.g.) -
- * postfix for match beginning (VR_skybox VR_skyboxmat e.g.) -
-- -NOTE: to hide a skybox when importing/loading a 3D file (force AR) is possible by linking to `
-https://my.org/foo.glb#-skyboxorhttps://my.org/foo.glb#-skyboxmaterial
Sharing object or file (#|)
- -The pipe-symbol (|) sends a (targeted) object to the OS.
-Clicking the href-value below will:
-
-
- share the (targeted object in the) file to a another application -
-- -This URL can be fed straight into Web Share API or xdg-open
-
-
-
- href:
xrf://#|bar
-
-- -NOTE: sharing is limited to (internal objects) via
-xrf:scheme-only
xrf:// URI scheme
- -Prefixing the xrf: to href-values will prevent level2 href-values from changing the top-Level URL.
-- -Usecase: for non-shareable URLs like
-href: xrf:#t=4,5, to display a stateful msg e.g.).
Reason: XR Fragments is inspired by HTML’s href-attribute, which does various things:
- --
-
- it updates the browser-location -
- it makes something clickable -
- it jumps to another document / elsewhere in the same document -
- and more -
The xrf: scheme will just do 2 & 3 (so the URL-values will not leak into the top-level URL).
-- -compliance with RFC 3986: unimplemented/unknown URI schemes (
-xrf:...e.g.) will not update the top-level URL
Level5: URI Templates (RFC6570)
- -)
- -XR Fragments adopts Level1 URI Fragment expansion to provide safe interactivity.
-This is non-normative, and the draft spec is available on request.
Top-level URL processing
- -- -
-- -Example URL:
-://foo/world.gltf#room1&t=10&cam
The URL-processing-flow for hypermedia browsers goes like this:
- --
-
- IF scene operators and/or animation operator (
t) are present in the URL then (re)position the camera (toroom1) and/or animation-range (10) accordingly.
- - IF no camera-position has been set in step 1 or 2 assume
0,0,0as camera coordinate (XR: add user-height) (example)
- - IF a camera-object exists with name
camassume that user(camera) position
-
UX
- -End-users should always have read/write access to:
- --
-
- the current (toplevel) URL (an URLbar etc) -
- URL-history (a back/forward button e.g.) -
- Clicking/Touching an
hrefnavigates (and updates the URL) to another scene/file (and coordinate e.g. in case the URL contains XR Fragments).
-
Example: Navigating content href portals
- -- -
navigation, portals & mutations
- -| fragment | -type | -example value | -
|---|---|---|
href |
-string (uri or predefined view) | -#room1#room1://somefile.gltf#room1 |
-
-
-
clicking an outbound “external”- or “file URI” fully replaces the current scene and assumes
room2by default (unless specified)
-
-relocation/reorientation should happen locally for local URI’s (
#....)
-
-navigation should not happen “immediately” when user is more than 5 meter away from the portal/object containing the href (to prevent accidental navigation e.g.)
-
-URL navigation should always be reflected in the client URL-bar (in case of javascript: see [here for an example navigator), and only update the URL-bar after the scene (default fragment
#) has been loaded.
-
-In immersive XR mode, the navigator back/forward-buttons should be always visible (using a wearable e.g., see [here for an example wearable)
-
-make sure that the “back-button” of the “browser-history” always refers to the previous position (see [here)
-
-ignore previous rule in special cases, like clicking an
hrefusing camera-portal collision (the back-button could cause a teleport-loop if the previous position is too close)
-
-href-events should bubble upward the node-tree (from children to ancestors, so that ancestors can also conain an href), however only 1 href can be executed at the same time.
-
-the end-user navigator back/forward buttons should repeat a back/forward action until a
#...primitive is found (the stateless xrf:// href-values should not be pushed to the url-history)
-
ยป example implementation
-ยป example 3D asset
-ยป discussion
Walking surfaces
- --- -By default position
-0,0,0of the 3D scene represents the walkable plane, however this is overridden when the following applies:
XR Fragment-compatible viewers can infer this data based scanning the scene for:
- --
-
- materialless (nameless & textureless) mesh-objects (without
hrefand >0 faces)
-
-- -optionally the viewer can offer thumbstick, mouse or joystick teleport-tools for non-roomscale VR/AR setups.
-
Example: Virtual world rings
- -- -
Consider 3D scenes linking to eachother using these href values, attached to 3D button-objects:
-
-
href: schoolA.edu/projects.gltf#math
-href: schoolB.edu/projects.gltf#math
-href: university.edu/projects.gltf#math
-
This would teleport users to the math-projects of those universities.
-Now consider adding a ‘webring index’-button to each file, with this href-value:
-
-
- href: workgroup.edu/webrings.glb#!webringmenu -
This would allow displaying the (remote 3D file) webring menu with various href-buttons inside, all centrally curated by the workgroup.
- -Additional scene metadata
- -- -
XR Fragments does not aim to redefine the metadata-space or accessibility-space by introducing its own cataloging-metadata fields. -Instead, it encourages browsers to scan nodes for the following custom properties:
- --
-
- SPDX license information -
- ARIA attributes (
aria-*: .....)
- - datapackage.json findability, accessibility, interoperability, and reusability of data -
ARIA’s aria-description-metadata is normative, to aid accessibility and scene transcripts
-- -NOTE: please always start
-aria-descriptionwith a verb to aid transcripts.
The following metadata are non-normative but encouraged, since they are popular and cheap to parse:
- --
-
- RDF/JSON-LD like this example or via glTF’s KHR_xmp_json_ld extension -
- Open Graph attributes (
og:*: .....)
- - Dublin-Core attributes(
dc:*: .....)
- - BibTex when known bibtex-keys exist with values enclosed in
{and},
-
-- -Example: object ‘tryceratops’ with
-aria-description: is a huge dinosaurus standing on a #mountaingenerates transcript#tryceratops is a huge dinosaurus standing on a #mountain, where the hashtags are clickable XR Fragments (activating the visible-links in the XR browser).
Individual nodes can be enriched with such metadata, but most importantly the scene node:
- -| metadata key | -example value | -
|---|---|
aria-description, og:description, dc:description |
-An immersive experience about Triceratops (*) |
-
SPDX |
-CC0-1.0 |
-
dc:creator |
-John Doe |
-
dc:title, og:title |
-‘Triceratops` (*) | -
og:site_name |
-https://xrfragment.org |
-
dc.publisher |
-NLNET |
-
dc.date |
-2024-01-01 |
-
dc.identifier |
-XRFRAGMENT-001 |
-
journal (bibTeX) |
-{Future Of Text Vol 3}, |
-
-- -* = these are interchangable (only one needs to be defined)
-
There’s no silver bullet when it comes to metadata, so XR Fragment-implementations should support where the metadata is/goes.
- --- -These attributes can be scanned and presented during an
-hreforsrceye/mouse-over.
Accessibility interface
- -- -
The addressibility of XR Fragments allows for unique 3D-to-text transcripts, as well as an textual interface to navigate 3D content.
-Spec:
-
-
- The enduser must be able to enable an accessibility-mode (which persists across application/webpage restarts) -
- Accessibility-mode must contain a text-input for the user to enter text -
- Accessibility-mode must contain a flexible textlog for the user to read (via screenreader, screen, or TTS e.g.) -
- the textlog contains
aria-descriptions, and its narration (Screenreader e.g.) can be skipped (via 2-button navigation)
- - The
backcommand should navigate back to the previous URL (alias for browser-backbutton)
- - The
forwardcommand should navigate back to the next URL (alias for browser-nextbutton)
- - A destination is a 3D node containing an
hrefwith a#...XR fragment (which matches a 3d object name)
- - The
gocommand should list all possible destinations
- - The
go leftcommand should move the camera around 0.3 meters to the left
- - The
go rightcommand should move the camera around 0.3 meters to the right
- - The
go forwardcommand should move the camera 0.3 meters forward (direction of current rotation).
- - The
rotate leftcommand should rotate the camera 0.3 to the left
- - The
rotate leftcommand should rotate the camera 0.3 to the right
- - The (dynamic)
go abccommand should navigate to#scene2in case there’s a 3D node with nameabcandhrefvalue#scene2
- - The
lookcommand should give an (contextual) 3D-to-text transcript, by scanning thearia-descriptionvalues of the current#...(3D object) value (including its children)
- - The
docommand should list all possiblehrefvalues which don’t contain an#...XR Fragment
- - The (dynamic)
do abccommand should navigate/executehttps://.../...in case a 3D node exist with nameabcandhrefvaluehttps://.../...
-
Two-button navigation
- -For specific user-profiles, gyroscope/mouse/keyboard/audio/visuals will not be available.
-Therefore a 2-button navigation-interface is the bare minimum interface:
-
-
- objects with href metadata can be cycled via a key (tab on a keyboard) -
- objects with href metadata can be activated via a key (enter on a keyboard) -
- the TTS reads the href-value (and/or aria-description if available) -
XRF microformat
- -How can applications discover 3D experiences on a network?
- --- -Answer: spatial microformats
-
The XRF microformat is an optional text heuristics which applications can detect across various usecases.
- -via HTML webpage
- -If the browser/application requests an webpage (https://nlnet.nl e.g.) it should check for the rel-me microformat :
<link rel="alternate" as="spatial-entrypoint" href="scene.xrf.glb">
+The XRF microformat is an optional text heuristics which applications can detect across various usecases.
+
+via HTML webpage
+If the browser/application requests an webpage (https://nlnet.nl e.g.) it should check for the rel-me microformat :
+
+<link rel="alternate" as="spatial-entrypoint" href="scene.xrf.glb">
-
-This way the application loads https://nlnet.nl/scene.xrf.glb when the user types nlnet.nl into the URLbar.
-Optionally, type can be specified for dynamically generated 3D files:
-
-<link rel="alternate" as="spatial-entrypoint" href="https://worlds.org/scene.php#platformB" type="model/gltf+binary" />
+This way the application loads https://nlnet.nl/scene.xrf.glb when the user types nlnet.nl into the URLbar.
+Optionally, type can be specified for dynamically generated 3D files:
+
+<link rel="alternate" as="spatial-entrypoint" href="https://worlds.org/scene.php#platformB" type="model/gltf+binary" />
-
-The type-attribute is for fallback-purposes.
-Viewer-supported 3D file-extensions (.glb e.g.) will ALWAYS take precedence over the (non)presence of the type attribute.
-The reason is that platforms (Mastodon ‘labels’ e.g.) don’t allow specifying type-attributes.
-Another reason is that XR Fragments is filetype-agnostic, so flexibility is expected on the viewer-side.
-
+The type-attribute is for fallback-purposes.
+Viewer-supported 3D file-extensions (.glb e.g.) will ALWAYS take precedence over the (non)presence of the type attribute.
+The reason is that platforms (Mastodon 'labels' e.g.) don't allow specifying type-attributes.
+Another reason is that XR Fragments is filetype-agnostic, so flexibility is expected on the viewer-side.
+
-NOTE: in case of multiple 3D files mentioned in <link rel="me", only the first (supported 3D filetype) will be chosen.
+NOTE: in case of multiple 3D files mentioned in <link rel="me", only the first (supported 3D filetype) will be chosen.
+
+Collections
+Example of a webpage with collection of 3D models (like icosa.gallery):
+
+<link rel='alternate' as='spatial-portal' href="result1.glb"/>
+<link rel='alternate' as='spatial-portal' href="result2.glb"/>
+<link rel='alternate' as='spatial-portal' href="result3.glb#buildingA"/>
+<link rel='alternate' as='spatial-portal' href="result3.glb#buildingB"/>
-Example of multiple spatial microformats:
-
-<link rel="alternate" as="spatial-entrypoint" href="scene.xrf.glb"/>
-<link rel="me" href="myavatar.vrm"/>
-<!-- JanusXR microformat https://github.com/jbaicoianu/janusweb
- <FireBoxRoom>
- <Assets>
- <assetobject id="experience" src="scene.xrf.glb"/>
- </Assets>
- <Room>
- <object pos="0 0 0" collision_id="experience" id="experience" />
- </Room>
- </FireBoxRoom>
+<!-- optional: pagination hints -->
+<link rel='next' as='spatial-portal' href="..."/>
+<link rel='prev' as='spatial-portal' href="..."/>
+<link rel="pages" min="1" max="46" items="8" />
+
+3D engines (games/apps) can render these like clickable portals, for example JanusXR-style portals:
+
+
+
+NOTE: for more customizability JML <link> will allow for positioning/thumbnailed portals:
+
+
+<fireboxroom>
+ <assets>
+ <assetimage src="/img/thumb1.jpg" id="img1"/>
+ <assetimage src="/img/thumb2.jpg" id="img2"/>
+ </assets>
+ <room skybox="true" pos="0 0 0" showavatar="false" use_local_asset="room_plane">
+ <link url="/myverse/janusxr_tutorial1/" thumb_id="img1" title_col="0.4 0.37 0.4" pos="0 0 0.001" draw_glow="true" scale="3 3 0.1" />
+ <link url="/myverse/janusxr_tutorial2/" thumb_id="img2" title_col="0.4 0.37 0.4" pos="3 0 0.001" draw_glow="true" scale="3 3 0.1" />
+ </room>
+</fireboxroom>
+
+Mixing multiple spatial microformats:
+<link rel="alternate" as="spatial-entrypoint" href="scene.xrf.glb"/>
+<link rel="me" href="myavatar.vrm"/>
+<!-- JanusXR JML https://github.com/jbaicoianu/janusweb
+<fireboxroom>
+ <room>
+ <object id="scene.xrf.glb" pos="0 0 0"/>
+ </room>
+</fireboxroom>
-->
-
-via WebFinger
-
-When John has an account on foo.com, how can other applications request his 3D homepage by simply entering john@foo.com?
-
+via WebFinger
+When John has an account on foo.com, how can other applications request his 3D homepage by simply entering john@foo.com?
+
-Answer: it can be requested at https://foo.com/.well-known/webfinger?resource=acct:john@foo.com, resulting in:
+Answer: it can be requested at https://foo.com/.well-known/webfinger?resource=acct:john@foo.com, resulting in:
+
-
{
- "subject": "acct:john@foo.com",
- "aliases": [
- "https://mastodon.example/social/john",
- "https://john.foo.com",
- "https://3d.john.foo.com/model/scene.glb"
+ "subject": "acct:john@foo.com",
+ "aliases": [
+ "https://mastodon.example/social/john",
+ "https://john.foo.com",
+ "https://3d.john.foo.com/model/scene.glb"
],
- "properties": {
- "http://schema.org/name": "John Doe",
- "http://schema.org/description": "Developer, 3D Enthusiast, and Social Explorer"
+ "properties": {
+ "http://schema.org/name": "John Doe",
+ "http://schema.org/description": "Developer, 3D Enthusiast, and Social Explorer"
},
- "links": [
+ "links": [
{
- "rel": "http://ostatus.org/schema/1.0/subscribe",
- "template": "https://mastodon.example/social/john/{uri}"
+ "rel": "http://ostatus.org/schema/1.0/subscribe",
+ "template": "https://mastodon.example/social/john/{uri}"
},
{
- "rel": "self",
- "type": "text/html",
- "href": "https://john.foo.com"
+ "rel": "self",
+ "type": "text/html",
+ "href": "https://john.foo.com"
},
{
- "rel": "me",
- "type": "text/html",
- "href": "https://john.foo.com"
+ "rel": "me",
+ "type": "text/html",
+ "href": "https://john.foo.com"
},
{
- "rel": "me",
- "type": "model/gltf+binary",
- "href": "https://3d.john.foo.com/model/avatar.vrm"
+ "rel": "me",
+ "type": "model/gltf+binary",
+ "href": "https://3d.john.foo.com/model/avatar.vrm"
},
{
- "rel": "scene",
- "type": "model/gltf+binary",
- "href": "https://3d.john.foo.com/model/scene.xrf.glb"
+ "rel": "scene",
+ "type": "model/gltf+binary",
+ "href": "https://3d.john.foo.com/model/scene.xrf.glb"
}
]
}
-
-This way the application will load https://3d.john.foo.com/model/scene.glb when the user types john@foo.com into the user field.
-
-via Text (URI)
-
-Another way for an application to trigger loading a 3D scene is by detecting URI’s of 3D scene-files any text:
-
+This way the application will load https://3d.john.foo.com/model/scene.glb when the user types john@foo.com into the user field.
+
+via Text (URI)
+As a fallback, for an application to trigger loading a 3D scene is by detecting URI's of 3D scene-files any text:
+
-foo.glb (or any other popular 3D extension)
-https://foo.com/scene.glb (or any other popular protocol)
+foo.glb (or any other popular 3D extension)
+https://foo.com/scene.glb (or any other popular protocol)
-
-This way, the application can highlight the link whenever it detects the URI (in a text-file or text-section of a 3D model)
-
-Overlap with fileformat-specific extensions
-
-Some 3D scene-fileformats have support for extensions.
-What if the functionality of those overlap?
-For example, GLTF has the OMI_LINK extension which might overlap with XR Fragment’s href:
-
+This way, the application can highlight the link whenever it detects the URI (in a text-file or text-section of a 3D model)
+
+
-- -Priority Order and Precedence, otherwise fallback applies
+What if we embed XR Fragment URI's inside a 3D or XML file? +
1.Extensions Take Precedence: Since glTF-specific extensions are designed with the formatโs -specific needs and optimizations in mind, they should take precedence over extras metadata -in cases where both contain overlapping functionality. -This approach aligns with the idea that extensions are more likely to be interpreted uniformly by glTF-compatible software.
- --
-
- Fallback Fall-through Mechanism: -If a glTF implementation does not support a particular extension, the (XRF) extras field can serve as a fallback. This way, metadata provided in extras can still be useful for applications that don’t handle certain extensions. -
-- -Example 1 In case of the OMI_LINK glTF extension (
- -href: https://nlnet.nl) and an XR Fragment (href: #otherroomorhref: otherplanet.glb), it is clear thathttps://nlnet.nlshould open in a browsertab, whereas the XR Fragment links should teleport the user. If the OMI_LINK contains an XR Fragment (#room1e.g.) a teleport should be performed only (and other [overlapping] metadata should be ignored).Example 2 If an Extensions uses XR Fragments in URI’s (
-href: #otherroomorhref: xrf://-wallsin OMI_LINK e.g.), then perform them according to XR Fragment spec (teleport user). But only once: ignore further overlapping metadata for that usecase.
Vendor Prefixes
- -- -
Vendor-specific metadata in a 3D scenefiles, are similar to vendor-specific CSS-prefixes (-moz-opacity: 0.2 e.g.).
-This allows popular 3D engines/frameworks, to initialize specific features when loading a scene/object, in a progressive enhanced way.
Vendor Prefixes allows embedding 3D engines/framework-specific features a 3D file via metadata:
- -| what | -XR metadata | -Lowest common denominator | -
|---|---|---|
| CSS | -vendor-agnostic | -2D canvas + object referencing/styling | -
| XR Fragments | -vendor-agnostic | -3D camera + object(file) load/embed/click/referencing | -
| Vendor prefixs | -vendor-specific | -Specialized Entity-Component implementation | -
-- -Why? Because not all XR interactions can/should be solved/standardized by embedding XR Fragments into any 3D file. -The lowest common denominator between 3D engines is the ‘entity’-part of their entity-component-system (ECS). The ‘component’-part can be progressively enhanced via vendor prefixes.
-
For example, the following metadata can be added to a .glb file, to make an object grabbable in AFRAME:
- -+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+
-โ http://y.io/z.glb | AFRAME app โ
-โ-----------------------------------------------+--------------------------------------------------------โ
-โ | โ
-โ | after loading the glb, john can be placed into the โ
-โ +-[3D mesh]-+ | castle via hands, because the author added metadata to โ
-โ | / \ | | john via either: โ
-โ | / \ | | โ
-โ | / \ | | 1. Blender (custom property-box, no plugins needed) โ
-โ | |_____| | | โ
-โ +-----โ-----+ | 2. javascript-code: โ
-โ โ | โ
-โ โโ name: castle | for( var com in this.el.components ){ โ
-โ โโ tag: house baroque | this.el.object3D.userData[`-AFRAME-${com}`] = '' โ
-โ | } โ
-โ [3D mesh-+ | // save to z.glb in AFRAME inspector โ
-โ | โโ name: john | โ
-โ | O โโ age: 23 | โ
-โ | /|\ โโ -aframe-grabbable: '' | > inits 'grabbable' component on object john โ
-โ | / \ โโ -aframe-material.color: '#F0A' | > inits 'material' component on object john โ
-โ | โโ -aframe-text.value: '{name}{age}'| > inits 'text' component (*) with value 'john' โ
-โ | โโ -three-material.fog: false | > changes material settings in THREE.js app โ
-โ | โโ -godot-Label3D.text: '{name}{age}'| > inits 'Label3D' component (*) in Godot โ
-โ +--------+ | โ
-โ | โ
-โโ -GODOT-version: '4.3' | > exporters/authors can report targeted version โ
-โโ -AFRAME-version: '1.6.0' | and (optionally) hint component-repoโ
-โโ -AFRAME-info: 'https://git.benetou.fr/comps' โ
-โ | โ
-+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+
+level2 promotes adding clickable hyperlinks, via the href metadata attribute.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<room>
+ <object id="plane" js_id="button" href="#building"/>
+ <object id="cube" js_id="building"/>
+ <link url="foo.glb#spawn"/>
+</room>
-
-
-- key/value syntax: -
<vendorname>-<component|version>.<key> [string/boolean/float/int]-value
-
-
-String-templatevalues are evaluated as per URI Templates (RFC6570) Level 1.
-
+Clicking the plane will teleport the user to object building.
+Clicking the portal (<link>) will clear the scene, load foo.glb and teleport the user to object spawn.
+
-This ‘separating of mechanism from policy’ (unix rule) does somewhat break portability of an XR experience, but still prevents (E-waste of) handcoded virtual worlds. It allows for (XR experience) metadata to survive in future 3D engines and scene-fileformats.
+For more info about JanusXR
+
+
+
+cube = scene.getObjectByName("cube")
+sphere = scene.getObjectByName("sphere")
-Security Considerations
+// add URI's with XR Fragments
+cube.userData.href = '#platform2'
+sphere.userData.href = "foo.glb#spawn'
-
-
-The only dynamic parts are W3C Media Fragments and URI Templates (RFC6570).
-The use of URI Templates is limited to pre-defined variables and Level0 fragments-expansion only, which makes it quite safe.
-n fact, it is much safer than relying on a scripting language (javascript) which can change URN too.
-
-FAQ
-
-
-
-Q: Why is everything HTTP GET-based, what about POST/PUT/DELETE HATEOS
-A: Because it’s out of scope: XR Fragment specifies a read-only way to surf XR documents. These things belong in the application layer (for example, an XR Hypermedia browser can decide to support POST/PUT/DELETE requests for embedded HTML thru src values)
-
-
-
-Q: Why isn’t there support for scripting, URI Template Fragments are so limited compared to WASM & javascript
-A: This is out of scope as it unhyperifies hypermedia, and this is up to XR hypermedia browser-extensions.
Historically scripting/Javascript seems to been able to turn webpages from hypermedia documents into its opposite (hyperscripted nonhypermedia documents).
In order to prevent this backward-movement (hypermedia tends to liberate people from finnicky scripting) XR Fragment uses W3C Media Fragments and URI Templates (RFC6570), to prevent unhyperifying itself by hardcoupling to a particular markup or scripting language.
-XR Fragments supports filtering objects in a scene only, because in the history of the javascript-powered web, showing/hiding document-entities seems to be one of the most popular basic usecases.
-Doing advanced scripting & networkrequests under the hood are obviously interesting endavours, but this is something which should not be hardcoupled with XR Fragments or hypermedia.
This perhaps belongs more to browser extensions.
-Non-HTML Hypermedia browsers should make browser extensions the right place, to ‘extend’ experiences, in contrast to code/javascript inside hypermedia documents (this turned out as a hypermedia antipattern).
-
-authors
-
-
-
-
-- Leon van Kammen (@lvk@mastodon.online)
-- Jens Finkhรคuser (@jens@social.finkhaeuser.de)
-
-
-IANA Considerations
-
-
-
-This document has no IANA actions.
-
-Acknowledgments
-
-
-
-
-- NLNET
-- Future of Text
-- James Baicoianu janusweb
-- Michiel Leenaars
-- Gerben van der Broeke
-- Mauve
-- Jens Finkhรคuser
-- Marc Belmont
-- Tim Gerritsen
-- Frode Hegland
-- Brandel Zackernuk
-- Mark Anderson
-
-
-Appendix: Definitions
-
-
+// local teleport!
+cube.onClick = () => {
+ camera.position.copy( scene.getObjectByName("platform2").position )
+}
+// remote teleport!
+sphere.onClick = await () => {
+ scene.clear()
+ await scene.load('foo.glb')
+ camera.position.copy( scene.getObjectByName("spawn").position )
+}
+
+Clicking the cube will teleport the user to object 'platform2'.
+Clicking the sphere will clear the scene, load foo.glb and teleport the user to object spawn.
+
+
+
+
+NOTE: gltf-models fully support href's in this implementation but href in markup is not supported (yet: JanusXR is a safer bet)
+
+
+<a-scene>
+ <a-cube href="#building"/>
+ <link href="foo.glb#spawn"/>
+</a-scene>
+
+Clicking the cube will teleport the user to object building.
+Clicking the portal (<link>) will clear the scene, load foo.glb and teleport the user to object spawn.</div>
+
+
+
+
+NOTE: no implementation (yet)
+
+
+<m-cube href="#building"></m-cube>
+<m-sphere href="foo.glb#spawn"></m-cube>
+
+Clicking the cube will teleport the user to object building.
+Clicking the sphere will clear the scene, load foo.glb and teleport the user to object spawn.</div>
+
+
+
+ All modern 3D editors can attach metadata to objects, and export these as 'extras' with the 3D file.
+
+
+
+An Easy nocode way to add metadata is by adding custom properties in blender e.g.. This is demonstrated in the getting started video:
+
+
+
+Undefined widget 'videojs'
+
+
+
-definition
-explanation
+custom property
+type
+functionality
-
-human
-a sentient being who thinks fuzzy, absorbs, and shares thought (by plain text, not markuplanguage)
-
-
-
-scene
-a (local/remote) 3D scene or 3D file (index.gltf e.g.)
-
-
-
-3D object
-an object inside a scene characterized by vertex-, face- and customproperty data.
-
-
-
-URI
-some resource at something somewhere via someprotocol (http://me.com/foo.glb#foo or e76f8efec8efce98e6f see interpeer.io)
-
-
-
-URL
-something somewhere via someprotocol (http://me.com/foo.glb)
-
-
-
-URN
-something at some domain (me.com/foo.glb)
-
-
-
-metadata
-custom properties of text, 3D Scene or Object(nodes), relevant to machines and a human minority (academics/developers)
-
-
-
-XR fragment
-URI Fragment with spatial hints (which match the name of a 3D object-, camera-, animation-object)
-
-
-
-the XRWG
-wordgraph (collapses 3D scene to tags)
-
-
-
-the hashbus
-hashtags map to camera/scene-projections
-
-
-
-spacetime hashtags
-positions camera, triggers scene-preset/time
-
-
-
-teleportation
-repositioning the enduser to a different position (or 3D scene/file)
-
-
-
-sourceportation
-teleporting the enduser to the original XR Document of an src embedded object.
-
-
-
-placeholder object
-a 3D object which with src-metadata (which will be replaced by the src-data.)
-
-
-
-src
-(HTML-piggybacked) metadata of a 3D object which instances content
-
-
-
-href
-(HTML-piggybacked) metadata of a 3D object which links to content
-
-
-
-filter
-URI Fragment(s) which show/hide object(s) in a scene based on name/tag/property (#cube&-price=>3)
-
-
-
-requestless metadata
-metadata which never spawns new requests (unlike RDF/HTML, which can cause framerate-dropping, hence not used a lot in games)
-
-
-
-FPS
-frames per second in spatial experiences (games,VR,AR e.g.), should be as high as possible
-
-
-
-introspective
-inward sensemaking (“I feel this belongs to that”)
-
-
-
-extrospective
-outward sensemaking (“I’m fairly sure John is a person who lives in oklahoma”)
-
-
-
-โป
-ascii representation of an 3D object/mesh
-
-
-
-(un)obtrusive
-obtrusive: wrapping human text/thought in XML/HTML/JSON obfuscates human text into a salad of machine-symbols and words
-
-
-
-flat 3D object
-a 3D object of which all verticies share a plane
+href
+string (uri or predefined view)
+href navigation / portals / teleporting to other XR documents
-Index
-
-
-- A
--
-
-
-
-
-- C
--
-
--
-Conventions and Definitions [go]
-
-
-
-
-
-- F
--
-
--
-FAQ [go]
-
-
-
-
-- H
--
-
--
-HFL (Hypermediatic Feedback Loop [go]
-
-
-
-
-
-- L
--
-
-
-
-
-
-- T
--
-
--
-Top-level URL processing [go]
-
-
-
-
-- V
--
-
--
-Vendor Prefixes [go]
-
-
-
-
-- W
--
-
--
-What is XR Fragments [go]
-
-
-
-
-- X
--
-
--
-XR Fragment URL Grammar [go]
-
-
-
-
-- a
--
-
--
-authors [go]
-
-
-
-
+
+3D documents using href are spec-compliant but similar variants (<Link url="..."> in JanusXR JML e.g) are considered spec-compatible
+
+
+
+Object metadata can also be added/exported programmatically, for example in AFRAME/THREE.js can export GLB/USDZ/OBJ/COLLADA-files with them, after setting myobject.userData.href = "#nameofplane" e.g.
+
+Spec
+Below is the related section of the spec (full spec here: HTML, TXT)
+
+
+Adding links to 3D objects
Clicking an 3D object with href-data, will teleport the user to that file and/or object.

+
+
+
+
+
+
+
+
+
+
+
+
+<room>
+ <object id="plane" js_id="button" href="#building"/>
+ <object id="cube" js_id="building"/>
+ <link url="foo.glb#spawn"/>
+</room>
+
+Clicking the plane will teleport the user to object building.
+Clicking the portal (<link>) will clear the scene, load foo.glb and teleport the user to object spawn.
+
+
+For more info about JanusXR
+
+
-
+
+cube = scene.getObjectByName("cube")
+sphere = scene.getObjectByName("sphere")
+// add URI's with XR Fragments
+cube.userData.href = '#platform2'
+sphere.userData.href = "foo.glb#spawn'
+
+// local teleport!
+cube.onClick = () => {
+ camera.position.copy( scene.getObjectByName("platform2").position )
+}
+
+// remote teleport!
+sphere.onClick = await () => {
+ scene.clear()
+ await scene.load('foo.glb')
+ camera.position.copy( scene.getObjectByName("spawn").position )
+}
+
+Clicking the cube will teleport the user to object 'platform2'.
+Clicking the sphere will clear the scene, load foo.glb and teleport the user to object spawn.
+
+
+
+
+NOTE: gltf-models fully support href's in this implementation but href in markup is not supported (yet: JanusXR is a safer bet)
+
+
+<a-scene>
+ <a-cube href="#building"/>
+ <link href="foo.glb#spawn"/>
+</a-scene>
+
+Clicking the cube will teleport the user to object building.
+Clicking the portal (<link>) will clear the scene, load foo.glb and teleport the user to object spawn.</div>
+
+
+
+
+NOTE: no implementation (yet)
+
+
+<m-cube href="#building"></m-cube>
+<m-sphere href="foo.glb#spawn"></m-cube>
+
+Clicking the cube will teleport the user to object building.
+Clicking the sphere will clear the scene, load foo.glb and teleport the user to object spawn.</div>
+
+
+
+ All modern 3D editors can attach metadata to objects, and export these as 'extras' with the 3D file.
+
+
+
+An Easy nocode way to add metadata is by adding custom properties in blender e.g.. This is demonstrated in the getting started video:
+
+
+
+Undefined widget 'videojs'
+
+
+property type example value hrefstring (uri) #bar
#pyramid
xrf://#-someobject
://somefile.gltf#foo
Interaction behaviour
1. when clicking a href-value (#bar e.g.), the user(camera) is teleport to the referenced object.
2. when clicking a remote href-value (https://foo.org/hello.glb#bar e.g.), then that 3D file replaces the current scene (+user(camera) is teleported to any referenced object roomB).
XR Safety Exception: when linking to a 3D file which has zero signs of XR Fragments (see ๐ level0: File), it will be treated as an Object import
Spec
See the full spec here: HTML, TXT
Demo
Undefined widget 'videojs'
capture of aframe/sandbox
XR Viewer implementation
spec action feature level0+1 hover 3D file href show the preview PNG thumbnail (if any). See ๐ level0: File) level0+1 launch 3D file href replace the current scene with a new 3D file (href: other.glb e.g.) level2 click internal 3D file href (#roomB e.g.) teleport the camera to the origin of object(name roomB). See teleport camera. level2 click external 3D file href (foo.glb e.g.) replace the current scene with a new 3D file (href: other.glb e.g.) level2 hover external 3D file href show the preview PNG thumbnail (if any sidecar ๐ level0: File) level2 click href hashbus: execute without changing the toplevel URL location (href: xrf://#someObjectName e.g.) level3 click href set the global 3D animation timeline to its Media Fragment value (#t=2,3 e.g.)
NOTE: hashbus links (xrf://#foo&bar) don't change the toplevel URL, which makes it ideal for interactions (in contrast to typical #roomC navigation, which benefit back/forward browser-buttons), see hashbus for more info.
XRF viewer pseudocode
scene.traverse( (n) => {
+ if( n.userData.href ){
+ n.addEventListener('click', () => scene.teleport(n.userData.href) )
+ }
+})
+XR Fragment-capable clients offer increased XR Accessibility via aria-description-metadata, and the so-called 2-button navigation:
+
+
+TAB and ENTER actions allow for cycling/executing objects with href metadata contextually, meaning that only relevant objects are candidates for this (allowing comfortable tab-navigation inside huge worlds with large amounts of buttons). The buttons are remappable, and can also be triggered via speech.
+
+
+Example of metadata of an accessible button:
+
+
+href: #platformB
+aria-description: is a space where the history of mankind is explained
+
+
+Selecting the button will display/read to the user: #platformB is a space where the history mankind is explained.
The spec encourages starting aria-description with a verb (for easy transcripts).
+
+
+
+Undefined widget 'videojs'
+
+Here's the relevant part of the spec:
+
+
+
+The spec also defines a simple text-input interface which allows navigation via speech or text-input:
+
+
+set the position of the camera.
+
+
level1 spawnpoints
+ protocol ://
+ my.org/world.glb
+ #bar
+Spawn user at object (with name) bar after loading (and replacing the current scene with) world.glb
level2 href spawnpoints

objectname optional functionality spawn yes Specifies default camera-position (if exist). Detected after loading scene (world.glb e.g.), if no URI hashtag is present (world.glb#roomC e.g.)
URI fragment type functionality #roomB string position camera to position of object with name roomB #cam2 string position camera to position of camera with name cam02, and make it active camera [follow animation e.g.] https://my.org/worldX.glb#roomY string position camera to position of object roomC after replacing the current scene with worldX.glb
the usercamera (usually default at 0,0,0 or at objectname spawn) is repositioned to the origin and upvector of the target object, and only in VR/AR its height gets adjusted (~1.6m height is subtracted, to compensate for camera-rig )
To enable VR elevators e.g., make sure:
the camera is attach/parented to that object (so it animates along with the object)
You can add this URI Fragment to the top-level URLbar, or as href value (to trigger via click) in a 3D model Editor (Blender e.g.):
+Undefined widget 'videojs'
+IMPORTANT: please respect collidable floor / objects. Also notice that #pos=roomB has been deprecated in favor of #roomB to simplify the spec.
Developers only:
ยป example implementation
+ยป discussion
Spec
Below is the related section of the spec (full spec here: HTML, TXT)
+
+
+Guided & interactive XR navigation is possible when using href in WebVTT subtitle-files.
+
+
+Potential
+
+- guided XR tours across multiple files/URLs
+- timeline for spawnpoints
+- rich storytelling / e-learning
+
+Example using sidecar files:
+
+myscene.xrf.glb
+myscene.xrf.vtt
+myscene.xrf.ogg
+
+Since .xrf. (or at least one href) is a heuristic for loading sidecar files, the webvtt subtitles (myscene.xrf.vtt) can be displayed while the experience plays (syncronized with myscene.xrf.ogg):
+
+WEBVTT
+
+00:01.000 --> 00:04.000 href:#spawn
+<v narrator voice>welcome to a special experience.
+one
+two
+three
+
+00:06.000 --> 00:12.000
+Let me take you to the divine..
+
+00:13.000 --> 00:14.000 href:#fadeAudioOut&inside
+Here we are
+
+00:14.000 --> 00:19.000
+Now lets open a portal
+to a remote location
+
+00:19.000 --> 00:25.000 href:https://xrfragment.org
+That portal will take us
+to https://xrfragment.org
+Just click it..
+
+00:25.100 --> 00:30.000
+Welcome to another Janus URL
+
+Here href is used as CUE setting, which the player can act upon.
+
+
+
+
+How to know whether a 3D file is a full scene or just a prop?
When should a 3D file hide its skybox?
How does a file know whether its embedded or not?
How to hide an object in AR-mode only?
How to ''hide'' an object by default, after loading a scene?
+
+
+Answer: somehow tagging the file, or object with predefined classes ; universal XR keywords.
+
+
+
+
+
+
+
+
+
+
+
+
+
+<!-- xr layers: vr ar portal embed -->
+<room>
+ <!-- override: dont show in AR by leaving 'ar' out -->
+ <object id="room_and_sky" class="vr portal embed">
+
+ <!-- override: only show in AR -->
+ <text text="welcome in AR mode" class="ar"/>
+</room>
+
+Here the JML browser is instructed to opt out certain elements, depending on the context.
+
+
+For more info about JanusXR
+
+
+
+
+cube = scene.getObjectByName("cube")
+sphere = scene.getObjectByName("sphere")
+
+// you can set the classes manually in case your glTF
+// does not have them (yet)
+scene.userData.class = "vr ar portal embed" // default
+cube.userData.class = 'ar' // only ar
+sphere.userData.class = "vr portal embed' // hide in ar
+
+const modes = getModes() // ['ar'] (somehow determine viewing context)
+
+scene.traverse( (obj) => { // trickle down classes to children
+ if( obj.userData.class ){
+ obj.userData.classes = obj.userData.class.replace(/ /,' ').split(' ')
+ modes.map( (mode) => {
+ if( ! ~obj.userData.classes.indexOf(mode) ) obj.visible = false
+ })
+ obj.traverse( (child) => {
+ child.userData.classes = obj.userData.classes )
+ child.visible = false
+ })
+ }
+})
+
+The cube will only be visible in AR, while the sphere also in VR, when renderered in a portal, or when embedded in another scene.
+
+
+
+
+NOTE: not implemented yet in this implementation but href in markup is not supported (yet: JanusXR is a safer bet)
+
+
+<a-scene> <!-- assumed default class="vr ar portal embed" -->
+ <a-cube layer="ar"/> <!-- show only in AR -->
+ <a-sphere layer="vr portal embed"/>
+</a-scene>
+
+The cube will only be visible in AR, while the sphere also in VR, when renderered in a portal, or when embedded in another scene.
+
+
+
+
+NOTE: no implementation (yet)
+
+
+ <m-cube layer="ar"/> <!-- show only in AR -->
+ <m-sphere layer="vr portal embed"/>
+
+The cube will only be visible in AR, while the sphere also in VR, when renderered in a portal, or when embedded in another scene.
+
+
+
+ All modern 3D editors can attach metadata to objects, and export these as 'extras' with the 3D file.
+
+
+
+Similar to href: instead of href, create an extra class-property with a string-value (ar e.g.), to opt out of the default inherited vr ar portal embed-value (from the scene-root, even when its not explicitly defined).
+
+
+
+
+Predefined hints: XR layers
+
+
+
+hint/class
+desktop
mode
+VR
mode
+AR
mode
+usecase
+
+
+
+
+vr
+show
+show
+hide
+render object+children
+
+
+ar
+hide
+hide
+show
+render object+children
+
+
+embed
+show
+show
+show
+render object+children when loaded in another scene
+
+
+portal
+show
+show
+show
+render object+children inside portal
+
+
+collection
+hide
+hide
+hide
+object+children are not part of a scene/experience (think importing into inventory, openbrush brushes e.g.).
+
+
+hide
+hide
+hide
+hide
+hide object+children
+
+
+
+Any element without any of these class-values is considered visible in all layers. Once class-value(s) are detected it'll work as a layer-mask: class: 'vr ar' will be visible in desktop-,VR- and AR-mode.
+
+
+NOTE: there's is no CSS: class attributes without CSS means no cascade inheritance; above class-definitions will apply to the element itself (and its children, which can override by defining their own XR layer class-definitions).
+
+
+Predefined hints: XR object interactions
+
+
+
+hint/class
+spec
+document default
+usecase
+
+
+
+
+grabbable
+v1
+unset
+allow single handtracking-pinch to reposition object, or via buttonhold + controllermove/mousemove
+
+
+stretchable
+v1
+unset
+allow both handtracking-pinch to stretch object, or via buttonhold + controllermove/mousemove
+
+
+collidable
+v1
+unset
+hints that grabbable and stretchable should halt upon collisions
+
+
+
+
+NOTE: href: #*foo implies that object foo has class: 'grabbable'
+
+
+Usecases
+
+- 3D previews:
class: 'vr ar' prevents rendering (heavy) items when displayed in a portal (or embedded into another scene).
+- extra info:
class: 'portal' displays onboarding texts/info ONLY when rendered in a portal.
+
+Examples
+
+
+
+
+XR Fragments is not a fileformat-specific extension, it's a spec for deeplinking any 3D file.
+The level2 metadata (See reference) is easy to embed in any 3D editor (not only blender) than it would be to support new GLTF extensions.
+This is not to say extensions are bad (they are superior in certain cases).
+
+
+Just like URLs allow fileformat-agnostic navigation, 3D asset 'extras' are fileformat-agnostic too, which together allow for XR Fragments.
+
+
+To deal with extensions/overlapping features
+see native vs XRF features
+
+
+How to deal with overlapping functionality?
+
+Well, native (extensions) take precende, otherwise 'fallback' applies.
+
+Examples
+
+
+
+Native feature
+XRF
+Solution
+
+
+
+
+<Link url="..."> in JanusXR JML
+href: ... (3Dfile extra)
<Link href="..."/> (JML)
+use <Link url="...">, otherwise href="...", otherwise href: ...
+
+
+OMI_Link gltf extension
+href: ....
+use OMI_Link, otherwise href
+
+
+
+Common advice is to 'stack' (portal)links to achieve graceful degradation:
+
+
+- plane at
0 0 0 has texture explaining link/portal
+- plane at
0 0 0.01 uses href link
+- plane at
0 0 0.02 uses OMI_LINK link
+
+That way there's click 'fallthrough': the user will click whichever the engine supports.
+
+
+Below is the related section of the spec (full spec here: HTML, TXT)
+
+
+
+For more info see How it works
+
+
+
+multilangual 3D file
+
+How to enable multilangual 3D experiences?
+
+
+Answer: by adding extra objectnames/metadata which include a language postfix (ISO 639-1 language 2char-code).
+
+Example object-metadata:
+
+aria-description: this is a cube
+aria-description-nl: dit is een kubus
+
+Example object-name:
+Given a scene with objectnames banner and banner-nl
+
+
+href: #+banner
+
+If the language is set to nl and banner-nl exists too, then that will be selected/operated instead.
+
+How to determine the language?
+This should be a setting of the browser.
+For example, to get the language from a webbrowser:
+
+navigator.language.substr(0,2) // 'en'
+
+
+NOTE: this is completely optional, and works via progressive enhancement.
+
+
+
+-XR Fragments allows us to better use implicit metadata inside 3D scene(files), by mapping it to proven technologies like [URI Fragments](https://en.wikipedia.org/wiki/URI_fragment).
- -> Almost every idea in this document is demonstrated at [https://xrfragment.org](https://xrfragment.org) - -{mainmatter} - -# Quick reference - -1. [Abstract](#abstract) -1. [Index](#index) -1. [Introduction](#introduction) -1. [How does it work](#how-does-it-work) -1. [What does it solve](#what-does-it-solve) -1. [Hypermediatic Feedback Loop for XR Browsers](#hfl-hypermediatic-feedback-loop-for-xr-browsers) -1. [Conventions and Definitions](#conventions-and-definitions) - 1. [XR Fragment URL Grammar](#xr-fragment-url-grammar) -1. [Spatial Referencing 3D](#spatial-referencing-3d) -1. [Level0: Files](#level0-files) - 1. [timelines](#timelines) - 1. [via href metadata](#via-href-metadata) - 1. [via chained extension](#via-chained-extension) - 1. [via subdocuments/xattr](#via-subdocuments-xattr) - 1. [JSON sidecar-file](#json-sidecar-file) -1. [Level1: URI](#level1-uri) - 1. [List of URI Fragments](#list-of-uri-fragments) - 1. [List of explicit metadata](#list-of-explicit-metadata) -1. [Level2: href links](#level2-href-links) - 1. [Interaction behaviour](#interaction-behaviour) - 1. [XR Viewer implementation](#xr-viewer-implementation) -1. [Level4: prefix operators](#level4-prefix-operators) - 1. [Object teleports](#object-teleports) - 1. [Object multipliers](#object-multipliers) - 1. [De/selectors (+ and -)](#de-selectors-and) - 1. [Sharing object or file (#|)](#sharing-object-or-file) - 1. [xrf:// URI scheme](#xrf-uri-scheme) -1. [Level5: URI Templates (RFC6570)](#level5-uri-templates-rfc6570) -1. [Level8: Media Fragments](#level8-media-fragments) - 1. [Animation(s) timeline](#animation-s-timeline) - 1. [Specify playback loopmode](#specify-playback-loopmode) - 1. [Controlling embedded content](#controlling-embedded-content) -1. [Top-level URL processing](#top-level-url-processing) - 1. [UX](#ux) -1. [Example: Navigating content href portals](#example-navigating-content-href-portals) - 1. [Walking surfaces](#walking-surfaces) -1. [Example: Virtual world rings](#example-virtual-world-rings) -1. [Additional scene metadata](#additional-scene-metadata) -1. [Accessibility interface](#accessibility-interface) - 1. [Two-button navigation](#two-button-navigation) - 1. [Overlap with fileformat-specific extensions](#overlap-with-fileformat-specific-extensions) -1. [XRF microformat](#XRF-microformat) -1. [Vendor Prefixes](#vendor-prefixes) -1. [Security Considerations](#security-considerations) -1. [FAQ](#faq) -1. [Authors](#authors) -1. [IANA Considerations](#iana-considerations) -1. [Acknowledgments](#acknowledgments) -1. [Appendix: Definitions](#appendix-definitions) - -# Introduction - - -How can we add more control to existing text and 3D scenes, without introducing new dataformats?
-Historically, there's many attempts to create the ultimate 3D fileformat.
-The lowest common denominator is: designers describing/tagging/naming things using **plain text**.
-XR Fragments exploits the fact that all 3D models already contain such metadata: - -** Deeplinking 3D objects by mapping objectnames to URI fragments** - -> For a better-readable, better-updated spec see the website https://xrfragment.org - -# How does it work - -XR Fragments utilizes URLs: - -1. for 3D viewers/browser to manipulate the camera or objects (via URI fragments) -2. implicitly: by mapping 3D objectnames (of a 3D scene/file) to URI fragments (3D deeplinking) -3. explicitly: by scanning `href` metadata **inside** 3D scene-files to enable interactions -4. externally: progressively enhance a 3D (file) into an experience via [sidecarfiles](https://en.wikipedia.org/wiki/Sidecar_file) - -> Aspect 1 was pioneered and implemented by JanusXR / James Baicoianu via [janusweb](https://github.com/jbaicoianu/janusweb) well before the formal specification was established. As a key architect of these early concepts, Jamesโs work laid the groundwork for the standard we use today. We owe him a great deal of thanks for his early contributions. - -# What does it solve - -It solves: - -1. addressibility and [hypermediatic](https://github.com/coderofsalvation/hypermediatic) navigation of 3D scenes/objects: [URI Fragments](https://en.wikipedia.org/wiki/URI_fragment) using src/href spatial metadata -1. unlocking spatial potential of the (originally 2D) hashtag (which jumps to a chapter) for navigating XR documents -1. refraining from introducing scripting-engines for mundane tasks (and preventing its inevitable security-headaches) -1. the gap between text an 3d objects: object-names directly map to hashtags (=fragments), which allows 3D to text transcription. - -> NOTE: The chapters in this document are ordered from highlevel to lowlevel (technical) as much as possible - -XR Fragments views XR experiences through the lens of 3D deeplinked URI's, rather than thru code(frameworks) or protocol-specific browsers (webbrowser e.g.). -To aid adoption, the standard comprises of various (optional) support-levels, which incorporate existing standards like [W3C Media Fragments](https://www.w3.org/TR/media-frags/) and [URI Templates (RFC6570)](https://www.rfc-editor.org/rfc/rfc6570) to promote spatial addressibility, sharing, navigation, filtering and databinding objects for (XR) Browsers.
- -> XR Fragments is in a sense, a heuristical 3D format or meta-format, which leverages heuristic rules derived from any 3D scene or well-established 3D file formats, to extract meaningful features from scene hierarchies.
-These heuristics, enable features that are both meaningful and consistent across different scene representations, allowing higher interop between fileformats, 3D editors, viewers and game-engines. - -# Hypermediatic feedback Loop in XR Browsers - -`href` metadata traditionally implies **click** AND **navigate**, however XR Fragments separates **click** via the `xrf://` scheme, which does not change the top-level URL-adress (of the browser). -This allows for many extra interactions via URLs, which otherwise needs a scripting language. -These are called **hash**-events in this sepc. - -> Being able to use the same URI Fragment DSL for navigation (`href: #foo`) as well as interactions (`href: xrf://#foo`) greatly simplifies implementation, increases HFL, and reduces need for scripting languages. - -This opens up the following benefits for traditional & future webbrowsers: - -* [hypermediatic](https://github.com/coderofsalvation/hypermediatic) loading/clicking 3D assets (gltf/fbx e.g.) natively (with or without using HTML). -* potentially allowing 3D assets/nodes to publish XR Fragments to themselves/eachother using the `xrf://` hash-events (`xrf://#person=walk` to trigger `walk`-animation for object `person`) -* potentially collapsing the 3D scene to an wordgraph (for essential navigation purposes) controllable thru a hash(tag)bus -* completely bypassing the security-trap of loading external scripts (by loading 3D model-files, not HTML-javascriptable resources) - - -XR Fragments itself are [hypermediatic](https://github.com/coderofsalvation/hypermediatic) and HTML-agnostic, though pseudo-XR Fragment browsers **can** be implemented on top of HTML/Javascript. - -| principle | 3D URL | HTML 2D URL | -|-----------------------------|-------------------------------------------------|---------------------------------------| -| the hash-events | hashtags alter camera/scene/object-projections | hashtags alter document positions | -| href metadata | teleports to other XR document | jumps to other HTML document | -| href metadata | href="xrf://#-foo&bar" | href="javascript:hideFooAndShowBar()` | - -> An important aspect is that URI Fragments can be triggered without updating the top-level URI (default href-behaviour) thru their own 'bus' (`xrf://#.....`). This decoupling between navigation and interaction prevents non-standard things like (`href`:`javascript:dosomething()`). - -# Conventions and Definitions - -See appendix below in case certain terms are not clear. - -## XR Fragment URL Grammar - -For typical HTTP-like browsers/applications: - -``` -reserved = gen-delims / sub-delims -gen-delims = "#" / "&" -sub-delims = "," / "=" -``` - -> Example: `://foo.com/my3d.gltf#room1&prio=-5&t=0,100` - -| Demo | Explanation | -|-------------------------------|---------------------------------| -| `room1` | vector/coordinate argument e.g. | -| `room1&cam1` | combinators | - -> this is already implemented in all browsers - -For in-browser implementations where hash is already used, the following formats can be used: - -* [janusweb](https://github.com/jbaicoianu/janusweb): `https://web.janus.org/#janus.url=https%3A%2F%2Ffoo.com%2Fmy3d.gltf%23room1%26prio%3D-5%26t%3D0%2C100` -* viewer using query for url-input: `https://my.org/myviewer?https%3A%2F%2Ffoo.com%2Fmy3d.gltf%23room1%26prio%3D-5%26t%3D0%2C100` - -# Spatial Referencing 3D - -3D files contain an hierarchy of objects.
-XR Fragments assumes the following objectname-to-URI-Fragment mapping, in order to deeplink 3D objects: - -``` - - my.io/scene.fbx - +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+ - โ sky โ src: http://my.io/scene.fbx#sky (includes building,mainobject,floor) - โ +โโโโโโโโโโโโโโโโโโโโโโโโโ+ โ - โ โ building โ โ src: http://my.io/scene.fbx#building (includes mainobject,floor) - โ โ +โโโโโโโโโโโโโโโโโโโโโ+ โ โ - โ โ โ mainobject โ โ โ src: http://my.io/scene.fbx#mainobject (includes floor) - โ โ โ +โโโโโโโโโโโโโโโโโ+ โ โ โ - โ โ โ โ floor โ โ โ โ src: http://my.io/scene.fbx#floor (just floor object) - โ โ โ โ โ โ โ โ - โ โ โ +โโโโโโโโโโโโโโโโโ+ โ โ โ - โ โ +โโโโโโโโโโโโโโโโโโโโโ+ โ โ - โ +โโโโโโโโโโโโโโโโโโโโโโโโโ+ โ - +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+ - -``` - -> Every 3D fileformat supports named 3D object, and this name allows URLs (fragments) to reference them (and their children objects). - -Clever nested design of 3D scenes allow great ways for re-using content, and/or previewing scenes.
-For example, to render a portal with a preview-version of the scene, create an 3D object with extra/metadata: - -* href: `https://scene.gltf` - -# Level0: Files - -Compatible 3D fileformats: [glTF](https://www.khronos.org/gltf/), [usdz](https://openusd.org/release/spec_usdz.html), [obj](https://en.wikipedia.org/wiki/Wavefront_.obj_file), [collada](https://www.khronos.org/collada), [THREE.json](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4), [X3D](https://en.wikipedia.org/wiki/X3D) e.g. -
- -A 3D scene-file can be considered XR Fragment-compatible when it contains metadata: -1. implicit: there's at least one object with a name (*) -2. explicit: (optional) object(s) have (level2) href extras. - -> \* = last wins in case of non-unique names - -There are **optional** auto-loaded [side-car files]() to enable hasslefree [XR Movies](#XR%20Movies).
-they can accomodate developers or applications who (for whatever reason) must not modify the 3D scene-file (a `.glb` e.g.). - -## Timelines - -When a loaded file contains a timeline (animations/subtitles e.g.), then: - -> All timelines must play (looped) by default (to enable [[XR Movies]]) - -Unless an object has multiple animations (actions e.g.), then just play the first or with name `default`. - -## via href metadata - -``` -scene.glb <--- 'href' extra [heuristic] detected inside! -scene.png (preview thumbnail) -scene.ogg (soundtrack to plays when global 3D animation starts) -scene.vtt (subtitles for accessibility or screenreaders) -scene.json (sidecar JSON-file with explicit metadata) -``` - -**heuristics**: - -* if at least one `href` custom property/extra is found in a 3D scene -* The viewer should poll for the above mentioned sidecar-file extensions (and present accordingly) - -## via chained extension - -``` -scene.xrf.glb <--- '.xrf.' sidecar file heuristic detected! -scene.xrf.png (preview thumbnail) -scene.xrf.ogg (soundtrack to plays when global 3D animation starts) -scene.xrf.vtt (subtitles for accessibility or screenreaders) -scene.xrf.json (sidecar JSON-file with explicit metadata) -``` - -> A fallback-mechanism to turn 3D files into [XR Movies](#XR%20Movies) without editing them. - -**heuristics**: - -* the chained-extension heuristic `.xrf.` should be present in the filename (`scene.xrf.glb` e.g.) - -## via subdocuments/xattr - -More secure protocols (Nextgraph e.g.) don't allow for simply polling files. -In such case, subdocuments or extended attributes should be polled: - -> NOTE: in the examples below we use the href-heuristic, but also the `.xrf.` chained-extension applies here. - -``` -myspreadsheet.ods -โโโ explainer.glb <--- 'href' extra [heuristic] detected inside! - โโโ explainer.ogg (soundtrack to play when global 3D animation starts) - โโโ explainer.png (preview thumnbnail) - โโโ explainer.json (sidecar JSON-file with explicit metadata) - โโโ explainer.vtt (subtitles for accessibility or screenreaders) -``` - -If only extended attributes (xattr) are available, the respective referenced file can be embedded: - -``` -$ setfattr -n explainer.ogg -v "soundtrack.ogg" explainer.glb -$ setfattr -n explainer.png -v "thumbnail.png" explainer.glb -$ setfattr -n explainer.vtt -v "subtitles.vtt" explainer.glb -``` - -> NOTE: Linux's `setfattr/getfattr` is `xattr` on mac, and `Set-Content/Get-content` on Windows. See [pxattr](https://www.lesbonscomptes.com/pxattr/index.html) for lowlevel access. - -## JSON sidecar-file - -> NOTE: the following approach is only recommended for archivist/userupload scenarios where the 3D file itself should not be altered. - -For developers, a json-sidecar-file can allow for defining explicit XR Fragments metadata (>level1), outside of the 3D file. -This can be done via (objectname/metadata) key/value-pairs in a JSON sidecar-file: - -```json -{ - "aria-description": "description of scene", - "button": { - "href": "#roomB", - "aria-description": "description of room" - } -} -``` - -This will make object button clickable, and teleport the user to object roomB. -
-> So after loading experience.glb the existence of experience.json is detected, to apply the explicit metadata.
The sidecar will define (or override already existing) extras, which can be handy for multi-user platforms (offer 3D scene customization/personalization to users). - -In THREE.js-code this would boil down to: - -```javascript - scene.userData['aria-description'] = "description of scene" - scene.getObjectByName("button").userData.href = "#roomB" -``` - -> now the XR Fragments parser can process the XR Fragments userData 'extras' in the scene - -# Level1: URI - - -> **XR Fragments allows deeplinking of 3D objects by mapping objectnames to URI fragments** - -XR Fragments tries to seek to connect the world of text (semantical web / RDF), and the world of pixels.
-Instead of forcing authors to combine 3D/2D objects programmatically (publishing thru a game-editor e.g.), XR Fragments **integrates all** which allows a universal viewing experience.
- -``` - +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+ - โ โ - โ U R N โ - โ U R L | โ - โ | |-----------------+--------| โ - โ +--------------------------------------------------| โ - โ | โ - โ + https://foo.com/some/foo/scene.glb#someview <-- http URI (=URL and has URN) โ - โ | โ - โ + ipfs://cfe0987ec9r9098ecr/cats.fbx#someview <-- an IPFS URI (=URL and has URN) โ - โ โ - โ ec09f7e9cf8e7f09c8e7f98e79c09ef89e000efece8f7ecfe9fe <-- an interpeer URI โ - โ โ - โ โ - โ |------------------------+-------------------------| โ - โ | โ - โ U R I โ - โ โ - +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+ - -``` - -Fact: our typical browser URL's are just **a possible implementation** of URI's (for untapped humancentric potential of URI's [see interpeer.io](https://interpeer.io) or [NextGraph](https://nextgraph.org) ) - -> XR Fragments does not look at XR (or the web) thru the lens of HTML or URLs.
But approaches things from a higherlevel local-first 3D hypermedia browser-perspective. - -Below you can see how this translates back into good-old URLs: - -``` - +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+ - โ โ - โ the soul of any URL: ://macro /meso ?micro #nano โ - โ โ - โ 2D URL: ://library.com /document ?search #chapter โ - โ โ - โ 4D URL: ://park.com /4Dscene.fbx โ> ?other.glb โ> #object โ - โ โ โ โ - โ โ โ โ - โ โ โ โ - โ โ โ โ - โ โ โ โ - โ โ โ โ - โ โโ view change โโโโโโโโโโโโโโโ+ โ - โ โ - โ โ - +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+ - -``` - -> ?-linked and #-linked navigation are JUST one possible way to implement XR Fragments: the essential goal is to allow a Hypermediatic FeedbackLoop (HFL) between external and internal 4D navigation. - -## List of URI Fragments - -| fragment | type | example | info | -|-------------------|------------|--------------------|----------------------------------------------------------------------| -| `#......` | vector3 | `#room1` `#room2` `#cam2` | positions/parents camera(rig) (or XR floor) to xyz-coord/object/camera and upvector | - - -## List of **explicit* metadata - -These are the possible 'extras' for 3D nodes and sidecar-files - -| key | type | example (JSON) | function | existing compatibility | -|--------------|----------|------------------------|---------------------|----------------------------------------| -| `href` | string | `"href": "b.gltf"` | XR teleport | custom property in 3D fileformats | - - -# Level2: href links - - -Explicit href metadata ('extras') in a 3D object (of a 3D file), hint the viewer that the user ''can interact'' with that object : - -| fragment | type | example value | -|----------|------|----------------| -| `href` | string (uri or predefined view) | `#pyramid`, `#lastvisit`, `xrf://#-someobject`, `://somefile.gltf#foo` | - -## Interaction behaviour - -When clicking an ''href''-value, the user(camera) is teleport to the referenced object. - -The imported/teleported destination can be another object in the same scene-file, or a different file. - -## XR Viewer implementation - -| **spec** | **action** | **feature** | -|----------|------------|-------------| -| level0+1 | hover 3D file [href](#via-href-metadata) | show the preview PNG thumbnail (if any). | -| level0+1 | launch 3D file [href](#via-href-metadata) | replace the current scene with a new 3D file (`href: other.glb` e.g.) | -| level2 | click internal 3D file [href](#via-href-metadata) (`#roomB` e.g.) | teleport the camera to the origin of object(name `roomB`). See [[teleport camera]].| -| level2 | click external 3D file [href](#via-href-metadata) (`foo.glb` e.g.) | replace the current scene with a new 3D file (`href: other.glb` e.g.) | -| level2 | hover external 3D file [href](#via-href-metadata) | show the preview PNG thumbnail (if any sidecar, see level0) | -| level2 | activate animation | clicking href-value `#foo` will select animation `foo` (if exist) | -| level2 | click [href](#via-href-metadata) | hash-events: execute without changing the toplevel URL location (`href: xrf://#someObjectName` e.g.) | -| higher levels | non-normative | non-normative | - -> NOTE: hash-events links (`xrf://#foo&bar`) don't change the toplevel URL, which makes it ideal for interactions (in contrast to typical `#roomC` navigation, which benefit back/forward browser-buttons), see hash-events for more info. - -> **default camera (spawn) location**: When a 3D file is loaded, it will position the user/camera at xyz: 0,0,0 OR to the location of (an object called) ''spawn''. - -Basically: - -``` -https://my.org/foo.glb -``` - -will load as default: - -``` -https://my.org/foo.glb#spawn -``` - -# Level3: XR hints - -> How to know whether a 3D file is a full scene or just a prop?
When should a 3D file hide its skybox?
How does a file know whether its embedded or not?
How to hide an object in AR-mode only?
How to ''hide'' an object by default, after loading a scene? - -**Answer**: somehow tagging the file, or object with **predefined classes** ; universal XR keywords. - -Example in JanusWeb JML: - -``` - -
mode | VR
mode | AR
mode | **usecase** | -|-|-|-|-|-| -| `vr` | show | show | hide | render object+children | -| `ar` | hide | hide | show | render object+children | -| `embed` | show | show | show | render object+children when loaded in another scene | -| `portal` | show | show | show | render object+children inside portal | -| `collection` | hide | hide | hide | object+children are not part of a scene/experience (think importing into inventory, openbrush brushes e.g.). | -| `hide` | hide | hide | hide | hide object+children | - -Any element without any of these class-values is considered visible in all layers. Once class-value(s) are detected it'll work as a layer-mask: `class: 'vr ar'` will be visible in desktop-,VR- and AR-mode. - -> **NOTE**: there's is no CSS: class attributes without CSS means **no cascade inheritance**; above class-definitions will apply to the element itself (and its children, which can override by defining their own XR layer class-definitions). - -## Predefined hints: XR object interactions - -| **hint/class** | **spec** | **document default** | **usecase** | -|-|-|-|-| -| `grabbable` | v1 | unset | allow single handtracking-pinch to reposition object, or via buttonhold + controllermove/mousemove | -| `stretchable` | v1 | unset | allow both handtracking-pinch to stretch object, or via buttonhold + controllermove/mousemove | -| `collidable` | v1 | unset | hints that `grabbable` and `stretchable` should halt upon collisions | - -> **NOTE:** `href: #*foo` implies that object `foo` has `class: 'grabbable'` - -## Usecases - -* 3D previews: `class: 'vr ar'` prevents rendering (heavy) items when displayed in a portal (or embedded into another scene). -* extra info: `class: 'portal'` displays onboarding texts/info ONLY when rendered in a portal. - -# Level8: Media Fragments - - -> these allow for XR Movies with a controllable timeline using `href` URI's with Media Fragments - -Just like with 2D media-files, W3C mediafragments (`#t=1,2`) can be used to control a timeline via the [#t](##t) primitive. -XR Fragments Level3 makes the 3D timeline, as well as URL-referenced files **controllable** via Media Fragments like: - -* level2 hrefs (`href: #t=4` e.g. to control 3D timeline) -* level4: `xrf:` URI scheme: - * `href: xrf:foo.wav#t=0` to play a wav - * `href: xrf:news.glb?clone#t=0` to instance and play another experience - -## Animation(s) timeline - -controls the animation(s) of the scene (or `src` resource which contains a timeline) - -| fragment | type | functionality | -|----------|------|---------------| -| #t=start,stop | [[vector2]] (default:`#t=0`) | start,stop (in seconds | - - -| Example Value | Explanation | -|-------------------|-------------| -| `#t=1` | play (3D) animations from 1 seconds till end (and stop) | -| `#t=1,100` | play (3D) animations from 1 till 100 seconds (and stop) | - -## Specify playback loopmode - -This compensates a missing element from Media Fragments to enable/disable temporal looping. . - -| fragment | type | functionality | -| #loop | string | enables animation/video/audio loop | -| #-loop | string | disables animation/video/audio loop | - - -## Controlling embedded content - -use [[URI Templates]] to control embedded media, for example a simple video-player: - -``` - foo.usdz - โ - โโโ โป loopbutton_enable - โ โ href: #loop <-- enable global loop - โ - โโโ โป loopbutton_enable - โ โ href: #-loop <-- disable global loop - โ - โโโ โป playbutton - โ โ href: #t=10&loop <-- play global 3D timeline (all anims) (looped) - โ - โโโ โป playbutton_external - โ href: https://my.org/animation.glb#!&t=3,10 <-- import & play external anim - -``` - -# Level4: prefix operators - - -Prefixing objectnames with the following simple operators allow for **extremely powerful** XR interactions: - -* #! -* #* -* #+ or #- -* #| -* xrf: URI scheme - -> **Examples:** `#+menu` to show a object, `#-menu` to hide a menu, `#!menu` to teleport a menu, `#*block` to clone a grabbable block, `#|object` to share an object - - -## Object teleports - -Prefixing an object with an exclamation-symbol, will teleport a (local or remote) referenced object from/to its original/usercamera location.
- -[img[objecteleport.png]] - -Usecases: -* show/hide objects/buttons (menu e.g.) in front of user -* embed remote (object within) 3D file via remote URL -* instance an interactive object near the user regardless of location -* instance HUD or semi-transparent-textured-sphere (LUT) around the user - -
- -Clicking the [href](#via-href-metadata)-value above will: - -1. **reposition the referenced object** (menu) to the usercamera's-coordinates. -2. **zoom** in case of (non-empty) mesh-object: rescale to 1 mยณ, and position 1m in front of the camera -3. toggle behaviour: revert values if 1/2 were already applied -4. `#+` is always implied (objects are always made visible) - -This tiny but powerful symbol allows incredible interactive possibilities, by carefully positioning re-usable objects outside of a scene (below the usercamera's floor e.g.). - -* href: `#whiteroom&!explainer&!exitmenu` - -> This will teleport the user to `whiteroom` and moves object `explainer` and `exitmenu` in front of the user. - -* href: `https://my.org/foo.glb#! - -Clicking the [href](#via-href-metadata)-value above will: - -1. import `foo.glb` from `my.org`'s webserver -2. show it in front of the user (because `#!` indicates object teleport) - -* href: `https://foo.glb#roomB&!bar` - -Clicking the [href](#via-href-metadata)-value above will: - -1. replace the current scene with `foo.glb` -2. teleport the user to #roomB inside `foo.glb` -3. **instance the referenced object** (bar inside foo.glb) in front of the user. -4. it will update the top-Level URL (because `xrf:` was not used) -5. hide the **instanced object** when clicked again (toggle visibility) - -> **NOTE**: level2 teleportation links, as well as instancing mitigates the 'broken embedded image'-issue of HTML: **always** attaching the href-values to **a 3D (preview) object** (that way broken links will not break the design). - -**Example:** clicking a 3D button with title 'menu' and [href](#href)-value `xrf:menu.glb?instance#t=4,5` would instance a 3D menu (`menu.glb`) in front of the user, and loop its animation between from 4-5 seconds (`t=4,5`) - -> **NOTE**: combining instance-operators allows dynamic construction of 3D scenes (`#london&!welcomeMenu&!fadeBox` e.g.) - -## Object multipliers (*) - -The star-prefix will clone a (local or remote) referenced object to the usercamera's location, and make it grabbable.
-Usecases: -* object-picker (build stuff with objects) - -> **NOTE**: this is basically the [#! operator](#%23%21) which infinitely **clones** the referenced object (instead of repositioning the object). - -## De/selectors (+ and -) - -> How to show/hide/group material- or object- or animations by name? - -Clicking href-values below will show/hide the targeted material- or animation or object-name (incl. children): - -* `#-welcome` -* `#+welcome` -* `#-VR*` -* `https://foo.glb#bar&-welcome` - -Matching logic: - -* - and + prefix for exact matches (welcome e.g.) -* \* postfix for match beginning (VR_skybox VR_skyboxmat e.g.) - -> NOTE: to hide a skybox when importing/loading a 3D file (force AR) is possible by linking to ``https://my.org/foo.glb#-skybox` or `https://my.org/foo.glb#-skyboxmaterial` - - - -## Sharing object or file (#|) - -The pipe-symbol (`|`) sends a (targeted) object to the OS. -Clicking the href-value below will: - -1. share the (targeted object in the) file to a another application - -> This URL can be fed straight into [Web Share API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Share_API) or [xdg-open](https://www.freedesktop.org/wiki/Software/xdg-utils/) - -* href: `xrf://#|bar` - -> **NOTE**: sharing is limited to (internal objects) via `xrf:` scheme-only - -## xrf:// URI scheme - -Prefixing the `xrf:` to [href](#href)-values **will prevent** [level2](#๐%20level2:%20explicit%20links) [href](#href)-values from changing the top-Level URL. - -> **Usecase**: for non-shareable URLs like `href: xrf:#t=4,5`, to display a stateful msg e.g.). - -**Reason:** XR Fragments is inspired by HTML's [href-attribute](https://en.wikipedia.org/wiki/Hyperlink), which does various things: - -1. it updates the browser-location -2. it makes something clickable -3. it jumps to another document / elsewhere in the same document -4. and more - -The `xrf:` scheme will just do 2 & 3 (so the URL-values will not leak into the top-level URL). - -> **compliance with RFC 3986**: unimplemented/unknown URI schemes (`xrf:...` e.g.) will not update the top-level URL - -# Level5: URI Templates (RFC6570) - - -XR Fragments adopts Level1 URI **Fragment** expansion to provide safe interactivity.
-This is non-normative, and the draft spec is available on request. - - -# Top-level URL processing - - -> Example URL: `://foo/world.gltf#room1&t=10&cam` - -The URL-processing-flow for hypermedia browsers goes like this: - -1. IF scene operators and/or animation operator (`t`) are present in the URL then (re)position the camera (to `room1`) and/or animation-range (`10`) accordingly. -2. IF no camera-position has been set in step 1 or 2 assume `0,0,0` as camera coordinate (XR: add user-height) ([example](https://github.com/coderofsalvation/xrfragment/blob/main/src/3rd/js/three/navigator.js#L31]])) -3. IF a camera-object exists with name `cam` assume that user(camera) position - -## UX - -End-users should always have read/write access to: - -1. the current (toplevel) URL (an URLbar etc) -2. URL-history (a back/forward button e.g.) -3. Clicking/Touching an `href` navigates (and updates the URL) to another scene/file (and coordinate e.g. in case the URL contains XR Fragments). - - -# Example: Navigating content href portals - - -navigation, portals & mutations - -| fragment | type | example value | -|----------|---------------------------------|---------------------------------------------------------------------------------------------------------------------------| -|`href` | string (uri or predefined view) | `#room1`
`#room1`
`://somefile.gltf#room1`
| - -1. clicking an outbound ''external''- or ''file URI'' fully replaces the current scene and assumes `room2` by default (unless specified) - -2. relocation/reorientation should happen locally for local URI's (`#....`) - -3. navigation should not happen ''immediately'' when user is more than 5 meter away from the portal/object containing the href (to prevent accidental navigation e.g.) - -4. URL navigation should always be reflected in the client URL-bar (in case of javascript: see [[here](https://github.com/coderofsalvation/xrfragment/blob/dev/src/3rd/js/three/navigator.js) for an example navigator), and only update the URL-bar after the scene (default fragment `#`) has been loaded. - -5. In immersive XR mode, the navigator back/forward-buttons should be always visible (using a wearable e.g., see [[here](https://github.com/coderofsalvation/xrfragment/blob/dev/example/aframe/sandbox/index.html#L26-L29) for an example wearable) - -6. make sure that the ''back-button'' of the ''browser-history'' always refers to the previous position (see [[here](https://github.com/coderofsalvation/xrfragment/blob/main/src/3rd/js/three/xrf/href.js#L97)) - -7. ignore previous rule in special cases, like clicking an `href` using camera-portal collision (the back-button could cause a teleport-loop if the previous position is too close) - -8. href-events should bubble upward the node-tree (from children to ancestors, so that ancestors can also conain an href), however only 1 href can be executed at the same time. - -9. the end-user navigator back/forward buttons should repeat a back/forward action until a `#...` primitive is found (the stateless xrf:// href-values should not be pushed to the url-history) - -[ยป example implementation](https://github.com/coderofsalvation/xrfragment/blob/main/src/3rd/js/three/xrf/href.js)
-[ยป example 3D asset](https://github.com/coderofsalvation/xrfragment/blob/main/example/assets/href.gltf#L192)
-[ยป discussion](https://github.com/coderofsalvation/xrfragment/issues/1)
- -# Example: Virtual world webrings - - -Consider 3D scenes linking to eachother using these `href` values, attached to 3D button-objects: - -* `href: schoolA.edu/projects.gltf#math` -* `href: schoolB.edu/projects.gltf#math` -* `href: university.edu/projects.gltf#math` - -This would teleport users to the math-projects of those universities.
-Now consider adding a 'webring index'-button to each file, with this href-value: - - -* href: workgroup.edu/webrings.glb#!webringmenu - -This would allow displaying the (remote 3D file) webring menu with various href-buttons inside, all centrally curated by the workgroup. - -# Additional scene metadata - - -XR Fragments does not aim to redefine the metadata-space or accessibility-space by introducing its own cataloging-metadata fields. -Instead, it encourages browsers to scan nodes for the following custom properties: - -* [SPDX](https://spdx.dev/) license information -* [ARIA](https://www.w3.org/WAI/standards-guidelines/aria/) attributes (`aria-*: .....`) -* [datapackage.json](https://datapackage.org) findability, accessibility, interoperability, and reusability of data - -ARIA's `aria-description`-metadata is normative, to aid accessibility and scene transcripts - -> **NOTE**: please always start `aria-description` with a verb to aid transcripts. - -The following metadata are non-normative but encouraged, since they are popular and cheap to parse: - -* [RDF/JSON-LD](https://json-ld.org) like [this example](https://mvmd.org/standards/gltf/) or via glTF's [KHR_xmp_json_ld extension](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_xmp_json_ld) -* [Open Graph](https://ogp.me) attributes (`og:*: .....`) -* [Dublin-Core](https://www.dublincore.org/specifications/dublin-core/application-profile-guidelines/) attributes(`dc:*: .....`) -* [BibTex](https://bibtex.eu/fields) when known bibtex-keys exist with values enclosed in `{` and `},` - - -> Example: object 'tryceratops' with `aria-description: is a huge dinosaurus standing on a #mountain` generates transcript `#tryceratops is a huge dinosaurus standing on a #mountain`, where the hashtags are clickable XR Fragments (activating the visible-links in the XR browser). - -Individual nodes can be enriched with such metadata, but most importantly the scene node: - -| metadata key | example value | -|--------------------------------------------------------|-------------------------------------------------| -| `aria-description`, `og:description`, `dc:description` | `An immersive experience about Triceratops` (*) | -| `SPDX` | `CC0-1.0` | -| `dc:creator` | `John Doe` | -| `dc:title`, `og:title` | 'Triceratops` (*) | -| `og:site_name` | `https://xrfragment.org` | -| `dc.publisher` | `NLNET` | -| `dc.date` | `2024-01-01` | -| `dc.identifier` | `XRFRAGMENT-001` | -| `journal` (bibTeX) | `{Future Of Text Vol 3},` | - -> \* = these are interchangable (only one needs to be defined) - -There's no silver bullet when it comes to metadata, so XR Fragment-implementations should support where the metadata is/goes. - -> These attributes can be scanned and presented during an `href` or `src` eye/mouse-over. - -# Accessibility interface - - -The addressibility of XR Fragments allows for unique 3D-to-text transcripts, as well as an textual interface to navigate 3D content.
-Spec:
- -1. The enduser must be able to enable an accessibility-mode (which persists across application/webpage restarts) -2. Accessibility-mode must contain a text-input for the user to enter text -3. Accessibility-mode must contain a flexible textlog for the user to read (via screenreader, screen, or TTS e.g.) -4. the textlog contains `aria-descriptions`, and its narration (Screenreader e.g.) can be skipped (via 2-button navigation) -5. The `back` command should navigate back to the previous URL (alias for browser-backbutton) -6. The `forward` command should navigate back to the next URL (alias for browser-nextbutton) -7. A destination is a 3D node containing an `href` with a `#...` XR fragment (which matches a 3d object name) -8. The `go` command should list all possible destinations -9. The `go left` command should move the camera around 0.3 meters to the left -10. The `go right` command should move the camera around 0.3 meters to the right -11. The `go forward` command should move the camera 0.3 meters forward (direction of current rotation). -12. The `rotate left` command should rotate the camera 0.3 to the left -13. The `rotate left` command should rotate the camera 0.3 to the right -14. The (dynamic) `go abc` command should navigate to `#scene2` in case there's a 3D node with name `abc` and `href` value `#scene2` -15. The `look` command should give an (contextual) 3D-to-text transcript, by scanning the `aria-description` values of the current `#...` (3D object) value (including its children) -16. The `do` command should list all possible `href` values which don't contain an `#...` XR Fragment -17. The (dynamic) `do abc` command should navigate/execute `https://.../...` in case a 3D node exist with name `abc` and `href` value `https://.../...` - -## Two-button navigation - -For specific user-profiles, gyroscope/mouse/keyboard/audio/visuals will not be available.
-Therefore a 2-button navigation-interface is the bare minimum interface: - -1. objects with href metadata can be cycled via a key (tab on a keyboard) -2. objects with href metadata can be activated via a key (enter on a keyboard) -3. the TTS reads the href-value (and/or aria-description if available) - -# XRF Microformat - -How can applications discover 3D experiences on a network? - -> Answer: **spatial microformats** - -The XRF microformat is an [optional](#Progressive%20enhancement) text heuristics which applications can detect across various usecases. - -## via HTML webpage - -If the browser/application requests an webpage (`https://nlnet.nl` e.g.) it should check for the [rel-me microformat](https://gmpg.org/xfn/) : - -``` - -``` - -This way the application loads `https://nlnet.nl/scene.xrf.glb` when the user types `nlnet.nl` into the URLbar.
-Optionally, `type` can be specified for dynamically generated 3D files: - -``` - -``` - -The `type`-attribute is for fallback-purposes.
-Viewer-supported 3D file-extensions (`.glb` e.g.) will **ALWAYS** take precedence over the (non)presence of the `type` attribute.
-The reason is that platforms (Mastodon 'labels' e.g.) don't allow specifying type-attributes.
-Another reason is that XR Fragments is filetype-agnostic, so flexibility is expected on the viewer-side. - -> NOTE: in case of multiple 3D files mentioned in ` - - - - - - - - -``` - -3D engines (games/apps) can render these like clickable portals, for example JanusXR-style portals: - -> NOTE: for more customizability [JML <link>](https://coderofsalvation.github.io/janus-guide/#/build/room?id=link) will allow for positioning/thumbnailed portals: - -```xml -
-The use of URI Templates is limited to pre-defined variables and Level0 fragments-expansion only, which makes it quite safe.
-n fact, it is much safer than relying on a scripting language (javascript) which can change URN too. - -# FAQ - - -**Q:** Why is everything HTTP GET-based, what about POST/PUT/DELETE HATEOS
-**A:** Because it's out of scope: XR Fragment specifies a read-only way to surf XR documents. These things belong in the application layer (for example, an XR Hypermedia browser can decide to support POST/PUT/DELETE requests for embedded HTML thru `src` values) - ---- - -**Q:** Why isn't there support for scripting, URI Template Fragments are so limited compared to WASM & javascript -**A:** This is out of scope as it unhyperifies hypermedia, and this is up to XR hypermedia browser-extensions.
Historically scripting/Javascript seems to been able to turn webpages from hypermedia documents into its opposite (hyperscripted nonhypermedia documents).
In order to prevent this backward-movement (hypermedia tends to liberate people from finnicky scripting) XR Fragment uses [W3C Media Fragments](https://www.w3.org/TR/media-frags/) and [URI Templates (RFC6570)](https://www.rfc-editor.org/rfc/rfc6570), to prevent unhyperifying itself by hardcoupling to a particular markup or scripting language.
-XR Fragments supports filtering objects in a scene only, because in the history of the javascript-powered web, showing/hiding document-entities seems to be one of the most popular basic usecases.
-Doing advanced scripting & networkrequests under the hood are obviously interesting endavours, but this is something which should not be hardcoupled with XR Fragments or hypermedia.
This perhaps belongs more to browser extensions.
-Non-HTML Hypermedia browsers should make browser extensions the right place, to 'extend' experiences, in contrast to code/javascript inside hypermedia documents (this turned out as a hypermedia antipattern). - -# authors - - -* Leon van Kammen (@lvk@mastodon.online) -* Jens Finkhรคuser (@jens@social.finkhaeuser.de) - -# IANA Considerations - - -This document has no IANA actions. - -# Acknowledgments - - -* [NLNET](https://nlnet.nl) -* [Future of Text](https://futureoftext.org) -* James Baicoianu [janusweb](https://github.com/jbaicoianu/janusweb) -* Michiel Leenaars -* Gerben van der Broeke -* Mauve -* Jens Finkhรคuser -* Marc Belmont -* Tim Gerritsen -* Frode Hegland -* Brandel Zackernuk -* Mark Anderson - -# Appendix: Definitions - - -|definition | explanation | -|----------------------|--------------------------------------------------------------------------------------------------------------------------------------| -|human | a sentient being who thinks fuzzy, absorbs, and shares thought (by plain text, not markuplanguage) | -|scene | a (local/remote) 3D scene or 3D file (index.gltf e.g.) | -|3D object | an object inside a scene characterized by vertex-, face- and customproperty data. | -|URI | some resource at something somewhere via someprotocol (`http://me.com/foo.glb#foo` or `e76f8efec8efce98e6f` [see interpeer.io](https://interpeer.io))| -|URL | something somewhere via someprotocol (`http://me.com/foo.glb`) | -|URN | something at some domain (`me.com/foo.glb`) | -|metadata | custom properties of text, 3D Scene or Object(nodes), relevant to machines and a human minority (academics/developers) | -|XR fragment | URI Fragment with spatial hints (which match the name of a 3D object-, camera-, animation-object) | -|the hash-events | hashtags map to camera/scene-projections | -|spacetime hashtags | positions camera, triggers scene-preset/time | -|teleportation | repositioning the enduser to a different position (or 3D scene/file) | -|sourceportation | teleporting the enduser to the original XR Document of an `src` embedded object. | -|placeholder object | a 3D object which with src-metadata (which will be replaced by the src-data.) | -|src | (HTML-piggybacked) metadata of a 3D object which instances content | -|href | (HTML-piggybacked) metadata of a 3D object which links to content | -|filter | URI Fragment(s) which show/hide object(s) in a scene based on name/tag/property (`#cube&-price=>3`) | -|requestless metadata | metadata which never spawns new requests (unlike RDF/HTML, which can cause framerate-dropping, hence not used a lot in games) | -|FPS | frames per second in spatial experiences (games,VR,AR e.g.), should be as high as possible | -|introspective | inward sensemaking ("I feel this belongs to that") | -|extrospective | outward sensemaking ("I'm fairly sure John is a person who lives in oklahoma") | -|`โป` | ascii representation of an 3D object/mesh | -|(un)obtrusive | obtrusive: wrapping human text/thought in XML/HTML/JSON obfuscates human text into a salad of machine-symbols and words | -|flat 3D object | a 3D object of which all verticies share a plane | - diff --git a/doc/RFC_XR_Fragments.txt b/doc/RFC_XR_Fragments.txt index abdbb58..679c8d1 100644 --- a/doc/RFC_XR_Fragments.txt +++ b/doc/RFC_XR_Fragments.txt @@ -1,300 +1,216 @@ -``` -โ โ โโโโโโโ โโโโโโโ โโโโโโโ โโโโโโโ โโโโโโ โโโ โโโ โโโโโโโ โโโโโโโ โ โโโโโโ -โ โ โ โ โ โ โ โ โ โ โโโ โ โ โ โ โ โ โ โโโโโโ โโโโโโ -โโโโโโโ โ โ โโโโ โ โ โโโโโโโ โ โ โ โ โโโโโโโ โ โ โ โ -โ โ โ โ โ โ โ โโโโโโ โ โ โโโโโโโ โ โ โโโโโโ โโโโโโ -``` +โ โ โโโโโโโ โโโโโโโ โโโโโโโ โโโโโโโ โโโโโโ โโโ โโโ โโโโโโโ โโโโโโโ โ โโโโโโ +โ โ โ โ โ โ โ โ โ โ โโโ โ โ โ โ โ โ โ โโโโโโ โโโโโโ +โโโโโโโ โ โ โโโโ โ โ โโโโโโโ โ โ โ โ โโโโโโโ โ โ โ โ +โ โ โ โ โ โ โ โโโโโโ โ โ โโโโโโโ โ โ โโโโโโ โโโโโโ -# XR Fragments spec -``` + + + +All-in-one-spec + +9th November 2026 at 11:59am +Reference + +Download [1]HTML, [2]TXT stream: Guerilla Standardisation area: Internet status: informational author: Leon van Kammen -date: 2026-11-06 workgroup: Internet Engineering Task Force -value: draft-XRFRAGMENTS-leonvankammen-00 -``` +value: XRFRAGMENTS-leonvankammen-00 +Abstract -# Abstract +Version: 0.6 -> Version: 0.5 +An open specification for hyperlinking & deeplinking 3D fileformats. This is a specification for interactive URI-controllable 3D files, to enable spatial webs for local-first XR hypermedia browsers. +XR Fragments allows us to better use implicit metadata inside 3D scene(files), by mapping it to proven technologies like [3]URI Fragments. -An open specification for hyperlinking & deeplinking 3D fileformats. -This is a specification for interactive URI-controllable 3D files, to enable spatial webs for local-first XR hypermedia browsers.
-XR Fragments allows us to better use implicit metadata inside 3D scene(files), by mapping it to proven technologies like [URI Fragments](https://en.wikipedia.org/wiki/URI_fragment).
+Almost every idea in this document is demonstrated at [4]https://xrfragment.org -> Almost every idea in this document is demonstrated at [https://xrfragment.org](https://xrfragment.org) +Introduction -{mainmatter} +How can we add more control to existing text and 3D scenes, without introducing new dataformats? +Historically, there's many attempts to create the ultimate 3D fileformat. +The lowest common denominator is: designers describing/tagging/naming things using plain text. +XR Fragments exploits the fact that all 3D models & markuplanguages already contain such metadata: -# Quick reference + ** Deeplinking 3D objects by mapping objectnames to URI fragments** -1. [Abstract](#abstract) -1. [Index](#index) -1. [Introduction](#introduction) -1. [How does it work](#how-does-it-work) -1. [What does it solve](#what-does-it-solve) -1. [Hypermediatic Feedback Loop for XR Browsers](#hfl-hypermediatic-feedback-loop-for-xr-browsers) -1. [Conventions and Definitions](#conventions-and-definitions) - 1. [XR Fragment URL Grammar](#xr-fragment-url-grammar) -1. [Spatial Referencing 3D](#spatial-referencing-3d) -1. [Level0: Files](#level0-files) - 1. [timelines](#timelines) - 1. [via href metadata](#via-href-metadata) - 1. [via chained extension](#via-chained-extension) - 1. [via subdocuments/xattr](#via-subdocuments-xattr) - 1. [JSON sidecar-file](#json-sidecar-file) -1. [Level1: URI](#level1-uri) - 1. [List of URI Fragments](#list-of-uri-fragments) - 1. [List of explicit metadata](#list-of-explicit-metadata) -1. [Level2: href links](#level2-href-links) - 1. [Interaction behaviour](#interaction-behaviour) - 1. [XR Viewer implementation](#xr-viewer-implementation) -1. [Level4: prefix operators](#level4-prefix-operators) - 1. [Object teleports](#object-teleports) - 1. [Object multipliers](#object-multipliers) - 1. [De/selectors (+ and -)](#de-selectors-and) - 1. [Sharing object or file (#|)](#sharing-object-or-file) - 1. [xrf:// URI scheme](#xrf-uri-scheme) -1. [Level5: URI Templates (RFC6570)](#level5-uri-templates-rfc6570) -1. [Level8: Media Fragments](#level8-media-fragments) - 1. [Animation(s) timeline](#animation-s-timeline) - 1. [Specify playback loopmode](#specify-playback-loopmode) - 1. [Controlling embedded content](#controlling-embedded-content) -1. [Top-level URL processing](#top-level-url-processing) - 1. [UX](#ux) -1. [Example: Navigating content href portals](#example-navigating-content-href-portals) - 1. [Walking surfaces](#walking-surfaces) -1. [Example: Virtual world rings](#example-virtual-world-rings) -1. [Additional scene metadata](#additional-scene-metadata) -1. [Accessibility interface](#accessibility-interface) - 1. [Two-button navigation](#two-button-navigation) - 1. [Overlap with fileformat-specific extensions](#overlap-with-fileformat-specific-extensions) -1. [XRF microformat](#XRF-microformat) -1. [Vendor Prefixes](#vendor-prefixes) -1. [Security Considerations](#security-considerations) -1. [FAQ](#faq) -1. [Authors](#authors) -1. [IANA Considerations](#iana-considerations) -1. [Acknowledgments](#acknowledgments) -1. [Appendix: Definitions](#appendix-definitions) +For a better-readable, better-updated spec see the website https://xrfragment.org -# Introduction +How does it work - -How can we add more control to existing text and 3D scenes, without introducing new dataformats?
-Historically, there's many attempts to create the ultimate 3D fileformat.
-The lowest common denominator is: designers describing/tagging/naming things using **plain text**.
-XR Fragments exploits the fact that all 3D models already contain such metadata: - -** Deeplinking 3D objects by mapping objectnames to URI fragments** - -> For a better-readable, better-updated spec see the website https://xrfragment.org - -# How does it work - -XR Fragments utilizes URLs: - -1. for 3D viewers/browser to manipulate the camera or objects (via URI fragments) +XR Fragments utilizes URLs on various levels: +1. for 3D viewers/browser to manipulate the camera or objects of a 3D scene (via URI fragments) 2. implicitly: by mapping 3D objectnames (of a 3D scene/file) to URI fragments (3D deeplinking) -3. explicitly: by scanning `href` metadata **inside** 3D scene-files to enable interactions -4. externally: progressively enhance a 3D (file) into an experience via [sidecarfiles](https://en.wikipedia.org/wiki/Sidecar_file) +3. explicitly: by scanning href metadata inside 3D scene-files to enable interactions +4. explicitly: by scanning for XR hints metadata inside 3D scene-files to distinguish contextual rendering (AR vs VR e.g.) +5. externally: progressively enhance a 3D (file) into an experience via [5]sidecarfiles -> Aspect 1 was pioneered and implemented by JanusXR / James Baicoianu via [janusweb](https://github.com/jbaicoianu/janusweb) well before the formal specification was established. As a key architect of these early concepts, Jamesโs work laid the groundwork for the standard we use today. We owe him a great deal of thanks for his early contributions. +Aspect 1 was pioneered and implemented by JanusXR / James Baicoianu via [6]janusweb well before the formal specification was established. As a key architect of these early concepts, James's work laid the groundwork for the standard we use today. We owe him a great deal of thanks for his early contributions. -# What does it solve +Applications can adopt XR Fragments at various levels, depending on application needs. However, Level1 is considered the soul of XR fragments: other levels are optional and not required to consider something 'XR Fragment compatible' (3D objects & camera reference-able via URL). + +Spatial Referencing 3D objects + +3D files/scenes contain an hierarchy of objects. +XR Fragments assumes the following objectname-to-URI-Fragment mapping, in order to deeplink 3D objects: +my.io/scene.fbx (or my.io/scene.html delivering a three.js scene) + + +-----------------------------+ + | sky | src: http://my.io/scene.fbx#sky (includes building,mainobject,floor) + | +-------------------------+ | + | | building | | src: http://my.io/scene.fbx#building (includes mainobject,floor) + | | +---------------------+ | | + | | | mainobject | | | src: http://my.io/scene.fbx#mainobject (includes floor) + | | | +-----------------+ | | | + | | | | floor | | | | src: http://my.io/scene.fbx#floor (just floor object) + | | | | | | | | + | | | +-----------------+ | | | + | | +---------------------+ | | + | +-------------------------+ | + +-----------------------------+ + + +Every 3D fileformat supports named 3D objects, and this name allows URLs (fragments) to reference them (and their children objects). + +In case of the href-attribute (see level2: explicit hyperlinks) we use this reference to teleport the player/camera to that location (of the referenced object). + +What does it solve It solves: +1. addressibility and [7]hypermediatic navigation of 3D scenes/objects: [8]URI Fragments using src/href spatial metadata +2. unlocking spatial potential of the (originally 2D) hashtag (which jumps to a chapter) for navigating XR documents +3. refraining from introducing an opiniated scripting-engine for mundane tasks (and preventing its inevitable security-headaches) -1. addressibility and [hypermediatic](https://github.com/coderofsalvation/hypermediatic) navigation of 3D scenes/objects: [URI Fragments](https://en.wikipedia.org/wiki/URI_fragment) using src/href spatial metadata -1. unlocking spatial potential of the (originally 2D) hashtag (which jumps to a chapter) for navigating XR documents -1. refraining from introducing scripting-engines for mundane tasks (and preventing its inevitable security-headaches) -1. the gap between text an 3d objects: object-names directly map to hashtags (=fragments), which allows 3D to text transcription. +XR Fragments views XR experiences through the lens of 3D deeplinked URI's, rather than thru a specific scripting- or game-engine, or protocol-specific browsers (https webbrowser e.g.). To aid adoption, the standard comprises of various (optional) support-levels, which incorporate existing standards like [9]W3C Media Fragments and [10]URI Templates (RFC6570) to promote spatial addressibility, sharing, navigation, filtering and databinding objects for (XR) Browsers. -> NOTE: The chapters in this document are ordered from highlevel to lowlevel (technical) as much as possible +XR Fragments is in a sense, a heuristical 3D format or meta-format, which leverages heuristic rules derived from any 3D scene or well-established 3D file formats, to extract meaningful features from scene hierarchies. +These heuristics, enable features that are both meaningful and consistent across different scene representations, allowing higher interop between fileformats, 3D editors, viewers and game-engines. -XR Fragments views XR experiences through the lens of 3D deeplinked URI's, rather than thru code(frameworks) or protocol-specific browsers (webbrowser e.g.). -To aid adoption, the standard comprises of various (optional) support-levels, which incorporate existing standards like [W3C Media Fragments](https://www.w3.org/TR/media-frags/) and [URI Templates (RFC6570)](https://www.rfc-editor.org/rfc/rfc6570) to promote spatial addressibility, sharing, navigation, filtering and databinding objects for (XR) Browsers.
+Level0: file -> XR Fragments is in a sense, a heuristical 3D format or meta-format, which leverages heuristic rules derived from any 3D scene or well-established 3D file formats, to extract meaningful features from scene hierarchies.
-These heuristics, enable features that are both meaningful and consistent across different scene representations, allowing higher interop between fileformats, 3D editors, viewers and game-engines. +Capable 3D fileformats -# Hypermediatic feedback Loop in XR Browsers + [11]glTF, [12]usdz, [13]obj, [14]collada, [15]THREE.json, [16]X3D e.g. are capable of XR Fragments. +The requirements of any 3D file is: a scenegraph with 1 or more named objects. -`href` metadata traditionally implies **click** AND **navigate**, however XR Fragments separates **click** via the `xrf://` scheme, which does not change the top-level URL-adress (of the browser). -This allows for many extra interactions via URLs, which otherwise needs a scripting language. -These are called **hash**-events in this sepc. +XR Fragment Compatible -> Being able to use the same URI Fragment DSL for navigation (`href: #foo`) as well as interactions (`href: xrf://#foo`) greatly simplifies implementation, increases HFL, and reduces need for scripting languages. +A 3D scene-file can be considered XR Fragment-compatible when it matches one of these heuristics +1. implicit: it has at least one [17]sidecar-file +2. explicit: an object has an [18]href extra. +3. explicit: it has at least one [19]system folder (one objectname starting with underscore) -This opens up the following benefits for traditional & future webbrowsers: + * = last wins in case of non-unique names -* [hypermediatic](https://github.com/coderofsalvation/hypermediatic) loading/clicking 3D assets (gltf/fbx e.g.) natively (with or without using HTML). -* potentially allowing 3D assets/nodes to publish XR Fragments to themselves/eachother using the `xrf://` hash-events (`xrf://#person=walk` to trigger `walk`-animation for object `person`) -* potentially collapsing the 3D scene to an wordgraph (for essential navigation purposes) controllable thru a hash(tag)bus -* completely bypassing the security-trap of loading external scripts (by loading 3D model-files, not HTML-javascriptable resources) +Loading a file -XR Fragments itself are [hypermediatic](https://github.com/coderofsalvation/hypermediatic) and HTML-agnostic, though pseudo-XR Fragment browsers **can** be implemented on top of HTML/Javascript. -| principle | 3D URL | HTML 2D URL | -|-----------------------------|-------------------------------------------------|---------------------------------------| -| the hash-events | hashtags alter camera/scene/object-projections | hashtags alter document positions | -| href metadata | teleports to other XR document | jumps to other HTML document | -| href metadata | href="xrf://#-foo&bar" | href="javascript:hideFooAndShowBar()` | -> An important aspect is that URI Fragments can be triggered without updating the top-level URI (default href-behaviour) thru their own 'bus' (`xrf://#.....`). This decoupling between navigation and interaction prevents non-standard things like (`href`:`javascript:dosomething()`). -# Conventions and Definitions -See appendix below in case certain terms are not clear. +When an XR player (myplayer.exe e.g.) is launched (without a specific file), it should poll for a default file (myplayer.glb e.g.). -## XR Fragment URL Grammar +Sidecar files -For typical HTTP-like browsers/applications: +These are optional auto-loaded files to enable hasslefree publishing of [24]XR Movie applications. +The application should poll for only those [25]3D file-formats it supports. + __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ -``` -reserved = gen-delims / sub-delims -gen-delims = "#" / "&" -sub-delims = "," / "=" -``` +Webviewer example -> Example: `://foo.com/my3d.gltf#room1&prio=-5&t=0,100` +1. https://my.org/demo.html loads demo.glb +2. https://my.org/demo.html?file=foo.glb loads foo.glb -| Demo | Explanation | -|-------------------------------|---------------------------------| -| `room1` | vector/coordinate argument e.g. | -| `room1&cam1` | combinators | +Linux/Mac example -> this is already implemented in all browsers +$ ls -la +myplayer +myplayer.glb +$ ./myplayer <-- automatically loads myplayer.glb +$ ./myplayer foo.glb <-- no sidecar logic -For in-browser implementations where hash is already used, the following formats can be used: +Windows example -* [janusweb](https://github.com/jbaicoianu/janusweb): `https://web.janus.org/#janus.url=https%3A%2F%2Ffoo.com%2Fmy3d.gltf%23room1%26prio%3D-5%26t%3D0%2C100` -* viewer using query for url-input: `https://my.org/myviewer?https%3A%2F%2Ffoo.com%2Fmy3d.gltf%23room1%26prio%3D-5%26t%3D0%2C100` +> dir +myplayer.exe +myplayer.glb +> myplayer.exe <-- automatically loads myplayer.glb +> myplayer.exe foo.glb <-- no sidecar logic -# Spatial Referencing 3D +NOTE: after loading a file the usual [26]sidecar file-logic applies -3D files contain an hierarchy of objects.
-XR Fragments assumes the following objectname-to-URI-Fragment mapping, in order to deeplink 3D objects: +Slideshow -``` +when a loaded file ends with a number (foo1.glb) automatically check for the existence of foo2.glb) - my.io/scene.fbx - +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+ - โ sky โ src: http://my.io/scene.fbx#sky (includes building,mainobject,floor) - โ +โโโโโโโโโโโโโโโโโโโโโโโโโ+ โ - โ โ building โ โ src: http://my.io/scene.fbx#building (includes mainobject,floor) - โ โ +โโโโโโโโโโโโโโโโโโโโโ+ โ โ - โ โ โ mainobject โ โ โ src: http://my.io/scene.fbx#mainobject (includes floor) - โ โ โ +โโโโโโโโโโโโโโโโโ+ โ โ โ - โ โ โ โ floor โ โ โ โ src: http://my.io/scene.fbx#floor (just floor object) - โ โ โ โ โ โ โ โ - โ โ โ +โโโโโโโโโโโโโโโโโ+ โ โ โ - โ โ +โโโโโโโโโโโโโโโโโโโโโ+ โ โ - โ +โโโโโโโโโโโโโโโโโโโโโโโโโ+ โ - +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+ +This will allow simple 3D slideshows: +foo1.glb +foo2.glb +foo3.glb +foo4.glb -``` +But with [sidecar files](#sidecar files) this also allows for XR movie series: +foo-episode1.glb +foo-episode1.vtt +foo-episode1.ogg -> Every 3D fileformat supports named 3D object, and this name allows URLs (fragments) to reference them (and their children objects). +foo-episode2.glb +foo-episode2.vtt +foo-episode2.ogg -Clever nested design of 3D scenes allow great ways for re-using content, and/or previewing scenes.
-For example, to render a portal with a preview-version of the scene, create an 3D object with extra/metadata: +and so on -* href: `https://scene.gltf` +F3D -# Level0: Files +The opensource [27]F3D 3D viewer supports level0 'next file' by invoking: +$ f3d --animation-autoplay foo-episode*.glb -Compatible 3D fileformats: [glTF](https://www.khronos.org/gltf/), [usdz](https://openusd.org/release/spec_usdz.html), [obj](https://en.wikipedia.org/wiki/Wavefront_.obj_file), [collada](https://www.khronos.org/collada), [THREE.json](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4), [X3D](https://en.wikipedia.org/wiki/X3D) e.g. -
+In a similar spirit of the XR Fragment spec: F3D supports multiple 3D file formats, so the 3D slideshow can exist of different 3D fileformats. -A 3D scene-file can be considered XR Fragment-compatible when it contains metadata: -1. implicit: there's at least one object with a name (*) -2. explicit: (optional) object(s) have (level2) href extras. +Sidecar files -> \* = last wins in case of non-unique names +These are optional auto-loaded files to enable hasslefree [28]XR Movies: + __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ -There are **optional** auto-loaded [side-car files]() to enable hasslefree [XR Movies](#XR%20Movies).
-they can accomodate developers or applications who (for whatever reason) must not modify the 3D scene-file (a `.glb` e.g.). +via [29]href metadata -## Timelines +scene.glb <--- 'href' extra [heuristic] detected inside! +scene.png <--- then poll preview thumbnail +scene.ogg <--- then poll soundtrack to plays when global 3D animation starts) +scene.vtt <--- then poll fallback subtitles for accessibility or screenreaders +scene.json <--- then poll sidecar JSON-file with explicit metadata -When a loaded file contains a timeline (animations/subtitles e.g.), then: +heuristics +1. if at least one `href` custom property/extra is found in a 3D scene +2. The viewer should poll for the above mentioned sidecar-file extensions (and present accordingly) + __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ -> All timelines must play (looped) by default (to enable [[XR Movies]]) +via chained extension -Unless an object has multiple animations (actions e.g.), then just play the first or with name `default`. +scene.xrf.glb <--- 'href' extra [heuristic] detected inside! +scene.xrf.png <--- then poll preview thumbnail +scene.xrf.ogg <--- then poll soundtrack to plays when global 3D animation starts) +scene.xrf.vtt <--- then poll fallback subtitles for accessibility or screenreaders +scene.xrf.json <--- then poll sidecar JSON-file with explicit metadata -## via href metadata +A fallback-mechanism to turn 3D files into [30]XR Movies without editing them. -``` -scene.glb <--- 'href' extra [heuristic] detected inside! -scene.png (preview thumbnail) -scene.ogg (soundtrack to plays when global 3D animation starts) -scene.vtt (subtitles for accessibility or screenreaders) -scene.json (sidecar JSON-file with explicit metadata) -``` +heuristics -**heuristics**: +the chained-extension heuristic .xrf. should be present in the filename (scene.xrf.glb e.g.) + __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ -* if at least one `href` custom property/extra is found in a 3D scene -* The viewer should poll for the above mentioned sidecar-file extensions (and present accordingly) +JSON sidecar-file -## via chained extension +NOTE: the following approach is only recommended for archivist/userupload scenarios where the 3D file itself should not be altered. -``` -scene.xrf.glb <--- '.xrf.' sidecar file heuristic detected! -scene.xrf.png (preview thumbnail) -scene.xrf.ogg (soundtrack to plays when global 3D animation starts) -scene.xrf.vtt (subtitles for accessibility or screenreaders) -scene.xrf.json (sidecar JSON-file with explicit metadata) -``` - -> A fallback-mechanism to turn 3D files into [XR Movies](#XR%20Movies) without editing them. - -**heuristics**: - -* the chained-extension heuristic `.xrf.` should be present in the filename (`scene.xrf.glb` e.g.) - -## via subdocuments/xattr - -More secure protocols (Nextgraph e.g.) don't allow for simply polling files. -In such case, subdocuments or extended attributes should be polled: - -> NOTE: in the examples below we use the href-heuristic, but also the `.xrf.` chained-extension applies here. - -``` -myspreadsheet.ods -โโโ explainer.glb <--- 'href' extra [heuristic] detected inside! - โโโ explainer.ogg (soundtrack to play when global 3D animation starts) - โโโ explainer.png (preview thumnbnail) - โโโ explainer.json (sidecar JSON-file with explicit metadata) - โโโ explainer.vtt (subtitles for accessibility or screenreaders) -``` - -If only extended attributes (xattr) are available, the respective referenced file can be embedded: - -``` -$ setfattr -n explainer.ogg -v "soundtrack.ogg" explainer.glb -$ setfattr -n explainer.png -v "thumbnail.png" explainer.glb -$ setfattr -n explainer.vtt -v "subtitles.vtt" explainer.glb -``` - -> NOTE: Linux's `setfattr/getfattr` is `xattr` on mac, and `Set-Content/Get-content` on Windows. See [pxattr](https://www.lesbonscomptes.com/pxattr/index.html) for lowlevel access. - -## JSON sidecar-file - -> NOTE: the following approach is only recommended for archivist/userupload scenarios where the 3D file itself should not be altered. - -For developers, a json-sidecar-file can allow for defining explicit XR Fragments metadata (>level1), outside of the 3D file. -This can be done via (objectname/metadata) key/value-pairs in a JSON sidecar-file: - -```json +For developers, a json-sidecar-file can allow for defining explicit XR Fragments metadata (>level1), outside of the 3D file. This can be done via (objectname/metadata) key/value-pairs in a JSON sidecar-file: { "aria-description": "description of scene", "button": { @@ -302,561 +218,267 @@ This can be done via (objectname/metadata) key/value-pairs in a JSON sidecar-fil "aria-description": "description of room" } } -``` This will make object button clickable, and teleport the user to object roomB. -
-> So after loading experience.glb the existence of experience.json is detected, to apply the explicit metadata.
The sidecar will define (or override already existing) extras, which can be handy for multi-user platforms (offer 3D scene customization/personalization to users). + +So after loading experience.glb the existence of experience.json is detected, to apply the explicit metadata. +The sidecar will define (or override already existing) extras, which can be handy for multi-user platforms (offer 3D scene customization/personalization to users). In THREE.js-code this would boil down to: +scene.userData['aria-description'] = "description of scene" +scene.getObjectByName("button").userData.href = "#roomB" -```javascript - scene.userData['aria-description'] = "description of scene" - scene.getObjectByName("button").userData.href = "#roomB" -``` +now the XR Fragments parser can process the XR Fragments userData 'extras' in the scene -> now the XR Fragments parser can process the XR Fragments userData 'extras' in the scene +multilanguage example -# Level1: URI +Applications or webservers can use symbolic links or (webpaths) for language-directories: +scene.glb +scene.json +es/scene.glb --> ../scene.glb +es/scene.png +es/scene.ogg +es/scene.vtt +es/scene.json --> ../scene.json +However, embedding the multilanguage postfixes are preferred for portability reasons: see [31]multilangual -> **XR Fragments allows deeplinking of 3D objects by mapping objectnames to URI fragments** +via subdocuments/xattr -XR Fragments tries to seek to connect the world of text (semantical web / RDF), and the world of pixels.
-Instead of forcing authors to combine 3D/2D objects programmatically (publishing thru a game-editor e.g.), XR Fragments **integrates all** which allows a universal viewing experience.
+More secure protocols (Nextgraph e.g.) don't allow for simply polling files. In such case, subdocuments or extended attributes should be polled: -``` - +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+ - โ โ - โ U R N โ - โ U R L | โ - โ | |-----------------+--------| โ - โ +--------------------------------------------------| โ - โ | โ - โ + https://foo.com/some/foo/scene.glb#someview <-- http URI (=URL and has URN) โ - โ | โ - โ + ipfs://cfe0987ec9r9098ecr/cats.fbx#someview <-- an IPFS URI (=URL and has URN) โ - โ โ - โ ec09f7e9cf8e7f09c8e7f98e79c09ef89e000efece8f7ecfe9fe <-- an interpeer URI โ - โ โ - โ โ - โ |------------------------+-------------------------| โ - โ | โ - โ U R I โ - โ โ - +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+ +NOTE: in the examples below we use the [32]href-heuristic, but also the .xrf. chained-extension applies here. -``` +myspreadsheet.ods ++-- explainer.glb <--- 'href' extra [heuristic] detected inside! + +-- explainer.ogg (soundtrack to play when global 3D animation starts) + +-- explainer.png (preview thumnbnail) + +-- explainer.json (sidecar JSON-file with explicit metadata) + +-- explainer.vtt (subtitles for accessibility or screenreaders) -Fact: our typical browser URL's are just **a possible implementation** of URI's (for untapped humancentric potential of URI's [see interpeer.io](https://interpeer.io) or [NextGraph](https://nextgraph.org) ) +If only extended attributes (xattr) are available, the respective referenced file can be embedded: +$ setfattr -n explainer.ogg -v "soundtrack.ogg" explainer.glb +$ setfattr -n explainer.png -v "thumbnail.png" explainer.glb +$ setfattr -n explainer.vtt -v "subtitles.vtt" explainer.glb -> XR Fragments does not look at XR (or the web) thru the lens of HTML or URLs.
But approaches things from a higherlevel local-first 3D hypermedia browser-perspective. +NOTE: Linux's setfattr/getfattr is xattr on mac, and Set-Content/Get-content on Windows. See [33]pxattr for lowlevel access. -Below you can see how this translates back into good-old URLs: +when a loaded file contains a timeline (animations/subtitles e.g.), then: -``` - +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+ - โ โ - โ the soul of any URL: ://macro /meso ?micro #nano โ - โ โ - โ 2D URL: ://library.com /document ?search #chapter โ - โ โ - โ 4D URL: ://park.com /4Dscene.fbx โ> ?other.glb โ> #object โ - โ โ โ โ - โ โ โ โ - โ โ โ โ - โ โ โ โ - โ โ โ โ - โ โ โ โ - โ โโ view change โโโโโโโโโโโโโโโ+ โ - โ โ - โ โ - +โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ+ +All timelines must play (looped) by default (to enable [34]XR Movies) -``` +Unless an object has multiple animations (actions e.g.), then just play the first or with name default. -> ?-linked and #-linked navigation are JUST one possible way to implement XR Fragments: the essential goal is to allow a Hypermediatic FeedbackLoop (HFL) between external and internal 4D navigation. - -## List of URI Fragments +protocol:// my.org/world.glb #room2 -| fragment | type | example | info | -|-------------------|------------|--------------------|----------------------------------------------------------------------| -| `#......` | vector3 | `#room1` `#room2` `#cam2` | positions/parents camera(rig) (or XR floor) to xyz-coord/object/camera and upvector | +URLs are the heart of XR Fragment-based 3D Hypermedia: + * it allows navigating the XR browser to a (different) 3D scene (world.glb e.g.) + * it allows teleporting the user to a different location (room2 e.g.) + * it allows back/forward navigation + * it allows addressibility (for 3d objects inside a file) +Examples: +https://linux.world/#roomF&t=1,100 +linuxapp://conference/nixworkshop?newuser#roomC&t=2,200 +androidapp://page1?tutorial#roomB&t=1,100 -## List of **explicit* metadata +Implicit and Explicit adressibility is the core of the XR Fragments spec, as well as user teleportation: -These are the possible 'extras' for 3D nodes and sidecar-files -| key | type | example (JSON) | function | existing compatibility | -|--------------|----------|------------------------|---------------------|----------------------------------------| -| `href` | string | `"href": "b.gltf"` | XR teleport | custom property in 3D fileformats | -# Level2: href links -Explicit href metadata ('extras') in a 3D object (of a 3D file), hint the viewer that the user ''can interact'' with that object : +Software uses level1 for deeplinking objects, or to teleport the user: here's pseudocode for a level1 XR Fragments browser in THREE.js: +// by default the (VR) user gets position at 0,0,0 at the loaded scene (+VR userheight) -| fragment | type | example value | -|----------|------|----------------| -| `href` | string (uri or predefined view) | `#pyramid`, `#lastvisit`, `xrf://#-someobject`, `://somefile.gltf#foo` | +url = 'world.glb#roomB&car' +file = url.split("#")[0] +xrf = new URLSearchParams( url.split("#")[1] ) +refs = ([...xrf.keys()]).filter( (k) => !k.match(/(t)/) ) // skip mediafrags -## Interaction behaviour +// set last (nonoperator) objectname as camera-location +for( i in refs ){ +scene.setActiveCameraByName(refs[i]) // teleport +obj = extractObject(scene,refs[i]) // or purely deeplink +} -When clicking an ''href''-value, the user(camera) is teleport to the referenced object. +for robust parsing of XR Fragments use a http query-language parser, or the polyglot [39]parser -The imported/teleported destination can be another object in the same scene-file, or a different file. +Below is the related section of the spec (full spec here: [40]HTML, [41]TXT) -## XR Viewer implementation +IFRAME: [42]doc/RFC_XR_Fragments.html#list-of-uri-fragments -| **spec** | **action** | **feature** | -|----------|------------|-------------| -| level0+1 | hover 3D file [href](#via-href-metadata) | show the preview PNG thumbnail (if any). | -| level0+1 | launch 3D file [href](#via-href-metadata) | replace the current scene with a new 3D file (`href: other.glb` e.g.) | -| level2 | click internal 3D file [href](#via-href-metadata) (`#roomB` e.g.) | teleport the camera to the origin of object(name `roomB`). See [[teleport camera]].| -| level2 | click external 3D file [href](#via-href-metadata) (`foo.glb` e.g.) | replace the current scene with a new 3D file (`href: other.glb` e.g.) | -| level2 | hover external 3D file [href](#via-href-metadata) | show the preview PNG thumbnail (if any sidecar, see level0) | -| level2 | activate animation | clicking href-value `#foo` will select animation `foo` (if exist) | -| level2 | click [href](#via-href-metadata) | hash-events: execute without changing the toplevel URL location (`href: xrf://#someObjectName` e.g.) | -| higher levels | non-normative | non-normative | +For more info see [43]How it works -> NOTE: hash-events links (`xrf://#foo&bar`) don't change the toplevel URL, which makes it ideal for interactions (in contrast to typical `#roomC` navigation, which benefit back/forward browser-buttons), see hash-events for more info. +Every 3D object, material or camera can be adressed by URI fragments (#myobject e.g.) which are derived from the 3D scene objectnames (implicit metadata). +These are inferred at runtime from the 3D scene-nodes (object names, object metadata etc). +Free fragments and features generated for you..How great is that? -> **default camera (spawn) location**: When a 3D file is loaded, it will position the user/camera at xyz: 0,0,0 OR to the location of (an object called) ''spawn''. +my.io/scene.usdz Embeddable as: + +-----------------------------+ + | sky | src: http://my.io/scene.udsz#sky (includes building,mainobject,floor) + | +-------------------------+ | + | | building | | src: http://my.io/scene.udsz#building (includes mainobject,floor) + | | +---------------------+ | | + | | | mainobject | | | src: http://my.io/scene.udsz#mainobject (includes floor) + | | | +-----------------+ | | | + | | | | floor | | | | src: http://my.io/scene.udsz#floor (just floor object) + | | | | | | | | + | | | +-----------------+ | | | href: http://my.io/scene.udsz#-mainobject (hides mainobject when clicked) + | | +---------------------+ | | + | +-------------------------+ | + +-----------------------------+ -Basically: -``` -https://my.org/foo.glb -``` +Fragments (#building e.g.) allow for very convenient, guess-able [44]filters to reference/show/hide objects within a 3D scene. -will load as default: +For more examples see [45]filters and [46]the reference-menu (by feature) -``` -https://my.org/foo.glb#spawn -``` +Below is the related section of the spec (full spec here: [47]HTML, [48]TXT) -# Level3: XR hints +IFRAME: [49]doc/RFC_XR_Fragments.html#fragment-to-metadata-mapping -> How to know whether a 3D file is a full scene or just a prop?
When should a 3D file hide its skybox?
How does a file know whether its embedded or not?
How to hide an object in AR-mode only?
How to ''hide'' an object by default, after loading a scene? +default portals -**Answer**: somehow tagging the file, or object with **predefined classes** ; universal XR keywords. +To render a portal, the easiest way is [50]JanusXR-style portals: -Example in JanusWeb JML: +clickable planes which teleport the user to a different position or file. This is the whole idea behind [51]href and [52]XRF microformat metadata. -``` - -
mode | VR
mode | AR
mode | **usecase** | -|-|-|-|-|-| -| `vr` | show | show | hide | render object+children | -| `ar` | hide | hide | show | render object+children | -| `embed` | show | show | show | render object+children when loaded in another scene | -| `portal` | show | show | show | render object+children inside portal | -| `collection` | hide | hide | hide | object+children are not part of a scene/experience (think importing into inventory, openbrush brushes e.g.). | -| `hide` | hide | hide | hide | hide object+children | +Undefined widget 'videojs' -Any element without any of these class-values is considered visible in all layers. Once class-value(s) are detected it'll work as a layer-mask: `class: 'vr ar'` will be visible in desktop-,VR- and AR-mode. +Portals avoid XR clutter. Rinsema's effect: "To observe much is to absorb little" -> **NOTE**: there's is no CSS: class attributes without CSS means **no cascade inheritance**; above class-definitions will apply to the element itself (and its children, which can override by defining their own XR layer class-definitions). +A materialless mesh with the following heuristics will render as an immersive portal: +Portaltype Heuristics Result +XR lens [54]child objects in materialless mesh objects are only visible in mesh +XR portal [55]href value the other mesh will be used as camera-point + (location will have 1.6m camera-height added) -## Predefined hints: XR object interactions +NOTE: in 3D engines this is refererred to as rendering to a designated stencil. -| **hint/class** | **spec** | **document default** | **usecase** | -|-|-|-|-| -| `grabbable` | v1 | unset | allow single handtracking-pinch to reposition object, or via buttonhold + controllermove/mousemove | -| `stretchable` | v1 | unset | allow both handtracking-pinch to stretch object, or via buttonhold + controllermove/mousemove | -| `collidable` | v1 | unset | hints that `grabbable` and `stretchable` should halt upon collisions | +You can see this demonstrated in [56]index.glb or the demo-video & viewer below: -> **NOTE:** `href: #*foo` implies that object `foo` has `class: 'grabbable'` +NOTE: designers are adviced to always accompany a button to the portal (see video), to keep things backwards compatible with barebones (non-portal-supporting) XRF viewers. -## Usecases +Examples -* 3D previews: `class: 'vr ar'` prevents rendering (heavy) items when displayed in a portal (or embedded into another scene). -* extra info: `class: 'portal'` displays onboarding texts/info ONLY when rendered in a portal. +Example scene hierarchy: -# Level8: Media Fragments +my.io/scene.usdz + +-----------------------------+ + | world1 | + | +-------------------------+ | + | | myportalmesh------------------+ href: #portalpoint + | | | | + | +-------------------------+ | myportalmesh renders world2 + | world2 | inside from portalpoint's of view + | +-------------------------+ | (if myportalmesh has no material) + | | cube | | + | | portalpoint | | + | +-------------------------+ | + +-----------------------------+ -> these allow for XR Movies with a controllable timeline using `href` URI's with Media Fragments +Lenses -Just like with 2D media-files, W3C mediafragments (`#t=1,2`) can be used to control a timeline via the [#t](##t) primitive. -XR Fragments Level3 makes the 3D timeline, as well as URL-referenced files **controllable** via Media Fragments like: +Will render objects inside of the portal (children) ONLY inside of the portal. + [xrlens.png] -* level2 hrefs (`href: #t=4` e.g. to control 3D timeline) -* level4: `xrf:` URI scheme: - * `href: xrf:foo.wav#t=0` to play a wav - * `href: xrf:news.glb?clone#t=0` to instance and play another experience +Example scene hierarchy: -## Animation(s) timeline +my.io/scene.usdz + +-----------------------------+ + | world1 | + | +-------------------------+ | + | | myportal | | myportal renders someinfo inside + | | +----------+ | | as portal + | | | someinfo | | | (if myportal has no material) + | | +----------+ | | + | +-------------------------+ | + +-----------------------------+ -controls the animation(s) of the scene (or `src` resource which contains a timeline) -| fragment | type | functionality | -|----------|------|---------------| -| #t=start,stop | [[vector2]] (default:`#t=0`) | start,stop (in seconds | +Demo viewer +Press the 'Teleport down there'-button (in the lens) and witness the portals afterwards yourself: -| Example Value | Explanation | -|-------------------|-------------| -| `#t=1` | play (3D) animations from 1 seconds till end (and stop) | -| `#t=1,100` | play (3D) animations from 1 till 100 seconds (and stop) | +IFRAME: [57]./example/aframe/sandbox/index.html?index.glb -## Specify playback loopmode +set the position of the camera. -This compensates a missing element from Media Fragments to enable/disable temporal looping. . +level1 spawnpoints -| fragment | type | functionality | -| #loop | string | enables animation/video/audio loop | -| #-loop | string | disables animation/video/audio loop | +protocol :// my.org/world.glb #bar +Spawn user at object (with name) bar after loading (and replacing the current scene with) world.glb -## Controlling embedded content +level2 href spawnpoints -use [[URI Templates]] to control embedded media, for example a simple video-player: + [B5vTCkruO9skAAAAAElFTkSuQmCC] +objectname optional functionality +spawn yes Specifies default camera-position (if exist). Detected after loading scene (world.glb e.g.), if no URI hashtag is present (world.glb#roomC e.g.) +URI fragment type functionality + #roomB string position camera to position of object with name roomB + #cam2 string position camera to position of camera with name cam02, and make it active camera [follow animation e.g.] + [58]https://my.org/worldX.glb#roomY string position camera to position of object roomC after replacing the current scene with worldX.glb -``` - foo.usdz - โ - โโโ โป loopbutton_enable - โ โ href: #loop <-- enable global loop - โ - โโโ โป loopbutton_enable - โ โ href: #-loop <-- disable global loop - โ - โโโ โป playbutton - โ โ href: #t=10&loop <-- play global 3D timeline (all anims) (looped) - โ - โโโ โป playbutton_external - โ href: https://my.org/animation.glb#!&t=3,10 <-- import & play external anim +the usercamera (usually default at 0,0,0 or at objectname spawn) is repositioned to the origin and upvector of the target object, and only in VR/AR its height gets adjusted (~1.6m height is subtracted, to compensate for camera-rig ) -``` +To enable VR elevators e.g., make sure: -# Level4: prefix operators +the camera is attach/parented to that object (so it animates along with the object) +You can add this URI Fragment to the top-level URLbar, or as [59]href value (to trigger via click) in a 3D model Editor (Blender e.g.): -Prefixing objectnames with the following simple operators allow for **extremely powerful** XR interactions: +Undefined widget 'videojs' -* #! -* #* -* #+ or #- -* #| -* xrf: URI scheme +IMPORTANT: please respect [60]collidable floor / objects. Also notice that #pos=roomB has been deprecated in favor of #roomB to simplify the spec. -> **Examples:** `#+menu` to show a object, `#-menu` to hide a menu, `#!menu` to teleport a menu, `#*block` to clone a grabbable block, `#|object` to share an object +Developers only: + [61]ป example implementation + [62]ป discussion -## Object teleports +Spec -Prefixing an object with an exclamation-symbol, will teleport a (local or remote) referenced object from/to its original/usercamera location.
+Below is the related section of the spec (full spec here: [63]HTML, [64]TXT) -[img[objecteleport.png]] - -Usecases: -* show/hide objects/buttons (menu e.g.) in front of user -* embed remote (object within) 3D file via remote URL -* instance an interactive object near the user regardless of location -* instance HUD or semi-transparent-textured-sphere (LUT) around the user - -
- -Clicking the [href](#via-href-metadata)-value above will: - -1. **reposition the referenced object** (menu) to the usercamera's-coordinates. -2. **zoom** in case of (non-empty) mesh-object: rescale to 1 mยณ, and position 1m in front of the camera -3. toggle behaviour: revert values if 1/2 were already applied -4. `#+` is always implied (objects are always made visible) - -This tiny but powerful symbol allows incredible interactive possibilities, by carefully positioning re-usable objects outside of a scene (below the usercamera's floor e.g.). - -* href: `#whiteroom&!explainer&!exitmenu` - -> This will teleport the user to `whiteroom` and moves object `explainer` and `exitmenu` in front of the user. - -* href: `https://my.org/foo.glb#! - -Clicking the [href](#via-href-metadata)-value above will: - -1. import `foo.glb` from `my.org`'s webserver -2. show it in front of the user (because `#!` indicates object teleport) - -* href: `https://foo.glb#roomB&!bar` - -Clicking the [href](#via-href-metadata)-value above will: - -1. replace the current scene with `foo.glb` -2. teleport the user to #roomB inside `foo.glb` -3. **instance the referenced object** (bar inside foo.glb) in front of the user. -4. it will update the top-Level URL (because `xrf:` was not used) -5. hide the **instanced object** when clicked again (toggle visibility) - -> **NOTE**: level2 teleportation links, as well as instancing mitigates the 'broken embedded image'-issue of HTML: **always** attaching the href-values to **a 3D (preview) object** (that way broken links will not break the design). - -**Example:** clicking a 3D button with title 'menu' and [href](#href)-value `xrf:menu.glb?instance#t=4,5` would instance a 3D menu (`menu.glb`) in front of the user, and loop its animation between from 4-5 seconds (`t=4,5`) - -> **NOTE**: combining instance-operators allows dynamic construction of 3D scenes (`#london&!welcomeMenu&!fadeBox` e.g.) - -## Object multipliers (*) - -The star-prefix will clone a (local or remote) referenced object to the usercamera's location, and make it grabbable.
-Usecases: -* object-picker (build stuff with objects) - -> **NOTE**: this is basically the [#! operator](#%23%21) which infinitely **clones** the referenced object (instead of repositioning the object). - -## De/selectors (+ and -) - -> How to show/hide/group material- or object- or animations by name? - -Clicking href-values below will show/hide the targeted material- or animation or object-name (incl. children): - -* `#-welcome` -* `#+welcome` -* `#-VR*` -* `https://foo.glb#bar&-welcome` - -Matching logic: - -* - and + prefix for exact matches (welcome e.g.) -* \* postfix for match beginning (VR_skybox VR_skyboxmat e.g.) - -> NOTE: to hide a skybox when importing/loading a 3D file (force AR) is possible by linking to ``https://my.org/foo.glb#-skybox` or `https://my.org/foo.glb#-skyboxmaterial` - - - -## Sharing object or file (#|) - -The pipe-symbol (`|`) sends a (targeted) object to the OS. -Clicking the href-value below will: - -1. share the (targeted object in the) file to a another application - -> This URL can be fed straight into [Web Share API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Share_API) or [xdg-open](https://www.freedesktop.org/wiki/Software/xdg-utils/) - -* href: `xrf://#|bar` - -> **NOTE**: sharing is limited to (internal objects) via `xrf:` scheme-only - -## xrf:// URI scheme - -Prefixing the `xrf:` to [href](#href)-values **will prevent** [level2](#๐%20level2:%20explicit%20links) [href](#href)-values from changing the top-Level URL. - -> **Usecase**: for non-shareable URLs like `href: xrf:#t=4,5`, to display a stateful msg e.g.). - -**Reason:** XR Fragments is inspired by HTML's [href-attribute](https://en.wikipedia.org/wiki/Hyperlink), which does various things: - -1. it updates the browser-location -2. it makes something clickable -3. it jumps to another document / elsewhere in the same document -4. and more - -The `xrf:` scheme will just do 2 & 3 (so the URL-values will not leak into the top-level URL). - -> **compliance with RFC 3986**: unimplemented/unknown URI schemes (`xrf:...` e.g.) will not update the top-level URL - -# Level5: URI Templates (RFC6570) - - -XR Fragments adopts Level1 URI **Fragment** expansion to provide safe interactivity.
-This is non-normative, and the draft spec is available on request. - - -# Top-level URL processing - - -> Example URL: `://foo/world.gltf#room1&t=10&cam` - -The URL-processing-flow for hypermedia browsers goes like this: - -1. IF scene operators and/or animation operator (`t`) are present in the URL then (re)position the camera (to `room1`) and/or animation-range (`10`) accordingly. -2. IF no camera-position has been set in step 1 or 2 assume `0,0,0` as camera coordinate (XR: add user-height) ([example](https://github.com/coderofsalvation/xrfragment/blob/main/src/3rd/js/three/navigator.js#L31]])) -3. IF a camera-object exists with name `cam` assume that user(camera) position - -## UX - -End-users should always have read/write access to: - -1. the current (toplevel) URL (an URLbar etc) -2. URL-history (a back/forward button e.g.) -3. Clicking/Touching an `href` navigates (and updates the URL) to another scene/file (and coordinate e.g. in case the URL contains XR Fragments). - - -# Example: Navigating content href portals - - -navigation, portals & mutations - -| fragment | type | example value | -|----------|---------------------------------|---------------------------------------------------------------------------------------------------------------------------| -|`href` | string (uri or predefined view) | `#room1`
`#room1`
`://somefile.gltf#room1`
| - -1. clicking an outbound ''external''- or ''file URI'' fully replaces the current scene and assumes `room2` by default (unless specified) - -2. relocation/reorientation should happen locally for local URI's (`#....`) - -3. navigation should not happen ''immediately'' when user is more than 5 meter away from the portal/object containing the href (to prevent accidental navigation e.g.) - -4. URL navigation should always be reflected in the client URL-bar (in case of javascript: see [[here](https://github.com/coderofsalvation/xrfragment/blob/dev/src/3rd/js/three/navigator.js) for an example navigator), and only update the URL-bar after the scene (default fragment `#`) has been loaded. - -5. In immersive XR mode, the navigator back/forward-buttons should be always visible (using a wearable e.g., see [[here](https://github.com/coderofsalvation/xrfragment/blob/dev/example/aframe/sandbox/index.html#L26-L29) for an example wearable) - -6. make sure that the ''back-button'' of the ''browser-history'' always refers to the previous position (see [[here](https://github.com/coderofsalvation/xrfragment/blob/main/src/3rd/js/three/xrf/href.js#L97)) - -7. ignore previous rule in special cases, like clicking an `href` using camera-portal collision (the back-button could cause a teleport-loop if the previous position is too close) - -8. href-events should bubble upward the node-tree (from children to ancestors, so that ancestors can also conain an href), however only 1 href can be executed at the same time. - -9. the end-user navigator back/forward buttons should repeat a back/forward action until a `#...` primitive is found (the stateless xrf:// href-values should not be pushed to the url-history) - -[ยป example implementation](https://github.com/coderofsalvation/xrfragment/blob/main/src/3rd/js/three/xrf/href.js)
-[ยป example 3D asset](https://github.com/coderofsalvation/xrfragment/blob/main/example/assets/href.gltf#L192)
-[ยป discussion](https://github.com/coderofsalvation/xrfragment/issues/1)
- -# Example: Virtual world webrings - - -Consider 3D scenes linking to eachother using these `href` values, attached to 3D button-objects: - -* `href: schoolA.edu/projects.gltf#math` -* `href: schoolB.edu/projects.gltf#math` -* `href: university.edu/projects.gltf#math` - -This would teleport users to the math-projects of those universities.
-Now consider adding a 'webring index'-button to each file, with this href-value: - - -* href: workgroup.edu/webrings.glb#!webringmenu - -This would allow displaying the (remote 3D file) webring menu with various href-buttons inside, all centrally curated by the workgroup. - -# Additional scene metadata - - -XR Fragments does not aim to redefine the metadata-space or accessibility-space by introducing its own cataloging-metadata fields. -Instead, it encourages browsers to scan nodes for the following custom properties: - -* [SPDX](https://spdx.dev/) license information -* [ARIA](https://www.w3.org/WAI/standards-guidelines/aria/) attributes (`aria-*: .....`) -* [datapackage.json](https://datapackage.org) findability, accessibility, interoperability, and reusability of data - -ARIA's `aria-description`-metadata is normative, to aid accessibility and scene transcripts - -> **NOTE**: please always start `aria-description` with a verb to aid transcripts. - -The following metadata are non-normative but encouraged, since they are popular and cheap to parse: - -* [RDF/JSON-LD](https://json-ld.org) like [this example](https://mvmd.org/standards/gltf/) or via glTF's [KHR_xmp_json_ld extension](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_xmp_json_ld) -* [Open Graph](https://ogp.me) attributes (`og:*: .....`) -* [Dublin-Core](https://www.dublincore.org/specifications/dublin-core/application-profile-guidelines/) attributes(`dc:*: .....`) -* [BibTex](https://bibtex.eu/fields) when known bibtex-keys exist with values enclosed in `{` and `},` - - -> Example: object 'tryceratops' with `aria-description: is a huge dinosaurus standing on a #mountain` generates transcript `#tryceratops is a huge dinosaurus standing on a #mountain`, where the hashtags are clickable XR Fragments (activating the visible-links in the XR browser). - -Individual nodes can be enriched with such metadata, but most importantly the scene node: - -| metadata key | example value | -|--------------------------------------------------------|-------------------------------------------------| -| `aria-description`, `og:description`, `dc:description` | `An immersive experience about Triceratops` (*) | -| `SPDX` | `CC0-1.0` | -| `dc:creator` | `John Doe` | -| `dc:title`, `og:title` | 'Triceratops` (*) | -| `og:site_name` | `https://xrfragment.org` | -| `dc.publisher` | `NLNET` | -| `dc.date` | `2024-01-01` | -| `dc.identifier` | `XRFRAGMENT-001` | -| `journal` (bibTeX) | `{Future Of Text Vol 3},` | - -> \* = these are interchangable (only one needs to be defined) - -There's no silver bullet when it comes to metadata, so XR Fragment-implementations should support where the metadata is/goes. - -> These attributes can be scanned and presented during an `href` or `src` eye/mouse-over. - -# Accessibility interface - - -The addressibility of XR Fragments allows for unique 3D-to-text transcripts, as well as an textual interface to navigate 3D content.
-Spec:
- -1. The enduser must be able to enable an accessibility-mode (which persists across application/webpage restarts) -2. Accessibility-mode must contain a text-input for the user to enter text -3. Accessibility-mode must contain a flexible textlog for the user to read (via screenreader, screen, or TTS e.g.) -4. the textlog contains `aria-descriptions`, and its narration (Screenreader e.g.) can be skipped (via 2-button navigation) -5. The `back` command should navigate back to the previous URL (alias for browser-backbutton) -6. The `forward` command should navigate back to the next URL (alias for browser-nextbutton) -7. A destination is a 3D node containing an `href` with a `#...` XR fragment (which matches a 3d object name) -8. The `go` command should list all possible destinations -9. The `go left` command should move the camera around 0.3 meters to the left -10. The `go right` command should move the camera around 0.3 meters to the right -11. The `go forward` command should move the camera 0.3 meters forward (direction of current rotation). -12. The `rotate left` command should rotate the camera 0.3 to the left -13. The `rotate left` command should rotate the camera 0.3 to the right -14. The (dynamic) `go abc` command should navigate to `#scene2` in case there's a 3D node with name `abc` and `href` value `#scene2` -15. The `look` command should give an (contextual) 3D-to-text transcript, by scanning the `aria-description` values of the current `#...` (3D object) value (including its children) -16. The `do` command should list all possible `href` values which don't contain an `#...` XR Fragment -17. The (dynamic) `do abc` command should navigate/execute `https://.../...` in case a 3D node exist with name `abc` and `href` value `https://.../...` - -## Two-button navigation - -For specific user-profiles, gyroscope/mouse/keyboard/audio/visuals will not be available.
-Therefore a 2-button navigation-interface is the bare minimum interface: - -1. objects with href metadata can be cycled via a key (tab on a keyboard) -2. objects with href metadata can be activated via a key (enter on a keyboard) -3. the TTS reads the href-value (and/or aria-description if available) - -# XRF Microformat +IFRAME: [65]doc/RFC_XR_Fragments.html#navigating-3d How can applications discover 3D experiences on a network? -> Answer: **spatial microformats** +Answer: spatial microformats -The XRF microformat is an [optional](#Progressive%20enhancement) text heuristics which applications can detect across various usecases. +The XRF microformat is an [66]optional text heuristics which applications can detect across various usecases. -## via HTML webpage +via HTML webpage -If the browser/application requests an webpage (`https://nlnet.nl` e.g.) it should check for the [rel-me microformat](https://gmpg.org/xfn/) : - -``` +If the browser/application requests an webpage (https://nlnet.nl e.g.) it should check for the [67]rel-me microformat : -``` -This way the application loads `https://nlnet.nl/scene.xrf.glb` when the user types `nlnet.nl` into the URLbar.
-Optionally, `type` can be specified for dynamically generated 3D files: - -``` +This way the application loads https://nlnet.nl/scene.xrf.glb when the user types nlnet.nl into the URLbar. +Optionally, type can be specified for dynamically generated 3D files: -``` -The `type`-attribute is for fallback-purposes.
-Viewer-supported 3D file-extensions (`.glb` e.g.) will **ALWAYS** take precedence over the (non)presence of the `type` attribute.
-The reason is that platforms (Mastodon 'labels' e.g.) don't allow specifying type-attributes.
+The type-attribute is for fallback-purposes. +Viewer-supported 3D file-extensions (.glb e.g.) will ALWAYS take precedence over the (non)presence of the type attribute. +The reason is that platforms (Mastodon 'labels' e.g.) don't allow specifying type-attributes. Another reason is that XR Fragments is filetype-agnostic, so flexibility is expected on the viewer-side. -> NOTE: in case of multiple 3D files mentioned in ` @@ -865,14 +487,14 @@ Example of a webpage with collection of 3D models (like [icosa.gallery](https:// - -``` + 3D engines (games/apps) can render these like clickable portals, for example JanusXR-style portals: -> NOTE: for more customizability [JML <link>](https://coderofsalvation.github.io/janus-guide/#/build/room?id=link) will allow for positioning/thumbnailed portals: +result1.glbresult2.glb + +NOTE: for more customizability [69]JML will allow for positioning/thumbnailed portals: -```xml