update spec with mediafragment
This commit is contained in:
parent
8c087c26c7
commit
8d3c92dbed
|
@ -319,9 +319,9 @@ That way, if the link gets shared, the XR Fragments implementation at <code>http
|
|||
|
||||
<tr>
|
||||
<td><code>#t</code></td>
|
||||
<td>timevector</td>
|
||||
<td><code>#t=2,2000,1</code></td>
|
||||
<td>play animation-loop range between frame 2 and 2000 at (normal) speed 1</td>
|
||||
<td><a href="#media%20fragments%20and%20datatypes">media fragment</a></td>
|
||||
<td><code>#t=0,2</code></td>
|
||||
<td>play/loop 3D animation from 0 seconds till 2 seconds</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -370,66 +370,6 @@ That way, if the link gets shared, the XR Fragments implementation at <code>http
|
|||
<p>Supported popular compatible 3D fileformats: <code>.gltf</code>, <code>.obj</code>, <code>.fbx</code>, <code>.usdz</code>, <code>.json</code> (THREE.js), <code>.dae</code> and so on.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="vector-datatypes">vector datatypes</h2>
|
||||
|
||||
<p>| type | syntax | example | info |</p>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>vector2</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>vector3</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>timevector</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<blockquote>
|
||||
<p>NOTE: XR Fragments are optional but also file- and protocol-agnostic, which means that programmatic 3D scene(nodes) can also use the mechanism/metadata.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="dynamic-xr-fragments-databindings">Dynamic XR Fragments (+databindings)</h2>
|
||||
|
||||
<p>These are automatic fragment-to-metadata mappings, which only trigger if the 3D scene metadata matches a specific identifier (<code>aliasname</code> e.g.)</p>
|
||||
|
@ -459,11 +399,18 @@ That way, if the link gets shared, the XR Fragments implementation at <code>http
|
|||
<td>focus object(s) with <code>tag: person</code> or name <code>person</code> by looking up XRWG</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>#[-]<tag_or_objectname></code></td>
|
||||
<td>string</td>
|
||||
<td><code>#person</code> (<code>#-person</code>)</td>
|
||||
<td>focus/show (or hide) object(s) with <code>tag: person</code> or name <code>person</code> by looking up XRWG</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>#<cameraname></code></td>
|
||||
<td>string</td>
|
||||
<td><code>#cam01</code></td>
|
||||
<td>set camera as active camera</td>
|
||||
<td>set camera with name <code>cam01</code> as active camera</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
@ -484,21 +431,142 @@ That way, if the link gets shared, the XR Fragments implementation at <code>http
|
|||
<td><code>#<objectname>=<mediafrag></code></td>
|
||||
<td>string=<a href="https://www.w3.org/TR/media-frags/#valid-uri">media frag</a></td>
|
||||
<td><code>#foo=0,1</code></td>
|
||||
<td>play media <code>src</code> using <a href="https://www.w3.org/TR/media-frags/#valid-uri">media fragment URI</a></td>
|
||||
<td>play 3D animation (or <code>src</code> media) using <a href="https://www.w3.org/TR/media-frags/#valid-uri">media fragment URI</a> with <a href="#media%20fragments%20and%20datatypes">looping/speed/texturescroll abilities</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2 id="media-fragments-and-datatypes">media fragments and datatypes</h2>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>type</th>
|
||||
<th>syntax</th>
|
||||
<th>example</th>
|
||||
<th>info</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>vector2</td>
|
||||
<td>x,y</td>
|
||||
<td>2,3.0</td>
|
||||
<td>2-dimensional vector</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>#<objectname>=<timevector></code></td>
|
||||
<td>string=timevector</td>
|
||||
<td><code>#sky=0,0.5,0.1,0</code></td>
|
||||
<td>sets 1D/2D/3D time(line) vectors (uv-position e.g.) to <code>0,0.5</code> (and autoscroll x with max <code>0.1</code> every second)</td>
|
||||
<td>vector3</td>
|
||||
<td>x,y,z</td>
|
||||
<td>2,3.0,4</td>
|
||||
<td>3-dimensional vector</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>media fragment</td>
|
||||
<td>x</td>
|
||||
<td>0</td>
|
||||
<td>1D timeline: play from 0 seconds to end (and stop)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>media fragment</td>
|
||||
<td>x,y</td>
|
||||
<td>0,2</td>
|
||||
<td>1D timeline: play from 0 seconds till 2 seconds (and stop)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>media fragment</td>
|
||||
<td>u,v</td>
|
||||
<td>0,0.5</td>
|
||||
<td>2D texture: set uv-coordinate at <code>0,0.5</code></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>media fragment *</td>
|
||||
<td>u,v, … [*speed, …]</td>
|
||||
<td>0*2</td>
|
||||
<td>1D timeline: play from 0 seconds till end (and loop) at double (2) speed</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>*</td>
|
||||
<td></td>
|
||||
<td>0,1*2</td>
|
||||
<td>1D timeline: play from 0 seconds till 2 seconds (and loop) at double (2) speed</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>*</td>
|
||||
<td></td>
|
||||
<td><code>#music=1,2</code></td>
|
||||
<td>play media of object (<code>src: podcast.mp3</code> e.g.) from beginning (<code>1</code>) at double speed (<code>2</code>)</td>
|
||||
<td>0,1*0.1</td>
|
||||
<td>2D texture: set uvcoordinates at <code>0,1</code> and scroll them <code>0.1</code> per second (interpolating)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<blockquote>
|
||||
<p>* = this is extending the <a href="https://www.w3.org/TR/media-frags/#mf-advanced">W3C media fragments</a> with multidimensionality and loop(speed). The multidimensional (nonspeed) values will be forwarded to shaders as <strong>uniforms</strong> as following:</p>
|
||||
</blockquote>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>value</th>
|
||||
<th>uniform name</th>
|
||||
<th>implementation</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>u</td>
|
||||
<td>u</td>
|
||||
<td>sets U of UV-coordinate</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>v</td>
|
||||
<td>v</td>
|
||||
<td>sets V of UV-coordinate</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>…</td>
|
||||
<td>vendorId</td>
|
||||
<td>shader library identifier (7447 e.g.)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>…</td>
|
||||
<td>preset</td>
|
||||
<td>shader presetnumber</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>…</td>
|
||||
<td>presetVersion</td>
|
||||
<td>targeted version of preset (so libraries can version/update their presets)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>…</td>
|
||||
<td>preset0</td>
|
||||
<td>preset parameter 0</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>…</td>
|
||||
<td>preset1</td>
|
||||
<td>preset parameter 1</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>…</td>
|
||||
<td>…</td>
|
||||
<td>and so on</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -233,7 +233,7 @@ That way, if the link gets shared, the XR Fragments implementation at `https://m
|
|||
|-------------------|------------|--------------------|----------------------------------------------------------------------|
|
||||
| `#pos` | vector3 | `#pos=0.5,0,0` | positions camera (or XR floor) to xyz-coord 0.5,0,0, |
|
||||
| `#rot` | vector3 | `#rot=0,90,0` | rotates camera to xyz-coord 0.5,0,0 |
|
||||
| `#t` | timevector | `#t=2,2000,1` | play animation-loop range between frame 2 and 2000 at (normal) speed 1 |
|
||||
| `#t` | [media fragment](#media%20fragments%20and%20datatypes) | `#t=0,2` | play/loop 3D animation from 0 seconds till 2 seconds |
|
||||
|
||||
## List of metadata for 3D nodes
|
||||
|
||||
|
@ -245,25 +245,6 @@ That way, if the link gets shared, the XR Fragments implementation at `https://m
|
|||
|
||||
> Supported popular compatible 3D fileformats: `.gltf`, `.obj`, `.fbx`, `.usdz`, `.json` (THREE.js), `.dae` and so on.
|
||||
|
||||
## vector datatypes
|
||||
|
||||
| type | syntax | example | info |
|
||||
|------
|
||||
| vector2 | x,y | 2,3.0 | 2-dimensional vector |
|
||||
| vector3 | x,y,z | 2,3.0,4 | 3-dimensional vector |
|
||||
| timevector | speed | 1 | 1D timeline: play |
|
||||
| | | 0 | 1D timeline: stop |
|
||||
| | x,speed | 1,2 | 1D timeline: play at offset `1` at (normal) speed `2` |
|
||||
| | | 0,0 | 1D timeline: stop (stopoffset-startoffset == 0) |
|
||||
| | | 0,1 | 1D timeline: unpause with (normal) speed `1` |
|
||||
| | | 1..100,1 | 1D timeline: play (loop) between offset `1` and `100` at normal speed (`1`) |
|
||||
| | x,y,xspeed,yspeed | 0,0.5,0,0 | 2D timeline: stop uv-coordinate at `0,0.5` |
|
||||
| | | 0,0.5,0.2,0 | 2D timeline: play uv-coordinate at offset `0,0.5` and scroll `x` (=u) `0.2` within each second |
|
||||
| | | 0,0..0.5,0.2,0 | 2D timeline: play uv-coordinate between offset `0,0` and `0,0.5` (loop) and scroll `x` (=u) `0.2` within each second |
|
||||
| | x,y,z,xspeed,yspeed,zspeed | 0,0.5,1,0.2,0,2 | XD timeline: play uv-coordinate at `0,0.5` and scroll `x` (=u) `0.2` within each second and pass `1` and `2` as custom data to shader uniforms `za` and `zb` |
|
||||
|
||||
> NOTE: XR Fragments are optional but also file- and protocol-agnostic, which means that programmatic 3D scene(nodes) can also use the mechanism/metadata.
|
||||
|
||||
## Dynamic XR Fragments (+databindings)
|
||||
|
||||
These are automatic fragment-to-metadata mappings, which only trigger if the 3D scene metadata matches a specific identifier (`aliasname` e.g.)
|
||||
|
@ -272,12 +253,42 @@ These are automatic fragment-to-metadata mappings, which only trigger if the 3D
|
|||
|------------------------|----------|-------------------|-------------------------------------------------------------------------------|
|
||||
| `#<aliasname>` | string | `#cubes` | evaluate predefined views (`#cubes: #foo&bar` e.g.) |
|
||||
| `#<tag_or_objectname>` | string | `#person` | focus object(s) with `tag: person` or name `person` by looking up XRWG |
|
||||
| `#<cameraname>` | string | `#cam01` | set camera as active camera |
|
||||
| `#[-]<tag_or_objectname>` | string | `#person` (`#-person`) | focus/show (or hide) object(s) with `tag: person` or name `person` by looking up XRWG |
|
||||
| `#<cameraname>` | string | `#cam01` | set camera with name `cam01` as active camera |
|
||||
| `#<objectname>=<material>` | string=string | `#car=metallic`| set material of car to material with name `metallic` |
|
||||
| | string=string | `#product=metallic`| set material of objects tagged with `product` to material with name `metallic` |
|
||||
| `#<objectname>=<mediafrag>` | string=[media frag](https://www.w3.org/TR/media-frags/#valid-uri) | `#foo=0,1`| play media `src` using [media fragment URI](https://www.w3.org/TR/media-frags/#valid-uri) |
|
||||
| `#<objectname>=<timevector>` | string=timevector | `#sky=0,0.5,0.1,0`| sets 1D/2D/3D time(line) vectors (uv-position e.g.) to `0,0.5` (and autoscroll x with max `0.1` every second)|
|
||||
| | | `#music=1,2`| play media of object (`src: podcast.mp3` e.g.) from beginning (`1`) at double speed (`2`) |
|
||||
| `#<objectname>=<mediafrag>` | string=[media frag](https://www.w3.org/TR/media-frags/#valid-uri) | `#foo=0,1`| play 3D animation (or `src` media) using [media fragment URI](https://www.w3.org/TR/media-frags/#valid-uri) with [looping/speed/texturescroll abilities](#media%20fragments%20and%20datatypes) |
|
||||
|
||||
## media fragments and datatypes
|
||||
|
||||
> NOTE: below the word 'play' applies to 3D animations embedded in the 3D scene(file) **but also** media defined in `src`-metadata like audio/video-files (mp3/mp4 e.g.)
|
||||
|
||||
| type | syntax | example | info |
|
||||
|------------|--------|---------|------|
|
||||
| vector2 | x,y | 2,3.0 | 2-dimensional vector |
|
||||
| vector3 | x,y,z | 2,3.0,4 | 3-dimensional vector |
|
||||
| media fragment | x | 0 | 1D timeline: play from 0 seconds to end (and stop) |
|
||||
| media fragment | x,y | 0,2 | 1D timeline: play from 0 seconds till 2 seconds (and stop) |
|
||||
| media fragment | u,v | 0,0.5 | 2D texture: set uv-coordinate at `0,0.5` |
|
||||
| media fragment * | u,v, ... [*speed, ...] | 0*2 | 1D timeline: play from 0 seconds till end (and loop) at double (2) speed |
|
||||
| * | | 0,1*2 | 1D timeline: play from 0 seconds till 2 seconds (and loop) at double (2) speed |
|
||||
| * | | 0,1*0.1 | 2D texture: set uvcoordinates at `0,1` and scroll U with `0.1` per second (interpolating) |
|
||||
| * | | 0,1*0.1*0.2 | 2D texture: set uvcoordinates at `0,1` and scroll U with `0.1` and V with `0.2` per second (interpolating) |
|
||||
|
||||
> \* = this is extending the [W3C media fragments](https://www.w3.org/TR/media-frags/#mf-advanced) with multidimensionality and loop(speed). The multidimensional (nonspeed) values will be forwarded to shaders as **uniforms** as following:
|
||||
|
||||
| value | uniform name | implementation |
|
||||
|-----------|--------------|----------------|
|
||||
| u | u | sets U of UV-coordinate |
|
||||
| v | v | sets V of UV-coordinate |
|
||||
| ... | vendor | shader library identifier (7447 e.g.) |
|
||||
| ... | preset | shader presetnumber (0 e.g.) |
|
||||
| ... | presetVersion| targeted version of preset (so libraries can version/update their presets)|
|
||||
| ... | preset0 | preset parameter 0 |
|
||||
| ... | preset1 | preset parameter 1 |
|
||||
| ... | ... | and so on |
|
||||
|
||||
> This allows 3D objects to hint the viewer which shader to (not load). If the shader does not support a certain shader-library (7447), then it will simply set the u/v coordinates on a flat shader.
|
||||
|
||||
# Spatial Referencing 3D
|
||||
XR Fragments assume the following objectname-to-URIFragment mapping:
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
|
||||
Internet Engineering Task Force L.R. van Kammen
|
||||
Internet-Draft 30 January 2024
|
||||
Internet-Draft 1 February 2024
|
||||
Intended status: Informational
|
||||
|
||||
|
||||
|
@ -41,7 +41,7 @@ Status of This Memo
|
|||
time. It is inappropriate to use Internet-Drafts as reference
|
||||
material or to cite them other than as "work in progress."
|
||||
|
||||
This Internet-Draft will expire on 2 August 2024.
|
||||
This Internet-Draft will expire on 4 August 2024.
|
||||
|
||||
Copyright Notice
|
||||
|
||||
|
@ -53,9 +53,9 @@ Copyright Notice
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 1]
|
||||
van Kammen Expires 4 August 2024 [Page 1]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
This document is subject to BCP 78 and the IETF Trust's Legal
|
||||
|
@ -75,43 +75,43 @@ Table of Contents
|
|||
3.1. XR Fragment URL Grammar . . . . . . . . . . . . . . . . . 6
|
||||
4. List of URI Fragments . . . . . . . . . . . . . . . . . . . . 7
|
||||
4.1. List of metadata for 3D nodes . . . . . . . . . . . . . . 8
|
||||
4.2. vector datatypes . . . . . . . . . . . . . . . . . . . . 8
|
||||
4.3. Dynamic XR Fragments (+databindings) . . . . . . . . . . 9
|
||||
5. Spatial Referencing 3D . . . . . . . . . . . . . . . . . . . 10
|
||||
6. Navigating 3D . . . . . . . . . . . . . . . . . . . . . . . . 10
|
||||
7. Top-level URL processing . . . . . . . . . . . . . . . . . . 12
|
||||
8. Embedding XR content using src . . . . . . . . . . . . . . . 12
|
||||
9. Navigating content href portals . . . . . . . . . . . . . . . 14
|
||||
9.1. Walking surfaces . . . . . . . . . . . . . . . . . . . . 16
|
||||
9.2. UX spec . . . . . . . . . . . . . . . . . . . . . . . . . 16
|
||||
9.3. Scaling instanced content . . . . . . . . . . . . . . . . 16
|
||||
10. XR Fragment: pos . . . . . . . . . . . . . . . . . . . . . . 17
|
||||
11. XR Fragment: rot . . . . . . . . . . . . . . . . . . . . . . 17
|
||||
12. XR Fragment: t . . . . . . . . . . . . . . . . . . . . . . . 17
|
||||
13. XR audio/video integration . . . . . . . . . . . . . . . . . 18
|
||||
14. XR Fragment filters . . . . . . . . . . . . . . . . . . . . . 18
|
||||
14.1. including/excluding . . . . . . . . . . . . . . . . . . 19
|
||||
14.2. Filter Parser . . . . . . . . . . . . . . . . . . . . . 19
|
||||
15. Visible links . . . . . . . . . . . . . . . . . . . . . . . . 20
|
||||
16. Text in XR (tagging,linking to spatial objects) . . . . . . . 20
|
||||
16.1. Default Data URI mimetype . . . . . . . . . . . . . . . 24
|
||||
16.2. URL and Data URI . . . . . . . . . . . . . . . . . . . . 25
|
||||
16.3. XR Text example parser . . . . . . . . . . . . . . . . . 26
|
||||
17. Transclusion (broken link) resolution . . . . . . . . . . . . 28
|
||||
18. Topic-based index-less Webrings . . . . . . . . . . . . . . . 29
|
||||
19. Security Considerations . . . . . . . . . . . . . . . . . . . 30
|
||||
20. FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
|
||||
21. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 31
|
||||
22. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 31
|
||||
23. Appendix: Definitions . . . . . . . . . . . . . . . . . . . . 31
|
||||
4.2. Dynamic XR Fragments (+databindings) . . . . . . . . . . 8
|
||||
4.3. media fragments and datatypes . . . . . . . . . . . . . . 9
|
||||
5. Spatial Referencing 3D . . . . . . . . . . . . . . . . . . . 11
|
||||
6. Navigating 3D . . . . . . . . . . . . . . . . . . . . . . . . 11
|
||||
7. Top-level URL processing . . . . . . . . . . . . . . . . . . 13
|
||||
8. Embedding XR content using src . . . . . . . . . . . . . . . 13
|
||||
9. Navigating content href portals . . . . . . . . . . . . . . . 15
|
||||
9.1. Walking surfaces . . . . . . . . . . . . . . . . . . . . 17
|
||||
9.2. UX spec . . . . . . . . . . . . . . . . . . . . . . . . . 17
|
||||
9.3. Scaling instanced content . . . . . . . . . . . . . . . . 17
|
||||
10. XR Fragment: pos . . . . . . . . . . . . . . . . . . . . . . 18
|
||||
11. XR Fragment: rot . . . . . . . . . . . . . . . . . . . . . . 18
|
||||
12. XR Fragment: t . . . . . . . . . . . . . . . . . . . . . . . 18
|
||||
13. XR audio/video integration . . . . . . . . . . . . . . . . . 19
|
||||
14. XR Fragment filters . . . . . . . . . . . . . . . . . . . . . 19
|
||||
14.1. including/excluding . . . . . . . . . . . . . . . . . . 20
|
||||
14.2. Filter Parser . . . . . . . . . . . . . . . . . . . . . 20
|
||||
15. Visible links . . . . . . . . . . . . . . . . . . . . . . . . 21
|
||||
16. Text in XR (tagging,linking to spatial objects) . . . . . . . 21
|
||||
16.1. Default Data URI mimetype . . . . . . . . . . . . . . . 25
|
||||
16.2. URL and Data URI . . . . . . . . . . . . . . . . . . . . 26
|
||||
16.3. XR Text example parser . . . . . . . . . . . . . . . . . 27
|
||||
17. Transclusion (broken link) resolution . . . . . . . . . . . . 29
|
||||
18. Topic-based index-less Webrings . . . . . . . . . . . . . . . 30
|
||||
19. Security Considerations . . . . . . . . . . . . . . . . . . . 31
|
||||
20. FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
|
||||
21. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 32
|
||||
22. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 32
|
||||
23. Appendix: Definitions . . . . . . . . . . . . . . . . . . . . 32
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 2]
|
||||
van Kammen Expires 4 August 2024 [Page 2]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
1. Introduction
|
||||
|
@ -165,9 +165,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 3]
|
||||
van Kammen Expires 4 August 2024 [Page 3]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
+───────────────────────────────────────────────────────────────────────────────────────────────+
|
||||
|
@ -221,9 +221,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 4]
|
||||
van Kammen Expires 4 August 2024 [Page 4]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
+───────────────────────────────────────────────────────────────────────────────────────────────+
|
||||
|
@ -277,9 +277,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 5]
|
||||
van Kammen Expires 4 August 2024 [Page 5]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
+===========+===============================+====================+
|
||||
|
@ -333,9 +333,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 6]
|
||||
van Kammen Expires 4 August 2024 [Page 6]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
+==========================+=================================+
|
||||
|
@ -362,38 +362,40 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
4. List of URI Fragments
|
||||
|
||||
+==========+============+==============+===========================+
|
||||
| fragment | type | example | info |
|
||||
+==========+============+==============+===========================+
|
||||
| #pos | vector3 | #pos=0.5,0,0 | positions camera (or XR |
|
||||
| | | | floor) to xyz-coord |
|
||||
| | | | 0.5,0,0, |
|
||||
+----------+------------+--------------+---------------------------+
|
||||
| #rot | vector3 | #rot=0,90,0 | rotates camera to xyz- |
|
||||
| | | | coord 0.5,0,0 |
|
||||
+----------+------------+--------------+---------------------------+
|
||||
| #t | timevector | #t=2,2000,1 | play animation-loop range |
|
||||
| | | | between frame 2 and 2000 |
|
||||
| | | | at (normal) speed 1 |
|
||||
+----------+------------+--------------+---------------------------+
|
||||
|
||||
Table 3
|
||||
+========+======================================+============+=========+
|
||||
|fragment|type |example |info |
|
||||
+========+======================================+============+=========+
|
||||
|#pos |vector3 |#pos=0.5,0,0|positions|
|
||||
| | | |camera |
|
||||
| | | |(or XR |
|
||||
| | | |floor) to|
|
||||
| | | |xyz-coord|
|
||||
| | | |0.5,0,0, |
|
||||
+--------+--------------------------------------+------------+---------+
|
||||
|#rot |vector3 |#rot=0,90,0 |rotates |
|
||||
| | | |camera to|
|
||||
| | | |xyz-coord|
|
||||
| | | |0.5,0,0 |
|
||||
+--------+--------------------------------------+------------+---------+
|
||||
|#t |media fragment |#t=0,2 |play/loop|
|
||||
| |(#media%20fragments%20and%20datatypes)| |3D |
|
||||
| | | |animation|
|
||||
| | | |from 0 |
|
||||
| | | |seconds |
|
||||
| | | |till 2 |
|
||||
| | | |seconds |
|
||||
+--------+--------------------------------------+------------+---------+
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 7]
|
||||
van Kammen Expires 4 August 2024 [Page 7]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
Table 3
|
||||
|
||||
4.1. List of metadata for 3D nodes
|
||||
|
||||
+======+========+==========+===================+===================+
|
||||
|
@ -416,94 +418,148 @@ Internet-Draft XR Fragments January 2024
|
|||
| Supported popular compatible 3D fileformats: .gltf, .obj, .fbx,
|
||||
| .usdz, .json (THREE.js), .dae and so on.
|
||||
|
||||
4.2. vector datatypes
|
||||
|
||||
| type | syntax | example | info |
|
||||
|
||||
+------------+
|
||||
| vector2 |
|
||||
+------------+
|
||||
| vector3 |
|
||||
+------------+
|
||||
| timevector |
|
||||
+------------+
|
||||
+------------+
|
||||
+------------+
|
||||
+------------+
|
||||
+------------+
|
||||
+------------+
|
||||
+------------+
|
||||
+------------+
|
||||
+------------+
|
||||
+------------+
|
||||
|
||||
Table 5
|
||||
|
||||
| NOTE: XR Fragments are optional but also file- and protocol-
|
||||
| agnostic, which means that programmatic 3D scene(nodes) can also
|
||||
| use the mechanism/metadata.
|
||||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 8]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
|
||||
|
||||
4.3. Dynamic XR Fragments (+databindings)
|
||||
4.2. Dynamic XR Fragments (+databindings)
|
||||
|
||||
These are automatic fragment-to-metadata mappings, which only trigger
|
||||
if the 3D scene metadata matches a specific identifier (aliasname
|
||||
e.g.)
|
||||
|
||||
+==========================+=======================+=================+=======================+
|
||||
|fragment |type |example |info |
|
||||
+==========================+=======================+=================+=======================+
|
||||
|#<aliasname> |string |#cubes |evaluate predefined |
|
||||
| | | |views (#cubes: #foo&bar|
|
||||
| | | |e.g.) |
|
||||
+--------------------------+-----------------------+-----------------+-----------------------+
|
||||
|#<tag_or_objectname> |string |#person |focus object(s) with |
|
||||
| | | |tag: person or name |
|
||||
| | | |person by looking up |
|
||||
| | | |XRWG |
|
||||
+--------------------------+-----------------------+-----------------+-----------------------+
|
||||
|#<cameraname> |string |#cam01 |set camera as active |
|
||||
| | | |camera |
|
||||
+--------------------------+-----------------------+-----------------+-----------------------+
|
||||
|#<objectname>=<material> |string=string |#car=metallic |set material of car to |
|
||||
| | | |material with name |
|
||||
| | | |metallic |
|
||||
+--------------------------+-----------------------+-----------------+-----------------------+
|
||||
| |string=string |#product=metallic|set material of objects|
|
||||
| | | |tagged with product to |
|
||||
| | | |material with name |
|
||||
| | | |metallic |
|
||||
+--------------------------+-----------------------+-----------------+-----------------------+
|
||||
|#<objectname>=<mediafrag> |string=media frag |#foo=0,1 |play media src using |
|
||||
| |(https://www.w3.org/TR/| |media fragment URI |
|
||||
| |media-frags/#valid-uri)| |(https://www.w3.org/TR/|
|
||||
| | | |media-frags/#valid-uri)|
|
||||
+--------------------------+-----------------------+-----------------+-----------------------+
|
||||
|#<objectname>=<timevector>|string=timevector |#sky=0,0.5,0.1,0 |sets 1D/2D/3D |
|
||||
| | | |time(line) vectors (uv-|
|
||||
| | | |position e.g.) to 0,0.5|
|
||||
| | | |(and autoscroll x with |
|
||||
| | | |max 0.1 every second) |
|
||||
+--------------------------+-----------------------+-----------------+-----------------------+
|
||||
| | |#music=1,2 |play media of object |
|
||||
| | | |(src: podcast.mp3 e.g.)|
|
||||
| | | |from beginning (1) at |
|
||||
| | | |double speed (2) |
|
||||
+--------------------------+-----------------------+-----------------+-----------------------+
|
||||
|
||||
Table 6
|
||||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 9]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
van Kammen Expires 4 August 2024 [Page 8]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
+=========================+=======================+=================+======================================+
|
||||
|fragment |type |example |info |
|
||||
+=========================+=======================+=================+======================================+
|
||||
|#<aliasname> |string |#cubes |evaluate predefined views (#cubes: |
|
||||
| | | |#foo&bar e.g.) |
|
||||
+-------------------------+-----------------------+-----------------+--------------------------------------+
|
||||
|#<tag_or_objectname> |string |#person |focus object(s) with tag: person or |
|
||||
| | | |name person by looking up XRWG |
|
||||
+-------------------------+-----------------------+-----------------+--------------------------------------+
|
||||
|#[-]<tag_or_objectname> |string |#person |focus/show (or hide) object(s) with |
|
||||
| | |(#-person) |tag: person or name person by looking |
|
||||
| | | |up XRWG |
|
||||
+-------------------------+-----------------------+-----------------+--------------------------------------+
|
||||
|#<cameraname> |string |#cam01 |set camera with name cam01 as active |
|
||||
| | | |camera |
|
||||
+-------------------------+-----------------------+-----------------+--------------------------------------+
|
||||
|#<objectname>=<material> |string=string |#car=metallic |set material of car to material with |
|
||||
| | | |name metallic |
|
||||
+-------------------------+-----------------------+-----------------+--------------------------------------+
|
||||
| |string=string |#product=metallic|set material of objects tagged with |
|
||||
| | | |product to material with name metallic|
|
||||
+-------------------------+-----------------------+-----------------+--------------------------------------+
|
||||
|#<objectname>=<mediafrag>|string=media frag |#foo=0,1 |play 3D animation (or src media) using|
|
||||
| |(https://www.w3.org/TR/| |media fragment URI |
|
||||
| |media-frags/#valid-uri)| |(https://www.w3.org/TR/media- |
|
||||
| | | |frags/#valid-uri) with looping/speed/ |
|
||||
| | | |texturescroll abilities |
|
||||
| | | |(#media%20fragments%20and%20datatypes)|
|
||||
+-------------------------+-----------------------+-----------------+--------------------------------------+
|
||||
|
||||
Table 5
|
||||
|
||||
4.3. media fragments and datatypes
|
||||
|
||||
+==========+==========+=========+==================================+
|
||||
| type | syntax | example | info |
|
||||
+==========+==========+=========+==================================+
|
||||
| vector2 | x,y | 2,3.0 | 2-dimensional vector |
|
||||
+----------+----------+---------+----------------------------------+
|
||||
| vector3 | x,y,z | 2,3.0,4 | 3-dimensional vector |
|
||||
+----------+----------+---------+----------------------------------+
|
||||
| media | x | 0 | 1D timeline: play from 0 seconds |
|
||||
| fragment | | | to end (and stop) |
|
||||
+----------+----------+---------+----------------------------------+
|
||||
| media | x,y | 0,2 | 1D timeline: play from 0 seconds |
|
||||
| fragment | | | till 2 seconds (and stop) |
|
||||
+----------+----------+---------+----------------------------------+
|
||||
| media | u,v | 0,0.5 | 2D texture: set uv-coordinate at |
|
||||
|
||||
|
||||
|
||||
van Kammen Expires 4 August 2024 [Page 9]
|
||||
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
| fragment | | | 0,0.5 |
|
||||
+----------+----------+---------+----------------------------------+
|
||||
| media | u,v, ... | 0*2 | 1D timeline: play from 0 seconds |
|
||||
| fragment | [*speed, | | till end (and loop) at double |
|
||||
| * | ...] | | (2) speed |
|
||||
+----------+----------+---------+----------------------------------+
|
||||
| * | | 0,1*2 | 1D timeline: play from 0 seconds |
|
||||
| | | | till 2 seconds (and loop) at |
|
||||
| | | | double (2) speed |
|
||||
+----------+----------+---------+----------------------------------+
|
||||
| * | | 0,1*0.1 | 2D texture: set uvcoordinates at |
|
||||
| | | | 0,1 and scroll them 0.1 per |
|
||||
| | | | second (interpolating) |
|
||||
+----------+----------+---------+----------------------------------+
|
||||
|
||||
Table 6
|
||||
|
||||
| * = this is extending the W3C media fragments
|
||||
| (https://www.w3.org/TR/media-frags/#mf-advanced) with
|
||||
| multidimensionality and loop(speed). The multidimensional
|
||||
| (nonspeed) values will be forwarded to shaders as *uniforms* as
|
||||
| following:
|
||||
|
||||
+=======+===============+==========================================+
|
||||
| value | uniform name | implementation |
|
||||
+=======+===============+==========================================+
|
||||
| u | u | sets U of UV-coordinate |
|
||||
+-------+---------------+------------------------------------------+
|
||||
| v | v | sets V of UV-coordinate |
|
||||
+-------+---------------+------------------------------------------+
|
||||
| ... | vendorId | shader library identifier (7447 e.g.) |
|
||||
+-------+---------------+------------------------------------------+
|
||||
| ... | preset | shader presetnumber |
|
||||
+-------+---------------+------------------------------------------+
|
||||
| ... | presetVersion | targeted version of preset (so libraries |
|
||||
| | | can version/update their presets) |
|
||||
+-------+---------------+------------------------------------------+
|
||||
| ... | preset0 | preset parameter 0 |
|
||||
+-------+---------------+------------------------------------------+
|
||||
| ... | preset1 | preset parameter 1 |
|
||||
+-------+---------------+------------------------------------------+
|
||||
| ... | ... | and so on |
|
||||
+-------+---------------+------------------------------------------+
|
||||
|
||||
Table 7
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
van Kammen Expires 4 August 2024 [Page 10]
|
||||
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
5. Spatial Referencing 3D
|
||||
|
@ -557,9 +613,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 10]
|
||||
van Kammen Expires 4 August 2024 [Page 11]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
| | | scene-animation or src- |
|
||||
|
@ -568,7 +624,7 @@ Internet-Draft XR Fragments January 2024
|
|||
| <b>#rot</b>=0,90,0 | vector3 | rotate camera |
|
||||
+--------------------+---------+-----------------------------+
|
||||
|
||||
Table 7
|
||||
Table 8
|
||||
|
||||
» example implementation
|
||||
(https://github.com/coderofsalvation/xrfragment/blob/main/src/3rd/js/
|
||||
|
@ -613,9 +669,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 11]
|
||||
van Kammen Expires 4 August 2024 [Page 12]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
7. Top-level URL processing
|
||||
|
@ -661,7 +717,7 @@ Internet-Draft XR Fragments January 2024
|
|||
| | |foo.mp3#0,0,0 |
|
||||
+--------+--------+---------------------------------------------------+
|
||||
|
||||
Table 8
|
||||
Table 9
|
||||
|
||||
Here's an ascii representation of a 3D scene-graph with 3D objects ◻
|
||||
which embeds remote & local 3D objects ◻ with/out using filters:
|
||||
|
@ -669,9 +725,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 12]
|
||||
van Kammen Expires 4 August 2024 [Page 13]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
+────────────────────────────────────────────────────────+ +─────────────────────────+
|
||||
|
@ -725,9 +781,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 13]
|
||||
van Kammen Expires 4 August 2024 [Page 14]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
6. <b>external</b> src values should be served with appropriate
|
||||
|
@ -781,9 +837,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 14]
|
||||
van Kammen Expires 4 August 2024 [Page 15]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
+==========+==================+============================+
|
||||
|
@ -794,7 +850,7 @@ Internet-Draft XR Fragments January 2024
|
|||
| | | ://somefile.gltf#pos=1,1,0 |
|
||||
+----------+------------------+----------------------------+
|
||||
|
||||
Table 9
|
||||
Table 10
|
||||
|
||||
1. clicking an outbound ''external''- or ''file URI'' fully replaces
|
||||
the current scene and assumes pos=0,0,0&rot=0,0,0 by default
|
||||
|
@ -837,9 +893,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 15]
|
||||
van Kammen Expires 4 August 2024 [Page 16]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
» example implementation
|
||||
|
@ -893,9 +949,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 16]
|
||||
van Kammen Expires 4 August 2024 [Page 17]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
* calculate the <b>bounding box</b> of the instanced scene, and
|
||||
|
@ -949,9 +1005,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 17]
|
||||
van Kammen Expires 4 August 2024 [Page 18]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
13. XR audio/video integration
|
||||
|
@ -988,7 +1044,7 @@ Internet-Draft XR Fragments January 2024
|
|||
| | then only show object with price above 10 |
|
||||
+--------------------+-------------------------------------------+
|
||||
|
||||
Table 10
|
||||
Table 11
|
||||
|
||||
It's simple but powerful syntax which allows filtering the scene
|
||||
using searchengine prompt-style feeling:
|
||||
|
@ -1005,9 +1061,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 18]
|
||||
van Kammen Expires 4 August 2024 [Page 19]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
14.1. including/excluding
|
||||
|
@ -1032,7 +1088,7 @@ Internet-Draft XR Fragments January 2024
|
|||
| | embedded objects (starting with #) |
|
||||
+----------+----------------------------------------------+
|
||||
|
||||
Table 11
|
||||
Table 12
|
||||
|
||||
| NOTE 1: after an external embedded object has been instanced (src:
|
||||
| https://y.com/bar.fbx#room e.g.), filters do not affect them
|
||||
|
@ -1061,9 +1117,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 19]
|
||||
van Kammen Expires 4 August 2024 [Page 20]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
2. detect object id's & properties foo=1 and foo (reference regex=
|
||||
|
@ -1117,9 +1173,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 20]
|
||||
van Kammen Expires 4 August 2024 [Page 21]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
| The XR Fragments does this by collapsing space into a *Word Graph*
|
||||
|
@ -1173,9 +1229,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 21]
|
||||
van Kammen Expires 4 August 2024 [Page 22]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
Example:
|
||||
|
@ -1229,9 +1285,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 22]
|
||||
van Kammen Expires 4 August 2024 [Page 23]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
As seen above, the XRWG can expand bibs
|
||||
|
@ -1253,7 +1309,7 @@ Internet-Draft XR Fragments January 2024
|
|||
| foo.gltf#house | other objects with tag house or todo |
|
||||
+------------------+--------------------------------------+
|
||||
|
||||
Table 12
|
||||
Table 13
|
||||
|
||||
| hashtagbibs (https://github.com/coderofsalvation/hashtagbibs)
|
||||
| potentially allow the enduser to annotate text/objects by
|
||||
|
@ -1285,9 +1341,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 23]
|
||||
van Kammen Expires 4 August 2024 [Page 24]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
12. Default font (unless specified otherwise) is a modern monospace
|
||||
|
@ -1341,9 +1397,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 24]
|
||||
van Kammen Expires 4 August 2024 [Page 25]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
* lines beginning with @ will not be rendered verbatim by default
|
||||
|
@ -1397,9 +1453,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 25]
|
||||
van Kammen Expires 4 August 2024 [Page 26]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
+--------------------------------------------------------------+ +------------------------+
|
||||
|
@ -1453,9 +1509,9 @@ xrtext = {
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 26]
|
||||
van Kammen Expires 4 August 2024 [Page 27]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
// bibtex: ↓@ ↓<tag|tag{phrase,|{ruler}> ↓property ↓end
|
||||
|
@ -1509,9 +1565,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 27]
|
||||
van Kammen Expires 4 August 2024 [Page 28]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
str = `
|
||||
|
@ -1565,9 +1621,9 @@ console.log( xrtext.encode(text,tags) ) // multiplex text & bibtex back to
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 28]
|
||||
van Kammen Expires 4 August 2024 [Page 29]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
2. mirroring files on another protocol using (HTTP) errorcode tags
|
||||
|
@ -1621,9 +1677,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 29]
|
||||
van Kammen Expires 4 August 2024 [Page 30]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
* href: university.edu/projects.gltf#math&-theme math
|
||||
|
@ -1677,9 +1733,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 30]
|
||||
van Kammen Expires 4 August 2024 [Page 31]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
Non-HTML Hypermedia browsers should make browser extensions the right
|
||||
|
@ -1733,9 +1789,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 31]
|
||||
van Kammen Expires 4 August 2024 [Page 32]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
| | human minority (academics/developers) |
|
||||
|
@ -1789,9 +1845,9 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 32]
|
||||
van Kammen Expires 4 August 2024 [Page 33]
|
||||
|
||||
Internet-Draft XR Fragments January 2024
|
||||
Internet-Draft XR Fragments February 2024
|
||||
|
||||
|
||||
| | is a person who lives in oklahoma") |
|
||||
|
@ -1816,7 +1872,7 @@ Internet-Draft XR Fragments January 2024
|
|||
| | XML |
|
||||
+-----------------+---------------------------------------------+
|
||||
|
||||
Table 13
|
||||
Table 14
|
||||
|
||||
|
||||
|
||||
|
@ -1845,4 +1901,4 @@ Internet-Draft XR Fragments January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 33]
|
||||
van Kammen Expires 4 August 2024 [Page 34]
|
||||
|
|
|
@ -236,9 +236,9 @@ That way, if the link gets shared, the XR Fragments implementation at <tt>https:
|
|||
|
||||
<tr>
|
||||
<td><tt>#t</tt></td>
|
||||
<td>timevector</td>
|
||||
<td><tt>#t=2,2000,1</tt></td>
|
||||
<td>play animation-loop range between frame 2 and 2000 at (normal) speed 1</td>
|
||||
<td><eref target="#media%20fragments%20and%20datatypes">media fragment</eref></td>
|
||||
<td><tt>#t=0,2</tt></td>
|
||||
<td>play/loop 3D animation from 0 seconds till 2 seconds</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -282,61 +282,6 @@ That way, if the link gets shared, the XR Fragments implementation at <tt>https:
|
|||
</table><blockquote><t>Supported popular compatible 3D fileformats: <tt>.gltf</tt>, <tt>.obj</tt>, <tt>.fbx</tt>, <tt>.usdz</tt>, <tt>.json</tt> (THREE.js), <tt>.dae</tt> and so on.</t>
|
||||
</blockquote></section>
|
||||
|
||||
<section anchor="vector-datatypes"><name>vector datatypes</name>
|
||||
<t>| type | syntax | example | info |</t>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>vector2</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>vector3</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>timevector</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table><blockquote><t>NOTE: XR Fragments are optional but also file- and protocol-agnostic, which means that programmatic 3D scene(nodes) can also use the mechanism/metadata.</t>
|
||||
</blockquote></section>
|
||||
|
||||
<section anchor="dynamic-xr-fragments-databindings"><name>Dynamic XR Fragments (+databindings)</name>
|
||||
<t>These are automatic fragment-to-metadata mappings, which only trigger if the 3D scene metadata matches a specific identifier (<tt>aliasname</tt> e.g.)</t>
|
||||
<table>
|
||||
|
@ -364,11 +309,18 @@ That way, if the link gets shared, the XR Fragments implementation at <tt>https:
|
|||
<td>focus object(s) with <tt>tag: person</tt> or name <tt>person</tt> by looking up XRWG</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><tt>#[-]<tag_or_objectname></tt></td>
|
||||
<td>string</td>
|
||||
<td><tt>#person</tt> (<tt>#-person</tt>)</td>
|
||||
<td>focus/show (or hide) object(s) with <tt>tag: person</tt> or name <tt>person</tt> by looking up XRWG</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><tt>#<cameraname></tt></td>
|
||||
<td>string</td>
|
||||
<td><tt>#cam01</tt></td>
|
||||
<td>set camera as active camera</td>
|
||||
<td>set camera with name <tt>cam01</tt> as active camera</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
@ -389,21 +341,136 @@ That way, if the link gets shared, the XR Fragments implementation at <tt>https:
|
|||
<td><tt>#<objectname>=<mediafrag></tt></td>
|
||||
<td>string=<eref target="https://www.w3.org/TR/media-frags/#valid-uri">media frag</eref></td>
|
||||
<td><tt>#foo=0,1</tt></td>
|
||||
<td>play media <tt>src</tt> using <eref target="https://www.w3.org/TR/media-frags/#valid-uri">media fragment URI</eref></td>
|
||||
<td>play 3D animation (or <tt>src</tt> media) using <eref target="https://www.w3.org/TR/media-frags/#valid-uri">media fragment URI</eref> with <eref target="#media%20fragments%20and%20datatypes">looping/speed/texturescroll abilities</eref></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></section>
|
||||
|
||||
<section anchor="media-fragments-and-datatypes"><name>media fragments and datatypes</name>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>type</th>
|
||||
<th>syntax</th>
|
||||
<th>example</th>
|
||||
<th>info</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>vector2</td>
|
||||
<td>x,y</td>
|
||||
<td>2,3.0</td>
|
||||
<td>2-dimensional vector</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><tt>#<objectname>=<timevector></tt></td>
|
||||
<td>string=timevector</td>
|
||||
<td><tt>#sky=0,0.5,0.1,0</tt></td>
|
||||
<td>sets 1D/2D/3D time(line) vectors (uv-position e.g.) to <tt>0,0.5</tt> (and autoscroll x with max <tt>0.1</tt> every second)</td>
|
||||
<td>vector3</td>
|
||||
<td>x,y,z</td>
|
||||
<td>2,3.0,4</td>
|
||||
<td>3-dimensional vector</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>media fragment</td>
|
||||
<td>x</td>
|
||||
<td>0</td>
|
||||
<td>1D timeline: play from 0 seconds to end (and stop)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>media fragment</td>
|
||||
<td>x,y</td>
|
||||
<td>0,2</td>
|
||||
<td>1D timeline: play from 0 seconds till 2 seconds (and stop)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>media fragment</td>
|
||||
<td>u,v</td>
|
||||
<td>0,0.5</td>
|
||||
<td>2D texture: set uv-coordinate at <tt>0,0.5</tt></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>media fragment *</td>
|
||||
<td>u,v, ... [*speed, ...]</td>
|
||||
<td>0*2</td>
|
||||
<td>1D timeline: play from 0 seconds till end (and loop) at double (2) speed</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>*</td>
|
||||
<td></td>
|
||||
<td>0,1*2</td>
|
||||
<td>1D timeline: play from 0 seconds till 2 seconds (and loop) at double (2) speed</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>*</td>
|
||||
<td></td>
|
||||
<td><tt>#music=1,2</tt></td>
|
||||
<td>play media of object (<tt>src: podcast.mp3</tt> e.g.) from beginning (<tt>1</tt>) at double speed (<tt>2</tt>)</td>
|
||||
<td>0,1*0.1</td>
|
||||
<td>2D texture: set uvcoordinates at <tt>0,1</tt> and scroll them <tt>0.1</tt> per second (interpolating)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table><blockquote><t>* = this is extending the <eref target="https://www.w3.org/TR/media-frags/#mf-advanced">W3C media fragments</eref> with multidimensionality and loop(speed). The multidimensional (nonspeed) values will be forwarded to shaders as <strong>uniforms</strong> as following:</t>
|
||||
</blockquote><table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>value</th>
|
||||
<th>uniform name</th>
|
||||
<th>implementation</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>u</td>
|
||||
<td>u</td>
|
||||
<td>sets U of UV-coordinate</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>v</td>
|
||||
<td>v</td>
|
||||
<td>sets V of UV-coordinate</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td>vendorId</td>
|
||||
<td>shader library identifier (7447 e.g.)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td>preset</td>
|
||||
<td>shader presetnumber</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td>presetVersion</td>
|
||||
<td>targeted version of preset (so libraries can version/update their presets)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td>preset0</td>
|
||||
<td>preset parameter 0</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td>preset1</td>
|
||||
<td>preset parameter 1</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td>...</td>
|
||||
<td>and so on</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></section>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
|
||||
Internet Engineering Task Force L.R. van Kammen
|
||||
Internet-Draft 30 January 2024
|
||||
Internet-Draft 1 February 2024
|
||||
Intended status: Informational
|
||||
|
||||
|
||||
|
@ -38,7 +38,7 @@ Status of This Memo
|
|||
time. It is inappropriate to use Internet-Drafts as reference
|
||||
material or to cite them other than as "work in progress."
|
||||
|
||||
This Internet-Draft will expire on 2 August 2024.
|
||||
This Internet-Draft will expire on 4 August 2024.
|
||||
|
||||
Copyright Notice
|
||||
|
||||
|
@ -53,9 +53,9 @@ Copyright Notice
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 1]
|
||||
van Kammen Expires 4 August 2024 [Page 1]
|
||||
|
||||
Internet-Draft XR Macros January 2024
|
||||
Internet-Draft XR Macros February 2024
|
||||
|
||||
|
||||
extracted from this document must include Revised BSD License text as
|
||||
|
@ -109,9 +109,9 @@ Table of Contents
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 2]
|
||||
van Kammen Expires 4 August 2024 [Page 2]
|
||||
|
||||
Internet-Draft XR Macros January 2024
|
||||
Internet-Draft XR Macros February 2024
|
||||
|
||||
|
||||
3. Metadata-values can contain the | symbol to 🎲 roundrobin variable
|
||||
|
@ -165,9 +165,9 @@ Internet-Draft XR Macros January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 3]
|
||||
van Kammen Expires 4 August 2024 [Page 3]
|
||||
|
||||
Internet-Draft XR Macros January 2024
|
||||
Internet-Draft XR Macros February 2024
|
||||
|
||||
|
||||
+=========+======+===================+=================+=============+
|
||||
|
@ -221,9 +221,9 @@ Internet-Draft XR Macros January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 4]
|
||||
van Kammen Expires 4 August 2024 [Page 4]
|
||||
|
||||
Internet-Draft XR Macros January 2024
|
||||
Internet-Draft XR Macros February 2024
|
||||
|
||||
|
||||
Table 3
|
||||
|
@ -277,9 +277,9 @@ Internet-Draft XR Macros January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 5]
|
||||
van Kammen Expires 4 August 2024 [Page 5]
|
||||
|
||||
Internet-Draft XR Macros January 2024
|
||||
Internet-Draft XR Macros February 2024
|
||||
|
||||
|
||||
4.5. Usecase: present context menu with options
|
||||
|
@ -333,9 +333,9 @@ click object with (`!clickme`:`!foo|!bar|!flop` e.g.)
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 6]
|
||||
van Kammen Expires 4 August 2024 [Page 6]
|
||||
|
||||
Internet-Draft XR Macros January 2024
|
||||
Internet-Draft XR Macros February 2024
|
||||
|
||||
|
||||
| Note that only macro's can trigger roundrobin values or
|
||||
|
@ -389,4 +389,4 @@ Internet-Draft XR Macros January 2024
|
|||
|
||||
|
||||
|
||||
van Kammen Expires 2 August 2024 [Page 7]
|
||||
van Kammen Expires 4 August 2024 [Page 7]
|
||||
|
|
Binary file not shown.
|
@ -2,7 +2,6 @@ xrf.addEventListener('dynamicKeyValue', (opts) => {
|
|||
let {scene,match,v} = opts
|
||||
let objname = v.fragment
|
||||
let autoscroll = v.z > 0 || v.w > 0
|
||||
return // DISABLED
|
||||
scene.traverse( (mesh) => {
|
||||
if( mesh.name == objname ){
|
||||
if( !mesh.geometry ) return console.warn(`mesh '${objname}' has no uvcoordinates to offset`)
|
||||
|
|
|
@ -21,12 +21,11 @@ class Parser {
|
|||
Frag.set("tag", XRF.ASSET | XRF.T_STRING );
|
||||
|
||||
// spatial category: query selector / object manipulation
|
||||
Frag.set("pos", XRF.PV_OVERRIDE | XRF.T_VECTOR3 | XRF.T_STRING | XRF.T_STRING_OBJ | XRF.METADATA | XRF.NAVIGATOR );
|
||||
Frag.set("pos", XRF.PV_OVERRIDE | XRF.T_VECTOR3 | XRF.T_STRING | XRF.METADATA | XRF.NAVIGATOR );
|
||||
Frag.set("rot", XRF.QUERY_OPERATOR | XRF.PV_OVERRIDE | XRF.T_VECTOR3 | XRF.METADATA | XRF.NAVIGATOR );
|
||||
|
||||
// category: animation
|
||||
Frag.set("t", XRF.ASSET | XRF.PV_OVERRIDE | XRF.T_FLOAT | XRF.T_VECTOR2 | XRF.T_STRING | XRF.NAVIGATOR | XRF.METADATA);
|
||||
Frag.set("tv", XRF.ASSET | XRF.PV_OVERRIDE | XRF.T_FLOAT | XRF.T_VECTOR2 | XRF.T_VECTOR3 | XRF.NAVIGATOR | XRF.METADATA);
|
||||
Frag.set("t", XRF.ASSET | XRF.PV_OVERRIDE | XRF.T_FLOAT | XRF.T_VECTOR2 | XRF.T_MEDIAFRAG | XRF.NAVIGATOR | XRF.METADATA);
|
||||
|
||||
// category: author / metadata
|
||||
Frag.set("namespace", XRF.ASSET | XRF.T_STRING );
|
||||
|
|
|
@ -32,8 +32,7 @@ class XRF {
|
|||
public static var T_URL:Int = 262144;
|
||||
public static var T_PREDEFINED_VIEW:Int = 524288;
|
||||
public static var T_STRING:Int = 1048576;
|
||||
public static var T_STRING_OBJ:Int = 2097152;
|
||||
public static var T_STRING_OBJ_PROP:Int = 4194304;
|
||||
public static var T_MEDIAFRAG:Int = 2097152;
|
||||
|
||||
// regexes
|
||||
public static var isColor:EReg = ~/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/; // 1. hex colors are detected using regex `/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/`
|
||||
|
@ -41,13 +40,14 @@ class XRF {
|
|||
public static var isFloat:EReg = ~/^[-0-9]+\.[0-9]+$/; // 1. floats are detected using regex `/^[0-9]+\.[0-9]+$/`
|
||||
public static var isVector:EReg = ~/([,]+|\w)/; // 1. vectors are detected using regex `/[,]/` (but can also be an string referring to an entity-ID in the asset)
|
||||
public static var isUrl:EReg = ~/(:\/\/)?\..*/; // 1. url/file */`
|
||||
public static var isUrlOrPretypedView:EReg = ~/(^#|:\/\/)?\..*/; // 1. url/file */`
|
||||
public static var isUrlOrPretypedView:EReg = ~/(^#|:\/\/)?\..*/; // 1. url/file */`
|
||||
public static var isString:EReg = ~/.*/; // 1. anything else is string `/.*/`
|
||||
public static var operators:EReg = ~/(^-|[\*]+)/; // 1. detect operators so you can easily strip keys (reference regex= `~/(^-)?(\/)?(\*)?/` )
|
||||
public static var isProp:EReg = ~/^.*=[><=]?/; // 1. detect object id's & properties `foo=1` and `foo` (reference regex= `~/^.*=[><=]?/` )
|
||||
public static var isExclude:EReg = ~/^-/; // 1. detect excluders like `-foo`,`-foo=1`,`-.foo`,`-/foo` (reference regex= `/^-/` )
|
||||
public static var isDeep:EReg = ~/\*/; // 1. detect deep selectors like `foo*` (reference regex= `/\*$/` )
|
||||
public static var isNumber:EReg = ~/^[0-9\.]+$/; // 1. detect number values like `foo=1` (reference regex= `/^[0-9\.]+$/` )
|
||||
public static var isMediaFrag:EReg = ~/^[0-9\.,\*]+$/; // 1. detect (extended) media fragment
|
||||
|
||||
// value holder(s) // |------|------|--------|----------------------------------|
|
||||
public var fragment:String;
|
||||
|
@ -56,7 +56,8 @@ class XRF {
|
|||
public var x:Float; // |vector| x,y,z| comma-separated | #pos=1,2,3 |
|
||||
public var y:Float;
|
||||
public var z:Float;
|
||||
public var w:Float;
|
||||
public var floats:Array<Float> = new Array<Float>();
|
||||
public var speed:Array<Float> = new Array<Float>();
|
||||
public var color:String; // |string| color| FFFFFF (hex) | #fog=5m,FFAACC |
|
||||
public var string:String; // |string| | | #q=-sun |
|
||||
public var int:Int; // |int | | [-]x[xxxxx] | #price:>=100 |
|
||||
|
@ -98,11 +99,13 @@ class XRF {
|
|||
if( !Std.isOfType(str,String) ) return;
|
||||
if( str.length > 0 ){
|
||||
if( str.split(",").length > 1){ // 1. `,` assumes 1D/2D/3D vector-values like x[,y[,z]]
|
||||
var xyzw:Array<String> = str.split(","); // 1. parseFloat(..) and parseInt(..) is applied to vector/float and int values
|
||||
if( xyzw.length > 0 ) v.x = Std.parseFloat(xyzw[0]); // 1. anything else will be treated as string-value
|
||||
if( xyzw.length > 1 ) v.y = Std.parseFloat(xyzw[1]); // 1. incompatible value-types will be dropped / not used
|
||||
if( xyzw.length > 2 ) v.z = Std.parseFloat(xyzw[2]); //
|
||||
if( xyzw.length > 3 ) v.w = Std.parseFloat(xyzw[3]); //
|
||||
var xyzn:Array<String> = str.split(","); // 1. parseFloat(..) and parseInt(..) is applied to vector/float and int values
|
||||
if( xyzn.length > 0 ) v.x = Std.parseFloat(xyzn[0]); // 1. anything else will be treated as string-value
|
||||
if( xyzn.length > 1 ) v.y = Std.parseFloat(xyzn[1]); // 1. incompatible value-types will be dropped / not used
|
||||
if( xyzn.length > 2 ) v.z = Std.parseFloat(xyzn[2]); //
|
||||
for( i in 0...xyzn.length ){
|
||||
v.floats.push( Std.parseFloat(xyzn[i]) );
|
||||
}
|
||||
} // > the xrfragment specification should stay simple enough
|
||||
// > for anyone to write a parser using either regexes or grammar/lexers
|
||||
if( isColor.match(str) ) v.color = str; // > therefore expressions/comprehensions are not supported (max wildcard/comparison operators for queries e.g.)
|
||||
|
@ -114,6 +117,16 @@ class XRF {
|
|||
v.int = Std.parseInt(str);
|
||||
v.x = cast(v.int);
|
||||
}
|
||||
if( isMediaFrag.match(str) ){
|
||||
var speed:Array<String> = str.split("*");
|
||||
v.speed = new Array<Float>();
|
||||
if( speed.length > 0 ){
|
||||
var values:Array<String> = str.split(",");
|
||||
for( i in 0...values.length ){
|
||||
v.speed.push( Std.parseFloat(values[i]) );
|
||||
}
|
||||
}
|
||||
}
|
||||
v.filter = new Filter(v.fragment+"="+v.string);
|
||||
}else v.filter = new Filter(v.fragment);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue