POV-Ray : Newsgroups : povray.advanced-users : Question for the Math Geniuses (Geniuii? Genies?) : Re: Question for the Math Geniuses (Geniuii? Genies?) Server Time
29 Jul 2024 18:27:12 EDT (-0400)
  Re: Question for the Math Geniuses (Geniuii? Genies?)  
From: Bryan Valencia
Date: 23 Feb 2001 21:30:02
Message: <3A971D71.54F5C7E0@209software.com>
A Million Thanks!

Where did you learn 3d Geometry?  I need to go there!

David Fontaine wrote:

> If you have triangle ABC, the cross-product of A-C (CA) and B-C (CB) will
> give you a vector perpendicular to the triangle. Cross-product of <u,v,w>
> and <x,y,z> is <vz-wy,wx-uz,uy-vx>. The x,y,z components of this new
> vector are the coefficients for the equation of a plane, Ax+By+Cz=D. To
> find D, plug one of the original points in for x, y and z. Now that we
> have the equation, it is simply a matter of solving for y: y=(D-Ax-Cz)/B
>
> double GetY(double Ax, double Ay, double Az,
>     double Bx, double By, double Bz,
>     double Cx, double Cy, double Cz,
>     double _X, double _Z)
> {
>  double _A, _B, _C, _D;
>
>    _A = (Ay-Cy)*(Bz-Cz) - (Az-Cz)*(By-Cy);
>    _B = (Az-Cz)*(Bx-Cx) - (Ax-Cx)*(Bz-Cz);
>    _C = (Ax-Cx)*(By-Cy) - (Ay-Cy)*(Bx-Cx);
>    _D = _A*Ax + _B*Ay + _C*Az;
>    return (_D - _A*_X - _C*_Z) / _B;
> }
>
> --
> David Fontaine  <dav### [at] faricynet>  ICQ 55354965
> My raytracing gallery:  http://davidf.faricy.net/

--
Bryan Valencia
www.eloan.com
925-560-2661


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.