POV-Ray : Newsgroups : povray.general : Variable #points in PRISM : Re: Variable #points in PRISM Server Time
4 Aug 2024 02:21:28 EDT (-0400)
  Re: Variable #points in PRISM  
From: ABX
Date: 7 Aug 2003 05:01:35
Message: <m454jvgss3ts3ohbn35la7mc6rkb6btofc@4ax.com>
On Wed,  6 Aug 2003 22:57:21 EDT, "BorisW37" <Bor### [at] yahoocom> wrote:

>I am making a macro that would draw Prisms with a variable number (N) of
>points (set in macro properties).
>Points are going to be generated by a certain formula.
>How do i go about descrbibing such a prism?

#macro Formula(n)
  // calculate n-th point
  <n-th point>
#end

prism {
  linear_sweep
  linear_spline
  -0.5,
   0.5,
  N,
  #local C=0;
  #while(C<N)
    Formula(N)
    #local C=C+1;
  #end
}

ABX


Post a reply to this message

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