POV-Ray : Newsgroups : povray.general : Mathematics help needed, please. : Re: Mathematics help needed, please. Server Time
12 Aug 2024 13:20:35 EDT (-0400)
  Re: Mathematics help needed, please.  
From: Nieminen Mika
Date: 11 Feb 1999 14:47:20
Message: <36c333c8.0@news.povray.org>
gemelli david <gem### [at] imerirassofr> wrote:
: #declare xpos = xPoint2 - xPoint1;
: #declare ypos = yPoint2 - yPoint1;
: #declare zpos = zPoint2 - zPoint1;
: #declare incx = xpos / NbSpheres;
: #declare incy = ypos / NbSpheres;
: #declare incz = zpos / NbSpheres;
: #declare i = 1;
: #while (i < NbSpheres)
:     #declare xpos = xPoint1 + (incx * i);
:     #declare ypos = yPoint1 + (incy * i);
:     #declare zpos = zPoint1 + (incz * i);
:     sphere {<xpos, ypos,zpos>, Radius ... }
:     #declare i = i + 1;
: #end

  Or more briefly:

(Point1 and Point2 are vectors)

#declare pos=Point2-Point1;
#declare inc=pos/NbSpheres;
#declare i=0;
#while(i<NbSpheres)
  sphere { Point1+inc*i, Radius }
  #declare i=i+1;
#end

-- 
main(i){char*_="BdsyFBThhHFBThhHFRz]NFTITQF|DJIFHQhhF";while(i=
*_++)for(;i>1;printf("%s",i-70?i&1?"[]":" ":(i=0,"\n")),i/=2);} /*- Warp -*/


Post a reply to this message

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