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
how to write $TX = $TY+$TZ expression ?
4900 3 2- freesign
- Member
- 104 posts
- Joined: March 2008
- Offline
- JColdrick
- Member
- 4140 posts
- Joined: July 2005
- Offline
- old_school
- 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).
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!
- freesign
- Member
- 104 posts
- Joined: March 2008
- Offline
-
- Quick Links