Why my point warngle intersection doesn't works?

   2772   4   0
User Avatar
Member
407 posts
Joined: Aug. 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 - Oct. 20, 2017 01:58:55

Attachments:
intersection.JPG (18.3 KB)

Masoud Saadatmand (MSDVFX)
User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
here's my idea….upload file…
User Avatar
Member
373 posts
Joined: March 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
8522 posts
Joined: July 2007
Online
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
132 posts
Joined: July 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