Blobby TCL
source "H:/vsfx705/tcl/dataField.tcl"
proc makeBlobby { scrPath dstPath} {
set blobbyCount [xyzCount $scrPath]
#open
set input [open $scrPath r]
set output [open $dstPath w]
puts $output "Blobby $blobbyCount"
puts $output "\["
for {set n 0} {$n< $blobbyCount} { incr n} {
puts $output "1001 [expr $n *16]"
}
#more process
puts $output "0 $blobbyCount"
for {set n 0} {$n< $blobbyCount} { incr n} {
puts $output "$n"
}
puts $output "\]"
puts $output "\["
#transformation matrix
while {[eof $input] != 1} {
gets $input data
#only process non-blank
if { [string trim $data]!="" } {
puts $output "1 0 0 0 0 1 0 0 0 0 1 0 $data 1 "
}
}
puts $output "\]"
puts $output "\[ \" \" \] "
close $output
}
makeBlobby "H:/vsfx705/test.txt" "H:/vsfx705/testtcl.rib"
-------------------------------------------------------------------------------------
|
|
#blobby scale are set as
1
0.5
3
5 |
Mushrrom effects:
# I remodified the TCL to make the blobby could be generated differentlly based on the even / odd order of a vertex. Two exis.
source "H:/vsfx705/tcl/dataField.tcl"
proc makeBlobby { scrPath dstPath} {
set blobbyCount [xyzCount $scrPath]
#open
set input [open $scrPath r]
set output [open $dstPath w]
puts $output "Blobby $blobbyCount"
puts $output "\["
for {set n 0} {$n< $blobbyCount} { incr n} {
puts $output "1001 [expr $n *16]"
}
#more process
puts $output "0 $blobbyCount"
for {set n 0} {$n< $blobbyCount} { incr n} {
puts $output "$n"
}
puts $output "\]"
puts $output "\["
set ss 0
#transformation matrix
while {[eof $input] != 1} {
gets $input data
#only process non-blank
if { [string trim $data]!="" } {
if {$ss == 0} {
#colum
puts $output "0.5 0 0 0 0 2 0 0 0 0 0.5 0 $data 1 "
#set $ss 1
set ss 1
puts "$ss"
} else {
#plat form
puts $output "2 0 0 0 0 0.3 0 0 0 0 2 0 $data 1 "
set ss 0
puts "$ss"
}
#puts $output "0.5 0 0 0 0 0 5 0 0 0 0 0.5 0 $data 1 "
}
}
puts $output "\]"
puts $output "\[ \" \" \] "
close $output
}
makeBlobby "H:/vsfx705/test.txt" "H:/vsfx705/testtcl.rib"
|
|
Three axis version
source "H:/vsfx705/tcl/dataField.tcl"
proc makeBlobby { scrPath dstPath} {
set blobbyCount [xyzCount $scrPath]
#open
set input [open $scrPath r]
set output [open $dstPath w]
puts $output "Blobby $blobbyCount"
puts $output "\["
for {set n 0} {$n< $blobbyCount} { incr n} {
puts $output "1001 [expr $n *16]"
}
#more process
puts $output "0 $blobbyCount"
for {set n 0} {$n< $blobbyCount} { incr n} {
puts $output "$n"
}
puts $output "\]"
puts $output "\["
set ss 0
#transformation matrix
while {[eof $input] != 1} {
gets $input data
#only process non-blank
if { [string trim $data]!="" } {
if {$ss == 0} {
#colum
puts $output "2 0 0 0 0 2 0 0 0 0 0.5 0 $data 1 "
#set $ss 1
set ss 1
puts "$ss"
} elseif {$ss == 1} {
#beam
puts $output "0.5 0 0 0 0 2 0 0 0 0 2 0 $data 1 "
set ss 2
puts "$ss"
} else {
#plat form
puts $output "2 0 0 0 0 0.5 0 0 0 0 2 0 $data 1 "
set ss 0
puts "$ss"
}
#puts $output "0.5 0 0 0 0 0 5 0 0 0 0 0.5 0 $data 1 "
}
}
puts $output "\]"
puts $output "\[ \" \" \] "
close $output
}
makeBlobby "H:/vsfx705/test.txt" "H:/vsfx705/testtcl.rib"
|
|
Blobby substraction
#two axis and subtract by even, odd
source "H:/vsfx705/tcl/dataField.tcl"
proc makeBlobby { scrPath dstPath} {
set blobbyCount [xyzCount $scrPath]
#open
set input [open $scrPath r]
set output [open $dstPath w]
puts $output "Blobby $blobbyCount"
puts $output "\["
for {set n 0} {$n< $blobbyCount} { incr n} {
puts $output "1001 [expr $n *16]"
}
#more process (first)
puts $output "0 [expr $blobbyCount/2 + 1]"
for {set n 0} {$n< $blobbyCount} { incr n 2} {
puts $output "$n"
}
#more process (second)
puts $output "0 [expr $blobbyCount-$blobbyCount/2 - 1]"
for {set n 1} {$n< $blobbyCount} { incr n 2} {
puts $output "$n"
}
#more process (substract)
puts $output "4 [expr $blobbyCount +1] [expr $blobbyCount +0]"
puts $output "\]"
puts $output "\["
set ss 0
#transformation matrix
while {[eof $input] != 1} {
gets $input data
#only process non-blank
if { [string trim $data]!="" } {
if {$ss == 0} {
#colum
puts $output "0.8 0 0 0 0 6 0 0 0 0 0.8 0 $data 1 "
#set $ss 1
set ss 1
puts "$ss"
} else {
#plat form
puts $output "2 0 0 0 0 0.3 0 0 0 0 2 0 $data 1 "
set ss 0
puts "$ss"
}
#puts $output "0.5 0 0 0 0 0 5 0 0 0 0 0.5 0 $data 1 "
}
}
puts $output "\]"
puts $output "\[ \" \" \] "
close $output
}
makeBlobby "H:/vsfx705/test.txt" "H:/vsfx705/testtcl.rib"
|
Blobby substraction
#three axis and subtract by even, odd
source "H:/vsfx705/tcl/dataField.tcl"
proc makeBlobby { scrPath dstPath} {
set blobbyCount [xyzCount $scrPath]
#open
set input [open $scrPath r]
set output [open $dstPath w]
puts $output "Blobby $blobbyCount"
puts $output "\["
for {set n 0} {$n< $blobbyCount} { incr n} {
puts $output "1001 [expr $n *16]"
}
#more process (first)
puts $output "0 [expr $blobbyCount/2 + 1]"
for {set n 0} {$n< $blobbyCount} { incr n 2} {
puts $output "$n"
}
#more process (second)
puts $output "0 [expr $blobbyCount-$blobbyCount/2 - 1]"
for {set n 1} {$n< $blobbyCount} { incr n 2} {
puts $output "$n"
}
#more process (substract)
puts $output "4 [expr $blobbyCount +1] [expr $blobbyCount +0]"
puts $output "\]"
puts $output "\["
set ss 0
#transformation matrix
while {[eof $input] != 1} {
gets $input data
#only process non-blank
if { [string trim $data]!="" } {
if {$ss == 0} {
#colum
puts $output "2 0 0 0 0 2 0 0 0 0 0.5 0 $data 1 "
#set $ss 1
set ss 1
puts "$ss"
} elseif {$ss == 1} {
#beam
puts $output "0.5 0 0 0 0 2 0 0 0 0 2 0 $data 1 "
set ss 2
puts "$ss"
} else {
#plat form
puts $output "2 0 0 0 0 0.5 0 0 0 0 2 0 $data 1 "
set ss 0
puts "$ss"
}
#puts $output "0.5 0 0 0 0 0 5 0 0 0 0 0.5 0 $data 1 "
}
}
puts $output "\]"
puts $output "\[ \" \" \] "
close $output
}
makeBlobby "H:/vsfx705/test.txt" "H:/vsfx705/testtcl.rib"
|
Blobby substraction
# three axi and subtract by first half, second half
source "H:/vsfx705/tcl/dataField.tcl"
proc makeBlobby { scrPath dstPath} {
set blobbyCount [xyzCount $scrPath]
#open
set input [open $scrPath r]
set output [open $dstPath w]
puts $output "Blobby $blobbyCount"
puts $output "\["
for {set n 0} {$n< $blobbyCount} { incr n} {
puts $output "1001 [expr $n *16]"
}
#more process (first)
puts $output "0 [expr $blobbyCount/2]"
for {set n 0} {$n< [expr $blobbyCount/2]} { incr n} {
puts $output "$n"
}
#more process (second)
puts $output "0 [expr $blobbyCount-$blobbyCount/2]"
for {set n [expr $blobbyCount/2]} {$n< $blobbyCount} { incr n} {
puts $output "$n"
}
#more process (substract)
puts $output "4 [expr $blobbyCount +0] [expr $blobbyCount +1]"
puts $output "\]"
puts $output "\["
set ss 0
#transformation matrix
while {[eof $input] != 1} {
gets $input data
#only process non-blank
if { [string trim $data]!="" } {
if {$ss == 0} {
#colum
puts $output "2 0 0 0 0 2 0 0 0 0 0.5 0 $data 1 "
#set $ss 1
set ss 1
puts "$ss"
} elseif {$ss == 1} {
#beam
puts $output "0.5 0 0 0 0 2 0 0 0 0 2 0 $data 1 "
set ss 2
puts "$ss"
} else {
#plat form
puts $output "2 |