diff --git a/doc/RFC_XR_Fragments.md b/doc/RFC_XR_Fragments.md index 65d534b..0cb13d4 100644 --- a/doc/RFC_XR_Fragments.md +++ b/doc/RFC_XR_Fragments.md @@ -298,7 +298,7 @@ It instances content (in objects) in the current scene/asset. | fragment | type | example value | |----------|------|---------------| -|`src`| string (uri, hashtag/query) | `#cube`
`#sometag`
#q=-ball_inside_cube`
`#q=-/sky -rain`
`#q=-.language .english`
`#q=price:>2 price:<5`
`https://linux.org/penguin.png`
`https://linux.world/distrowatch.gltf#t=1,100`
`linuxapp://conference/nixworkshop/apply.gltf#q=flyer`
`androidapp://page1?tutorial#pos=0,0,1&t1,100`| +|`src`| string (uri, hashtag/query) | `#cube`
`#sometag`
#q=-ball_inside_cube`
`#q=-/sky -rain`
`#q=-.language .english`
`#q=price:>2 price:<5`
`https://linux.org/penguin.png`
`https://linux.world/distrowatch.gltf#t=1,100`
`linuxapp://conference/nixworkshop/apply.gltf#q=flyer`
`androidapp://page1?tutorial#pos=0,0,1&t1,100`
`foo.mp3#0,0,0`| Here's an ascii representation of a 3D scene-graph with 3D objects `◻` which embeds remote & local 3D objects `◻` with/out using queries: @@ -407,6 +407,45 @@ How does the scale of the object (with the embedded properties) impact the scale > TODO: needs intermediate visuals to make things more obvious +# XR Fragment: pos + +# XR Fragment: rot + +# XR Fragment: t + +controls the animation(s) of the scene (or `src` resource which contains a timeline) + +| fragment | type | functionality | +| #t=1,1,100 | [[vector3|vector]] (default:`#t=1,0,0`) | speed,framestart,framestop | + +* playposition is reset to framestart, when framestart or framestop is greater than 0 | + +| Example Value | Explanation | +|-|-| +| `1,1,100` | play loop between frame 1 and 100 | +| `1,1,0` | play once from frame 1 (oneshot) | +| `1,0,0` | play (previously set looprange if any) | +| `0,0,0` | pause | +| `1,1,1` | play and auto-loop between begin and end of duration | +| `-1,0,0` | reverse playback speed | +| `2.3,0,0` | set (forward) playback speed to 2.3 (no restart) | +| `-2.3,0,0` | set (reverse) playback speed to -2.3 ( no restart)| +| `-2.3,100,0` | set (reverse) playback speed to -2.3 restarting from frame 100 | + +[[» example implementation|https://github.com/coderofsalvation/xrfragment/blob/main/src/3rd/js/three/xrf/t.js]]
+[[» discussion|https://github.com/coderofsalvation/xrfragment/issues/10]]
+ +# XR audio/video integration + +To play global audio/video items: + +* add a `src: foo.mp3` or `src: bar.mp4` metadata to a 3D object (`cube` e.g.) +* to disable auto-play and global timeline ([[#t=|t]]) control: hardcode a [[#t=|t]] XR Fragment: (`src: bar.mp3#t=0,0,0` e.g.) +* to play it, add `href: #cube` somewhere else +* when the enduser clicks the `href`, `#t=1,0,0` (play) will be applied to the `src` value + +> NOTE: hardcoded framestart/framestop uses sampleRate/fps of embedded audio/video, otherwise the global fps applies. For more info see [[#t|t]]. + # XR Fragment queries Include, exclude, hide/shows objects using space-separated strings: