Why my point warngle intersection doesn't works?

   3147   4   0
User Avatar
Member
415 posts
Joined: 8月 2015
Offline
Hi guys;
I would like to find the intersection point on a surface, using point wrangle.

vector NewPointUV, DirPoint;

DirPoint = point(2, "P", 0);
i@hit = intersect(1, @P, DirPoint, v@NewPointLoc, NewPointUV);
@P = @NewPointLoc;

But it doesn't work. Any idea?

Thanks.
Edited by Masoud - 2017年10月20日 01:58:55

Attachments:
intersection.JPG (18.3 KB)

Masoud Saadatmand (MSDVFX)
User Avatar
Member
555 posts
Joined: 2月 2017
Offline
here's my idea….upload file…
User Avatar
Member
373 posts
Joined: 3月 2009
Offline
I think you need a direction vector, not a position…

i@hit = intersect(1, @P, DirPoint-@P, v@NewPointLoc, NewPointUV);

I may the direction backwards – try @P-DirPoint if that doesn't work.
Ian Farnsworth
User Avatar
Member
8833 posts
Joined: 7月 2007
Offline
that and also be aware that the direction vector's length is used as maximum distance, so if there is no intersection found within that distance, it will not hit
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
133 posts
Joined: 7月 2007
Offline
I've been toying with line intersections a lot lately and I would recommend debugging the values coming out of the intersect (or intersect_all) functions by printing or setting detail attributes and making sure they look good. You may be getting intersections you don't expect that are throwing off your results.
You may also need to try intersect_all and tweak the optional tolerance values.
  • Quick Links