summaryrefslogtreecommitdiff
path: root/share/hackvr/examples/filebrowser/list_to_cubes.sh
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2019-02-06 00:53:08 -0600
committerepoch <epoch@hacking.allowed.org>2019-02-06 00:53:08 -0600
commitbf16b7b8593d4013adbd03838af5a2fb3bce34ee (patch)
tree25944f4d4907a075e513f03b7e37a99f4c813752 /share/hackvr/examples/filebrowser/list_to_cubes.sh
parent73c246a797fc6c1bac132b4eb242e1c90540e2d4 (diff)
downloadhackvr-bf16b7b8593d4013adbd03838af5a2fb3bce34ee.tar.gz
hackvr-bf16b7b8593d4013adbd03838af5a2fb3bce34ee.zip
I forgot to add the examples dir somehow. they're back. tictactoe works again too.
Diffstat (limited to 'share/hackvr/examples/filebrowser/list_to_cubes.sh')
-rwxr-xr-xshare/hackvr/examples/filebrowser/list_to_cubes.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/share/hackvr/examples/filebrowser/list_to_cubes.sh b/share/hackvr/examples/filebrowser/list_to_cubes.sh
new file mode 100755
index 0000000..be438b8
--- /dev/null
+++ b/share/hackvr/examples/filebrowser/list_to_cubes.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+# blank lines deleteallexcept epoch
+# expected input format:
+#
+# line1
+# line2
+# line3
+#
+# line1
+# line2
+j=1
+r=200
+while read -r line;do
+ if [ "_$line" != '_' ];then
+# ../tools/obj2hackvr.pl "$line" ../meshes/cube.obj
+ #turn line into hex to prevent stupid shit
+ hexline="$(printf "%s" "$line" | xxd -p | tr -d '\n')"
+ printf "%s addshape 18 3 8 %d %d 0 %d %d 0 %d %d\n" "$hexline" "$j" "$r" "$[$j+8]" "$r" "$j" "$r"
+ cd ..
+ printf "%s\n" "$line" | tee /dev/stderr | makelabel.sh "$hexline" 15 $j $r
+ cd filebrowser
+ #printf "%s move 0 %d %d 0 0 0 0 0 0\n" "$hexline" "$i" "$r"
+ printf "%s rotate 0 %d 0\n" "$hexline" "$[i * 3]"
+ #somehow printf '%s\n' "$line" | ./testfont.sh and make its output belong to same group as $line.. sed?
+ i=$[i+10]
+ j=$[j+4]
+ else
+ cat camera.pos
+ printf "USER deleteallexcept USER\n" #deleteallexcept doesn't have gr deletions yet I think.
+ j=0
+ i=0
+ fi
+done