summaryrefslogtreecommitdiffstats
path: root/$mmm/plugins/gltf
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2022-05-08 19:14:58 +0000
committers-ol <s+removethis@s-ol.nu>2022-05-20 08:38:41 +0000
commitb615a7cf0fc9d81b4b905a9d4e1db0beebdebd3d (patch)
tree2bf24f2da1aa80df2534637de10e0fe45aeb80f0 /$mmm/plugins/gltf
downloadhw.s-ol.nu-b615a7cf0fc9d81b4b905a9d4e1db0beebdebd3d.tar.gz
hw.s-ol.nu-b615a7cf0fc9d81b4b905a9d4e1db0beebdebd3d.zip
initial commit
Diffstat (limited to '$mmm/plugins/gltf')
-rw-r--r--$mmm/plugins/gltf/converts: text$lua -> table.lua16
-rw-r--r--$mmm/plugins/gltf/converts: text$moonscript -> table.moon16
-rw-r--r--$mmm/plugins/gltf/scripts: text$html+frag.html2
3 files changed, 34 insertions, 0 deletions
diff --git a/$mmm/plugins/gltf/converts: text$lua -> table.lua b/$mmm/plugins/gltf/converts: text$lua -> table.lua
new file mode 100644
index 0000000..5a7869f
--- /dev/null
+++ b/$mmm/plugins/gltf/converts: text$lua -> table.lua
@@ -0,0 +1,16 @@
+local dom = require('mmm.dom')
+return {
+ {
+ inp = 'URL -> model/gltf-binary',
+ out = 'mmm/dom',
+ cost = 1,
+ transform = function(self, href)
+ return dom['model-viewer']({
+ src = href,
+ ['auto-rotate'] = true,
+ ['camera-controls'] = true,
+ ['camera-orbit'] = "548.2deg 117deg 282.4m"
+ })
+ end
+ }
+}
diff --git a/$mmm/plugins/gltf/converts: text$moonscript -> table.moon b/$mmm/plugins/gltf/converts: text$moonscript -> table.moon
new file mode 100644
index 0000000..1036eee
--- /dev/null
+++ b/$mmm/plugins/gltf/converts: text$moonscript -> table.moon
@@ -0,0 +1,16 @@
+dom = require 'mmm.dom'
+
+{
+ {
+ inp: 'URL -> model/gltf-binary'
+ out: 'mmm/dom'
+ cost: 1
+ transform: (href) =>
+ dom['model-viewer'] {
+ src: href
+ 'auto-rotate': true
+ 'camera-controls': true
+ 'camera-orbit': "548.2deg 117deg 282.4m"
+ }
+ }
+}
diff --git a/$mmm/plugins/gltf/scripts: text$html+frag.html b/$mmm/plugins/gltf/scripts: text$html+frag.html
new file mode 100644
index 0000000..d2b1e44
--- /dev/null
+++ b/$mmm/plugins/gltf/scripts: text$html+frag.html
@@ -0,0 +1,2 @@
+ <script type="module" src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"></script>
+ <script nomodule src="https://unpkg.com/@google/model-viewer/dist/model-viewer-legacy.js"></script>