VEX intersect function help

   331   0   0
User Avatar
Member
1 posts
Joined: 3月 2021
Offline
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;
}

Attachments:
Animation.gif (1.0 MB)

  • Quick Links