POV-Ray : Newsgroups : povray.general : Q: Math : Re: Q: Math Server Time
12 Aug 2024 07:27:39 EDT (-0400)
  Re: Q: Math  
From: Nieminen Mika
Date: 15 Mar 1999 06:18:05
Message: <36ecec6d.0@news.povray.org>
Margus Ramst <mar### [at] peakeduee> wrote:
: Well, it's been a while since I studied it (and I wasn't into POV back
: then). So maybe you remember how to accomplish this: given a normal vector
: and the distance along that normal (like a plane{}), how can I create a
: matrix of, let's say spheres, with their centres lying on that plane?
: Should be some kind of reverse-engineering of the cross product, but what?

  Applying the matrix page:

object
{ ArrayOfSpheresInXZPlane

  translate y*Distance
  #local VX1=y;
  #local VX2=vnormalize(NormalVector);
  #local VY=vcross(VX2,VX1);
  #if (vlength(VY)>0)
    #local VY=vnormalize(VY);
    #local VZ1=vcross(VY,VX1);
    #local VZ2=vcross(VY,VX2);

    matrix < VX1.x, VY.x, VZ1.x,
             VX1.y, VY.y, VZ1.y,
             VX1.z, VY.z, VZ1.z,
                 0     0      0 >
 
    matrix < VX2.x, VX2.y, VX2.z,
              VY.x,  VY.y,  VY.z,
             VZ2.x, VZ2.y, VZ2.z,
                 0,     0,     0 >
  #end
}

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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