Compare commits
No commits in common. "main" and "feat/remotestorage" have entirely different histories.
main
...
feat/remot
15
.env
|
|
@ -20,18 +20,5 @@ test "$GITEA_ROOT_URL" = "https://forgejo.isvery.ninja/" && {
|
|||
# on the website xrfragment.org copy examples to root-dir
|
||||
# (so https://xrfragment.org/index.glb can be requested remotely)
|
||||
# because that really emphasizes a nice WebXR experience-at-website-root paradigm
|
||||
ln -fs assets/index.glb .
|
||||
ln -fs assets/index.ogg .
|
||||
mkdir -p example/assets
|
||||
wget "https://codeberg.org/coderofsalvation/xrfragment-haxe/raw/branch/pages/example/assets/logo.png" -O example/assets/logo.png
|
||||
wget "https://codeberg.org/coderofsalvation/xrfragment-haxe/raw/branch/pages/example/assets/logo.svg" -O example/assets/logo.svg
|
||||
test -d dist && rm -rf dist
|
||||
mkdir dist
|
||||
cd dist
|
||||
wget "https://raw.codeberg.page/coderofsalvation/xrfragment-haxe/dist/xrfragment.aframe.all.js"
|
||||
wget "https://raw.codeberg.page/coderofsalvation/xrfragment-haxe/dist/xrfragment.aframe.js"
|
||||
wget "https://raw.codeberg.page/coderofsalvation/xrfragment-haxe/dist/xrfragment.js"
|
||||
wget "https://raw.codeberg.page/coderofsalvation/xrfragment-haxe/dist/xrfragment.module.js"
|
||||
wget "https://raw.codeberg.page/coderofsalvation/xrfragment-haxe/dist/xrfragment.three.js"
|
||||
wget "https://raw.codeberg.page/coderofsalvation/xrfragment-haxe/dist/xrfragment.three.module.js"
|
||||
cp -r example/assets/* .
|
||||
}
|
||||
|
|
|
|||
22
.github/workflows/test.yml
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- feature/*
|
||||
- bugfix/*
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: install haxe
|
||||
run: ./make install
|
||||
- name: transpile haxe into languages
|
||||
run: ./make
|
||||
- name: run tests
|
||||
run: ./make tests
|
||||
115
.github/workflows/website.yml
vendored
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
# Simple workflow for deploying static content to GitHub Pages
|
||||
name: Deploy static content to Pages
|
||||
|
||||
on:
|
||||
# Runs on pushes targeting the default branch
|
||||
push:
|
||||
branches: ["main"] # ["main","feat/multiparty"]
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
# Single deploy job since we're just deploying
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
#- name: Checkout feat/multiparty
|
||||
# uses: actions/checkout@v3
|
||||
# with:
|
||||
# ref: feat/multiparty
|
||||
# path: feat/multiparty
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v3
|
||||
- name: create index.glb
|
||||
run: cp example/assets/*.glb .
|
||||
- name: cleanup 1
|
||||
run: test -f example/three/sandbox/other.gltf && rm example/three/sandbox/other.gltf || true
|
||||
- name: cleanup 2
|
||||
run: test -f example/three/sandbox/assets/2wa.gitlab.io && rm -rf example/three/sandbox/assets/2wa.gitlab.io || true
|
||||
# working-directory: ./
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v2
|
||||
with:
|
||||
path: '.'
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v2
|
||||
|
||||
## Simple workflow for deploying static content to GitHub Pages
|
||||
#name: Deploy static content to Pages
|
||||
#
|
||||
#on:
|
||||
# # Runs on pushes targeting the default branch
|
||||
# push:
|
||||
# branches: ["main"]
|
||||
#
|
||||
# # Allows you to run this workflow manually from the Actions tab
|
||||
# workflow_dispatch:
|
||||
#
|
||||
## Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
#permissions:
|
||||
# contents: read
|
||||
# pages: write
|
||||
# id-token: write
|
||||
#
|
||||
## Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||
## However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||
#concurrency:
|
||||
# group: "pages"
|
||||
# cancel-in-progress: false
|
||||
#
|
||||
#jobs:
|
||||
# # Single deploy job since we're just deploying
|
||||
# deploy:
|
||||
# environment:
|
||||
# name: github-pages
|
||||
# url: ${{ steps.deployment.outputs.page_url }}
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: Checkout main
|
||||
# uses: actions/checkout@v3
|
||||
# - name: Checkout feat/multiparty
|
||||
# uses: actions/checkout@v3
|
||||
# with:
|
||||
# ref: feat/multiparty
|
||||
# path: feat/multiparty
|
||||
# #- name: mkdir branches
|
||||
# # run: mkdir -p public/feat/multiparty
|
||||
# - name: Setup Pages
|
||||
# uses: actions/configure-pages@v3
|
||||
# - name: create public-folder
|
||||
# uses: mkdir public
|
||||
# - name: copy master-branch
|
||||
# run: cp -r * public/.
|
||||
# - name: create index.gltf
|
||||
# run: cp example/assets/query.gltf public/index.gltf
|
||||
# - name: copy gltfs
|
||||
# run: cp example/assets/*.gltf public/.
|
||||
# # Checkout other branches
|
||||
# # working-directory: ./
|
||||
# - name: Upload artifact
|
||||
# uses: actions/upload-pages-artifact@v1
|
||||
# with:
|
||||
# path: 'public'
|
||||
# - name: Deploy to GitHub Pages
|
||||
# id: deployment
|
||||
# uses: actions/deploy-pages@v2
|
||||
#
|
||||
8
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
dist/*.pyc
|
||||
src/spec/tmp.json
|
||||
tags
|
||||
example/assets/*.blend*
|
||||
2wa.gitlab.io/*
|
||||
src/3rd/js/aframe/build/aframe
|
||||
example/godot/addons
|
||||
example/godot/dist
|
||||
3
.gitmodules
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "example/godot"]
|
||||
path = example/godot
|
||||
url = https://codeberg.org/coderofsalvation/xrfragment-godot.git
|
||||
4
.vimrc
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
noremap <silent> <F8> :!haxe --no-output %<CR>
|
||||
noremap <silent> <F9> :!./make build js<CR>
|
||||
noremap <silent> <F10> :!./make build && ./make tests<CR>
|
||||
noremap <silent> <F11> :!./make tests \| less<CR>
|
||||
661
LICENSE
Normal file
|
|
@ -0,0 +1,661 @@
|
|||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
72
README.md
|
|
@ -1,11 +1,67 @@
|
|||
website / researchwiki of xrfragments
|
||||
<link rel="stylesheet" href="doc/style.css"/>
|
||||
<link href="https://fonts.cdnfonts.com/css/montserrat" rel="stylesheet"/>
|
||||
|
||||
> NOTE: to re-export `all.html` please disable reveal-js and videojs plugin (and hit Tools > 'export all' > HTML)
|
||||
[](https://github.com/coderofsalvation/xrfragment/actions)
|
||||
|
||||
# AI usage / Contributing
|
||||
<img src="https://xrfragment.org/example/assets/logo.png" width="200"/>
|
||||
|
||||
* codebase has been handwritten in vim
|
||||
* (neo)vim settings: `set expandtab shiftwidth=4 tabstop=4 softtabstop=4 autoindent smartindent`
|
||||
* AI policy:
|
||||
* AI (preferrably local) is used for lookup or testing, not synthesis.
|
||||
* no capacity to review AI-synthesized PR's (beyond oneliner bugfixes)
|
||||
A tiny specification for viewing 3D models as linkable AR/VR websites.<br>
|
||||
Address and Control anything inside a 3D model with [W3C Media Fragments](https://www.w3.org/TR/media-frags/) and [URI Templates](https://www.rfc-editor.org/rfc/rfc6570).<br>
|
||||
<br>
|
||||
|
||||

|
||||
|
||||
<br>
|
||||
Simply SURF a 3D file-verse and design for a Spatial Open Internet with the highest degree of interoperability ❤
|
||||
|
||||
# Documentation / Website
|
||||
|
||||
https://xrfragment.org
|
||||
|
||||

|
||||
|
||||
# Getting started
|
||||
|
||||

|
||||
|
||||
https://xrfragmenorg
|
||||
|
||||
# available parser-implementations
|
||||
|
||||
* [javascript](dist/xrfragment.js) [(+example)](test/test.js)
|
||||
* [javascript module](dist/xrfragment.module.js)
|
||||
* [python](dist/xrfragment.py) [(+example)](test/test.py)
|
||||
* [lua](dist/xrfragment.lua) [(+example)](test/test.lua)
|
||||
* [haXe](src/xrfragment) (allows exporting to various programming languages)
|
||||
* [Godot](https://codeberg.org/coderofsalvation/xrfragment-godot) exports to all platforms
|
||||
|
||||
See documentation for more info
|
||||
|
||||
# development
|
||||
|
||||
Pre-build libraries can be found in [/dist folder](dist)<br>
|
||||
If you really want to build from source:
|
||||
|
||||
```
|
||||
$ nix-shell # nix-users: drops you into a dev-ready shell
|
||||
$ ./make install # debian-users: install deps via apt-get
|
||||
$ ./make build && ./make tests
|
||||
```
|
||||
|
||||
> NOTE #1: to rebundle the THREE/AFRAME javascripts during dev run `./make build js`
|
||||
> NOTE #2: to regenerate the parser in various languages (via haxe), run `./make build parser`
|
||||
|
||||
# Godot (>=v4.3.1)
|
||||
|
||||
```
|
||||
$ ./make install godot # this installs the godot-xr-tools addon
|
||||
```
|
||||
|
||||
> NOTE: the godot project is in [src/xrfragment/godot](./src/xrfragment/godot) (open the folder in godot)
|
||||
|
||||
# Credits
|
||||
|
||||
<br>
|
||||
<a href="https://nlnet.nl" target="_blank">
|
||||
<img src="https://nlnet.nl/image/logo_nlnet.svg" width="100"/>
|
||||
</a>
|
||||
|
|
|
|||
BIN
assets/index.glb
BIN
assets/index.ogg
|
Before Width: | Height: | Size: 88 KiB |
|
|
@ -1,89 +0,0 @@
|
|||
{
|
||||
"$schema": "https://manyfold.app/profiles/0.0/datapackage.json",
|
||||
"name": "xr-fragments-assets",
|
||||
"title": "XR Fragments assets",
|
||||
"homepage": "http://xrfragment.org",
|
||||
"image": "assets.webp",
|
||||
"keywords": [
|
||||
"singleuser",
|
||||
"fontmap"
|
||||
],
|
||||
"licenses": [
|
||||
{
|
||||
"name": "CC-BY-SA-4.0",
|
||||
"path": "https://spdx.org/licenses/CC-BY-SA-4.0.html"
|
||||
}
|
||||
],
|
||||
"resources": [
|
||||
{
|
||||
"name": "assets",
|
||||
"path": "assets.webp",
|
||||
"mediatype": "image/webp",
|
||||
"up": "+z",
|
||||
"presupported": false
|
||||
},
|
||||
{
|
||||
"name": "fontmap",
|
||||
"path": "tiles_fontmap.glb",
|
||||
"mediatype": "model/gltf",
|
||||
"up": "+y",
|
||||
"presupported": false
|
||||
},
|
||||
{
|
||||
"name": "tree",
|
||||
"path": "object_tree.glb",
|
||||
"mediatype": "model/gltf",
|
||||
"up": "+y",
|
||||
"presupported": false
|
||||
},
|
||||
{
|
||||
"name": "glass",
|
||||
"path": "material_glass.glb",
|
||||
"mediatype": "model/gltf",
|
||||
"up": "+y",
|
||||
"presupported": false
|
||||
},
|
||||
{
|
||||
"name": "lake",
|
||||
"path": "material_lake.glb",
|
||||
"mediatype": "model/gltf",
|
||||
"up": "+y",
|
||||
"presupported": false
|
||||
},
|
||||
{
|
||||
"name": "blocktronic",
|
||||
"path": "space_blocktronic.glb",
|
||||
"mediatype": "model/gltf",
|
||||
"up": "+y",
|
||||
"presupported": false
|
||||
},
|
||||
{
|
||||
"name": "fogtronic",
|
||||
"path": "space_fogtronic.glb",
|
||||
"mediatype": "model/gltf",
|
||||
"up": "+y",
|
||||
"presupported": false
|
||||
}
|
||||
],
|
||||
"sensitive": false,
|
||||
"contributors": [
|
||||
{
|
||||
"title": "xrfragments",
|
||||
"path": "http://localhost:3214/creators/xrfragments",
|
||||
"roles": [
|
||||
"creator"
|
||||
],
|
||||
"caption": "",
|
||||
"description": "XR Fragments is an open specification for hyperlinking & deeplinking 3D fileformats .\nTurn 3D files into linkable AR/VR websites .\n3D files with XR Fragments enable interoperable, networkable and interactions via so-called extras and promote URL standards .",
|
||||
"links": [
|
||||
{
|
||||
"path": "https://xrfragment.org"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"collections": [
|
||||
],
|
||||
"links": [
|
||||
]
|
||||
}
|
||||
|
Before Width: | Height: | Size: 70 KiB |
|
|
@ -1,41 +0,0 @@
|
|||
{
|
||||
"$schema": "https://manyfold.app/profiles/0.0/datapackage.json",
|
||||
"name": "xr-fragments-template-website",
|
||||
"title": "Mastodon posts",
|
||||
"homepage": "http://xrfragment.org",
|
||||
"image": "website.jpg",
|
||||
"keywords": [
|
||||
"@lvk@mastodon.online",
|
||||
"@utopiah@mastodon.pirateparty.be",
|
||||
"template"
|
||||
],
|
||||
"licenses": [
|
||||
{
|
||||
"name": "CC-BY-SA-4.0",
|
||||
"path": "https://spdx.org/licenses/CC-BY-SA-4.0.html"
|
||||
}
|
||||
],
|
||||
"resources": [
|
||||
],
|
||||
"sensitive": false,
|
||||
"contributors": [
|
||||
{
|
||||
"title": "xrfragments",
|
||||
"path": "http://localhost:3214/creators/xrfragments",
|
||||
"roles": [
|
||||
"creator"
|
||||
],
|
||||
"caption": "",
|
||||
"description": "XR Fragments is an open specification for hyperlinking & deeplinking 3D fileformats .\nTurn 3D files into linkable AR/VR websites .\n3D files with XR Fragments enable interoperable, networkable and interactions via so-called extras and promote URL standards .",
|
||||
"links": [
|
||||
{
|
||||
"path": "https://xrfragment.org"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"collections": [
|
||||
],
|
||||
"links": [
|
||||
]
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
{
|
||||
"$schema": "https://manyfold.app/profiles/0.0/datapackage.json",
|
||||
"name": "murial-2d-image",
|
||||
"title": "Murial 2D image",
|
||||
"caption": "",
|
||||
"description": "<!-- Hi there! Below is autogenerated JanusXR Markup (JML). -->\n<!-- If you want to tweak it, then first disable autogeneration -->\n<!-- How? make sure to remove autogenerate from the <Room> tag below -->\n<!-- -->\n<!-- JML info: -->\n<!-- https://coderofsalvation.github.io/janus-guide/#/examples/markup -->\n<!-- https://janusxr.org/docs/build/introtojml/index.html -->\n\n<FireBoxRoom>\n <Assets>\n <assetobject id=\"experience\" src=\"http://localhost:8791/templates/xrfragments/%233/templates/xrfragments/%233/murial2D.glb\"/>\n\n </Assets>\n <Room autogenerate use_local_asset=\"room3\" >\n <object pos=\"0 0 5\" rotation=\"-180 0 180\" lighting=\"false\" collision_id=\"experience\" id=\"experience\" />\n </Room>\n</FireBoxRoom>\n<!-- archive.org hints -->\n<a href=\"http://localhost:8791/templates/xrfragments/%233/templates/xrfragments/%233/murial2D.glb\"></a> \n\n",
|
||||
"homepage": "http://localhost:3214/models/dc7l7rfscgb9",
|
||||
"image": "murial2D.jpg",
|
||||
"keywords": [
|
||||
"xrfragments",
|
||||
"template",
|
||||
"room3",
|
||||
"janusxr",
|
||||
"mml"
|
||||
],
|
||||
"licenses": [
|
||||
{
|
||||
"name": "CC-BY-4.0",
|
||||
"path": "https://spdx.org/licenses/CC-BY-4.0.html"
|
||||
}
|
||||
],
|
||||
"resources": [
|
||||
{
|
||||
"name": "murial2d",
|
||||
"path": "murial2D.glb",
|
||||
"mediatype": "model/gltf",
|
||||
"up": "+y",
|
||||
"presupported": false
|
||||
},
|
||||
{
|
||||
"name": "murial2d_img0",
|
||||
"path": "murial2D_img0.png",
|
||||
"mediatype": "image/png",
|
||||
"up": "+z",
|
||||
"presupported": false
|
||||
},
|
||||
{
|
||||
"name": "murial2d",
|
||||
"path": "murial2D.jpg",
|
||||
"mediatype": "image/jpeg",
|
||||
"up": "+z",
|
||||
"presupported": false
|
||||
}
|
||||
],
|
||||
"sensitive": false,
|
||||
"contributors": [
|
||||
{
|
||||
"title": "xrfragments",
|
||||
"path": "http://localhost:3214/creators/xrfragments",
|
||||
"roles": [
|
||||
"creator"
|
||||
],
|
||||
"caption": "",
|
||||
"description": "XR Fragments is an open specification for hyperlinking & deeplinking 3D fileformats .\nTurn 3D files into linkable AR/VR websites .\n3D files with XR Fragments enable interoperable, networkable and interactions via so-called extras and promote URL standards .",
|
||||
"links": [
|
||||
{
|
||||
"path": "http://localhost:3214/creators/xrfragments"
|
||||
},
|
||||
{
|
||||
"path": "https://xrfragment.org"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
{
|
||||
"path": "http://localhost:3214/models/91plknnr4dnh"
|
||||
},
|
||||
{
|
||||
"path": "http://localhost:3214/models/dc7l7rfscgb9"
|
||||
},
|
||||
{
|
||||
"path": "http://localhost:3214/models/n763hc89dm39"
|
||||
}
|
||||
],
|
||||
"main": "templates/xrfragments/#3/murial2D.glb"
|
||||
}
|
||||
|
Before Width: | Height: | Size: 129 KiB |
|
|
@ -1,72 +0,0 @@
|
|||
{
|
||||
"$schema": "https://manyfold.app/profiles/0.0/datapackage.json",
|
||||
"name": "murial-3d-image",
|
||||
"title": "Murial 3D image",
|
||||
"caption": "",
|
||||
"description": "<!-- Hi there! Below is autogenerated JanusXR Markup (JML). -->\n<!-- If you want to tweak it, then first disable autogeneration -->\n<!-- How? make sure to remove autogenerate from the <Room> tag below -->\n<!-- -->\n<!-- JML info: -->\n<!-- https://coderofsalvation.github.io/janus-guide/#/examples/markup -->\n<!-- https://janusxr.org/docs/build/introtojml/index.html -->\n\n<FireBoxRoom>\n <Assets>\n <assetobject id=\"experience\" src=\"http://localhost:8791/templates/xrfragments/%234/templates/xrfragments/%234/murial3D.glb\"/>\n\n </Assets>\n <Room autogenerate use_local_asset=\"room3\" >\n <object pos=\"0 0 5\" rotation=\"-180 0 180\" lighting=\"false\" collision_id=\"experience\" id=\"experience\" />\n </Room>\n</FireBoxRoom>\n<!-- archive.org hints -->\n<a href=\"http://localhost:8791/templates/xrfragments/%234/templates/xrfragments/%234/murial3D.glb\"></a> \n\n",
|
||||
"homepage": "http://localhost:3214/models/h11mkw067b9s",
|
||||
"image": "murial3D.jpg",
|
||||
"keywords": [
|
||||
"janusxr",
|
||||
"mml",
|
||||
"xrfragments",
|
||||
"room3"
|
||||
],
|
||||
"licenses": [
|
||||
{
|
||||
"name": "CC-BY-NC-SA-4.0",
|
||||
"path": "https://spdx.org/licenses/CC-BY-NC-SA-4.0.html"
|
||||
}
|
||||
],
|
||||
"resources": [
|
||||
{
|
||||
"name": "murial3d",
|
||||
"path": "murial3D.glb",
|
||||
"mediatype": "model/gltf",
|
||||
"caption": "",
|
||||
"description": "",
|
||||
"up": "+z",
|
||||
"presupported": false
|
||||
},
|
||||
{
|
||||
"name": "murial3d_img0",
|
||||
"path": "murial3D_img0.png",
|
||||
"mediatype": "image/png",
|
||||
"up": "+z",
|
||||
"presupported": false
|
||||
},
|
||||
{
|
||||
"name": "murial3d",
|
||||
"path": "murial3D.jpg",
|
||||
"mediatype": "image/jpeg",
|
||||
"up": "+z",
|
||||
"presupported": false
|
||||
}
|
||||
],
|
||||
"sensitive": false,
|
||||
"contributors": [
|
||||
{
|
||||
"title": "xrfragments",
|
||||
"path": "http://localhost:3214/creators/xrfragments",
|
||||
"roles": [
|
||||
"creator"
|
||||
],
|
||||
"caption": "",
|
||||
"description": "XR Fragments is an open specification for hyperlinking & deeplinking 3D fileformats .\nTurn 3D files into linkable AR/VR websites .\n3D files with XR Fragments enable interoperable, networkable and interactions via so-called extras and promote URL standards .",
|
||||
"links": [
|
||||
{
|
||||
"path": "http://localhost:3214/creators/xrfragments"
|
||||
},
|
||||
{
|
||||
"path": "https://xrfragment.org"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
{
|
||||
"path": "http://localhost:3214/models/h11mkw067b9s"
|
||||
}
|
||||
],
|
||||
"main": "templates/xrfragments/#4/murial3D.glb"
|
||||
}
|
||||
|
Before Width: | Height: | Size: 91 KiB |
|
|
@ -1,66 +0,0 @@
|
|||
{
|
||||
"$schema": "https://manyfold.app/profiles/0.0/datapackage.json",
|
||||
"name": "spatial-website-template",
|
||||
"title": "Spatial website template",
|
||||
"caption": "",
|
||||
"description": "<!-- Hi there! Below is autogenerated JanusXR Markup (JML). -->\n<!-- If you want to tweak it, then first disable autogeneration -->\n<!-- How? make sure to remove autogenerate from the <Room> tag below -->\n<!-- -->\n<!-- JML info: -->\n<!-- https://coderofsalvation.github.io/janus-guide/#/examples/markup -->\n<!-- https://janusxr.org/docs/build/introtojml/index.html -->\n\n<FireBoxRoom>\n <Assets>\n <assetobject id=\"experience\" src=\"http://localhost:8791/templates/xrfragments/%232/website.glb\"/>\n </Assets>\n <Room autogenerate >\n <object pos=\"0 0 5\" rotation=\"-180 0 180\" lighting=\"false\" collision_id=\"experience\" id=\"experience\" />\n </Room>\n</FireBoxRoom>\n<!-- archive.org hints -->\n<a href=\"http://localhost:8791/templates/xrfragments/%232/website.glb\"></a> \n\n",
|
||||
"homepage": "http://localhost:3214/models/knnvtnnk4tcl",
|
||||
"image": "website.jpg",
|
||||
"keywords": [
|
||||
"template",
|
||||
"janusxr",
|
||||
"mml",
|
||||
"xrfragments"
|
||||
],
|
||||
"licenses": [
|
||||
{
|
||||
"name": "CC-BY-SA-4.0",
|
||||
"path": "https://spdx.org/licenses/CC-BY-SA-4.0.html"
|
||||
}
|
||||
],
|
||||
"resources": [
|
||||
{
|
||||
"name": "website",
|
||||
"path": "website.jpg",
|
||||
"mediatype": "image/jpeg",
|
||||
"up": "+z",
|
||||
"presupported": false
|
||||
},
|
||||
{
|
||||
"name": "website",
|
||||
"path": "website.glb",
|
||||
"mediatype": "model/gltf",
|
||||
"up": "+z",
|
||||
"presupported": false
|
||||
}
|
||||
],
|
||||
"sensitive": false,
|
||||
"contributors": [
|
||||
{
|
||||
"title": "xrfragments",
|
||||
"path": "http://localhost:3214/creators/xrfragments",
|
||||
"roles": [
|
||||
"creator"
|
||||
],
|
||||
"caption": "",
|
||||
"description": "XR Fragments is an open specification for hyperlinking & deeplinking 3D fileformats .\nTurn 3D files into linkable AR/VR websites .\n3D files with XR Fragments enable interoperable, networkable and interactions via so-called extras and promote URL standards .",
|
||||
"links": [
|
||||
{
|
||||
"path": "http://localhost:3214/creators/xrfragments"
|
||||
},
|
||||
{
|
||||
"path": "https://xrfragment.org"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
{
|
||||
"path": "http://localhost:3214/models/knnvtnnk4tcl"
|
||||
},
|
||||
{
|
||||
"path": "http://xrfragment.org"
|
||||
}
|
||||
],
|
||||
"main": "website.glb"
|
||||
}
|
||||
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 5 MiB |
89
build.hxml
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
-dce full
|
||||
-cp src
|
||||
xrfragment
|
||||
-D shallow-expose
|
||||
-js dist/xrfragment.js
|
||||
|
||||
--next
|
||||
-dce full
|
||||
-cp src
|
||||
Test
|
||||
-D shallow-expose
|
||||
-m Test
|
||||
-js test/generated/test.js
|
||||
|
||||
--next
|
||||
-dce full
|
||||
-cp src
|
||||
xrfragment
|
||||
-lua dist/xrfragment.lua
|
||||
|
||||
--next
|
||||
-dce full
|
||||
-cp src
|
||||
xrfragment
|
||||
-python dist/xrfragment.py
|
||||
|
||||
#--next
|
||||
#-dce full
|
||||
#-cp src
|
||||
#xrfragment
|
||||
#-cpp dist/xrfragment.cpp
|
||||
|
||||
#--next
|
||||
#-dce full
|
||||
#-cp src
|
||||
#xrfragment
|
||||
#-php dist/xrfragment.php
|
||||
#
|
||||
#--next
|
||||
#-dce full
|
||||
#-cp src
|
||||
#xrfragment
|
||||
#-java dist/xrfragment.java
|
||||
|
||||
--next
|
||||
-dce full
|
||||
-cp src
|
||||
Test
|
||||
-m Test
|
||||
-python test/generated/test.py
|
||||
|
||||
#--next
|
||||
#-dce full
|
||||
#-cp src
|
||||
#xrfragment
|
||||
#-lib gdscript
|
||||
#-D gdscript-output=dist/godot
|
||||
#-D generate_godot_plugin
|
||||
|
||||
#--next
|
||||
#
|
||||
#-dce full
|
||||
#-cp src
|
||||
#
|
||||
#
|
||||
#--next
|
||||
#
|
||||
#-dce full
|
||||
#-cp src
|
||||
#
|
||||
#xrfragment.Query
|
||||
#-cppia dist/xrfragment.cppia
|
||||
#
|
||||
#--next
|
||||
#
|
||||
#-dce full
|
||||
#-cp src
|
||||
#
|
||||
#xrfragment.Query
|
||||
#-cs dist/xrfragment.csharp
|
||||
#
|
||||
#
|
||||
#--next
|
||||
#
|
||||
#-dce full
|
||||
#-cp src
|
||||
#
|
||||
#xrfragment.Query
|
||||
#-java xrfragment.jdk
|
||||
BIN
dist/__pycache__/__init__.cpython-310.pyc
vendored
Normal file
BIN
dist/__pycache__/xrfragment.cpython-310.pyc
vendored
Normal file
2
dist/aframe-blink-controls.min.js
vendored
Normal file
1
dist/aframe-hand-tracking-controls-extras.min.js
vendored
Normal file
18
dist/aframe-troika-text.min.js
vendored
Normal file
2
dist/aframe.min.js
vendored
Normal file
BIN
dist/audio/click.wav
vendored
Normal file
BIN
dist/audio/hover.wav
vendored
Normal file
BIN
dist/audio/teleport.wav
vendored
Normal file
9
dist/xrfragment.aframe.all.js
vendored
7
dist/xrfragment.aframe.js
vendored
|
|
@ -1,8 +1,3 @@
|
|||
/*
|
||||
* v0.5.1 generated at Thu May 22 07:30:49 PM CEST 2025
|
||||
* https://xrfragment.org
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
/*
|
||||
* v0.5.1 generated at Thu May 15 04:48:16 PM CEST 2025
|
||||
* https://xrfragment.org
|
||||
|
|
@ -6798,7 +6793,7 @@ AFRAME.registerSystem('xrf-hands',{
|
|||
},
|
||||
|
||||
tick: function(){
|
||||
if( !this.indexFinger || !xrf.interactive ) return
|
||||
if( !this.indexFinger ) return
|
||||
if( !this.el.sceneEl.renderer.xr.isPresenting || !this.indexFinger.length ) return
|
||||
for( let i = 0; i < this.indexFinger.length; i++ ){
|
||||
let indexFinger = this.indexFinger[i]
|
||||
|
|
|
|||
5
dist/xrfragment.js
vendored
|
|
@ -1,8 +1,3 @@
|
|||
/*
|
||||
* v0.5.1 generated at Thu May 22 07:30:49 PM CEST 2025
|
||||
* https://xrfragment.org
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
/*
|
||||
* v0.5.1 generated at Thu May 15 04:48:16 PM CEST 2025
|
||||
* https://xrfragment.org
|
||||
|
|
|
|||
9
dist/xrfragment.model-viewer.js
vendored
3242
dist/xrfragment.module.js
vendored
2
dist/xrfragment.plugin.editor.js
vendored
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* v0.5.1 generated at Thu May 22 07:30:49 PM CEST 2025
|
||||
* v0.5.1 generated at Thu May 15 04:48:16 PM CEST 2025
|
||||
* https://xrfragment.org
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
|
|
|||
2
dist/xrfragment.plugin.frontend.css.js
vendored
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* v0.5.1 generated at Thu May 22 07:30:49 PM CEST 2025
|
||||
* v0.5.1 generated at Thu May 15 04:48:16 PM CEST 2025
|
||||
* https://xrfragment.org
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
|
|
|||
2
dist/xrfragment.plugin.frontend.js
vendored
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* v0.5.1 generated at Thu May 22 07:30:49 PM CEST 2025
|
||||
* v0.5.1 generated at Thu May 15 04:48:16 PM CEST 2025
|
||||
* https://xrfragment.org
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
|
|
|||
2
dist/xrfragment.plugin.matrix.js
vendored
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* v0.5.1 generated at Thu May 22 07:30:49 PM CEST 2025
|
||||
* v0.5.1 generated at Thu May 15 04:48:16 PM CEST 2025
|
||||
* https://xrfragment.org
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
|
|
|||
2
dist/xrfragment.plugin.network.js
vendored
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* v0.5.1 generated at Thu May 22 07:30:49 PM CEST 2025
|
||||
* v0.5.1 generated at Thu May 15 04:48:16 PM CEST 2025
|
||||
* https://xrfragment.org
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
|
|
|||
2
dist/xrfragment.plugin.p2p.js
vendored
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* v0.5.1 generated at Thu May 22 07:30:49 PM CEST 2025
|
||||
* v0.5.1 generated at Thu May 15 04:48:16 PM CEST 2025
|
||||
* https://xrfragment.org
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
|
|
|||
2
dist/xrfragment.plugin.remotestorage.js
vendored
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* v0.5.1 generated at Thu May 22 07:30:49 PM CEST 2025
|
||||
* v0.5.1 generated at Thu May 15 04:48:16 PM CEST 2025
|
||||
* https://xrfragment.org
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
|
|
|||
5
dist/xrfragment.three.js
vendored
|
|
@ -1,8 +1,3 @@
|
|||
/*
|
||||
* v0.5.1 generated at Thu May 22 07:30:49 PM CEST 2025
|
||||
* https://xrfragment.org
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
/*
|
||||
* v0.5.1 generated at Thu May 15 04:48:16 PM CEST 2025
|
||||
* https://xrfragment.org
|
||||
|
|
|
|||
5
dist/xrfragment.three.module.js
vendored
|
|
@ -1,8 +1,3 @@
|
|||
/*
|
||||
* v0.5.1 generated at Thu May 22 07:30:49 PM CEST 2025
|
||||
* https://xrfragment.org
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
/*
|
||||
* v0.5.1 generated at Thu May 15 04:48:16 PM CEST 2025
|
||||
* https://xrfragment.org
|
||||
|
|
|
|||
BIN
doc/RF6_XR_Fragments.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
1173
doc/RFC_XR_Fragments.md
Normal file
614
doc/RFC_XR_Fragments.md.bak
Normal file
|
|
@ -0,0 +1,614 @@
|
|||
%%%
|
||||
Title = "XR Fragments"
|
||||
area = "Internet"
|
||||
workgroup = "Internet Engineering Task Force"
|
||||
|
||||
[seriesInfo]
|
||||
name = "XR-Fragments"
|
||||
value = "draft-XRFRAGMENTS-leonvankammen-00"
|
||||
stream = "IETF"
|
||||
status = "informational"
|
||||
|
||||
date = 2023-04-12T00:00:00Z
|
||||
|
||||
[[author]]
|
||||
initials="L.R."
|
||||
surname="van Kammen"
|
||||
fullname="L.R. van Kammen"
|
||||
|
||||
%%%
|
||||
|
||||
<!-- for annotated version see: https://raw.githubusercontent.com/ietf-tools/rfcxml-templates-and-schemas/main/draft-rfcxml-general-template-annotated-00.xml -->
|
||||
|
||||
<!--{
|
||||
|
||||
<style type="text/css">
|
||||
body{
|
||||
font-family: monospace;
|
||||
max-width: 1000px;
|
||||
font-size: 15px;
|
||||
padding: 0% 20%;
|
||||
line-height: 30px;
|
||||
color:#555;
|
||||
background:#F0F0F3
|
||||
}
|
||||
h1 { margin-top:40px; }
|
||||
pre{ line-height:18px; }
|
||||
a,a:visited,a:active{ color: #70f; }
|
||||
code{
|
||||
border: 1px solid #AAA;
|
||||
border-radius: 3px;
|
||||
padding: 0px 5px 2px 5px;
|
||||
}
|
||||
|
||||
pre{
|
||||
line-height: 18px;
|
||||
overflow: auto;
|
||||
padding: 12px;
|
||||
}
|
||||
pre + code {
|
||||
background:#DDD;
|
||||
}
|
||||
pre>code{
|
||||
border:none;
|
||||
border-radius:0px;
|
||||
padding:0;
|
||||
}
|
||||
blockquote{
|
||||
padding-left: 30px;
|
||||
margin: 0;
|
||||
border-left: 5px solid #CCC;
|
||||
}
|
||||
th {
|
||||
border-bottom: 1px solid #000;
|
||||
text-align: left;
|
||||
padding-right:45px;
|
||||
padding-left:7px;
|
||||
background: #DDD;
|
||||
}
|
||||
|
||||
td {
|
||||
border-bottom: 1px solid #CCC;
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<br>
|
||||
<h1>XR Fragments</h1>
|
||||
<br>
|
||||
|
||||
<pre>
|
||||
stream: IETF
|
||||
area: Internet
|
||||
status: informational
|
||||
author: Leon van Kammen
|
||||
date: 2023-04-12T00:00:00Z
|
||||
workgroup: Internet Engineering Task Force
|
||||
value: draft-XRFRAGMENTS-leonvankammen-00
|
||||
</pre>
|
||||
|
||||
|
||||
}-->
|
||||
|
||||
.# Abstract
|
||||
|
||||
This draft offers a specification for 4D URLs & navigation, to link 3D scenes and text together with- or without a network-connection.<br>
|
||||
The specification promotes spatial addressibility, sharing, navigation, query-ing and tagging interactive (text)objects across for (XR) Browsers.<br>
|
||||
XR Fragments allows us to enrich existing dataformats, by recursive use of existing proven technologies like [URI Fragments](https://en.wikipedia.org/wiki/URI_fragment) and BibTags notation.<br>
|
||||
|
||||
> Almost every idea in this document is demonstrated at [https://xrfragment.org](https://xrfragment.org)
|
||||
|
||||
{mainmatter}
|
||||
|
||||
# Introduction
|
||||
|
||||
How can we add more features to existing text & 3D scenes, without introducing new dataformats?<br>
|
||||
Historically, there's many attempts to create the ultimate markuplanguage or 3D fileformat.<br>
|
||||
However, thru the lens of authoring, their lowest common denominator is still: plain text.<br>
|
||||
XR Fragments allows us to enrich/connect existing dataformats, by recursive use of existing technologies:<br>
|
||||
|
||||
1. addressibility and navigation of 3D scenes/objects: [URI Fragments](https://en.wikipedia.org/wiki/URI_fragment) + src/href spatial metadata
|
||||
1. hasslefree tagging across text and spatial objects using [BibTags](https://en.wikipedia.org/wiki/BibTeX) as appendix (see [visual-meta](https://visual-meta.info) e.g.)
|
||||
|
||||
> NOTE: The chapters in this document are ordered from highlevel to lowlevel (technical) as much as possible
|
||||
|
||||
# Core principle
|
||||
|
||||
XR Fragments strives to serve (nontechnical/fuzzy) humans first, and machine(implementations) later, by ensuring hasslefree text-vs-thought feedback loops.<br>
|
||||
This also means that the repair-ability of machine-matters should be human friendly too (not too complex).<br>
|
||||
|
||||
> "When a car breaks down, the ones **without** turbosupercharger are easier to fix"
|
||||
|
||||
Let's always focus on average humans: the 'fuzzy symbolical mind' must be served first, before serving the greater ['categorized typesafe RDF hive mind'](https://en.wikipedia.org/wiki/Borg)).
|
||||
|
||||
> Humans first, machines (AI) later.
|
||||
|
||||
# Conventions and 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. |
|
||||
|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 like `#pos=0,0,0&t=1,100` e.g. |
|
||||
|src | (HTML-piggybacked) metadata of a 3D object which instances content |
|
||||
|href | (HTML-piggybacked) metadata of a 3D object which links to content |
|
||||
|query | an URI Fragment-operator which queries object(s) from a scene like `#q=cube` |
|
||||
|visual-meta | [visual-meta](https://visual.meta.info) data appended to text/books/papers which is indirectly visible/editable in XR. |
|
||||
|requestless metadata | opposite of networked metadata (RDF/HTML requests can easily fan out into 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 |
|
||||
|BibTeX | simple tagging/citing/referencing standard for plaintext |
|
||||
|BibTag | a BibTeX tag |
|
||||
|
||||
# List of URI Fragments
|
||||
|
||||
| fragment | type | example | info |
|
||||
|--------------|----------|-------------------|-------------------------------------------------------------------|
|
||||
| `#pos` | vector3 | `#pos=0.5,0,0` | positions camera to xyz-coord 0.5,0,0 |
|
||||
| `#rot` | vector3 | `#rot=0,90,0` | rotates camera to xyz-coord 0.5,0,0 |
|
||||
| `#t` | vector2 | `#t=500,1000` | sets animation-loop range between frame 500 and 1000 |
|
||||
| `#......` | string | `#.cubes` `#cube` | object(s) of interest (fragment to object name or class mapping) |
|
||||
|
||||
> xyz coordinates are similar to ones found in SVG Media Fragments
|
||||
|
||||
# List of metadata for 3D nodes
|
||||
|
||||
| key | type | example (JSON) | info |
|
||||
|--------------|----------|--------------------|--------------------------------------------------------|
|
||||
| `name` | string | `"name": "cube"` | available in all 3D fileformats & scenes |
|
||||
| `class` | string | `"class": "cubes"` | available through custom property in 3D fileformats |
|
||||
| `href` | string | `"href": "b.gltf"` | available through custom property in 3D fileformats |
|
||||
| `src` | string | `"src": "#q=cube"` | available through custom property in 3D fileformats |
|
||||
|
||||
Popular compatible 3D fileformats: `.gltf`, `.obj`, `.fbx`, `.usdz`, `.json` (THREEjs), `COLLADA` and so on.
|
||||
|
||||
> NOTE: XR Fragments are file-agnostic, which means that the metadata exist in programmatic 3D scene(nodes) too.
|
||||
|
||||
# Navigating 3D
|
||||
|
||||
Here's an ascii representation of a 3D scene-graph which contains 3D objects `◻` and their metadata:
|
||||
|
||||
```
|
||||
+--------------------------------------------------------+
|
||||
| |
|
||||
| index.gltf |
|
||||
| │ |
|
||||
| ├── ◻ buttonA |
|
||||
| │ └ href: #pos=1,0,1&t=100,200 |
|
||||
| │ |
|
||||
| └── ◻ buttonB |
|
||||
| └ href: other.fbx | <-- file-agnostic (can be .gltf .obj etc)
|
||||
| |
|
||||
+--------------------------------------------------------+
|
||||
|
||||
```
|
||||
|
||||
An XR Fragment-compatible browser viewing this scene, allows the end-user to interact with the `buttonA` and `buttonB`.<br>
|
||||
In case of `buttonA` the end-user will be teleported to another location and time in the **current loaded scene**, but `buttonB` will
|
||||
**replace the current scene** with a new one, like `other.fbx`.
|
||||
|
||||
# Embedding 3D content
|
||||
|
||||
Here's an ascii representation of a 3D scene-graph with 3D objects `◻` which embeds remote & local 3D objects `◻` (without) using queries:
|
||||
|
||||
```
|
||||
+--------------------------------------------------------+ +-------------------------+
|
||||
| | | |
|
||||
| index.gltf | | ocean.com/aquarium.fbx |
|
||||
| │ | | │ |
|
||||
| ├── ◻ canvas | | └── ◻ fishbowl |
|
||||
| │ └ src: painting.png | | ├─ ◻ bass |
|
||||
| │ | | └─ ◻ tuna |
|
||||
| ├── ◻ aquariumcube | | |
|
||||
| │ └ src: ://rescue.com/fish.gltf#q=bass%20tuna | +-------------------------+
|
||||
| │ |
|
||||
| ├── ◻ bedroom |
|
||||
| │ └ src: #q=canvas |
|
||||
| │ |
|
||||
| └── ◻ livingroom |
|
||||
| └ src: #q=canvas |
|
||||
| |
|
||||
+--------------------------------------------------------+
|
||||
```
|
||||
|
||||
An XR Fragment-compatible browser viewing this scene, lazy-loads and projects `painting.png` onto the (plane) object called `canvas` (which is copy-instanced in the bed and livingroom).<br>
|
||||
Also, after lazy-loading `ocean.com/aquarium.gltf`, only the queried objects `bass` and `tuna` will be instanced inside `aquariumcube`.<br>
|
||||
Resizing will be happen accordingly to its placeholder object `aquariumcube`, see chapter Scaling.<br>
|
||||
|
||||
# XR Fragment queries
|
||||
|
||||
Include, exclude, hide/shows objects using space-separated strings:
|
||||
|
||||
* `#q=cube`
|
||||
* `#q=cube -ball_inside_cube`
|
||||
* `#q=* -sky`
|
||||
* `#q=-.language .english`
|
||||
* `#q=cube&rot=0,90,0`
|
||||
* `#q=price:>2 price:<5`
|
||||
|
||||
It's simple but powerful syntax which allows <b>css</b>-like class/id-selectors with a searchengine prompt-style feeling:
|
||||
|
||||
1. queries are showing/hiding objects **only** when defined as `src` value (prevents sharing of scene-tampered URL's).
|
||||
1. queries are highlighting objects when defined in the top-Level (browser) URL (bar).
|
||||
1. search words like `cube` and `foo` in `#q=cube foo` are matched against 3D object names or custom metadata-key(values)
|
||||
1. search words like `cube` and `foo` in `#q=cube foo` are matched against tags (BibTeX) inside plaintext `src` values like `@cube{redcube, ...` e.g.
|
||||
1. `#` equals `#q=*`
|
||||
1. words starting with `.` like `.german` match class-metadata of 3D objects like `"class":"german"`
|
||||
1. words starting with `.` like `.german` match class-metadata of (BibTeX) tags in XR Text objects like `@german{KarlHeinz, ...` e.g.
|
||||
|
||||
> **For example**: `#q=.foo` is a shorthand for `#q=class:foo`, which will select objects with custom property `class`:`foo`. Just a simple `#q=cube` will simply select an object named `cube`.
|
||||
|
||||
* see [an example video here](https://coderofsalvation.github.io/xrfragment.media/queries.mp4)
|
||||
|
||||
## including/excluding
|
||||
|
||||
| operator | info |
|
||||
|----------|-------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `*` | select all objects (only useful in `src` custom property) |
|
||||
| `-` | removes/hides object(s) |
|
||||
| `:` | indicates an object-embedded custom property key/value |
|
||||
| `.` | alias for `"class" :".foo"` equals `class:foo` |
|
||||
| `>` `<` | compare float or int number |
|
||||
| `/` | reference to root-scene.<br>Useful in case of (preventing) showing/hiding objects in nested scenes (instanced by `src`) (*) |
|
||||
|
||||
> \* = `#q=-/cube` hides object `cube` only in the root-scene (not nested `cube` objects)<br> `#q=-cube` hides both object `cube` in the root-scene <b>AND</b> nested `skybox` objects |
|
||||
|
||||
[» example implementation](https://github.com/coderofsalvation/xrfragment/blob/main/src/3rd/js/three/xrf/q.js)
|
||||
[» example 3D asset](https://github.com/coderofsalvation/xrfragment/blob/main/example/assets/query.gltf#L192)
|
||||
[» discussion](https://github.com/coderofsalvation/xrfragment/issues/3)
|
||||
|
||||
## Query Parser
|
||||
|
||||
Here's how to write a query parser:
|
||||
|
||||
1. create an associative array/object to store query-arguments as objects
|
||||
1. detect object id's & properties `foo:1` and `foo` (reference regex: `/^.*:[><=!]?/` )
|
||||
1. detect excluders like `-foo`,`-foo:1`,`-.foo`,`-/foo` (reference regex: `/^-/` )
|
||||
1. detect root selectors like `/foo` (reference regex: `/^[-]?\//` )
|
||||
1. detect class selectors like `.foo` (reference regex: `/^[-]?class$/` )
|
||||
1. detect number values like `foo:1` (reference regex: `/^[0-9\.]+$/` )
|
||||
1. expand aliases like `.foo` into `class:foo`
|
||||
1. for every query token split string on `:`
|
||||
1. create an empty array `rules`
|
||||
1. then strip key-operator: convert "-foo" into "foo"
|
||||
1. add operator and value to rule-array
|
||||
1. therefore we we set `id` to `true` or `false` (false=excluder `-`)
|
||||
1. and we set `root` to `true` or `false` (true=`/` root selector is present)
|
||||
1. we convert key '/foo' into 'foo'
|
||||
1. finally we add the key/value to the store like `store.foo = {id:false,root:true}` e.g.
|
||||
|
||||
> An example query-parser (which compiles to many languages) can be [found here](https://github.com/coderofsalvation/xrfragment/blob/main/src/xrfragment/Query.hx)
|
||||
|
||||
## XR Fragment URI Grammar
|
||||
|
||||
```
|
||||
reserved = gen-delims / sub-delims
|
||||
gen-delims = "#" / "&"
|
||||
sub-delims = "," / "="
|
||||
```
|
||||
|
||||
> Example: `://foo.com/my3d.gltf#pos=1,0,0&prio=-5&t=0,100`
|
||||
|
||||
| Demo | Explanation |
|
||||
|-------------------------------|---------------------------------|
|
||||
| `pos=1,2,3` | vector/coordinate argument e.g. |
|
||||
| `pos=1,2,3&rot=0,90,0&q=.foo` | combinators |
|
||||
|
||||
|
||||
# Text in XR (tagging,linking to spatial objects)
|
||||
|
||||
We still think and speak in simple text, not in HTML or RDF.<br>
|
||||
The most advanced human will probably not shout `<h1>FIRE!</h1>` in case of emergency.<br>
|
||||
Given the new dawn of (non-keyboard) XR interfaces, keeping text as is (not obscuring with markup) is preferred.<br>
|
||||
Ideally metadata must come **later with** text, but not **obfuscate** the text, or **in another** file.<br>
|
||||
|
||||
> Humans first, machines (AI) later ([core principle](#core-principle)
|
||||
|
||||
This way:
|
||||
|
||||
1. XR Fragments allows <b id="tagging-text">hasslefree XR text tagging</b>, using BibTeX metadata **at the end of content** (like [visual-meta](https://visual.meta.info)).
|
||||
1. XR Fragments allows hasslefree <a href="#textual-tag">textual tagging</a>, <a href="#spatial-tag">spatial tagging</a>, and <a href="#supra-tagging">supra tagging</a>, by mapping 3D/text object (class)names using BibTeX 'tags'
|
||||
1. Bibs/BibTeX-appendices is first-choice **requestless metadata**-layer for XR text, HTML/RDF/JSON is great (but fits better in the application-layer)
|
||||
1. Default font (unless specified otherwise) is a modern monospace font, for maximized tabular expressiveness (see [the core principle](#core-principle)).
|
||||
1. anti-pattern: hardcoupling a mandatory **obtrusive markuplanguage** or framework with an XR browsers (HTML/VRML/Javascript) (see [the core principle](#core-principle))
|
||||
1. anti-pattern: limiting human introspection, by immediately funneling human thought into typesafe, precise, pre-categorized metadata like RDF (see [the core principle](#core-principle))
|
||||
|
||||
This allows recursive connections between text itself, as well as 3D objects and vice versa, using **BibTags** :
|
||||
|
||||
```
|
||||
+---------------------------------------------+ +------------------+
|
||||
| My Notes | | / \ |
|
||||
| | | / \ |
|
||||
| The houses here are built in baroque style. | | /house\ |
|
||||
| | | |_____| |
|
||||
| | +---------|--------+
|
||||
| @house{houses, >----'house'--------| class/name match?
|
||||
| url = {#.house} >----'houses'-------` class/name match?
|
||||
| } |
|
||||
+---------------------------------------------+
|
||||
```
|
||||
|
||||
> The enduser can add connections by speaking/typing/scanning [hashtagbibs](https://github.com/coderofsalvation/hashtagbibs) which the XR Browser can expand to BibTags.
|
||||
|
||||
This allows instant realtime tagging of objects at various scopes:
|
||||
|
||||
| scope | matching algo |
|
||||
|---------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| <b id="textual-tagging">textual</b> | text containing 'houses' is now automatically tagged with 'house' (incl. plaintext `src` child nodes) |
|
||||
| <b id="spatial-tagging">spatial</b> | spatial object(s) with `"class":"house"` (because of `{#.house}`) are now automatically tagged with 'house' (incl. child nodes) |
|
||||
| <b id="supra-tagging">supra</b> | text- or spatial-object(s) (non-descendant nodes) elsewhere, named 'house', are automatically tagged with 'house' (current node to root node) |
|
||||
| <b id="omni-tagging">omni</b> | text- or spatial-object(s) (non-descendant nodes) elsewhere, containing class/name 'house', are automatically tagged with 'house' (too node to all nodes) |
|
||||
| <b id="infinite-tagging">infinite</b> | text- or spatial-object(s) (non-descendant nodes) elsewhere, containing class/name 'house' or 'houses', are automatically tagged with 'house' (too node to all nodes) |
|
||||
|
||||
This empowers the enduser spatial expressiveness (see [the core principle](#core-principle)): spatial wires can be rendered, words can be highlighted, spatial objects can be highlighted/moved/scaled, links can be manipulated by the user.<br>
|
||||
The simplicity of appending BibTeX 'tags' (humans first, machines later) is also demonstrated by [visual-meta](https://visual-meta.info) in greater detail.
|
||||
|
||||
1. The XR Browser needs to adjust tag-scope based on the endusers needs/focus (infinite tagging only makes sense when environment is scaled down significantly)
|
||||
1. The XR Browser should always allow the human to view/edit the metadata, by clicking 'toggle metadata' on the 'back' (contextmenu e.g.) of any XR text, anywhere anytime.
|
||||
|
||||
> NOTE: infinite matches both 'house' and 'houses' in text, as well as spatial objects with `"class":"house"` or name "house". This multiplexing of id/category is deliberate because of [the core principle](#core-principle).
|
||||
|
||||
## Default Data URI mimetype
|
||||
|
||||
The `src`-values work as expected (respecting mime-types), however:
|
||||
|
||||
The XR Fragment specification bumps the traditional default browser-mimetype
|
||||
|
||||
`text/plain;charset=US-ASCII`
|
||||
|
||||
to a hashtagbib(tex)-friendly one:
|
||||
|
||||
`text/plain;charset=utf-8;bib=^@`
|
||||
|
||||
This indicates that:
|
||||
|
||||
* utf-8 is supported by default
|
||||
* [hashtagbibs](https://github.com/coderofsalvation/hashtagbibs) are expanded to [bibtags](https://en.wikipedia.org/wiki/BibTeX)
|
||||
* lines matching regex `^@` will automatically get filtered out, in order to:
|
||||
* links between textual/spatial objects can automatically be detected
|
||||
* bibtag appendices ([visual-meta](https://visual-meta.info) can be interpreted e.g.
|
||||
|
||||
> for more info on this mimetype see [bibs](https://github.com/coderofsalvation/hashtagbibs)
|
||||
|
||||
Advantages:
|
||||
|
||||
* out-of-the-box (de)multiplex human text and metadata in one go (see [the core principle](#core-principle))
|
||||
* no network-overhead for metadata (see [the core principle](#core-principle))
|
||||
* ensuring high FPS: HTML/RDF historically is too 'requesty'/'parsy' for game studios
|
||||
* rich send/receive/copy-paste everywhere by default, metadata being retained (see [the core principle](#core-principle))
|
||||
* netto result: less webservices, therefore less servers, and overall better FPS in XR
|
||||
|
||||
> This significantly expands expressiveness and portability of human tagged text, by **postponing machine-concerns to the end of the human text** in contrast to literal interweaving of content and markupsymbols (or extra network requests, webservices e.g.).
|
||||
|
||||
For all other purposes, regular mimetypes can be used (but are not required by the spec).<br>
|
||||
|
||||
## URL and Data URI
|
||||
|
||||
```
|
||||
+--------------------------------------------------------------+ +------------------------+
|
||||
| | | author.com/article.txt |
|
||||
| index.gltf | +------------------------+
|
||||
| │ | | |
|
||||
| ├── ◻ article_canvas | | Hello friends. |
|
||||
| │ └ src: ://author.com/article.txt | | |
|
||||
| │ | | @friend{friends |
|
||||
| └── ◻ note_canvas | | ... |
|
||||
| └ src:`data:welcome human\n@...` | | } |
|
||||
| | +------------------------+
|
||||
| |
|
||||
+--------------------------------------------------------------+
|
||||
```
|
||||
|
||||
The enduser will only see `welcome human` and `Hello friends` rendered spatially.
|
||||
The beauty is that text (AND visual-meta) in Data URI promotes rich copy-paste.
|
||||
In both cases, the text gets rendered immediately (onto a plane geometry, hence the name '_canvas').
|
||||
The XR Fragment-compatible browser can let the enduser access visual-meta(data)-fields after interacting with the object (contextmenu e.g.).
|
||||
|
||||
> additional tagging using [bibs](https://github.com/coderofsalvation/hashtagbibs): to tag spatial object `note_canvas` with 'todo', the enduser can type or speak `@note_canvas@todo`
|
||||
|
||||
The mapping between 3D objects and text (src-data) is simple (the :
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
+------------------------------------------------+
|
||||
| |
|
||||
| index.gltf |
|
||||
| │ |
|
||||
| └── ◻ rentalhouse |
|
||||
| └ class: house <----------------- matches -------+
|
||||
| └ ◻ note | |
|
||||
| └ src:`data: todo: call owner | hashtagbib |
|
||||
| #owner@house@todo | ----> expands to @house{owner,
|
||||
| | bibtex: }
|
||||
| ` | @contact{
|
||||
+------------------------------------------------+ }
|
||||
```
|
||||
|
||||
Bi-directional mapping between 3D object names and/or classnames and text using bibs,BibTags & XR Fragments, allows for rich interlinking between text and 3D objects:
|
||||
|
||||
1. When the user surfs to https://.../index.gltf#rentalhouse the XR Fragments-parser points the enduser to the rentalhouse object, and can show contextual info about it.
|
||||
2. When (partial) remote content is embedded thru XR Fragment queries (see XR Fragment queries), indirectly related metadata can be embedded along.
|
||||
|
||||
## Bibs & BibTeX: lowest common denominator for linking data
|
||||
|
||||
> "When a car breaks down, the ones **without** turbosupercharger are easier to fix"
|
||||
|
||||
Unlike XML or JSON, BibTex is typeless, unnested, and uncomplicated, hence a great advantage for introspection.<br>
|
||||
It's a missing sensemaking precursor to extrospective RDF.<br>
|
||||
BibTeX-appendices are already used in the digital AND physical world (academic books, [visual-meta](https://visual-meta.info)), perhaps due to its terseness & simplicity.<br>
|
||||
In that sense, it's one step up from the `.ini` fileformat (which has never leaked into the physical world like BibTex):
|
||||
|
||||
1. <b id="frictionless-copy-paste">frictionless copy/pasting</b> (by humans) of (unobtrusive) content AND metadata
|
||||
1. an introspective 'sketchpad' for metadata, which can (optionally) mature into RDF later
|
||||
|
||||
| characteristic | UTF8 Plain Text (with BibTeX) | RDF |
|
||||
|------------------------------------|-------------------------------|---------------------------|
|
||||
| perspective | introspective | extrospective |
|
||||
| structure | fuzzy (sensemaking) | precise |
|
||||
| space/scope | local | world |
|
||||
| everything is text (string) | yes | no |
|
||||
| voice/paper-friendly | [bibs](https://github.com/coderofsalvation/hashtagbibs) | no |
|
||||
| leaves (dictated) text intact | yes | no |
|
||||
| markup language | just an appendix | ~4 different |
|
||||
| polyglot format | no | yes |
|
||||
| easy to copy/paste content+metadata| yes | up to application |
|
||||
| easy to write/repair for layman | yes | depends |
|
||||
| easy to (de)serialize | yes (fits on A4 paper) | depends |
|
||||
| infrastructure | selfcontained (plain text) | (semi)networked |
|
||||
| freeform tagging/annotation | yes, terse | yes, verbose |
|
||||
| can be appended to text-content | yes | up to application |
|
||||
| copy-paste text preserves metadata | yes | up to application |
|
||||
| emoji | yes | depends on encoding |
|
||||
| predicates | free | semi pre-determined |
|
||||
| implementation/network overhead | no | depends |
|
||||
| used in (physical) books/PDF | yes (visual-meta) | no |
|
||||
| terse non-verb predicates | yes | no |
|
||||
| nested structures | no (but: BibTex rulers) | yes |
|
||||
|
||||
> To keep XR Fragments a lightweight spec, BibTeX is used for rudimentary text/spatial tagging (not JSON, RDF or a scripting language because they're harder to write/speak/repair.).
|
||||
|
||||
Applications are also free to attach any JSON(LD / RDF) to spatial objects using custom properties (but is not interpreted by this spec).
|
||||
|
||||
## XR Text example parser
|
||||
|
||||
|
||||
1. The XR Fragments spec does not aim to harden the BiBTeX format
|
||||
2. respect multi-line BibTex values because of [the core principle](#core-principle)
|
||||
3. Expand hashtag(bibs) and rulers (like `${visual-meta-start}`) according to the [hashtagbibs spec](https://github.com/coderofsalvation/hashtagbibs)
|
||||
4. BibTeX snippets should always start in the beginning of a line (regex: ^@), hence mimetype `text/plain;charset=utf-8;bib=^@`
|
||||
|
||||
Here's an XR Text (de)multiplexer in javascript, which ticks all the above boxes:
|
||||
|
||||
```
|
||||
xrtext = {
|
||||
|
||||
expandBibs: (text) => {
|
||||
let bibs = { regex: /(#[a-zA-Z0-9_+@\-]+(#)?)/g, tags: {}}
|
||||
text.replace( bibs.regex , (m,k,v) => {
|
||||
tok = m.substr(1).split("@")
|
||||
match = tok.shift()
|
||||
if( tok.length ) tok.map( (t) => bibs.tags[t] = `@${t}{${match},\n}` )
|
||||
else if( match.substr(-1) == '#' )
|
||||
bibs.tags[match] = `@{${match.replace(/#/,'')}}`
|
||||
else bibs.tags[match] = `@${match}{${match},\n}`
|
||||
})
|
||||
return text.replace( bibs.regex, '') + Object.values(bibs.tags).join('\n')
|
||||
},
|
||||
|
||||
decode: (str) => {
|
||||
// bibtex: ↓@ ↓<tag|tag{phrase,|{ruler}> ↓property ↓end
|
||||
let pat = [ /@/, /^\S+[,{}]/, /},/, /}/ ]
|
||||
let tags = [], text='', i=0, prop=''
|
||||
let lines = xrtext.expandBibs(str).replace(/\r?\n/g,'\n').split(/\n/)
|
||||
for( let i = 0; i < lines.length && !String(lines[i]).match( /^@/ ); i++ )
|
||||
text += lines[i]+'\n'
|
||||
|
||||
bibtex = lines.join('\n').substr( text.length )
|
||||
bibtex.split( pat[0] ).map( (t) => {
|
||||
try{
|
||||
let v = {}
|
||||
if( !(t = t.trim()) ) return
|
||||
if( tag = t.match( pat[1] ) ) tag = tag[0]
|
||||
if( tag.match( /^{.*}$/ ) ) return tags.push({ruler:tag})
|
||||
t = t.substr( tag.length )
|
||||
t.split( pat[2] )
|
||||
.map( kv => {
|
||||
if( !(kv = kv.trim()) || kv == "}" ) return
|
||||
v[ kv.match(/\s?(\S+)\s?=/)[1] ] = kv.substr( kv.indexOf("{")+1 )
|
||||
})
|
||||
tags.push( { k:tag, v } )
|
||||
}catch(e){ console.error(e) }
|
||||
})
|
||||
return {text, tags}
|
||||
},
|
||||
|
||||
encode: (text,tags) => {
|
||||
let str = text+"\n"
|
||||
for( let i in tags ){
|
||||
let item = tags[i]
|
||||
if( item.ruler ){
|
||||
str += `@${item.ruler}\n`
|
||||
continue;
|
||||
}
|
||||
str += `@${item.k}\n`
|
||||
for( let j in item.v ) str += ` ${j} = {${item.v[j]}}\n`
|
||||
str += `}\n`
|
||||
}
|
||||
return str
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The above functions (de)multiplexe text/metadata, expands bibs, (de)serialize bibtex (and all fits more or less on one A4 paper)
|
||||
|
||||
> above can be used as a startingpoint for LLVM's to translate/steelman to a more formal form/language.
|
||||
|
||||
```
|
||||
str = `
|
||||
hello world
|
||||
here are some hashtagbibs followed by bibtex:
|
||||
|
||||
#world
|
||||
#hello@greeting
|
||||
#another-section#
|
||||
|
||||
@{some-section}
|
||||
@flap{
|
||||
asdf = {23423}
|
||||
}`
|
||||
|
||||
var {tags,text} = xrtext.decode(str) // demultiplex text & bibtex
|
||||
tags.find( (t) => t.k == 'flap{' ).v.asdf = 1 // edit tag
|
||||
tags.push({ k:'bar{', v:{abc:123} }) // add tag
|
||||
console.log( xrtext.encode(text,tags) ) // multiplex text & bibtex back together
|
||||
```
|
||||
This expands to the following (hidden by default) BibTex appendix:
|
||||
|
||||
```
|
||||
hello world
|
||||
here are some hashtagbibs followed by bibtex:
|
||||
|
||||
@{some-section}
|
||||
@flap{
|
||||
asdf = {1}
|
||||
}
|
||||
@world{world,
|
||||
}
|
||||
@greeting{hello,
|
||||
}
|
||||
@{another-section}
|
||||
@bar{
|
||||
abc = {123}
|
||||
}
|
||||
```
|
||||
|
||||
# HYPER copy/paste
|
||||
|
||||
The previous example, offers something exciting compared to simple copy/paste of 3D objects or text.
|
||||
XR Text according to the XR Fragment spec, allows HYPER-copy/paste: time, space and text interlinked.
|
||||
Therefore, the enduser in an XR Fragment-compatible browser can copy/paste/share data in these ways:
|
||||
|
||||
1. time/space: 3D object (current animation-loop)
|
||||
1. text: TeXt object (including BibTeX/visual-meta if any)
|
||||
1. interlinked: Collected objects by visual-meta tag
|
||||
|
||||
# Security Considerations
|
||||
|
||||
Since XR Text contains metadata too, the user should be able to set up tagging-rules, so the copy-paste feature can :
|
||||
|
||||
* filter out sensitive data when copy/pasting (XR text with `class:secret` e.g.)
|
||||
|
||||
# IANA Considerations
|
||||
|
||||
This document has no IANA actions.
|
||||
|
||||
# Acknowledgments
|
||||
|
||||
TODO acknowledge.
|
||||
BIN
doc/RFC_XR_Fragments.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
35994
doc/RFC_XR_Fragments.svg
Normal file
|
After Width: | Height: | Size: 1,002 KiB |
1706
doc/RFC_XR_Fragments.xml
Normal file
465
doc/RFC_XR_Macros.html
Normal file
|
|
@ -0,0 +1,465 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>XR Macros</title>
|
||||
<meta name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl">
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- for annotated version see: https://raw.githubusercontent.com/ietf-tools/rfcxml-templates-and-schemas/main/draft-rfcxml-general-template-annotated-00.xml -->
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
body{
|
||||
font-family: monospace;
|
||||
max-width: 1000px;
|
||||
font-size: 15px;
|
||||
padding: 0% 20%;
|
||||
line-height: 30px;
|
||||
color:#555;
|
||||
background:#F0F0F3
|
||||
}
|
||||
h1 { margin-top:40px; }
|
||||
pre{ line-height:18px; }
|
||||
a,a:visited,a:active{ color: #70f; }
|
||||
code{
|
||||
border: 1px solid #AAA;
|
||||
border-radius: 3px;
|
||||
padding: 0px 5px 2px 5px;
|
||||
}
|
||||
|
||||
pre{
|
||||
line-height: 18px;
|
||||
overflow: auto;
|
||||
padding: 12px;
|
||||
}
|
||||
pre + code {
|
||||
background:#DDD;
|
||||
}
|
||||
pre>code{
|
||||
border:none;
|
||||
border-radius:0px;
|
||||
padding:0;
|
||||
}
|
||||
blockquote{
|
||||
padding-left: 30px;
|
||||
margin: 0;
|
||||
border-left: 5px solid #CCC;
|
||||
}
|
||||
th {
|
||||
border-bottom: 1px solid #000;
|
||||
text-align: left;
|
||||
padding-right:45px;
|
||||
padding-left:7px;
|
||||
background: #DDD;
|
||||
}
|
||||
|
||||
td {
|
||||
border-bottom: 1px solid #CCC;
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<br>
|
||||
<h1>XR Macros</h1>
|
||||
<br>
|
||||
|
||||
<pre>
|
||||
stream: IETF
|
||||
area: Internet
|
||||
status: informational
|
||||
author: Leon van Kammen
|
||||
date: 2023-04-12T00:00:00Z
|
||||
workgroup: Internet Engineering Task Force
|
||||
value: draft-XRMACROS-leonvankammen-00
|
||||
</pre>
|
||||
|
||||
|
||||
|
||||
<h1 class="special" id="abstract">Abstract</h1>
|
||||
|
||||
<p>This draft offers a specification for embedding macros in existing 3D scenes/assets, to offer simple interactions and configure the renderer further.<br>
|
||||
Together with URI Fragments, it allows for rich immersive experiences without the need of a complicated sandboxed scripting languages.</p>
|
||||
|
||||
<blockquote>
|
||||
<p>Almost every idea in this document is demonstrated at <a href="https://xrfragment.org">https://xrfragment.org</a>, as this spec was created during the <a href="https://xrfragment.org">XR Fragments</a> spec.</p>
|
||||
</blockquote>
|
||||
<section data-matter="main">
|
||||
<h1 id="introduction">Introduction</h1>
|
||||
|
||||
<p>How can we add more features to existing text & 3D scenes, without introducing new dataformats?<br>
|
||||
Historically, there’s many attempts to create the ultimate markuplanguage or 3D fileformat.<br>
|
||||
Their lowest common denominator is: (co)authoring using plain text.<br>
|
||||
Therefore, XR Macros allows us to enrich/connect existing dataformats, by offering a polyglot notation based on existing notations:<br></p>
|
||||
|
||||
<ol>
|
||||
<li>getting/setting common used 3D properties using querystring- or JSON-notation</li>
|
||||
<li>targeting 3D properties using the lightweight query notation present in <a href="https://xrfragment.org">XR Fragments</a></li>
|
||||
</ol>
|
||||
|
||||
<blockquote>
|
||||
<p>NOTE: The chapters in this document are ordered from highlevel to lowlevel (technical) as much as possible</p>
|
||||
</blockquote>
|
||||
|
||||
<h1 id="core-principle">Core principle</h1>
|
||||
|
||||
<ol>
|
||||
<li>XR Macros use querystrings, but are HTML-agnostic (though pseudo-XR Fragment browsers <strong>can</strong> be implemented on top of HTML/Javascript).</li>
|
||||
<li>An XR Macro is 3D metadata which starts with ‘!’ (<code>!clickme: fog=0,10</code> e.g.)</li>
|
||||
<li>Metadata-values can contain the <code>|</code> symbol to 🎲 roundrobin variable values (<code>!toggleme: fog=0,10|fog=0,1000</code> e.g.)</li>
|
||||
<li>XR Macros acts as simple eventhandlers for URI Fragments: they are automatically published on the (<a href="https://xrfragment.org">XR Fragments</a>) hashbus, to act as events (so more serious scripting languages can react to them as well).</li>
|
||||
<li>XR Macros can assign object metadata (<code>!setlocal: foo=1</code> writes <code>foo:1</code> metadata to the object containing the <code>!setlocal</code> metadata)</li>
|
||||
<li>XR Macros can assign global metadata (<code>!setfoo: #foo=1</code> writes <code>foo:1</code> metadata to the root scene-node)</li>
|
||||
</ol>
|
||||
|
||||
<blockquote>
|
||||
<p>These very simple principles allow for rich interactions and dynamic querying</p>
|
||||
</blockquote>
|
||||
|
||||
<h1 id="conventions-and-definitions">Conventions and Definitions</h1>
|
||||
|
||||
<p>See appendix below in case certain terms are not clear.</p>
|
||||
|
||||
<h1 id="list-of-xr-macros">List of XR Macros</h1>
|
||||
|
||||
<p>(XR) Macros can be embedded in 3D assets/scenes.<br>
|
||||
Macros enrich existing spatial content with a lowcode, limited logic-layer, by recursive (economic) use of the querystring syntax (which search engines and <a href="https://xrfragment.org">XR Fragments</a> already uses.<br>
|
||||
This is done by allowing string/integer variables, and the <code>|</code> symbol to roundrobin variable values.<br>
|
||||
Macros also act as events, so more serious scripting languages can react to them as well.<br></p>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>key</th>
|
||||
<th>type</th>
|
||||
<th>example (JSON)</th>
|
||||
<th>function</th>
|
||||
<th>existing compatibility</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>@bg</code></td>
|
||||
<td>string</td>
|
||||
<td><code>"@bg":"#cube"</code></td>
|
||||
<td>bg: binds fog near/far based to cube x/y/z (anim) values</td>
|
||||
<td>custom property in 3D fileformats</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>@fog</code></td>
|
||||
<td>string</td>
|
||||
<td><code>"@fog":"#cube"</code></td>
|
||||
<td>fog: binds fog near/far based to cube x/y (anim) values</td>
|
||||
<td>custom property in 3D fileformats</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>@scroll</code></td>
|
||||
<td>string</td>
|
||||
<td><code>"@scroll":"#cube"</code></td>
|
||||
<td>texturescrolling: binds texture x/y/rot based to cube x/y/z (anim) values</td>
|
||||
<td>custom property in 3D fileformats</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>@emissive</code></td>
|
||||
<td>string</td>
|
||||
<td><code>"@emissive":"#cube"</code></td>
|
||||
<td>day/night/mood: binds material’s emissive value to cube x/y/z (anim) values</td>
|
||||
<td>custom property in 3D fileformats</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2 id="usecase-click-object">Usecase: click object</h2>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>custom property</th>
|
||||
<th>value</th>
|
||||
<th>trigger when</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>!clickme</td>
|
||||
<td>bg=1,1,1&foo=2</td>
|
||||
<td>object clicked</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2 id="usecase-conditional-click-object">Usecase: conditional click object</h2>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>custom property</th>
|
||||
<th>value</th>
|
||||
<th>trigger when</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>#</td>
|
||||
<td>foo=1</td>
|
||||
<td>scene</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>!clickme</td>
|
||||
<td>q=foo>2&bg=1,1,1</td>
|
||||
<td>object clicked and foo > 2</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<blockquote>
|
||||
<p>when a user clicks an object with the custom properties above, it should set the backgroundcolor to <code>1,1,1</code> when <code>foo</code> is greater than <code>2</code> (see previous example)</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="usecase-click-object-roundrobin">Usecase: click object (roundrobin)</h2>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>custom property</th>
|
||||
<th>value</th>
|
||||
<th>trigger when</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>!cycleme</td>
|
||||
<td>day|noon|night</td>
|
||||
<td>object clicked</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>day</td>
|
||||
<td>bg=1,1,1</td>
|
||||
<td>roundrobin</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>noon</td>
|
||||
<td>bg=0.5,0.5,0.5</td>
|
||||
<td>roundrobin</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>night</td>
|
||||
<td>bg=0,0,0&foo=2</td>
|
||||
<td>roundrobin</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<blockquote>
|
||||
<p>when a user clicks an object with the custom properties above, it should trigger either <code>day</code> <code>noon</code> or <code>night</code> in roundrobin fashion.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="usecase-click-object-or-uri-fragment-and-scene-load-trigger">Usecase: click object or URI fragment, and scene load trigger</h2>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>custom property</th>
|
||||
<th>value</th>
|
||||
<th>trigger when</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>#</td>
|
||||
<td>random</td>
|
||||
<td>scene loaded</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>#random</td>
|
||||
<td>random</td>
|
||||
<td>URL contains #random</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>!random</td>
|
||||
<td>day|noon|night</td>
|
||||
<td>#random, # or click</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>day</td>
|
||||
<td>bg=1,1,1</td>
|
||||
<td>roundrobin</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>noon</td>
|
||||
<td>bg=0.5,0.5,0.5</td>
|
||||
<td>roundrobin</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>night</td>
|
||||
<td>bg=0,0,0&foo=2</td>
|
||||
<td>roundrobin</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2 id="usecase-present-context-menu-with-options">Usecase: present context menu with options</h2>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>custom property</th>
|
||||
<th>value</th>
|
||||
<th>trigger when</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>!random</td>
|
||||
<td>!day</td>
|
||||
<td>!noon</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>!day</td>
|
||||
<td>bg=1,1,1</td>
|
||||
<td>clicked in contextmenu</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>!noon</td>
|
||||
<td>bg=0.5,0.5,0.5</td>
|
||||
<td>clicked in contextmenu</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>!night</td>
|
||||
<td>bg=0,0,0&foo=2</td>
|
||||
<td>clicked in contextmenu</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<blockquote>
|
||||
<p>When interacting with an object with more than one <code>!</code>-macro, the XR Browser should offer a contextmenu to execute a macro.</p>
|
||||
</blockquote>
|
||||
|
||||
<p>In a similar way, when <strong>any</strong> <code>!</code>-macro is present on the sceneroot, the XR Browser should offer a context-menu to execute those macro’s.</p>
|
||||
|
||||
<h2 id="event-bubble-flow">Event Bubble-flow</h2>
|
||||
|
||||
<p>click object with (<code>!clickme</code>:<code>AR</code> or <code>!clickme</code>: <code>!reset</code> e.g.)</p>
|
||||
|
||||
<pre><code> ◻
|
||||
│
|
||||
└── does current object contain this property-key (`AR` or `!reset` e.g.)?
|
||||
└── no: is there any (root)object containing property `AR`
|
||||
└── yes: evaluate its (roundrobin) XR macro-value(s) (and exit)
|
||||
└── no: trigger URL: #AR
|
||||
</code></pre>
|
||||
|
||||
<p>click object with (<code>!clickme</code>:<code>#AR|#VR</code> e.g.)</p>
|
||||
|
||||
<pre><code> ◻
|
||||
│
|
||||
└── apply the roundrobin (rotate the options, value `#AR` becomes `#VR` upon next click)
|
||||
└── is there any object with property-key (`#AR` e.g.)?
|
||||
└── no: just update the URL to `#AR`
|
||||
└── yes: apply its value to the scene, and update the URL to `#AR`
|
||||
|
||||
click object with (`!clickme`:`!foo|!bar|!flop` e.g.)
|
||||
</code></pre>
|
||||
|
||||
<p>◻
|
||||
│<br>
|
||||
└── apply the roundrobin (rotate the options, value <code>!foo</code> becomes <code>!bar</code> upon next click)
|
||||
└── is there any object with property-key (<code>!foo</code> e.g.)?
|
||||
└── no: do nothing
|
||||
└── yes: apply its value to the scene
|
||||
“`</p>
|
||||
|
||||
<blockquote>
|
||||
<p>Note that only macro’s can trigger roundrobin values or contextmenu’s, as well as roundrobin values never ending up in the toplevel URL.</p>
|
||||
</blockquote>
|
||||
|
||||
<h1 id="security-considerations">Security Considerations</h1>
|
||||
|
||||
<h1 id="iana-considerations">IANA Considerations</h1>
|
||||
|
||||
<p>This document has no IANA actions.</p>
|
||||
|
||||
<h1 id="acknowledgments">Acknowledgments</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://nlnet.nl">NLNET</a></li>
|
||||
<li><a href="https://futureoftext.org">Future of Text</a></li>
|
||||
<li><a href="https://visual-meta.info">visual-meta.info</a></li>
|
||||
</ul>
|
||||
|
||||
<h1 id="appendix-definitions">Appendix: Definitions</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>definition</th>
|
||||
<th>explanation</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>scene</td>
|
||||
<td>a (local/remote) 3D scene or 3D file (index.gltf e.g.)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>3D object</td>
|
||||
<td>an object inside a scene characterized by vertex-, face- and customproperty data.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>XR fragments</td>
|
||||
<td>URI Fragment with spatial hints like <code>#pos=0,0,0&t=1,100</code> e.g.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>query</td>
|
||||
<td>an URI Fragment-operator which queries object(s) from a scene like <code>#q=cube</code></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>FPS</td>
|
||||
<td>frames per second in spatial experiences (games,VR,AR e.g.), should be as high as possible</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><code>◻</code></td>
|
||||
<td>ascii representation of an 3D object/mesh</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>(un)obtrusive</td>
|
||||
<td>obtrusive: wrapping human text/thought in XML/HTML/JSON obfuscates human text into a salad of machine-symbols and words</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
251
doc/RFC_XR_Macros.md
Normal file
|
|
@ -0,0 +1,251 @@
|
|||
%%%
|
||||
Title = "XR Macros"
|
||||
area = "Internet"
|
||||
workgroup = "Internet Engineering Task Force"
|
||||
|
||||
[seriesInfo]
|
||||
name = "XR-Macros"
|
||||
value = "draft-XRMACROS-leonvankammen-00"
|
||||
stream = "IETF"
|
||||
status = "informational"
|
||||
|
||||
date = 2023-04-12T00:00:00Z
|
||||
|
||||
[[author]]
|
||||
initials="L.R."
|
||||
surname="van Kammen"
|
||||
fullname="L.R. van Kammen"
|
||||
|
||||
%%%
|
||||
|
||||
<!-- for annotated version see: https://raw.githubusercontent.com/ietf-tools/rfcxml-templates-and-schemas/main/draft-rfcxml-general-template-annotated-00.xml -->
|
||||
|
||||
<!--{
|
||||
|
||||
<style type="text/css">
|
||||
body{
|
||||
font-family: monospace;
|
||||
max-width: 1000px;
|
||||
font-size: 15px;
|
||||
padding: 0% 20%;
|
||||
line-height: 30px;
|
||||
color:#555;
|
||||
background:#F0F0F3
|
||||
}
|
||||
h1 { margin-top:40px; }
|
||||
pre{ line-height:18px; }
|
||||
a,a:visited,a:active{ color: #70f; }
|
||||
code{
|
||||
border: 1px solid #AAA;
|
||||
border-radius: 3px;
|
||||
padding: 0px 5px 2px 5px;
|
||||
}
|
||||
|
||||
pre{
|
||||
line-height: 18px;
|
||||
overflow: auto;
|
||||
padding: 12px;
|
||||
}
|
||||
pre + code {
|
||||
background:#DDD;
|
||||
}
|
||||
pre>code{
|
||||
border:none;
|
||||
border-radius:0px;
|
||||
padding:0;
|
||||
}
|
||||
blockquote{
|
||||
padding-left: 30px;
|
||||
margin: 0;
|
||||
border-left: 5px solid #CCC;
|
||||
}
|
||||
th {
|
||||
border-bottom: 1px solid #000;
|
||||
text-align: left;
|
||||
padding-right:45px;
|
||||
padding-left:7px;
|
||||
background: #DDD;
|
||||
}
|
||||
|
||||
td {
|
||||
border-bottom: 1px solid #CCC;
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<br>
|
||||
<h1>XR Macros</h1>
|
||||
<br>
|
||||
|
||||
<pre>
|
||||
stream: IETF
|
||||
area: Internet
|
||||
status: informational
|
||||
author: Leon van Kammen
|
||||
date: 2023-04-12T00:00:00Z
|
||||
workgroup: Internet Engineering Task Force
|
||||
value: draft-XRMACROS-leonvankammen-00
|
||||
</pre>
|
||||
|
||||
|
||||
}-->
|
||||
|
||||
.# Abstract
|
||||
|
||||
This draft offers a specification for embedding macros in existing 3D scenes/assets, to offer simple interactions and configure the renderer further.<br>
|
||||
Together with URI Fragments, it allows for rich immersive experiences without the need of a complicated sandboxed scripting languages.
|
||||
|
||||
> Almost every idea in this document is demonstrated at [https://xrfragment.org](https://xrfragment.org), as this spec was created during the [XR Fragments](https://xrfragment.org) spec.
|
||||
|
||||
{mainmatter}
|
||||
|
||||
# Introduction
|
||||
|
||||
How can we add more features to existing text & 3D scenes, without introducing new dataformats?<br>
|
||||
Historically, there's many attempts to create the ultimate markuplanguage or 3D fileformat.<br>
|
||||
Their lowest common denominator is: (co)authoring using plain text.<br>
|
||||
Therefore, XR Macros allows us to enrich/connect existing dataformats, by offering a polyglot notation based on existing notations:<br>
|
||||
|
||||
1. getting/setting common used 3D properties using querystring- or JSON-notation
|
||||
1. targeting 3D properties using the lightweight query notation present in [XR Fragments](https://xrfragment.org)
|
||||
|
||||
> NOTE: The chapters in this document are ordered from highlevel to lowlevel (technical) as much as possible
|
||||
|
||||
# Core principle
|
||||
|
||||
1. XR Macros use querystrings, but are HTML-agnostic (though pseudo-XR Fragment browsers **can** be implemented on top of HTML/Javascript).
|
||||
1. An XR Macro is 3D metadata which starts with '!' (`!clickme: fog=0,10` e.g.)
|
||||
1. Metadata-values can contain the `|` symbol to 🎲 roundrobin variable values (`!toggleme: fog=0,10|fog=0,1000` e.g.)
|
||||
1. XR Macros acts as simple eventhandlers for URI Fragments: they are automatically published on the ([XR Fragments](https://xrfragment.org)) hashbus, to act as events (so more serious scripting languages can react to them as well).
|
||||
1. XR Macros can assign object metadata (`!setlocal: foo=1` writes `foo:1` metadata to the object containing the `!setlocal` metadata)
|
||||
1. XR Macros can assign global metadata (`!setfoo: #foo=1` writes `foo:1` metadata to the root scene-node)
|
||||
|
||||
> These very simple principles allow for rich interactions and dynamic querying
|
||||
|
||||
# Conventions and Definitions
|
||||
|
||||
See appendix below in case certain terms are not clear.
|
||||
|
||||
# List of XR Macros
|
||||
|
||||
(XR) Macros can be embedded in 3D assets/scenes.<br>
|
||||
Macros enrich existing spatial content with a lowcode, limited logic-layer, by recursive (economic) use of the querystring syntax (which search engines and [XR Fragments](https://xrfragment.org) already uses.<br>
|
||||
This is done by allowing string/integer variables, and the `|` symbol to roundrobin variable values.<br>
|
||||
Macros also act as events, so more serious scripting languages can react to them as well.<br>
|
||||
|
||||
| key | type | example (JSON) | function | existing compatibility |
|
||||
|--------------|----------|------------------------|---------------------|----------------------------------------|
|
||||
| `@bg` | string | `"@bg":"#cube"` | bg: binds fog near/far based to cube x/y/z (anim) values | custom property in 3D fileformats |
|
||||
| `@fog` | string | `"@fog":"#cube"` | fog: binds fog near/far based to cube x/y (anim) values | custom property in 3D fileformats |
|
||||
| `@scroll` | string | `"@scroll":"#cube"` | texturescrolling: binds texture x/y/rot based to cube x/y/z (anim) values | custom property in 3D fileformats |
|
||||
| `@emissive` | string | `"@emissive":"#cube"` | day/night/mood: binds material's emissive value to cube x/y/z (anim) values | custom property in 3D fileformats |
|
||||
|
||||
## Usecase: click object
|
||||
|
||||
| custom property | value | trigger when |
|
||||
|-----------------|--------------------------|------------------------|
|
||||
| !clickme | bg=1,1,1&foo=2 | object clicked |
|
||||
|
||||
## Usecase: conditional click object
|
||||
|
||||
| custom property | value | trigger when |
|
||||
|-----------------|--------------------------|-----------------------------|
|
||||
| # | foo=1 | scene |
|
||||
| !clickme | q=foo>2&bg=1,1,1 | object clicked and foo > 2 |
|
||||
|
||||
> when a user clicks an object with the custom properties above, it should set the backgroundcolor to `1,1,1` when `foo` is greater than `2` (see previous example)
|
||||
|
||||
## Usecase: click object (roundrobin)
|
||||
|
||||
| custom property | value | trigger when |
|
||||
|-----------------|--------------------------|------------------------|
|
||||
| !cycleme | day|noon|night | object clicked |
|
||||
| day | bg=1,1,1 | roundrobin |
|
||||
| noon | bg=0.5,0.5,0.5 | roundrobin |
|
||||
| night | bg=0,0,0&foo=2 | roundrobin |
|
||||
|
||||
> when a user clicks an object with the custom properties above, it should trigger either `day` `noon` or `night` in roundrobin fashion.
|
||||
|
||||
## Usecase: click object or URI fragment, and scene load trigger
|
||||
|
||||
| custom property | value | trigger when |
|
||||
|-----------------|--------------------------|------------------------|
|
||||
| # | random | scene loaded |
|
||||
| #random | random | URL contains #random |
|
||||
| !random | day|noon|night | #random, # or click |
|
||||
| day | bg=1,1,1 | roundrobin |
|
||||
| noon | bg=0.5,0.5,0.5 | roundrobin |
|
||||
| night | bg=0,0,0&foo=2 | roundrobin |
|
||||
|
||||
## Usecase: present context menu with options
|
||||
|
||||
| custom property | value | trigger when |
|
||||
|-----------------|--------------------------|------------------------|
|
||||
| !random | !day|!noon|!night | clicked in contextmenu |
|
||||
| !day | bg=1,1,1 | clicked in contextmenu |
|
||||
| !noon | bg=0.5,0.5,0.5 | clicked in contextmenu |
|
||||
| !night | bg=0,0,0&foo=2 | clicked in contextmenu |
|
||||
|
||||
> When interacting with an object with more than one `!`-macro, the XR Browser should offer a contextmenu to execute a macro.
|
||||
|
||||
In a similar way, when **any** `!`-macro is present on the sceneroot, the XR Browser should offer a context-menu to execute those macro's.
|
||||
|
||||
## Event Bubble-flow
|
||||
|
||||
click object with (`!clickme`:`AR` or `!clickme`: `!reset` e.g.)
|
||||
```
|
||||
◻
|
||||
│
|
||||
└── does current object contain this property-key (`AR` or `!reset` e.g.)?
|
||||
└── no: is there any (root)object containing property `AR`
|
||||
└── yes: evaluate its (roundrobin) XR macro-value(s) (and exit)
|
||||
└── no: trigger URL: #AR
|
||||
```
|
||||
|
||||
click object with (`!clickme`:`#AR|#VR` e.g.)
|
||||
```
|
||||
◻
|
||||
│
|
||||
└── apply the roundrobin (rotate the options, value `#AR` becomes `#VR` upon next click)
|
||||
└── is there any object with property-key (`#AR` e.g.)?
|
||||
└── no: just update the URL to `#AR`
|
||||
└── yes: apply its value to the scene, and update the URL to `#AR`
|
||||
|
||||
click object with (`!clickme`:`!foo|!bar|!flop` e.g.)
|
||||
```
|
||||
◻
|
||||
│
|
||||
└── apply the roundrobin (rotate the options, value `!foo` becomes `!bar` upon next click)
|
||||
└── is there any object with property-key (`!foo` e.g.)?
|
||||
└── no: do nothing
|
||||
└── yes: apply its value to the scene
|
||||
```
|
||||
|
||||
> Note that only macro's can trigger roundrobin values or contextmenu's, as well as roundrobin values never ending up in the toplevel URL.
|
||||
|
||||
# Security Considerations
|
||||
|
||||
|
||||
# IANA Considerations
|
||||
|
||||
This document has no IANA actions.
|
||||
|
||||
# Acknowledgments
|
||||
|
||||
* [NLNET](https://nlnet.nl)
|
||||
* [Future of Text](https://futureoftext.org)
|
||||
* [visual-meta.info](https://visual-meta.info)
|
||||
|
||||
# Appendix: Definitions
|
||||
|
||||
|definition | explanation |
|
||||
|----------------------|-------------------------------------------------------------------------------------------------------------------------------|
|
||||
|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. |
|
||||
|XR fragments | URI Fragment with spatial hints like `#pos=0,0,0&t=1,100` e.g. |
|
||||
|query | an URI Fragment-operator which queries object(s) from a scene like `#q=cube` |
|
||||
|FPS | frames per second in spatial experiences (games,VR,AR e.g.), should be as high as possible |
|
||||
|`◻` | 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 |
|
||||
|
||||
392
doc/RFC_XR_Macros.txt
Normal file
|
|
@ -0,0 +1,392 @@
|
|||
|
||||
|
||||
|
||||
|
||||
Internet Engineering Task Force L.R. van Kammen
|
||||
Internet-Draft 27 September 2024
|
||||
Intended status: Informational
|
||||
|
||||
|
||||
|
||||
XR Macros
|
||||
draft-XRMACROS-leonvankammen-00
|
||||
|
||||
Abstract
|
||||
|
||||
This draft offers a specification for embedding macros in existing 3D
|
||||
scenes/assets, to offer simple interactions and configure the
|
||||
renderer further.
|
||||
Together with URI Fragments, it allows for rich immersive experiences
|
||||
without the need of a complicated sandboxed scripting languages.
|
||||
|
||||
Almost every idea in this document is demonstrated at
|
||||
https://xrfragment.org (https://xrfragment.org), as this spec was
|
||||
created during the XR Fragments (https://xrfragment.org) spec.
|
||||
|
||||
Status of This Memo
|
||||
|
||||
This Internet-Draft is submitted in full conformance with the
|
||||
provisions of BCP 78 and BCP 79.
|
||||
|
||||
Internet-Drafts are working documents of the Internet Engineering
|
||||
Task Force (IETF). Note that other groups may also distribute
|
||||
working documents as Internet-Drafts. The list of current Internet-
|
||||
Drafts is at https://datatracker.ietf.org/drafts/current/.
|
||||
|
||||
Internet-Drafts are draft documents valid for a maximum of six months
|
||||
and may be updated, replaced, or obsoleted by other documents at any
|
||||
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 31 March 2025.
|
||||
|
||||
Copyright Notice
|
||||
|
||||
Copyright (c) 2024 IETF Trust and the persons identified as the
|
||||
document authors. All rights reserved.
|
||||
|
||||
This document is subject to BCP 78 and the IETF Trust's Legal
|
||||
Provisions Relating to IETF Documents (https://trustee.ietf.org/
|
||||
license-info) in effect on the date of publication of this document.
|
||||
Please review these documents carefully, as they describe your rights
|
||||
and restrictions with respect to this document. Code Components
|
||||
|
||||
|
||||
|
||||
van Kammen Expires 31 March 2025 [Page 1]
|
||||
|
||||
Internet-Draft XR Macros September 2024
|
||||
|
||||
|
||||
extracted from this document must include Revised BSD License text as
|
||||
described in Section 4.e of the Trust Legal Provisions and are
|
||||
provided without warranty as described in the Revised BSD License.
|
||||
|
||||
Table of Contents
|
||||
|
||||
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
|
||||
2. Core principle . . . . . . . . . . . . . . . . . . . . . . . 2
|
||||
3. Conventions and Definitions . . . . . . . . . . . . . . . . . 3
|
||||
4. List of XR Macros . . . . . . . . . . . . . . . . . . . . . . 3
|
||||
4.1. Usecase: click object . . . . . . . . . . . . . . . . . . 4
|
||||
4.2. Usecase: conditional click object . . . . . . . . . . . . 4
|
||||
4.3. Usecase: click object (roundrobin) . . . . . . . . . . . 5
|
||||
4.4. Usecase: click object or URI fragment, and scene load
|
||||
trigger . . . . . . . . . . . . . . . . . . . . . . . . . 5
|
||||
4.5. Usecase: present context menu with options . . . . . . . 6
|
||||
4.6. Event Bubble-flow . . . . . . . . . . . . . . . . . . . . 6
|
||||
5. Security Considerations . . . . . . . . . . . . . . . . . . . 7
|
||||
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7
|
||||
7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 7
|
||||
8. Appendix: Definitions . . . . . . . . . . . . . . . . . . . . 7
|
||||
|
||||
1. Introduction
|
||||
|
||||
How can we add more features to existing text & 3D scenes, without
|
||||
introducing new dataformats?
|
||||
Historically, there's many attempts to create the ultimate
|
||||
markuplanguage or 3D fileformat.
|
||||
Their lowest common denominator is: (co)authoring using plain text.
|
||||
Therefore, XR Macros allows us to enrich/connect existing
|
||||
dataformats, by offering a polyglot notation based on existing
|
||||
notations:
|
||||
|
||||
1. getting/setting common used 3D properties using querystring- or
|
||||
JSON-notation
|
||||
2. targeting 3D properties using the lightweight query notation
|
||||
present in XR Fragments (https://xrfragment.org)
|
||||
|
||||
| NOTE: The chapters in this document are ordered from highlevel to
|
||||
| lowlevel (technical) as much as possible
|
||||
|
||||
2. Core principle
|
||||
|
||||
1. XR Macros use querystrings, but are HTML-agnostic (though pseudo-
|
||||
XR Fragment browsers *can* be implemented on top of HTML/
|
||||
Javascript).
|
||||
2. An XR Macro is 3D metadata which starts with '!' (!clickme:
|
||||
fog=0,10 e.g.)
|
||||
|
||||
|
||||
|
||||
van Kammen Expires 31 March 2025 [Page 2]
|
||||
|
||||
Internet-Draft XR Macros September 2024
|
||||
|
||||
|
||||
3. Metadata-values can contain the | symbol to 🎲 roundrobin variable
|
||||
values (!toggleme: fog=0,10|fog=0,1000 e.g.)
|
||||
4. XR Macros acts as simple eventhandlers for URI Fragments: they
|
||||
are automatically published on the (XR Fragments
|
||||
(https://xrfragment.org)) hashbus, to act as events (so more
|
||||
serious scripting languages can react to them as well).
|
||||
5. XR Macros can assign object metadata (!setlocal: foo=1 writes
|
||||
foo:1 metadata to the object containing the !setlocal metadata)
|
||||
6. XR Macros can assign global metadata (!setfoo: #foo=1 writes
|
||||
foo:1 metadata to the root scene-node)
|
||||
|
||||
| These very simple principles allow for rich interactions and
|
||||
| dynamic querying
|
||||
|
||||
3. Conventions and Definitions
|
||||
|
||||
See appendix below in case certain terms are not clear.
|
||||
|
||||
4. List of XR Macros
|
||||
|
||||
(XR) Macros can be embedded in 3D assets/scenes.
|
||||
Macros enrich existing spatial content with a lowcode, limited logic-
|
||||
layer, by recursive (economic) use of the querystring syntax (which
|
||||
search engines and XR Fragments (https://xrfragment.org) already
|
||||
uses.
|
||||
This is done by allowing string/integer variables, and the | symbol
|
||||
to roundrobin variable values.
|
||||
Macros also act as events, so more serious scripting languages can
|
||||
react to them as well.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
van Kammen Expires 31 March 2025 [Page 3]
|
||||
|
||||
Internet-Draft XR Macros September 2024
|
||||
|
||||
|
||||
+=========+======+===================+=================+=============+
|
||||
|key |type |example (JSON) |function |existing |
|
||||
| | | | |compatibility|
|
||||
+=========+======+===================+=================+=============+
|
||||
|@bg |string|"@bg":"#cube" |bg: binds fog |custom |
|
||||
| | | |near/far based to|property in |
|
||||
| | | |cube x/y/z (anim)|3D |
|
||||
| | | |values |fileformats |
|
||||
+---------+------+-------------------+-----------------+-------------+
|
||||
|@fog |string|"@fog":"#cube" |fog: binds fog |custom |
|
||||
| | | |near/far based to|property in |
|
||||
| | | |cube x/y (anim) |3D |
|
||||
| | | |values |fileformats |
|
||||
+---------+------+-------------------+-----------------+-------------+
|
||||
|@scroll |string|"@scroll":"#cube" |texturescrolling:|custom |
|
||||
| | | |binds texture |property in |
|
||||
| | | |x/y/rot based to |3D |
|
||||
| | | |cube x/y/z (anim)|fileformats |
|
||||
| | | |values | |
|
||||
+---------+------+-------------------+-----------------+-------------+
|
||||
|@emissive|string|"@emissive":"#cube"|day/night/mood: |custom |
|
||||
| | | |binds material's |property in |
|
||||
| | | |emissive value to|3D |
|
||||
| | | |cube x/y/z (anim)|fileformats |
|
||||
| | | |values | |
|
||||
+---------+------+-------------------+-----------------+-------------+
|
||||
|
||||
Table 1
|
||||
|
||||
4.1. Usecase: click object
|
||||
|
||||
+=================+================+================+
|
||||
| custom property | value | trigger when |
|
||||
+=================+================+================+
|
||||
| !clickme | bg=1,1,1&foo=2 | object clicked |
|
||||
+-----------------+----------------+----------------+
|
||||
|
||||
Table 2
|
||||
|
||||
4.2. Usecase: conditional click object
|
||||
|
||||
+=================+==================+============================+
|
||||
| custom property | value | trigger when |
|
||||
+=================+==================+============================+
|
||||
| # | foo=1 | scene |
|
||||
+-----------------+------------------+----------------------------+
|
||||
| !clickme | q=foo>2&bg=1,1,1 | object clicked and foo > 2 |
|
||||
+-----------------+------------------+----------------------------+
|
||||
|
||||
|
||||
|
||||
van Kammen Expires 31 March 2025 [Page 4]
|
||||
|
||||
Internet-Draft XR Macros September 2024
|
||||
|
||||
|
||||
Table 3
|
||||
|
||||
| when a user clicks an object with the custom properties above, it
|
||||
| should set the backgroundcolor to 1,1,1 when foo is greater than 2
|
||||
| (see previous example)
|
||||
|
||||
4.3. Usecase: click object (roundrobin)
|
||||
|
||||
+=================+================+================+
|
||||
| custom property | value | trigger when |
|
||||
+=================+================+================+
|
||||
| !cycleme | day|noon|night | object clicked |
|
||||
+-----------------+----------------+----------------+
|
||||
| day | bg=1,1,1 | roundrobin |
|
||||
+-----------------+----------------+----------------+
|
||||
| noon | bg=0.5,0.5,0.5 | roundrobin |
|
||||
+-----------------+----------------+----------------+
|
||||
| night | bg=0,0,0&foo=2 | roundrobin |
|
||||
+-----------------+----------------+----------------+
|
||||
|
||||
Table 4
|
||||
|
||||
| when a user clicks an object with the custom properties above, it
|
||||
| should trigger either day noon or night in roundrobin fashion.
|
||||
|
||||
4.4. Usecase: click object or URI fragment, and scene load trigger
|
||||
|
||||
+=================+================+======================+
|
||||
| custom property | value | trigger when |
|
||||
+=================+================+======================+
|
||||
| # | random | scene loaded |
|
||||
+-----------------+----------------+----------------------+
|
||||
| #random | random | URL contains #random |
|
||||
+-----------------+----------------+----------------------+
|
||||
| !random | day|noon|night | #random, # or click |
|
||||
+-----------------+----------------+----------------------+
|
||||
| day | bg=1,1,1 | roundrobin |
|
||||
+-----------------+----------------+----------------------+
|
||||
| noon | bg=0.5,0.5,0.5 | roundrobin |
|
||||
+-----------------+----------------+----------------------+
|
||||
| night | bg=0,0,0&foo=2 | roundrobin |
|
||||
+-----------------+----------------+----------------------+
|
||||
|
||||
Table 5
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
van Kammen Expires 31 March 2025 [Page 5]
|
||||
|
||||
Internet-Draft XR Macros September 2024
|
||||
|
||||
|
||||
4.5. Usecase: present context menu with options
|
||||
|
||||
+=================+================+========================+
|
||||
| custom property | value | trigger when |
|
||||
+=================+================+========================+
|
||||
| !random | !day | !noon |
|
||||
+-----------------+----------------+------------------------+
|
||||
| !day | bg=1,1,1 | clicked in contextmenu |
|
||||
+-----------------+----------------+------------------------+
|
||||
| !noon | bg=0.5,0.5,0.5 | clicked in contextmenu |
|
||||
+-----------------+----------------+------------------------+
|
||||
| !night | bg=0,0,0&foo=2 | clicked in contextmenu |
|
||||
+-----------------+----------------+------------------------+
|
||||
|
||||
Table 6
|
||||
|
||||
| When interacting with an object with more than one !-macro, the XR
|
||||
| Browser should offer a contextmenu to execute a macro.
|
||||
|
||||
In a similar way, when *any* !-macro is present on the sceneroot, the
|
||||
XR Browser should offer a context-menu to execute those macro's.
|
||||
|
||||
4.6. Event Bubble-flow
|
||||
|
||||
click object with (!clickme:AR or !clickme: !reset e.g.)
|
||||
|
||||
◻
|
||||
│
|
||||
└── does current object contain this property-key (`AR` or `!reset` e.g.)?
|
||||
└── no: is there any (root)object containing property `AR`
|
||||
└── yes: evaluate its (roundrobin) XR macro-value(s) (and exit)
|
||||
└── no: trigger URL: #AR
|
||||
|
||||
click object with (!clickme:#AR|#VR e.g.)
|
||||
|
||||
◻
|
||||
│
|
||||
└── apply the roundrobin (rotate the options, value `#AR` becomes `#VR` upon next click)
|
||||
└── is there any object with property-key (`#AR` e.g.)?
|
||||
└── no: just update the URL to `#AR`
|
||||
└── yes: apply its value to the scene, and update the URL to `#AR`
|
||||
|
||||
click object with (`!clickme`:`!foo|!bar|!flop` e.g.)
|
||||
|
||||
◻ │
|
||||
└── apply the roundrobin (rotate the options, value !foo becomes !bar
|
||||
upon next click) └── is there any object with property-key (!foo
|
||||
e.g.)? └── no: do nothing └── yes: apply its value to the scene ```
|
||||
|
||||
|
||||
|
||||
van Kammen Expires 31 March 2025 [Page 6]
|
||||
|
||||
Internet-Draft XR Macros September 2024
|
||||
|
||||
|
||||
| Note that only macro's can trigger roundrobin values or
|
||||
| contextmenu's, as well as roundrobin values never ending up in the
|
||||
| toplevel URL.
|
||||
|
||||
5. Security Considerations
|
||||
|
||||
6. IANA Considerations
|
||||
|
||||
This document has no IANA actions.
|
||||
|
||||
7. Acknowledgments
|
||||
|
||||
* NLNET (https://nlnet.nl)
|
||||
* Future of Text (https://futureoftext.org)
|
||||
* visual-meta.info (https://visual-meta.info)
|
||||
|
||||
8. Appendix: Definitions
|
||||
|
||||
+===============+===================================================+
|
||||
| definition | explanation |
|
||||
+===============+===================================================+
|
||||
| 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. |
|
||||
+---------------+---------------------------------------------------+
|
||||
| XR fragments | URI Fragment with spatial hints like |
|
||||
| | #pos=0,0,0&t=1,100 e.g. |
|
||||
+---------------+---------------------------------------------------+
|
||||
| query | an URI Fragment-operator which queries |
|
||||
| | object(s) from a scene like #q=cube |
|
||||
+---------------+---------------------------------------------------+
|
||||
| FPS | frames per second in spatial experiences |
|
||||
| | (games,VR,AR e.g.), should be as high as |
|
||||
| | possible |
|
||||
+---------------+---------------------------------------------------+
|
||||
| ◻ | 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 |
|
||||
+---------------+---------------------------------------------------+
|
||||
|
||||
Table 7
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
van Kammen Expires 31 March 2025 [Page 7]
|
||||
381
doc/RFC_XR_Macros.xml
Normal file
|
|
@ -0,0 +1,381 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
|
||||
<rfc version="3" ipr="trust200902" docName="draft-XRMACROS-leonvankammen-00" submissionType="IETF" category="info" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" indexInclude="true" consensus="true">
|
||||
|
||||
<front>
|
||||
<title>XR Macros</title><seriesInfo value="draft-XRMACROS-leonvankammen-00" stream="IETF" status="informational" name="XR-Macros"></seriesInfo>
|
||||
<author initials="L.R." surname="van Kammen" fullname="L.R. van Kammen"><organization></organization><address><postal><street></street>
|
||||
</postal></address></author><date/>
|
||||
<area>Internet</area>
|
||||
<workgroup>Internet Engineering Task Force</workgroup>
|
||||
|
||||
<abstract>
|
||||
<t>This draft offers a specification for embedding macros in existing 3D scenes/assets, to offer simple interactions and configure the renderer further.<br />
|
||||
|
||||
Together with URI Fragments, it allows for rich immersive experiences without the need of a complicated sandboxed scripting languages.</t>
|
||||
<t>Almost every idea in this document is demonstrated at <eref target="https://xrfragment.org">https://xrfragment.org</eref>, as this spec was created during the <eref target="https://xrfragment.org">XR Fragments</eref> spec.</t>
|
||||
</abstract>
|
||||
|
||||
</front>
|
||||
|
||||
<middle>
|
||||
|
||||
<section anchor="introduction"><name>Introduction</name>
|
||||
<t>How can we add more features to existing text & 3D scenes, without introducing new dataformats?<br />
|
||||
|
||||
Historically, there's many attempts to create the ultimate markuplanguage or 3D fileformat.<br />
|
||||
|
||||
Their lowest common denominator is: (co)authoring using plain text.<br />
|
||||
|
||||
Therefore, XR Macros allows us to enrich/connect existing dataformats, by offering a polyglot notation based on existing notations:<br />
|
||||
</t>
|
||||
|
||||
<ol spacing="compact">
|
||||
<li>getting/setting common used 3D properties using querystring- or JSON-notation</li>
|
||||
<li>targeting 3D properties using the lightweight query notation present in <eref target="https://xrfragment.org">XR Fragments</eref></li>
|
||||
</ol>
|
||||
<blockquote><t>NOTE: The chapters in this document are ordered from highlevel to lowlevel (technical) as much as possible</t>
|
||||
</blockquote></section>
|
||||
|
||||
<section anchor="core-principle"><name>Core principle</name>
|
||||
|
||||
<ol spacing="compact">
|
||||
<li>XR Macros use querystrings, but are HTML-agnostic (though pseudo-XR Fragment browsers <strong>can</strong> be implemented on top of HTML/Javascript).</li>
|
||||
<li>An XR Macro is 3D metadata which starts with '!' (<tt>!clickme: fog=0,10</tt> e.g.)</li>
|
||||
<li>Metadata-values can contain the <tt>|</tt> symbol to 🎲 roundrobin variable values (<tt>!toggleme: fog=0,10|fog=0,1000</tt> e.g.)</li>
|
||||
<li>XR Macros acts as simple eventhandlers for URI Fragments: they are automatically published on the (<eref target="https://xrfragment.org">XR Fragments</eref>) hashbus, to act as events (so more serious scripting languages can react to them as well).</li>
|
||||
<li>XR Macros can assign object metadata (<tt>!setlocal: foo=1</tt> writes <tt>foo:1</tt> metadata to the object containing the <tt>!setlocal</tt> metadata)</li>
|
||||
<li>XR Macros can assign global metadata (<tt>!setfoo: #foo=1</tt> writes <tt>foo:1</tt> metadata to the root scene-node)</li>
|
||||
</ol>
|
||||
<blockquote><t>These very simple principles allow for rich interactions and dynamic querying</t>
|
||||
</blockquote></section>
|
||||
|
||||
<section anchor="conventions-and-definitions"><name>Conventions and Definitions</name>
|
||||
<t>See appendix below in case certain terms are not clear.</t>
|
||||
</section>
|
||||
|
||||
<section anchor="list-of-xr-macros"><name>List of XR Macros</name>
|
||||
<t>(XR) Macros can be embedded in 3D assets/scenes.<br />
|
||||
|
||||
Macros enrich existing spatial content with a lowcode, limited logic-layer, by recursive (economic) use of the querystring syntax (which search engines and <eref target="https://xrfragment.org">XR Fragments</eref> already uses.<br />
|
||||
|
||||
This is done by allowing string/integer variables, and the <tt>|</tt> symbol to roundrobin variable values.<br />
|
||||
|
||||
Macros also act as events, so more serious scripting languages can react to them as well.<br />
|
||||
</t>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>key</th>
|
||||
<th>type</th>
|
||||
<th>example (JSON)</th>
|
||||
<th>function</th>
|
||||
<th>existing compatibility</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><tt>@bg</tt></td>
|
||||
<td>string</td>
|
||||
<td><tt>"@bg":"#cube"</tt></td>
|
||||
<td>bg: binds fog near/far based to cube x/y/z (anim) values</td>
|
||||
<td>custom property in 3D fileformats</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><tt>@fog</tt></td>
|
||||
<td>string</td>
|
||||
<td><tt>"@fog":"#cube"</tt></td>
|
||||
<td>fog: binds fog near/far based to cube x/y (anim) values</td>
|
||||
<td>custom property in 3D fileformats</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><tt>@scroll</tt></td>
|
||||
<td>string</td>
|
||||
<td><tt>"@scroll":"#cube"</tt></td>
|
||||
<td>texturescrolling: binds texture x/y/rot based to cube x/y/z (anim) values</td>
|
||||
<td>custom property in 3D fileformats</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><tt>@emissive</tt></td>
|
||||
<td>string</td>
|
||||
<td><tt>"@emissive":"#cube"</tt></td>
|
||||
<td>day/night/mood: binds material's emissive value to cube x/y/z (anim) values</td>
|
||||
<td>custom property in 3D fileformats</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<section anchor="usecase-click-object"><name>Usecase: click object</name>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>custom property</th>
|
||||
<th>value</th>
|
||||
<th>trigger when</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>!clickme</td>
|
||||
<td>bg=1,1,1&foo=2</td>
|
||||
<td>object clicked</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></section>
|
||||
|
||||
<section anchor="usecase-conditional-click-object"><name>Usecase: conditional click object</name>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>custom property</th>
|
||||
<th>value</th>
|
||||
<th>trigger when</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>#</td>
|
||||
<td>foo=1</td>
|
||||
<td>scene</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>!clickme</td>
|
||||
<td>q=foo>2&bg=1,1,1</td>
|
||||
<td>object clicked and foo > 2</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table><blockquote><t>when a user clicks an object with the custom properties above, it should set the backgroundcolor to <tt>1,1,1</tt> when <tt>foo</tt> is greater than <tt>2</tt> (see previous example)</t>
|
||||
</blockquote></section>
|
||||
|
||||
<section anchor="usecase-click-object-roundrobin"><name>Usecase: click object (roundrobin)</name>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>custom property</th>
|
||||
<th>value</th>
|
||||
<th>trigger when</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>!cycleme</td>
|
||||
<td>day|noon|night</td>
|
||||
<td>object clicked</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>day</td>
|
||||
<td>bg=1,1,1</td>
|
||||
<td>roundrobin</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>noon</td>
|
||||
<td>bg=0.5,0.5,0.5</td>
|
||||
<td>roundrobin</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>night</td>
|
||||
<td>bg=0,0,0&foo=2</td>
|
||||
<td>roundrobin</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table><blockquote><t>when a user clicks an object with the custom properties above, it should trigger either <tt>day</tt> <tt>noon</tt> or <tt>night</tt> in roundrobin fashion.</t>
|
||||
</blockquote></section>
|
||||
|
||||
<section anchor="usecase-click-object-or-uri-fragment-and-scene-load-trigger"><name>Usecase: click object or URI fragment, and scene load trigger</name>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>custom property</th>
|
||||
<th>value</th>
|
||||
<th>trigger when</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>#</td>
|
||||
<td>random</td>
|
||||
<td>scene loaded</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>#random</td>
|
||||
<td>random</td>
|
||||
<td>URL contains #random</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>!random</td>
|
||||
<td>day|noon|night</td>
|
||||
<td>#random, # or click</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>day</td>
|
||||
<td>bg=1,1,1</td>
|
||||
<td>roundrobin</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>noon</td>
|
||||
<td>bg=0.5,0.5,0.5</td>
|
||||
<td>roundrobin</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>night</td>
|
||||
<td>bg=0,0,0&foo=2</td>
|
||||
<td>roundrobin</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></section>
|
||||
|
||||
<section anchor="usecase-present-context-menu-with-options"><name>Usecase: present context menu with options</name>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>custom property</th>
|
||||
<th>value</th>
|
||||
<th>trigger when</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>!random</td>
|
||||
<td>!day</td>
|
||||
<td>!noon</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>!day</td>
|
||||
<td>bg=1,1,1</td>
|
||||
<td>clicked in contextmenu</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>!noon</td>
|
||||
<td>bg=0.5,0.5,0.5</td>
|
||||
<td>clicked in contextmenu</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>!night</td>
|
||||
<td>bg=0,0,0&foo=2</td>
|
||||
<td>clicked in contextmenu</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table><blockquote><t>When interacting with an object with more than one <tt>!</tt>-macro, the XR Browser should offer a contextmenu to execute a macro.</t>
|
||||
</blockquote><t>In a similar way, when <strong>any</strong> <tt>!</tt>-macro is present on the sceneroot, the XR Browser should offer a context-menu to execute those macro's.</t>
|
||||
</section>
|
||||
|
||||
<section anchor="event-bubble-flow"><name>Event Bubble-flow</name>
|
||||
<t>click object with (<tt>!clickme</tt>:<tt>AR</tt> or <tt>!clickme</tt>: <tt>!reset</tt> e.g.)</t>
|
||||
|
||||
<artwork><![CDATA[ ◻
|
||||
│
|
||||
└── does current object contain this property-key (`AR` or `!reset` e.g.)?
|
||||
└── no: is there any (root)object containing property `AR`
|
||||
└── yes: evaluate its (roundrobin) XR macro-value(s) (and exit)
|
||||
└── no: trigger URL: #AR
|
||||
]]>
|
||||
</artwork>
|
||||
<t>click object with (<tt>!clickme</tt>:<tt>#AR|#VR</tt> e.g.)</t>
|
||||
|
||||
<artwork><![CDATA[ ◻
|
||||
│
|
||||
└── apply the roundrobin (rotate the options, value `#AR` becomes `#VR` upon next click)
|
||||
└── is there any object with property-key (`#AR` e.g.)?
|
||||
└── no: just update the URL to `#AR`
|
||||
└── yes: apply its value to the scene, and update the URL to `#AR`
|
||||
|
||||
click object with (`!clickme`:`!foo|!bar|!flop` e.g.)
|
||||
]]>
|
||||
</artwork>
|
||||
<t>◻
|
||||
│<br />
|
||||
└── apply the roundrobin (rotate the options, value <tt>!foo</tt> becomes <tt>!bar</tt> upon next click)
|
||||
└── is there any object with property-key (<tt>!foo</tt> e.g.)?
|
||||
└── no: do nothing
|
||||
└── yes: apply its value to the scene
|
||||
```</t>
|
||||
<blockquote><t>Note that only macro's can trigger roundrobin values or contextmenu's, as well as roundrobin values never ending up in the toplevel URL.</t>
|
||||
</blockquote></section>
|
||||
</section>
|
||||
|
||||
<section anchor="security-considerations"><name>Security Considerations</name>
|
||||
</section>
|
||||
|
||||
<section anchor="iana-considerations"><name>IANA Considerations</name>
|
||||
<t>This document has no IANA actions.</t>
|
||||
</section>
|
||||
|
||||
<section anchor="acknowledgments"><name>Acknowledgments</name>
|
||||
|
||||
<ul spacing="compact">
|
||||
<li><eref target="https://nlnet.nl">NLNET</eref></li>
|
||||
<li><eref target="https://futureoftext.org">Future of Text</eref></li>
|
||||
<li><eref target="https://visual-meta.info">visual-meta.info</eref></li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section anchor="appendix-definitions"><name>Appendix: Definitions</name>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>definition</th>
|
||||
<th>explanation</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>scene</td>
|
||||
<td>a (local/remote) 3D scene or 3D file (index.gltf e.g.)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>3D object</td>
|
||||
<td>an object inside a scene characterized by vertex-, face- and customproperty data.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>XR fragments</td>
|
||||
<td>URI Fragment with spatial hints like <tt>#pos=0,0,0&t=1,100</tt> e.g.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>query</td>
|
||||
<td>an URI Fragment-operator which queries object(s) from a scene like <tt>#q=cube</tt></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>FPS</td>
|
||||
<td>frames per second in spatial experiences (games,VR,AR e.g.), should be as high as possible</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><tt>◻</tt></td>
|
||||
<td>ascii representation of an 3D object/mesh</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>(un)obtrusive</td>
|
||||
<td>obtrusive: wrapping human text/thought in XML/HTML/JSON obfuscates human text into a salad of machine-symbols and words</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></section>
|
||||
|
||||
</middle>
|
||||
|
||||
</rfc>
|
||||
350
doc/awkdown
|
|
@ -1,350 +0,0 @@
|
|||
#!/usr/bin/env -S awk -f
|
||||
|
||||
BEGIN {
|
||||
in_paragraph= 0
|
||||
in_blockquote= 0
|
||||
in_ul= 0
|
||||
ul_depth= 0
|
||||
in_ol= 0
|
||||
in_italics= 0
|
||||
in_bold= 0
|
||||
in_link= 0
|
||||
in_table= 0
|
||||
emitted= 0
|
||||
}
|
||||
|
||||
# Init lookahead
|
||||
FNR == 1 {
|
||||
getline nextline < FILENAME
|
||||
getline nextline < FILENAME
|
||||
}
|
||||
|
||||
# Drop setext header marks
|
||||
/^[=-]+$/ {
|
||||
getline
|
||||
getline nextline < FILENAME
|
||||
}
|
||||
|
||||
# Escape all ampersands (HTML rule)
|
||||
/&/ {
|
||||
gsub(/&/, "\\&", $0)
|
||||
}
|
||||
|
||||
# Restore ampersands part of HTML character escape
|
||||
/&[A-Za-z]{2,4};/ {
|
||||
gsub(/&/, "\\&", $0)
|
||||
}
|
||||
|
||||
# Escape less than (<) (HTML rule)
|
||||
/</ {
|
||||
gsub("<", "\\<", $0)
|
||||
}
|
||||
|
||||
# line break
|
||||
/^.*[ ]{2}$/ {
|
||||
sub( /[ ]{2}$/, "<br />", $0 )
|
||||
}
|
||||
|
||||
# block quote
|
||||
/^>/ {
|
||||
if( (! in_blockquote) && (! emitted) ) {
|
||||
print "<blockquote><p>"
|
||||
in_blockquote= 1
|
||||
in_paragraph= 1
|
||||
}
|
||||
sub(/^>[ ]*/, "", $0)
|
||||
}
|
||||
|
||||
# table
|
||||
/^[ ]*[|]/ {
|
||||
#print "<!-- table -->"
|
||||
if( ! in_table ) {
|
||||
print "<table>"
|
||||
in_table= 1
|
||||
in_paragraph= 1
|
||||
}
|
||||
if( match($0, /---/) )
|
||||
emitted= 1
|
||||
else if( match(nextline, /---/) ) {
|
||||
sub(/^[ ]*[|][ ]*/, "<tr><th>", $0)
|
||||
sub(/[ ]*[|][ ]*$/, "</th></tr>", $0)
|
||||
gsub(/[ ]*[|][ ]*/, "</th><th>", $0)
|
||||
} else {
|
||||
sub(/^[ ]*[|][ ]*/, "<tr><td>", $0)
|
||||
sub(/[ ]*[|][ ]*$/, "</td></tr>", $0)
|
||||
gsub(/[ ]*[|][ ]*/, "</td><td>", $0)
|
||||
}
|
||||
}
|
||||
|
||||
# ATX headers
|
||||
/^#/ {
|
||||
n= match($0, /^#+/)
|
||||
header_lvl= RLENGTH
|
||||
repl= sprintf("<h%d>", header_lvl)
|
||||
sub(/^#+ ?/, repl, $0)
|
||||
|
||||
repl= sprintf("</h%d>", header_lvl)
|
||||
if( match($0, /#+$/) )
|
||||
sub(/ ?#+$/, repl, $0)
|
||||
else
|
||||
sub(/$/, repl, $0)
|
||||
print
|
||||
emitted= 1
|
||||
}
|
||||
|
||||
# unordered list
|
||||
/^[ ]*[*+-] / {
|
||||
uld= match($0, /[*+-]/)
|
||||
if( uld > ul_depth ) {
|
||||
sub(/^[ ]*[*+-][ ]*/, "<ul><li>", $0)
|
||||
in_ul++
|
||||
in_paragraph= 1
|
||||
} else if( uld < ul_depth ) {
|
||||
sub(/^[ ]*[*+-][ ]*/, "</ul><li>", $0)
|
||||
in_ul--
|
||||
} else {
|
||||
sub(/^[ ]*[*+-][ ]*/, "<li>", $0)
|
||||
}
|
||||
ul_depth= uld
|
||||
|
||||
uld= match(nextline, /[*+-]/)
|
||||
if( uld <= ul_depth ) {
|
||||
sub(/$/, "</li>", $0)
|
||||
}
|
||||
}
|
||||
|
||||
# ordered list
|
||||
/^(([0-9]+)|([A-Za-z])|([iIvVxXlL]{1,4}))[.]/ {
|
||||
t= "1"
|
||||
if( $0 ~ /[ivxl]+[.]/ ) {
|
||||
t= "i"
|
||||
sub(/^[ivxl]{1,4}[.][ ]*/, "<li>", $0)
|
||||
} else if( $0 ~ /[IVXL]+[.]/ ) {
|
||||
t= "I"
|
||||
sub(/^[IVXL]{1,4}[.][ ]*/, "<li>", $0)
|
||||
} else if( $0 ~ /^[A-Z]./ ) {
|
||||
t= "A"
|
||||
sub(/^[A-Z][.][ ]*/, "<li>", $0)
|
||||
} else if( $0 ~ /^[a-z]./ ) {
|
||||
t= "a"
|
||||
sub(/^[a-z][.][ ]*/, "<li>", $0)
|
||||
} else {
|
||||
sub(/^[0-9]+[.][ ]*/, "<li>", $0)
|
||||
}
|
||||
if( ! in_ol ) {
|
||||
printf("<ol type=\"%s\">\n", t)
|
||||
in_ol= 1
|
||||
in_paragraph= 1
|
||||
}
|
||||
sub(/$/, "</li>", $0)
|
||||
}
|
||||
|
||||
# Links
|
||||
/\[.*\]\(.*\)/ {
|
||||
in_link= 1
|
||||
s = ""
|
||||
if( match($0, /(\[.*\])(\(.*)( ".*"\))/, tla) ) {
|
||||
l= substr(tla[2], 2)
|
||||
match(tla[3], /".*"/)
|
||||
a= substr(tla[3], RSTART, RLENGTH)
|
||||
match(tla[1], /\[.*\]/)
|
||||
t= substr(tla[1], RSTART+1, RLENGTH-2)
|
||||
s= sprintf("<a href=\"%s\" alt=%s>%s</a>", l, a, t)
|
||||
} else if( match($0, /(\[.*\])(\(.*\))/, tl) ) {
|
||||
match(tl[2], /\(.*\)/)
|
||||
l= substr(tl[2], RSTART+1, RLENGTH-2)
|
||||
match(tl[1], /\[.*\]/)
|
||||
t= substr(tl[1], RSTART+1, RLENGTH-2)
|
||||
s= sprintf("<a href=\"%s\">%s</a>", l, t)
|
||||
}
|
||||
sub(/\[.*\)/, s)
|
||||
}
|
||||
|
||||
# bold
|
||||
/[*_][*_]/ {
|
||||
if( !in_link && !in_codeblock && !in_code ) {
|
||||
while( $0 ~ /[*_][*_]/ ) {
|
||||
if( ! in_bold ) {
|
||||
sub(/[*_][*_]/, "<b>", $0)
|
||||
in_bold= 1
|
||||
} else {
|
||||
sub(/[*_][*_]/, "</b>", $0)
|
||||
in_bold= 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# italics
|
||||
/[*_]/ {
|
||||
if( !in_link && !in_codeblock && !in_code ) {
|
||||
while( $0 ~ /[*_]/ ) {
|
||||
if( ! in_italics ) {
|
||||
sub(/[*_]/, "<i>", $0)
|
||||
in_italics= 1
|
||||
} else {
|
||||
sub(/[*_]/, "</i>", $0)
|
||||
in_italics= 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# strikethrough
|
||||
/~~/ {
|
||||
if( !in_link && !in_codeblock && !in_code ) {
|
||||
while( $0 ~ /~~/ ) {
|
||||
if( ! in_strike ) {
|
||||
sub(/~~/, "<strike>", $0)
|
||||
in_strike= 1
|
||||
} else {
|
||||
sub(/~~/, "</strike>", $0)
|
||||
in_strike= 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# code block
|
||||
/^```/ {
|
||||
if( ! in_codeblock ) {
|
||||
sub(/```/, "<pre>", $0)
|
||||
in_codeblock= 1
|
||||
} else {
|
||||
sub(/```/, "</pre>", $0)
|
||||
in_codeblock= 0
|
||||
}
|
||||
}
|
||||
|
||||
# code in text
|
||||
/`/ {
|
||||
if( !in_link ) {
|
||||
while( $0 ~ /`/ ) {
|
||||
if( ! in_code ) {
|
||||
sub(/`/, "<code>", $0)
|
||||
in_code= 1
|
||||
} else {
|
||||
sub(/`/, "</code>", $0)
|
||||
in_code= 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# empty line
|
||||
/^$/ {
|
||||
if( in_blockquote && (! match(nextline, /^>/)) ) {
|
||||
print "</p></blockquote>"
|
||||
in_blockquote= 0
|
||||
in_paragraph= 0
|
||||
}
|
||||
|
||||
if( in_table ) {
|
||||
print "</table>"
|
||||
in_table= 0
|
||||
in_paragraph= 0
|
||||
}
|
||||
|
||||
if( in_ul ) {
|
||||
while( in_ul > 0 ) {
|
||||
print "</ul>"
|
||||
in_ul--
|
||||
}
|
||||
ul_depth= 0
|
||||
in_paragraph= 0
|
||||
}
|
||||
|
||||
if( in_ol ) {
|
||||
print "</ol>"
|
||||
in_ol= 0
|
||||
in_paragraph= 0
|
||||
}
|
||||
|
||||
if( in_italics ) {
|
||||
print "</i>"
|
||||
in_italics= 0
|
||||
}
|
||||
|
||||
if( in_bold ) {
|
||||
print "</b>"
|
||||
in_bold= 0
|
||||
}
|
||||
|
||||
if( in_paragraph ) {
|
||||
print "</p>"
|
||||
in_paragraph= 0
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# paragraph and/or setext header
|
||||
$0 !~ /^$/ {
|
||||
|
||||
if( match(nextline, /^[=]+$/) ) {
|
||||
printf("<h1>%s</h1>\n", $0)
|
||||
emitted= 1
|
||||
}
|
||||
|
||||
if( match(nextline, /^[-]+$/) ) {
|
||||
printf("<h2>%s</h2>\n", $0)
|
||||
emitted= 1
|
||||
}
|
||||
|
||||
if( (! in_paragraph) && (! emitted) ) {
|
||||
print "<p>"
|
||||
in_paragraph= 1
|
||||
}
|
||||
}
|
||||
|
||||
# Finally: print the line
|
||||
{
|
||||
if( ! emitted )
|
||||
print
|
||||
emitted= 0
|
||||
getline nextline < FILENAME
|
||||
}
|
||||
|
||||
END {
|
||||
if( in_table ) {
|
||||
print "</table>"
|
||||
in_paragraph= 0
|
||||
}
|
||||
|
||||
if( in_ul ) {
|
||||
print "</ul>"
|
||||
in_paragraph= 0
|
||||
}
|
||||
|
||||
if( in_ol ) {
|
||||
print "</ol>"
|
||||
in_paragraph= 0
|
||||
}
|
||||
|
||||
if( in_blockquote ) {
|
||||
print "</p></blockquote>"
|
||||
in_paragraph= 0
|
||||
}
|
||||
|
||||
if( in_italics ) {
|
||||
print "</i>"
|
||||
in_italics= 0
|
||||
}
|
||||
|
||||
if( in_bold ) {
|
||||
print "</b>"
|
||||
in_bold= 0
|
||||
}
|
||||
|
||||
if( in_strike ) {
|
||||
print "</strike>"
|
||||
in_code= 0
|
||||
}
|
||||
|
||||
if( in_code ) {
|
||||
print "</code>"
|
||||
in_code= 0
|
||||
}
|
||||
|
||||
if( in_paragraph )
|
||||
print "</p>"
|
||||
}
|
||||
|
|
@ -1,24 +1,10 @@
|
|||
#!/bin/sh
|
||||
set -xe
|
||||
FILE=RFC_XR_Fragments
|
||||
set -e
|
||||
|
||||
LOGO='
|
||||
▄ ▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄ ▄▄▄▄▄▄
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▄▄▄ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓▄▄▄▄▄ ▓▄▄▄▄▄
|
||||
▄▀▀▀▀▀▄ ▒ ▒ ▒▀▀▀ ▒ ▒ ▒▀▀▀▀▀▒ ▒ ▒ ▒ ▒ ▒▄▄▄▄▄▒ ▒ ▒ ▒ ▒
|
||||
░ ░ ░ ░ ░ ░ ░ ░▄▄▄▄░ ░ ░ ░▄▄▄▄▄▄ ░ ░ ░▄▄▄▄▄ ▄▄▄▄▄░
|
||||
|
||||
'
|
||||
|
||||
# to update HTML surf to http://localhost:8080/#📃 All-in-one-spec
|
||||
# and hit 'export tiddler' > html (save to RFC_XR_Fragments.html)
|
||||
{
|
||||
echo "$LOGO";
|
||||
lynx -width 600 -dump ${FILE}.html \
|
||||
| sed 's|file:.*/||g' \
|
||||
| sed 's|.*\(BUTTON\).*$||g' \
|
||||
| sed 's|^[ ]\+\([a-zA-Z0-9]\)|\1|g'
|
||||
} > ${FILE}.txt
|
||||
|
||||
#TEXT=1 ./meta.awk ${FILE}.md > ${FILE}.txt
|
||||
#HTML=1 ./meta.awk html/template.html > ${FILE}.html
|
||||
for topic in Fragments Macros; do
|
||||
mmark RFC_XR_$topic.md > RFC_XR_$topic.xml
|
||||
mmark --html RFC_XR_$topic.md | grep -vE '(<!--{|}-->)' > RFC_XR_$topic.html
|
||||
xml2rfc --v3 RFC_XR_$topic.xml # RFC_XR_$topic.txt
|
||||
sed -i 's/Expires: .*//g' RFC_XR_$topic.txt
|
||||
convert -size 700x2400 xc:white -font "FreeMono" +antialias -pointsize 12 -fill black -annotate +15+15 "@RFC_XR_Fragments.txt" -colorspace gray +dither -posterize 6 RF6_XR_Fragments.png
|
||||
done
|
||||
|
|
|
|||
|
|
@ -1,52 +0,0 @@
|
|||
<style type="text/css">
|
||||
body{
|
||||
font-family: monospace;
|
||||
max-width: 1000px;
|
||||
font-size: 15px;
|
||||
padding: 0% 10%;
|
||||
line-height: 30px;
|
||||
color:#555;
|
||||
background:#F7F7F7;
|
||||
}
|
||||
h1 { margin-top:40px; }
|
||||
pre{ line-height:18px; }
|
||||
a,a:visited,a:active{ color: #70f; }
|
||||
code{
|
||||
border: 1px solid #AAA;
|
||||
border-radius: 3px;
|
||||
padding: 0px 5px 2px 5px;
|
||||
}
|
||||
|
||||
pre{
|
||||
line-height: 18px;
|
||||
overflow: auto;
|
||||
padding: 12px;
|
||||
}
|
||||
pre + code {
|
||||
background:#DDD;
|
||||
}
|
||||
pre>code{
|
||||
border:none;
|
||||
border-radius:0px;
|
||||
padding:0;
|
||||
}
|
||||
blockquote{
|
||||
padding-left: 30px;
|
||||
margin: 0;
|
||||
border-left: 5px solid #CCC;
|
||||
}
|
||||
th {
|
||||
border-bottom: 1px solid #000;
|
||||
text-align: left;
|
||||
padding-right:45px;
|
||||
padding-left:7px;
|
||||
background: #DDD;
|
||||
}
|
||||
|
||||
td {
|
||||
border-bottom: 1px solid #CCC;
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
<html>
|
||||
<title>XR Fragments spec</title>
|
||||
<body>
|
||||
% system("cat html/style.css")
|
||||
% system("./meta.awk RFC_XR_Fragments.md > /tmp/out")
|
||||
% system("cat /tmp/out | ./awkdown")
|
||||
</body>
|
||||
</html>
|
||||
33
doc/meta.awk
|
|
@ -1,33 +0,0 @@
|
|||
#!/usr/bin/env -S awk -f
|
||||
# see https://codeberg.org/coderofsalvation/meta.awk.lua
|
||||
BEGIN {
|
||||
trigger = (ARGC > 2) ? ARGV[2] : "%";
|
||||
delete ARGV[2];
|
||||
cmd = "mktemp"
|
||||
cmd | getline generator
|
||||
close(cmd)
|
||||
print "BEGIN {" > generator;
|
||||
trigger_esc = trigger;
|
||||
gsub(/[[\]{}()*+?^$|.\\]/, "\\\\&", trigger_esc);
|
||||
pattern = trigger_esc ;
|
||||
}
|
||||
|
||||
{
|
||||
if ($0 ~ "(^|[ ])" trigger_esc) {
|
||||
line = $0;
|
||||
sub(".*"pattern, "", line);
|
||||
print line >> generator;
|
||||
} else {
|
||||
gsub(/\\/, "\\\\", $0);
|
||||
gsub(/"/, "\\\"", $0);
|
||||
print "print \"" $0 "\"" >> generator;
|
||||
}
|
||||
}
|
||||
|
||||
END {
|
||||
if (NR > 0) {
|
||||
print "}" >> generator;
|
||||
system("awk -f " generator " ; rm " generator);
|
||||
}
|
||||
}
|
||||
|
||||
3
doc/notes/prio.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
\#static allow client to ignore lower-prio objects in the renderloop, to compensate frame-drop/cpu/gpu-overload scenario’s
|
||||
|
||||
Q: should `-` be used to indicate 'lowering' priority (css's `z-index` 0-??? range is a bit confusing in that sense)
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
{ pkgs ? import <nixos-unstable> {} } :
|
||||
{
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
foo = pkgs.mkShell {
|
||||
pkgs.mkShell {
|
||||
# nativeBuildInputs is usually what you want -- tools you need to run
|
||||
nativeBuildInputs = with pkgs.buildPackages; [
|
||||
|
||||
wkhtmltopdf
|
||||
lynx
|
||||
];
|
||||
};
|
||||
mmark
|
||||
xml2rfc
|
||||
wkhtmltopdf-bin
|
||||
imagemagick
|
||||
|
||||
];
|
||||
}
|
||||
|
|
|
|||
489
doc/style.css
Normal file
|
|
@ -0,0 +1,489 @@
|
|||
:root {
|
||||
--color-a: black;
|
||||
--color-at: #000000CC;
|
||||
--color-b: #222;
|
||||
--color-c: #444;
|
||||
--color-d: #888;
|
||||
--color-e: #FF0;
|
||||
--color-f: #CCC;
|
||||
--color-g: #FFF;
|
||||
--color-gt: #FFF5;
|
||||
--params-width: 320px;
|
||||
--font-1: 'Montserrat', sans-serif;
|
||||
--font-2: monospace, courier;
|
||||
--font-size-1: 57px;
|
||||
--font-size-2: 26px;
|
||||
--font-size-3: 18px;
|
||||
--font-size-4: 15px;
|
||||
--gutter-1: 10%;
|
||||
--gradient-1: linear-gradient(45deg, #dc2454 0%, #944a9d 51%, #4824dc 100%);
|
||||
--gradient-2: linear-gradient(45deg, #dc2454 0%, #944a9d 21%, #4824dc 50%,#dc2454 70%, #944a9d 88%, #4824dc 100%);
|
||||
}
|
||||
|
||||
body>h1:nth-child(1) {
|
||||
display:none;
|
||||
}
|
||||
|
||||
body{
|
||||
position:relative;
|
||||
width:100%;
|
||||
height:100vh;
|
||||
color: var(--color-d);
|
||||
line-height: 38px;
|
||||
margin:0;
|
||||
padding:0;
|
||||
font-size: var(--font-size-3);
|
||||
}
|
||||
|
||||
* {
|
||||
font-family: var(--font-1);
|
||||
font-size: var(--font-size-3);
|
||||
font-weight:500;
|
||||
color: var(--color-c);
|
||||
}
|
||||
|
||||
img,
|
||||
.img{
|
||||
image-rendering: -webkit-optimize-contrast;
|
||||
}
|
||||
|
||||
#jumbotron{
|
||||
margin-top:50px;
|
||||
}
|
||||
|
||||
b{
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: var(--color-c);
|
||||
font-size: var(--font-size-1);
|
||||
font-weight:700;
|
||||
margin: 0;
|
||||
line-height: 11vh;
|
||||
padding-right:40px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: var(--font-size-2);
|
||||
font-weight:400;
|
||||
padding-right:40px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
background-image: var(--gradient-1);
|
||||
color: var(--color-g);
|
||||
display:inline;
|
||||
border-radius: 5px;
|
||||
padding: 2px 10px 2px 10px;
|
||||
font-weight: 600;
|
||||
font-size: var(--font-size-4);
|
||||
text-transform:uppercase;
|
||||
white-space:nowrap;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 700px) {
|
||||
body {
|
||||
font-size: var(--font-size-3);
|
||||
line-height: 40px;
|
||||
}
|
||||
svg.img{
|
||||
transform: scale(0.8);
|
||||
}
|
||||
.content{
|
||||
padding-top: 60px;
|
||||
margin-left: 27px !important;
|
||||
padding-right: 54px !important;
|
||||
}
|
||||
.heading{
|
||||
transform:scale(0.7);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
table {
|
||||
border:none;
|
||||
box-shadow: 0px 0px 10px #0005;
|
||||
padding:20px;
|
||||
background: transparent !important;
|
||||
border-radius:4px;
|
||||
}
|
||||
table tr td,
|
||||
table tr th {
|
||||
vertical-align:top;
|
||||
text-align:left;
|
||||
border-bottom:1px solid #555;
|
||||
color: var(--color-d);
|
||||
}
|
||||
table tr td a:visited,
|
||||
table tr td a:active,
|
||||
table tr td a{
|
||||
color: var(--color-e);
|
||||
}
|
||||
table tr:last-child td{
|
||||
border:none;
|
||||
}
|
||||
table tr th {
|
||||
border-bottom:2px solid var(--color-d);
|
||||
}
|
||||
|
||||
code{
|
||||
display: inline-block;
|
||||
unicode-bidi: embed;
|
||||
font-family: monospace;
|
||||
white-space: pre;
|
||||
background: var(--color-c);
|
||||
margin-bottom: 5px;
|
||||
padding: 0px 5px;
|
||||
font-size:16px;
|
||||
}
|
||||
|
||||
.content {
|
||||
height:99vh;
|
||||
max-width: 50em;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
padding-top:25px;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
|
||||
a,a:visited,a:active{
|
||||
color: var(--color-a);
|
||||
display:inline-block;
|
||||
text-decoration:none;
|
||||
}
|
||||
a:hover{
|
||||
opacity:0.9;
|
||||
}
|
||||
|
||||
/* lato-regular - latin */
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url('/assets/font/lato-v17-latin-regular.eot'); /* IE9 Compat Modes */
|
||||
src: local(''),
|
||||
url('/assets/font/lato-v17-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
||||
url('/assets/font/lato-v17-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
|
||||
url('/assets/font/lato-v17-latin-regular.woff') format('woff'), /* Modern Browsers */
|
||||
url('/assets/font/lato-v17-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
|
||||
url('/assets/font/lato-v17-latin-regular.svg#Lato') format('svg'); /* Legacy iOS */
|
||||
}
|
||||
|
||||
#sidemenu {
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
}
|
||||
|
||||
#sidemenu nav {
|
||||
width: 300px;
|
||||
box-shadow: 0px 0px 8px #0005;
|
||||
background:#FFF;
|
||||
z-index:10;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 99;
|
||||
height:100vh;
|
||||
}
|
||||
#sidemenu .sidemenu__btn {
|
||||
display: block;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
top:20px;
|
||||
left:20px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
#sidemenu .sidemenu__btn span {
|
||||
display: block;
|
||||
width: 30px;
|
||||
height: 3px;
|
||||
margin: auto;
|
||||
background:var(--color-d);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
-webkit-transition: all .4s ease;
|
||||
transition: all .4s ease;
|
||||
}
|
||||
#sidemenu .sidemenu__btn span.top {
|
||||
-webkit-transform: translateY(-8px);
|
||||
transform: translateY(-8px);
|
||||
}
|
||||
#sidemenu .sidemenu__btn span.bottom {
|
||||
-webkit-transform: translateY(8px);
|
||||
transform: translateY(8px);
|
||||
}
|
||||
#sidemenu .sidemenu__btn.active .top {
|
||||
-webkit-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
#sidemenu .sidemenu__btn.active .mid {
|
||||
-webkit-transform: translateX(-20px) rotate(360deg);
|
||||
transform: translateX(-20px) rotate(360deg);
|
||||
opacity: 0;
|
||||
}
|
||||
#sidemenu .sidemenu__btn.active .bottom {
|
||||
-webkit-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
#sidemenu .sidemenu__wrapper {
|
||||
padding-top: 70px;
|
||||
margin-left:20px;
|
||||
}
|
||||
#sidemenu .sidemenu__list {
|
||||
overflow-y: scroll;
|
||||
max-height: 73vh;
|
||||
padding-top: 50px;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
#sidemenu .sidemenu__item {
|
||||
padding: 0;
|
||||
}
|
||||
#sidemenu li > a {
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
-webkit-transition: .4s ease;
|
||||
transition: .4s ease;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
nav {
|
||||
-webkit-transition: .2s ease;
|
||||
transition: .2s ease;
|
||||
-webkit-transform: translateX(0px);
|
||||
transform: translateX(0px);
|
||||
opacity:1;
|
||||
}
|
||||
|
||||
nav.hide {
|
||||
-webkit-transform: translateX(-300px);
|
||||
transform: translateX(-300px);
|
||||
opacity:0;
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
margin-left:30px !important;
|
||||
margin-top: 35px !important;
|
||||
margin-bottom: 35px !important;
|
||||
}
|
||||
ul:nth-child(1){
|
||||
margin:0;
|
||||
}
|
||||
|
||||
ul,li{
|
||||
text-decoration:none !important;
|
||||
/*list-style:none;*/
|
||||
padding-left:10px;
|
||||
padding-right:10px;
|
||||
}
|
||||
|
||||
li > a,
|
||||
li > a.visited,
|
||||
li > a.active{
|
||||
color:#555;
|
||||
padding:5px;
|
||||
}
|
||||
li > b {
|
||||
background:#FFF;
|
||||
padding:5px;
|
||||
}
|
||||
|
||||
.sidemenu__list > li,
|
||||
.sidemenu__list > ul > li{
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
ul > li {
|
||||
display:block;
|
||||
}
|
||||
|
||||
.content ul > li::before {content: "•"; padding-right:10px;color: #54F;}
|
||||
|
||||
li > b {
|
||||
font-weight:100;
|
||||
}
|
||||
|
||||
.touchscreen {
|
||||
border:30px solid #aab5bb;
|
||||
border-radius:20px;
|
||||
position:relative;
|
||||
}
|
||||
.touchscreen:after {
|
||||
content:"";
|
||||
display:block;
|
||||
position:absolute;
|
||||
border-radius:50%;
|
||||
width:15px;
|
||||
height:15px;
|
||||
background:#FFF;
|
||||
top:136px;
|
||||
right:-22px;
|
||||
|
||||
}
|
||||
|
||||
div.pretty{
|
||||
border-radius: 4px;
|
||||
display: block;
|
||||
background: #372e42;
|
||||
overflow-x: scroll;
|
||||
white-space:pre-wrap;
|
||||
color:#65e;
|
||||
}
|
||||
|
||||
code.pretty,
|
||||
div.pretty > pre > code{
|
||||
background: -webkit-linear-gradient(-70deg,#98a7f0,#0d4e50);
|
||||
background-clip: border-box;
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
border: none;
|
||||
text-shadow: 0px 0px 5px #fff9;
|
||||
filter: brightness(1.8);
|
||||
font-size:14px;
|
||||
width:98%;
|
||||
padding:0px 15px;
|
||||
margin:0;
|
||||
box-sizing:border-box;
|
||||
line-height:20px;
|
||||
}
|
||||
|
||||
blockquote{
|
||||
box-sizing: border-box;
|
||||
background: transparent !important;
|
||||
border-radius: 7px;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
margin: 30px 0px 20px 0px;
|
||||
color: var(--color-f) !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
blockquote a {
|
||||
color:#000 !important;
|
||||
}
|
||||
blockquote a:hover {
|
||||
color:#FFF !important;
|
||||
background:#000;
|
||||
}
|
||||
|
||||
img {
|
||||
width:100%;
|
||||
filter: brightness(0.97)
|
||||
}
|
||||
|
||||
/* GRID SYSTEM */
|
||||
.block{
|
||||
display: block;
|
||||
text-align: left;
|
||||
margin-bottom: var(--gutter-1);
|
||||
min-height:55vh;
|
||||
}
|
||||
|
||||
.block .img{
|
||||
border-radius:15px;
|
||||
width:100%;
|
||||
height:35vh;
|
||||
margin-bottom:15px;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
p{ margin:0; padding:0; }
|
||||
|
||||
//the grid:
|
||||
|
||||
.grid{
|
||||
width: 90%;
|
||||
max-width: 900px;
|
||||
margin: 0 auto;
|
||||
background-color: $grid-color;
|
||||
//just for styling:
|
||||
padding-top: var(--gutter-1);
|
||||
}
|
||||
|
||||
.gutter{
|
||||
/*
|
||||
margin-left: calc( var(--gutter-1) /2 );
|
||||
margin-right: calc( var(--gutter-1) /2 );
|
||||
*/
|
||||
margin-right: var(--gutter-1);
|
||||
}
|
||||
|
||||
.col-33{
|
||||
width: 33.3%;
|
||||
float: left;
|
||||
}
|
||||
.col-50{
|
||||
width: 50%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.clear{
|
||||
clear: both;
|
||||
display: block;
|
||||
}
|
||||
|
||||
//responsive
|
||||
|
||||
@media all and (max-width:800px) {
|
||||
.col-33{
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (max-width:600px) {
|
||||
.col-50, .col-33{
|
||||
width: 100%;
|
||||
float: none;
|
||||
}
|
||||
h1 {
|
||||
font-size: 50px;
|
||||
line-height:70px;
|
||||
}
|
||||
h2{
|
||||
font-size: var(--font-size-3);
|
||||
}
|
||||
.block.gutter{
|
||||
margin-right:0;
|
||||
}
|
||||
}
|
||||
|
||||
.darken{
|
||||
filter: brightness(0.8);
|
||||
}
|
||||
|
||||
button{
|
||||
cursor:pointer;
|
||||
padding: 10px;
|
||||
border-radius: 6px;
|
||||
background-image: var(--gradient-1);
|
||||
border: none;
|
||||
border-radius: 20px;
|
||||
display:inline-block;
|
||||
color: #FFF;
|
||||
border: none;
|
||||
opacity:1.0;
|
||||
font-size: var(--font-size-4);
|
||||
font-weight:600;
|
||||
}
|
||||
button:hover{
|
||||
opacity:0.8;
|
||||
}
|
||||
|
||||
.gradient{
|
||||
background-image: var(--gradient-2);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
1
doc/tags
|
|
@ -1 +0,0 @@
|
|||
/home/leon/.ctags.js
|
||||
1
example/aframe/export/assets
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../assets
|
||||
1
example/aframe/export/dist
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../dist
|
||||
BIN
example/aframe/export/equirect.jpg
Normal file
|
After Width: | Height: | Size: 153 KiB |
1
example/aframe/export/index.glb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
assets/index.glb
|
||||
115
example/aframe/export/index.html
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>XR Fragments aframe exporter</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
|
||||
<!-- AFRAME v1.5.0 + extra THREE.js extra loaders -->
|
||||
<script src="./../../../dist/aframe.min.js"></script>
|
||||
<script src="./../../../dist/xrfragment.aframe.js"></script>
|
||||
|
||||
<!-- environment component -->
|
||||
<script src="https://unpkg.com/aframe-environment-component@1.3.3/dist/aframe-environment-component.min.js"></script>
|
||||
|
||||
<!-- important: allow touchevents in AR -->
|
||||
<style type="text/css"> canvas.a-dom-overlay:not(.a-no-style) { padding: 0; pointer-events: auto; }</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a-scene xr-mode-ui="XRMode: xr"
|
||||
renderer="colorManagement: true"
|
||||
device-orientation-permission-ui
|
||||
light="defaultLightsEnabled: true"
|
||||
xrf>
|
||||
|
||||
<a-entity xrf="#pos=place1" environment>
|
||||
|
||||
<a-entity id="place1">
|
||||
<a-plane position="0 0.01 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
|
||||
<a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9"></a-box>
|
||||
<a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere>
|
||||
<a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
|
||||
<a-box position="0 1.2 -2" depth="0.1" width="1.2" height="0.6" color="#222222" href="#pos=place2" billboard>
|
||||
<a-text value="click me" position="-0.4 0.02 0.1"></a-text>
|
||||
</a-box>
|
||||
</a-entity>
|
||||
|
||||
<a-entity id="place2" position="0 0 3">
|
||||
<a-plane position="0 0.01 0" rotation="-90 0 0" width="4" height="4" color="#FF00FF"></a-plane>
|
||||
</a-entity>
|
||||
|
||||
</a-entity>
|
||||
|
||||
<a-entity id="player" movement-controls touch-controls wasd-controls="fly:false" look-controls="magicWindowTrackingEnabled:true">
|
||||
<a-entity camera="fov:90" position="0 1.6 0" id="camera"></a-entity>
|
||||
<a-entity id="left-hand" hand-tracking-grab-controls="hand:left;modelColor:#cccccc" raycaster="objects:.ray" blink-controls="cameraRig:#player; teleportOrigin: #camera; collisionEntities: .floor">
|
||||
<a-entity rotation="-35 0 0" position="0 0.1 0" id="navigator">
|
||||
<a-entity id="back" xrf-button="label: <; width:0.05; action: history.back()" position="-0.025 0 0" class="ray"></a-entity>
|
||||
<a-entity id="next" xrf-button="label: >; width:0.05; action: history.forward()" position=" 0.025 0 0" class="ray"></a-entity>
|
||||
</a-entity>
|
||||
</a-entity>
|
||||
<a-entity id="right-hand" hand-tracking-grab-controls="hand:right;modelColor:#cccccc" laser-controls="hand: right" raycaster="objects:.ray" blink-controls="cameraRig:#player; teleportOrigin: #camera; collisionEntities: .floor" xrf-pinchmove="rig: #player"></a-entity>
|
||||
</a-entity>
|
||||
|
||||
</a-scene>
|
||||
|
||||
<div class="menu">
|
||||
<b>WARNING:</b> this AFRAME-to-Model exporter is very incomplete<br><br>
|
||||
<button onclick="exportModel()">export to 3D model</button>
|
||||
</div>
|
||||
|
||||
<style type="text/css">
|
||||
.menu { position:fixed; width: 300px; height: 90px; background: #000; display: block; top: 0px; left: 0px; padding: 20px; color: #CCC; font-family: Arial; }
|
||||
</style>
|
||||
|
||||
<!-- billboarding component -->
|
||||
<script>
|
||||
AFRAME.registerComponent('billboard', {
|
||||
schema: {
|
||||
target: {type: 'string', default: 'camera'}
|
||||
},
|
||||
init: function () { },
|
||||
update: function () { },
|
||||
tick: function () {
|
||||
const targetEl = document.getElementById(this.data.target).object3D;
|
||||
const el = this.el.object3D;
|
||||
const vec = new THREE.Vector3();
|
||||
targetEl.getWorldDirection(vec);
|
||||
vec.y = 0;
|
||||
vec.add(el.position)
|
||||
el.lookAt(vec);
|
||||
}
|
||||
});
|
||||
|
||||
function exportModel(){
|
||||
function download(dataurl, filename) {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL( new Blob([dataurl]) );
|
||||
a.setAttribute("download", filename);
|
||||
a.click();
|
||||
return false;
|
||||
}
|
||||
// setup exporters
|
||||
let defaultExporter = THREE.GLTFExporter
|
||||
xrf.loaders['gltf'].exporter = defaultExporter
|
||||
xrf.loaders['glb'].exporter = defaultExporter
|
||||
const exporter = new THREE.GLTFExporter()
|
||||
exporter.parse(
|
||||
xrf.model.scene,
|
||||
function ( glb ) { download(glb, `index.glb`) }, // ready
|
||||
function ( error ) { console.error(error) }, // error
|
||||
{
|
||||
binary:true,
|
||||
onlyVisible: false,
|
||||
animations: xrf.model.animations,
|
||||
includeCustomExtensions: true,
|
||||
trs:true
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1
example/aframe/export/other.glb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../assets/other.glb
|
||||
1
example/aframe/sandbox/assets
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../assets
|
||||
1
example/aframe/sandbox/dist
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../dist
|
||||
1
example/aframe/sandbox/index.glb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
./../../assets/index.glb
|
||||
94
example/aframe/sandbox/index.html
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>XR Fragments aframe viewer</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
|
||||
<!-- AFRAME v1.5.0 + extra THREE.js extra loaders -->
|
||||
<script src="./../../../dist/aframe.min.js"></script>
|
||||
<script src="./../../../dist/xrfragment.aframe.js"></script>
|
||||
|
||||
<!-- important: allow touchevents in AR -->
|
||||
<style type="text/css">
|
||||
canvas.a-dom-overlay:not(.a-no-style) { padding: 0; pointer-events: auto; }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a-scene xr-mode-ui="XRMode: xr"
|
||||
renderer="colorManagement: false; stencil: true; antialias:true; highRefreshRate:true; foveationLevel: 0.5; toneMapping: ACESFilmic; exposure: 3.0"
|
||||
device-orientation-permission-ui xrf-gaze-always joystick
|
||||
light="defaultLightsEnabled: false">
|
||||
<a-entity id="player" movement-controls touch-controls="axis:y" wasd-controls="fly:true" look-controls="magicWindowTrackingEnabled:true">
|
||||
<a-entity camera="fov:90" position="0 1.6 0" id="camera"></a-entity>
|
||||
<a-entity id="left-hand" hand-tracking-grab-controls="hand:left;modelColor:#cccccc" raycaster="objects:.ray" blink-controls="cameraRig:#player; teleportOrigin: #camera; collisionEntities: .floor">
|
||||
<a-entity rotation="-35 0 0" position="0 0.1 0" id="navigator">
|
||||
<a-entity id="back" xrf-button="label: <; width:0.05; action: history.back()" position="-0.025 0 0" class="ray"></a-entity>
|
||||
<a-entity id="next" xrf-button="label: >; width:0.05; action: history.forward()" position=" 0.025 0 0" class="ray"></a-entity>
|
||||
</a-entity>
|
||||
</a-entity>
|
||||
<a-entity id="right-hand" hand-tracking-grab-controls="hand:right;modelColor:#cccccc" laser-controls="hand: right" raycaster="objects:.ray" blink-controls="cameraRig:#player; teleportOrigin: #camera; collisionEntities: .floor" xrf-pinchmove="rig: #player"></a-entity>
|
||||
</a-entity>
|
||||
|
||||
<a-entity id="home" xrf="./../../assets/index.glb"></a-entity>
|
||||
</a-scene>
|
||||
|
||||
<!-- OPTIONAL -->
|
||||
<!-- -->
|
||||
<!-- everything below is completely optional, but handy to add a quick menu / connectivity to your space -->
|
||||
<!-- -->
|
||||
<script>
|
||||
|
||||
document.addEventListener('$menu:ready', (e) => {
|
||||
// add your menubuttons:
|
||||
let {$menu} = e.detail
|
||||
$menu.buttons = $menu.buttons.concat([
|
||||
`<a class="btn" aria-label="button" aria-title="menu button" onclick="$menu.showAbout()"><i class="gg-info"></i> about</a><br>`
|
||||
])
|
||||
$menu.collapsed = false
|
||||
$menu.showAbout = () => window.notify(`
|
||||
<h1>💁 Hi there!</h1>
|
||||
|
||||
This XR fragments experience works almost anywhere.<br>
|
||||
Allowing rich audiovisual events with(out)<br>
|
||||
VR/AR headsets (it's awesome though ♥️)<br>
|
||||
<br>
|
||||
<b>This uses only open standards:</b><br>
|
||||
📦 surf 3D models using URLs<br>
|
||||
🎞 interactive <a href="https://www.w3.org/TR/media-frags/" target="_blank">W3C Media Fragments</a> and <a href="https://en.wikipedia.org/wiki/URI_Template" target="_blank">URI Templates</a><br>
|
||||
🧑🤝🧑 <b>instant</b> meetings inside hyperlinked 3D models<br>
|
||||
🚫 <b>zero proprietary</b> tech/game engines or platforms<br>
|
||||
🙈 unhosted, privacy-friendly, avatar-agnostic scenes<br>
|
||||
🔗 <a href="https://xrfragment.org" target="_blank">XR Fragments</a> for 3D <b>hyper-linking</b> & navigation<br>
|
||||
📷 Serverless & encrypted <a href="https://webrtc.org" target="_blank">P2P WebRTC</a> using <a href="https://github.com/dmotz/trystero" target="_blank">trystero</a><br>
|
||||
🦍 <a href="https://immersiveweb.dev" target="_blank">WebXR</a> using <a href="https://aframe.io" target="_blank">AFRAME</a> + <a href="https://three.org" target="_blank">Three.js</a><br>
|
||||
🙉 go selfhost <a href="https://github.com/coderofsalvation/xrfragment-helloworld">worlds-in-a-webpage</a><br>
|
||||
♥️ Be sustainable: go 100% <a href="https://www.forbes.com/sites/adrianbridgwater/2023/02/06/the-future-for-open-source/" target="_blank">opensource</a>
|
||||
<br><br>
|
||||
<a href="https://nlnet.nl" target="_blank">
|
||||
<img src="https://nlnet.nl/image/logo_nlnet.svg" width="100"/>
|
||||
</a>
|
||||
<br><br>
|
||||
`,{timeout:false})
|
||||
|
||||
frontend.notify_links = true // shows href/src's as notifications when hovering buttons
|
||||
xrf.navigator.opts.openInNewTab = false // open webpages in new tabs
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!-- everything below is completely optional and not part of the spec -->
|
||||
|
||||
<script src="./../../../dist/aframe-blink-controls.min.js"></script> <!-- teleporting using controllers -->
|
||||
<script src="./../../../dist/xrfragment.plugin.p2p.js"></script> <!-- serverless p2p connectivity -->
|
||||
<script src="./../../../dist/xrfragment.plugin.matrix.js"></script> <!-- matrix connectivity -->
|
||||
<script src="./../../../dist/xrfragment.plugin.network.js"></script> <!-- matrix and webrtc chat/scene examples -->
|
||||
<script src="./../../../dist/xrfragment.plugin.editor.js"></script> <!-- basic editor example -->
|
||||
<script src="./../../../dist/xrfragment.plugin.remotestorage.js"></script><!-- basic remotestorage example -->
|
||||
<script src="./../../../dist/xrfragment.plugin.frontend.css.js"></script> <!-- basic menu interface css -->
|
||||
<script src="./../../../dist/xrfragment.plugin.frontend.js"></script> <!-- basic menu interface -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1
example/aframe/sandbox/other.glb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../assets/other.glb
|
||||
1
example/aframe/xrsh/assets
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../assets
|
||||
1
example/aframe/xrsh/dist
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../dist
|
||||
1
example/aframe/xrsh/index.glb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
./../../assets/index.glb
|
||||
109
example/aframe/xrsh/index.html
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>XR Fragments aframe viewer</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
|
||||
<!-- AFRAME v1.5.0 + extra THREE.js extra loaders -->
|
||||
<script src="./../../../dist/aframe.min.js"></script>
|
||||
<script src="./../../../dist/xrfragment.aframe.js"></script>
|
||||
<script src="./../../../src/3rd/js/plugin/frontend/tab-to-href.js"></script>
|
||||
<script src="https://xrsh.isvery.ninja/xrsh.js"></script>
|
||||
|
||||
<!-- important: allow touchevents in AR -->
|
||||
<style type="text/css">
|
||||
canvas.a-dom-overlay:not(.a-no-style) { padding: 0; pointer-events: auto; }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a-scene xr-mode-ui="XRMode: xr"
|
||||
renderer="colorManagement: false; stencil: true; antialias:true; highRefreshRate:true; foveationLevel: 0.5; toneMapping: ACESFilmic; exposure: 3.0"
|
||||
device-orientation-permission-ui xrf-gaze-always joystick
|
||||
light="defaultLightsEnabled: false">
|
||||
<a-entity id="player" movement-controls touch-controls="axis:y" wasd-controls="fly:false" look-controls="magicWindowTrackingEnabled:true">
|
||||
<a-entity camera="fov:90" position="0 1.6 0" id="camera"></a-entity>
|
||||
<a-entity id="left-hand" hand-tracking-grab-controls="hand:left;modelColor:#cccccc" raycaster="objects:.ray" blink-controls="cameraRig:#player; teleportOrigin: #camera; collisionEntities: .floor">
|
||||
<a-entity rotation="-35 0 0" position="0 0.1 0" id="navigator">
|
||||
<a-entity id="back" xrf-button="label: <; width:0.05; action: history.back()" position="-0.025 0 0" class="ray"></a-entity>
|
||||
<a-entity id="next" xrf-button="label: >; width:0.05; action: history.forward()" position=" 0.025 0 0" class="ray"></a-entity>
|
||||
</a-entity>
|
||||
</a-entity>
|
||||
<a-entity id="right-hand" hand-tracking-grab-controls="hand:right;modelColor:#cccccc" laser-controls="hand: right" raycaster="objects:.ray" blink-controls="cameraRig:#player; teleportOrigin: #camera; collisionEntities: .floor" xrf-pinchmove="rig: #player"></a-entity>
|
||||
|
||||
<a-entity isoterminal="width: 600; height:300" position="0 1.0 0.03"></a-entity>
|
||||
|
||||
</a-entity>
|
||||
|
||||
<a-entity id="home" xrf="./../../assets/elearning.glb"></a-entity>
|
||||
</a-scene>
|
||||
|
||||
<!-- initialize XRSH -->
|
||||
<script>
|
||||
document.querySelector('a-scene').addEventListener('isoterminal_init', function(e){
|
||||
|
||||
const isoterminal = document.querySelector('[isoterminal]').components.isoterminal
|
||||
|
||||
const transcriptToText = (t) => t.map( (o) => `[36m${o.name}[0m ${o.description}`).join(" ")
|
||||
|
||||
const describeScene = () => {
|
||||
let subscene = xrf.frag.pos.last || xrf.navigator.URI.XRF?.pos?.string
|
||||
subscene = subscene ? subscene = xrf.scene.getObjectByName( subscene ) : false
|
||||
let transcript = transcriptToText( xrf.sceneToTranscript(subscene) )
|
||||
term.send(`\r${transcript}\n\n\r`)
|
||||
}
|
||||
|
||||
// describe current scene
|
||||
xrf.addEventListener('navigateLoaded', () => setTimeout( () => describeScene(),100) )
|
||||
|
||||
isoterminal.el.addEventListener('init', () => {
|
||||
// clear bootmenu-array
|
||||
// see com/isoterminal/feat/boot.REPL.*.js for REPL examples
|
||||
ISOTerminal.prototype.boot.menu = []
|
||||
|
||||
// we've received our terminal \o/
|
||||
term = window.term = isoterminal.term
|
||||
|
||||
// describe mouseover button (and scene to be teleported to, if any)
|
||||
xrf.addEventListener('href', (e) => {
|
||||
if( !e.selected || !e.mesh ) return; // only process mouse-overs
|
||||
let name = "object"
|
||||
let info = ""
|
||||
let subscene = false
|
||||
if( e.click ){
|
||||
return setTimeout( () => {
|
||||
if( lastPos != xrf.frag.pos.last ) return
|
||||
describeScene()
|
||||
}, 100 )
|
||||
lastPos = xrf.frag.pos.last
|
||||
}
|
||||
if( e.mesh.userData ){
|
||||
if( e.mesh.userData.href && e.mesh.userData.href.match("pos=") ){
|
||||
name = "action: "
|
||||
subscene = xrfragment.URI.parse( e.mesh.userData.href ).XRF.pos.string
|
||||
}
|
||||
if( e.mesh.userData['aria-label'] ){
|
||||
info = e.mesh.userData['aria-label']
|
||||
}else if( e.mesh.userData['aria-description'] ){
|
||||
info = e.mesh.userData['aria-description']
|
||||
}else if( subscene ){
|
||||
info = `${transcriptToText( xrf.sceneToTranscript(subscene,false,true) )}`
|
||||
}
|
||||
if( !info && e.mesh.name ) name = e.mesh.name
|
||||
}
|
||||
term.send(`${name} ${info}\n\r`)
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!-- everything below is completely optional and not part of the spec -->
|
||||
|
||||
<script src="./../../../dist/aframe-blink-controls.min.js"></script> <!-- teleporting using controllers -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1
example/aframe/xrsh/other.glb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../assets/other.glb
|
||||