Re: [Plib-devel] Releasing PLIB 1.2 *soon*.
Brought to you by:
sjbaker
From: <Va...@t-...> - 2000-04-01 22:18:39
|
Steve Baker wrote: > > A not-normalized normal is a vector and a normalized vector is > a normal - so I find the names a bit confusing. A normal is a vector that decribes the 'direction' of a plane. So if you have got a 4th number you could write the plane equation (A x1 + B x2 + C x3 + D = 0 with A, B and C defining the normal) A normalized vector is a unit vector (i.e. legth == 1.0). This was that I thought of. But you are right it's confusing, it should be e.g. sgProjectOnUnitVector3 > I'm not quite sure what you intend these to do With this misunderstanding it's obvious that you don't know it... > but how about > > sgProjectVec3OntoPlane this would be the sgProjectOnNormal3 as the normal is defining the plane > sgProjectNormal3OntoPlane this wouldn't make sense as the resuld would be a zero vector... Yesterdy I've sent you the code (+ a patch a short time after I've sent the code) privately. It comes with descriptions of the functions. But please change the names to something less confusing (and update the CVS as I don't have SSH). For the interested here are the descriptions: // sgProjectOn[Normalized]VecX ( sgVecX dst, const sgVecX src1, const sgVecX src2 ) // // calculate the projection of src2 onto src1: // _ // /| // src2 / : // / : // / : // -------->--------------> // dst src1 // // src1 o src2 // dst = ----------- * src1 // ( src1 )^2 // sgProjectOnNormal3 ( sgVec3 dst, const sgVec3 src1, const sgVec3 src2 ) // // calculate the projection of src2 onto a plane that is specified by src1, // its normal vector // // This works by calculating temp, a vector that lies on the plane and has the // direction of the projected vector and then do the same stuff as above // // temp o src2 // temp = ( src1 x src2 ) x src1; dst = ----------- * temp // ( temp )^2 CU, Christian |