|
|
In article <391A13E8.53BB7F05@hotmail.com>, Pabs <pab### [at] hotmailcom>
wrote:
> I tried using VDist & the result is always positive because -ve * -ve =
> +ve
The point direction should not be difficult to figure out...something
like this maybe(I am tired and this is untested, so be warned):
O = ray origin(vector)
Pt = point on ray(vector)
Dir = ray direction(normalized vector)
Dist = point distance, calculated with VDist(floating point)
DBL cosA = 0;
VECTOR tmp;
VSub(tmp,Pt,O);
VNormalizeEq(tmp);
VDot(cosA, Dir, tmp);
if(cosA<0)
{ Dist *= -1;}
This basically flips the number(positive to negative) if the point and
the direction are not on the same side of the ray. I think.
--
Christopher James Huff - Personal e-mail: chr### [at] yahoocom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/
Post a reply to this message
|
|