how to write $TX = $TY+$TZ expression ?

   4900   3   2
User Avatar
Member
104 posts
Joined: March 2008
Offline
for example , i wanna let an obj geometry $TX = $TY + $TZ or
/obj/geo1/tx = /obj/geo1/ty + /obj/geo1/tz

how should i write the regular expression in the box ?

Thanks please

Attachments:
未命名.jpg (11.5 KB)

User Avatar
Member
4140 posts
Joined: July 2005
Offline
In this case -

ch(“ty”)+ch(“tz”)

Don't put the ‘TX =’ in there, it's inferred because this is the field you're putting the expression in.

The help has more examples.

Cheers,

J.C.
John Coldrick
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
To expand on John's answer, $TX returns each point's current position in X for the incoming geometry Same for $TY and $TZ.

Putting in the tx channel $TY + $TZ would be taking each point in turn and adding together that point's Y and Z position.
Using any local variables in a parameter forces the SOP to behave like a for loop that iterates over all the data passed in to it from the SOP wired in to it. The Point SOP works on points naturally.

See the help for the Point SOP. It lists all of the default local variables.

To reference a parameter's value, you use the ch() expression as John indicated. I usually include the $TX + as this references the current point position instead of absolutely setting each point to a constant value (usually quite boring…):
$TX + ch(“ty”)+ch(“tz”)
Fyi adding point positions together is rarely done. Subtracting point positions is done all the time and is perfectly legal. This results in a vector that describes distance (magnitude) and direction between two points. To do this put in the three tx, ty and tz parms respectively:
$TX2-$TX
$TY2-$TY
$TZ2-$TZ
where $T?2 refers to the geometry Point positions wired in to the second input of the Point SOP (again quite common to do this).
There's at least one school like the old school!
User Avatar
Member
104 posts
Joined: March 2008
Offline
Thanks so much for you 2 , cheers , its really help me out Have a nice days everyone
  • Quick Links