summaryrefslogtreecommitdiff
path: root/tools/obj2hackvr.pl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/obj2hackvr.pl')
-rwxr-xr-xtools/obj2hackvr.pl17
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/obj2hackvr.pl b/tools/obj2hackvr.pl
index 793b5ea..d8727e2 100755
--- a/tools/obj2hackvr.pl
+++ b/tools/obj2hackvr.pl
@@ -32,13 +32,28 @@ while(<FILE>) {
# }
#}
+#foreach $tmp (@faces) {
+# @points=split(/ /,$tmp);
+# @points = map { $_ =~ s/\/.+$//g; $_; } @points;
+## print @points;
+# print $ARGV[0];
+# print " addshape ";
+# print @points+0;
+# for($i=0;$i<(@points+0);$i++) {
+# print " ";
+# print $vertices[$points[$i]];
+# }
+# print "\n";
+#}
+
+#convert to triangles
foreach $tmp (@faces) {
@points=split(/ /,$tmp);
@points = map { $_ =~ s/\/.+$//g; $_; } @points;
# print @points;
for($i=2;$i<(@points);$i++) {
print $ARGV[0];
- print " addtriangle ";
+ print " addshape 3 ";
print $vertices[$points[0]-1];
print " ";
print $vertices[$points[$i-1]-1];