From 7c96fd084fe1f45427a0cd7cd0037091415ee4d2 Mon Sep 17 00:00:00 2001 From: s-ol Date: Sat, 28 Nov 2020 13:59:56 +0100 Subject: add GLTF model viewer plugin --- mmm/mmmfs/plugins/gltf.moon | 23 +++++++++++++++++++++++ mmm/mmmfs/plugins/init.moon | 1 + 2 files changed, 24 insertions(+) create mode 100644 mmm/mmmfs/plugins/gltf.moon diff --git a/mmm/mmmfs/plugins/gltf.moon b/mmm/mmmfs/plugins/gltf.moon new file mode 100644 index 0000000..28a6cf8 --- /dev/null +++ b/mmm/mmmfs/plugins/gltf.moon @@ -0,0 +1,23 @@ +dom = require 'mmm.dom' + +{ + converts: { + { + 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" + } + } + } + + scripts: [[ + + + ]] +} diff --git a/mmm/mmmfs/plugins/init.moon b/mmm/mmmfs/plugins/init.moon index 93190b2..b19c88f 100644 --- a/mmm/mmmfs/plugins/init.moon +++ b/mmm/mmmfs/plugins/init.moon @@ -297,6 +297,7 @@ add_plugin 'mermaid' add_plugin 'twitter' add_plugin 'youtube' add_plugin 'cites' +add_plugin 'gltf' if STATIC add_plugin 'static' -- cgit v1.2.3