Archive for May, 2005

coding TCL

Generation/Production od Complexity

and ways to manage it.

1) objet instanceing(memory)
2) proy objects.- theyreferance data on the harddisk.
ie: archive RIB files , we are repetivly useing the same geomotry overagain , for repeted on screen rrepresentation.
the proy model , only keeps a simple referanec to the object . as obosed to the instanced object you get to see the object , wher as in a proxy you don’t see it till it’s rendered.
3) procedual primities and geomotry.

trigger:

procedural “runprogram” [appname " inputs 1 2 3 4 5 ect."]

this allows us to add to the rib data stream from out side the rib . it can tell the renderere to add psrticals or pramiters , much fasster..

___________________—

TCL
puts “hello”

every application respective of the languge it’s writen in has 3 standard pipies ,

standard “in”
standard “out”
standard “error”

standard in -connects to key board mouse /input device.

standard out -connects to the moniter..
and satandad error also to the moniter..

renderman works ,

with a helper program to rediret these inputs..

__________________________________________________________

# basic code for renderman helper app:

while { [gets stdin buffer] != -1 } {

puts ” Sphere 1 -1 1 360″
puts “\377″
# special pixar code choosen because it’s out side of regular ASCII

}

_____________________________-

make a tcl , that finds texture files with in RIBS and replaces tyhem with another .. then make a web page.

prman class 15

Divide and conqure
1 keep related TCL procedures togeather in the same file

2 test the procedures individually on small problems

3 for RIB filtering we will require at least 2 TCL files

factonatztion.

so slow today..

and i’m hungary and i’m going to kill mike..

My computer at school is kinda frozen right now so i’m killign time trying to wait for it to finnish a proc .

yeah crash note to all you people who haven’t realies it yet Windows Sucks..

my p3 laptop would be runnin cutter / gaim/ 8 firefox instances and still not run this slow!!
yet i run cutte and 2 firefow instances and it crashed .. arrgh..

prman 14

#developing a series of regular exspressions that can be used
# to find specific text relating to a surface in a RIB file

#set line { Surface “defaultsurface” }

# basic atomic building blocks of regular exspressions .
#set SPACE {[\s]*}
#set STATEMENT {[\w]*}
#set statmentPattern $SPACE$STATEMENT$SPACE
#if {[regexp $statmentPattern $line m0] ==1 } {
#puts “found $m0″
#}

#set line { 537 }
#set SPACE {[\s]*}
#set FLOAT {[\d]*}
#set floatPattern $SPACE$FLOAT$SPACE
#if {[regexp $floatPattern $line m0] ==1 } {

#puts “found $m0″
#}

#set line { .537 }
#set SPACE {[\s]*}
#set FLOAT {[\d]*}
#set floatPattern $SPACE$FLOAT$SPACE
#if {[regexp $floatPattern $line m0] ==1 } {

#puts “found $m0″
#}

#set line { .537 }
#set SPACE {[\s]*}
#set FLOAT {[.\d]*}
#set floatPattern $SPACE$FLOAT$SPACE
#if {[regexp $floatPattern $line m0] ==1 } {

#puts “found $m0″
#}

#set line { -.537 }
#set SPACE {[\s]*}
#set NEG {[-]}
#set DECIMAL {[.]*}
#set FLOAT {[\d]*}
#set floatPattern $SPACE$NEG$DECIMAL$FLOAT$SPACE
#if {[regexp $floatPattern $line m0] ==1 } {
#puts “found $m0″
#}

# the post . finds anything comment it out \.
#set line { .537 }
#set SPACE {[\s]*}
#set FLOAT {(\.[\d]*)}
#set floatPattern $SPACE$FLOAT$SPACE
#if {[regexp $floatPattern $line m0] ==1 } {
#puts “found $m0″
#}

#set line { -.537 }
#set SPACE {[\s]*}
#set FLOAT {(-?\.[\d]*)}
#set floatPattern $SPACE$FLOAT$SPACE
#if {[regexp $floatPattern $line m0] ==1 } {
#puts “found $m0″
#}

#set line { 2.5 }
#set SPACE {[\s]*}
#set FLOAT {(-?\.?[\d]*)}
#set floatPattern $SPACE$FLOAT$SPACE
#if {[regexp $floatPattern $line m0] ==1 } {
#puts “found $m0″
#}

# either or
#set line { 537 }
#set SPACE {[\s]*}
#set FLOAT {([\d]*|\.[\d]*)}
#set floatPattern $SPACE$FLOAT$SPACE
#if {[regexp $floatPattern $line m0] ==1 } {
#puts “found $m0″
#}

#set line { 5.37 }
#set SPACE {[\s]*}
#set FLOAT {(-?[\d]*\.?[\d]*)}
#set floatPattern $SPACE$FLOAT$SPACE
#if {[regexp $floatPattern $line m0] ==1 } {
#puts “found $m0″
#}

#set line { ShadingRate 0.537 }

#set REMAINDER {(.)*}
#set SPACE {[\s]*}
#set STATEMENT {([\w]*)}
#set statmentPattern $SPACE$STATEMENT$SPACE$REMAINDER

#set FLOAT {(-?[\d]*\.?[\d]*)}
#set floatPattern $SPACE$FLOAT$SPACE
#if {[regexp $statmentPattern $line m0 m1 remainder] ==1 } {
#puts “input >$m0< found >$m1< remainder >$remainder< ”
#if { $m1 == “ShadingRate” } {
#if {[regexp $floatPattern $remainder m0 m1 remainder] ==1} {
#puts “name >$m1< remainder >$remainder< ”
#}

#match must look for the inital quatation
#{(\”[\w]*[\s]?[\w]*\”)}
#set line {Surface “float Ka” }
#set SPACE {[\s]*}
#set QUOTED {(“[\w]*[\s]?[\w]*”)}

#set quotePattern $SPACE$QUOTED$SPACE
#if {[regexp $quotePattern $line m0 m1 remainder ] ==0} {
#puts “no match”
#return
#}
#puts “match >$m1< ”
#if { 1 } {
#return
#}

#finding stuff with varblies
#set line {Surface “float Ka” }
#set SPACE {[\s]*}
#set QUOTED {(“([^"]*)”)}

#set quotePattern $SPACE$QUOTED$SPACE
#if {[regexp $quotePattern $line m0 m1 remainder ] ==0} {
##puts “no match”

#return
#}
#puts “match >$m1< ”
#if { 1 } {
#return
#}

#set line {Surface “float Ka” [10] }

set SPACE {[\s]*}
set REMAINDER {(.*)}
set NAME {([\w_]*)}
set QUOTE {\”}
set VALUE {\[([^]]*)\]}
set TYPE_NAME $NAME$SPACE$NAME
set QUOTED_TYPE_NAME $NAME$SPACE$NAME$QUOTE

#set quotedNamePattern $QUOTE$NAME$SPACE$NAME$QUOTE$REMAINDER
set paramaterPattern $QUOTED_TYPE_NAME$SPACE$VALUE$REMAINDER
set statementPattern $SPACE$NAME$SPACE$REMAINDER
set shaderNamePattern $QUOTE$NAME$QUOTE$REMAINDER

proc getStatement {line} {
global statementPattern
if {[regexp $statementPattern $line m0 m1 remainder]==0} {
return “”
}
return [list $m1 $remainder]
}

proc getShaderName {line} {
global shaderNamePattern
if {[regexp $shaderNamePattern $line m0 m1 remainder]==0} {
return “”
}
return [list $m1 $remainder]
}

set line {Surface “float Ka” [1] }

set result [getStatement $line]
puts $result

« Previous PageNext Page »