Hi I am trying to get a point into the correct position. I have 2 points with normals and was assuming I could send a point 90degree from the pair to meet at a desired position. All I keep doing is getting a plain locked flat to the diverging normals.
vectorP1 = point(0, "P", 0); // First point positionvectorP2 = point(0, "P", 1); // Second point positionvectorN1 = point(0, "N", 0); // First point normalvectorN2 = point(0, "N", 1); // Second point normalvectoredge = P2 - P1;
// Calculate a vector perpendicular to both normalsvectorplaneNormal = cross(N1, N2);
planeNormal = normalize(planeNormal);
[attach]help.png[/attach]
vectorthirdPoint = cross(edge, planeNormal);
thirdPoint = normalize(thirdPoint);
floatdistance = 1.0;
thirdPoint *= distance;
vectorP3 = P1 + thirdPoint;
@P = P3;
Well I got the position I wanted but not the way I had planed I have had to pass information in from further down the line to get an angle and length to use to find the position NOT ideal or what I was thinking. and a bit messy so would still be interested in some feed back.
floatangle = point(1,'angB',@ptnum);
floatlen = point(1,'lenA',@ptnum) * (cos(radians(angle)));
f@l=len;
vectorP1 = point(0, "P", 0); // First point positionvectorP2 = point(0, "P", 1); // Second point positionvectorN1 = point(0, "N", 0); // First point normalvectorN2 = point(0, "N", 1); // Second point normalvectoredge = P2 - P1;
// Calculate a vector perpendicular to both normalsvectorplaneNormal = cross(N1, N2);
planeNormal = normalize(planeNormal);
vectorthirdPoint = cross(edge, planeNormal);
thirdPoint = normalize(thirdPoint);
floatdistance = len;//1.0;thirdPoint *= distance;
vectorP3 = lerp(P1,P2,0.5) + thirdPoint;
vectorN3 = lerp(N1,N2,0.5);
@P = P3;
@N = N3;
removepoint(0,0);
the float distance had to be worked out from the edge and shifted over with a lerp