Q about selecting faces with Ray SOP
2070 4 1- KiLa
- Member
- 109 posts
- Joined: June 2008
- Offline
Hi,
is there a way to select faces that are pointing specific direction/object?
I'm trying to create Bullet sim and then emit some smoke from the exploding chunks. Now, i forget to add inside groups in Voronoi Fracture, and instead of enabling it and resimming and writing the geo into disk, i decided to use the geo that i have and educate myself and hopefully learn something new and find a way to select the inside faces other way.
I tried to use the Ray SOP, and then use some attributes and transfer them, but it doesn't seem to work quite as well i hoped…or i'm not using it correctly: it seems to select a bit more than i need.
Any ideas how to select only the polys that are facing the grid? Using Ray SOP or something else.
Cheers
-kimmo
is there a way to select faces that are pointing specific direction/object?
I'm trying to create Bullet sim and then emit some smoke from the exploding chunks. Now, i forget to add inside groups in Voronoi Fracture, and instead of enabling it and resimming and writing the geo into disk, i decided to use the geo that i have and educate myself and hopefully learn something new and find a way to select the inside faces other way.
I tried to use the Ray SOP, and then use some attributes and transfer them, but it doesn't seem to work quite as well i hoped…or i'm not using it correctly: it seems to select a bit more than i need.
Any ideas how to select only the polys that are facing the grid? Using Ray SOP or something else.
Cheers
-kimmo
- anon_user_40689665
- Member
- 648 posts
- Joined: July 2005
- Offline
- KiLa
- Member
- 109 posts
- Joined: June 2008
- Offline
- anon_user_40689665
- Member
- 648 posts
- Joined: July 2005
- Offline
oic, replace wrangle code with:
vector nn = normalize(@N);
vector op = @P + (nn*0.0001);
vector huv = set(0,0,0);
vector hpos = set(0,0,0);
nn = nn * 0.2;
int hit = intersect(1,op,nn,hpos,huv);
@Cd = set(1,0,0);
if (hit >= 0) {
@Cd = set(0,1,0);
setprimgroup(0,“inside”,@primnum,1,“add”);
}
It switches the target geo to 2nd input, shortens the ray to 0.2
vector nn = normalize(@N);
vector op = @P + (nn*0.0001);
vector huv = set(0,0,0);
vector hpos = set(0,0,0);
nn = nn * 0.2;
int hit = intersect(1,op,nn,hpos,huv);
@Cd = set(1,0,0);
if (hit >= 0) {
@Cd = set(0,1,0);
setprimgroup(0,“inside”,@primnum,1,“add”);
}
It switches the target geo to 2nd input, shortens the ray to 0.2
- KiLa
- Member
- 109 posts
- Joined: June 2008
- Offline
-
- Quick Links