Undertaker
June 17, 2003 08:46:29
Hi everybody,
It's now time for my daily newbie question
How would you create a condition like this ?
“IF Sphere A and Sphere B are aligned on X axis THEN create Box between them”
Should I use Vex Builder ?
Thanks in advance,
Julien
Xiangbiao
June 17, 2003 09:19:37
Just create it.
Any trouble?
Undertaker
June 17, 2003 09:22:02
Creating the box isn't such a problem
My problem is more to build the condition, I other words if sphere A and Sphere B are not aligned, do not create the box, IF aligned create the box.
David Gary
June 17, 2003 09:50:15
:idea: To create is to switch between nothing and something!
Why not use a switchOP with two inputs: something (your box) and nothing (a null sop)
Then type your expression in the “select input field”.
Undertaker
June 17, 2003 09:59:59
yeah, great
That's a good philosophic answer !
Thanks 8)
Xiangbiao
June 17, 2003 10:41:43
Sorry for my first post.
Undertaker's daily newbie question is difficult to me.
Two troubles:
I can't find null sop in SOP.
And What expression you type?
Thank you.
Undertaker
June 17, 2003 10:52:11
Xiangbiao, you can find the null SOP in the “generators” section of the Tab menu .
Concerning the expression I'm trying to find an expression or a way to evaluate the difference of the centroids of the 2 objects and then use a switch, but it's not very clear to me yet, I'm wondering if I can do that kind of things with the Vex Builder …
David Gary
June 17, 2003 11:38:08
Hi again!
Try the following
Create two spheres: sphereA and sphereB.
Do the switchOP thing.
try this expression:
((centroid(“/obj/model/sphereB”,D_Z)-centroid(“/obj/model/sphereA”,D_Z))==0)&&((centroid(“/obj/model/sphereB”,D_Y)-centroid(“/obj/model/sphereA”,D_Y))==0)warning: in this case, the null must be the first input and the box the second input.
Then change the spheres center to check the result .
Hope that helps.
Expressions get and set informations.
VEX only modify information :idea:
jason_iversen
June 17, 2003 11:39:35
The VEX Builder will only be able to process the points on geometry. Its not the right tool for the job, I'm afraid. The Null/Add SOP and Box SOP going into a Switch SOP is definitely your best interest.
type: exhelp centroid in a houdini text port for help.
Undertaker
June 17, 2003 11:45:41
un peu que ça help !!
Merci bien
That works very well, thanks
Undertaker
June 17, 2003 11:50:47
Ok Jason, thanks for the “methodology” tip
Xiangbiao
June 18, 2003 02:15:24
Thank you.
In generators, couldn't find null, only find add,
I'm using 5.5, perhaps because of this.
David Gary
June 18, 2003 02:53:19
Indeed. The null SOP comes with release 6!
It's also useful in sub-networks.