From ed79435a1efc2f9c348e66dd2d9b6c80e5f8f888 Mon Sep 17 00:00:00 2001 From: epoch Date: Tue, 19 Dec 2017 03:29:56 -0600 Subject: updated the tools to be color argument aware of addshape --- tools/dat2hackvr.pl | 2 +- tools/line2hackvr.sh | 2 +- tools/obj2hackvr.pl | 2 +- tools/obj2hackvr2.pl | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/dat2hackvr.pl b/tools/dat2hackvr.pl index 2a2fbe1..03c5315 100755 --- a/tools/dat2hackvr.pl +++ b/tools/dat2hackvr.pl @@ -20,7 +20,7 @@ while($line=) { } else { if($prev ne "") { print $ARGV[0]; - print " addshape 2 "; + print " addshape 2 2 "; print $line . " 0 " . $prev . " 0"; print "\n"; } diff --git a/tools/line2hackvr.sh b/tools/line2hackvr.sh index f2ea143..0ff5290 100755 --- a/tools/line2hackvr.sh +++ b/tools/line2hackvr.sh @@ -4,4 +4,4 @@ if [ "_$1" = '_' ];then echo 'usage: line2hackvr.sh name' >&2 exit 1 fi -xargs -L 1 printf "%s addshape 2 0 %d %d 0 %d %d\n" "$1" $line +xargs -L 1 printf "%s addshape 2 2 0 %d %d 0 %d %d\n" "$1" $line diff --git a/tools/obj2hackvr.pl b/tools/obj2hackvr.pl index 8173eee..3639750 100755 --- a/tools/obj2hackvr.pl +++ b/tools/obj2hackvr.pl @@ -53,7 +53,7 @@ foreach $tmp (@faces) { # print @points; for($i=2;$i<(@points);$i++) { print $ARGV[0]; - print " addshape 3 "; + print " addshape 2 3 "; print $vertices[$points[0]-1]; print " "; print $vertices[$points[$i-1]-1]; diff --git a/tools/obj2hackvr2.pl b/tools/obj2hackvr2.pl index 92d16a7..0736c6d 100755 --- a/tools/obj2hackvr2.pl +++ b/tools/obj2hackvr2.pl @@ -14,6 +14,7 @@ my @parts; my @points; my @tmp; my $tmp; +my $color=2; open(FILE,$ARGV[1]) if $ARGV[1]; while() { chomp; @@ -39,7 +40,7 @@ foreach $tmp (@faces) { @points = map { $_ =~ s/\/.+$//g; $_; } @points; ## print @points; print $ARGV[0]; - print " addshape "; + print " addshape " . (rand()*8%8) . " "; print @points+0; for($i=0;$i<(@points);$i++) { print " "; -- cgit v1.2.3