summaryrefslogtreecommitdiff
path: root/share/hackvr/examples
diff options
context:
space:
mode:
Diffstat (limited to 'share/hackvr/examples')
-rwxr-xr-xshare/hackvr/examples/marquee/marquee.sh28
-rw-r--r--share/hackvr/examples/subsume/arms.hackvr7
-rwxr-xr-xshare/hackvr/examples/subsume/test.sh11
3 files changed, 46 insertions, 0 deletions
diff --git a/share/hackvr/examples/marquee/marquee.sh b/share/hackvr/examples/marquee/marquee.sh
new file mode 100755
index 0000000..4ea6c61
--- /dev/null
+++ b/share/hackvr/examples/marquee/marquee.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+set -o pipefail
+
+pi=3 #lol
+
+from_cam=150
+
+elevation=10
+while printf "marquee rotate 0 +-2 0\n";do
+ sleep .1
+done &
+
+tail -F ~/.local/var/cache/music/nowplaying.txt 2>/dev/null | while read -r line;do
+ printf "%s deleteallexcept %s\n" "$USER" "$USER"
+ printf "nowplaying flatten\n"
+ printf "%s\n" "$line" >&2
+ chars="$(printf "%s" "$line" | wc -c | tr -cd '[0-9]')"
+ char_width=5 #I think..
+ rot=$[ 360 / $chars ]
+ diameter=$[ $chars * $char_width / $pi ]
+ printf "%s\n" "$line" | fold -w1 | while read -r char;do
+ printf "%s\n" "$char" | makelabel.sh nowplaying 0 0 0 | offsetshape.sh 0 0 "-${diameter}"
+ printf "nowplaying rotate 0 %d 0\n" "-$rot"
+ printf "nowplaying flatten\n"
+ done
+ printf "marquee assimilate nowplaying\n"
+ printf "marquee move 0 %s %s\n" "$elevation" "$[$diameter + $from_cam]" #this won't work before the generation loop unless I can flatten on certain parts.
+done
diff --git a/share/hackvr/examples/subsume/arms.hackvr b/share/hackvr/examples/subsume/arms.hackvr
new file mode 100644
index 0000000..de31aba
--- /dev/null
+++ b/share/hackvr/examples/subsume/arms.hackvr
@@ -0,0 +1,7 @@
+base addshape 1 2 0 0 0 0 8 0
+mid addshape 2 2 0 0 0 0 4 0
+mid move 0 8 0
+base subsume mid
+end addshape 4 2 0 0 0 0 2 0
+end move 0 4 0
+mid subsume end
diff --git a/share/hackvr/examples/subsume/test.sh b/share/hackvr/examples/subsume/test.sh
new file mode 100755
index 0000000..67139ac
--- /dev/null
+++ b/share/hackvr/examples/subsume/test.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+cat arms.hackvr
+
+# these start all straight-up, rotate counter clockwise as rotation increases, and
+# at these rates of rotation they should all be curled in on themselves at the bottom.
+while true;do
+ printf "base rotate 0 0 +1\n"
+ printf "mid rotate 0 0 +2\n"
+ printf "end rotate 0 0 +3\n"
+ sleep .1
+done