Search - User list
Full Version: Conditions
Root » Technical Discussion » Conditions
Undertaker
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
Just create it.
Any trouble?
Undertaker
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
: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
yeah, great

That's a good philosophic answer !


Thanks 8)
Xiangbiao
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
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
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
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
un peu que ça help !!

Merci bien



That works very well, thanks
Undertaker
Ok Jason, thanks for the “methodology” tip
Xiangbiao
Thank you.
In generators, couldn't find null, only find add,
I'm using 5.5, perhaps because of this.
David Gary
Indeed. The null SOP comes with release 6!
It's also useful in sub-networks.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB