Michael Sevruzgenko

msevruzgenko

About Me

Connect

LOCATION
Not Specified
ウェブサイト

Houdini Skills

Availability

Not Specified

Recent Forum Posts

VEX intersect function help 2024年2月21日13:35

i`m attached gif to you can understand better what the problem is.. Actually i can`t understand how to stop moving those points of first grid that while moving have very close position to 2nd grid i can`t store last position of them to use it for sticking them near 2nd grid even if they are continue moving between attribute wrangle node. Please help me to understand... sorry for my english

vector pos, uv;
@N = @N;
v@vec_movedir = {1,0,0}; //yellow
int primnumber = intersect(0,@P,v@vec_movedir,pos,uv);

vector prim_normal = prim(0,"N",primnumber);
vector prim_position = prim(0,"P",primnumber);
float dist = distance(@P,pos);


if (dist < 0.02 ){
@P.x = prim_position + prim_normal-0.001;
@remember_last_position = @P;
}
if (primnumber == -1){
@P = @remember_last_position;
}