POV-Ray : Newsgroups : povray.binaries.images : Smooth Triangle. (107kbs) : Re: Smooth Triangle. (107kbs) Server Time
20 Nov 2024 08:23:10 EST (-0500)
  Re: Smooth Triangle. (107kbs)  
From: Trevor Quayle
Date: 13 Sep 2001 17:04:16
Message: <3ba11f50$1@news.povray.org>
try loops and macros

i.e.:

#macro SphereLine (startpt,endpt,rad,nsegments)
    union{
      #local i=0;
      #local seglen=(endpt-startpt)/nsegments;
      #while (i<=nsegments)
          sphere{0 rad translate startpt+seglen*i}
          #local i=i+1;
      #end
  }
#end


use like:
object{SphereLine(<-5,0,-5>,<2,1,2>,0.25,100) texture{MyTexture}}

creates a line from pt1 to pt2 using 100 evenly spaced spheres of radius
0.25

-tgq

"25ct" <25c### [at] lineonenet> wrote in message news:3ba1120e@news.povray.org...
>
> "D. Stark - eSN" <dms### [at] esupportnowcom> wrote in message
> news:3BA### [at] esupportnowcom...
> > 25ct wrote:
> > >
> > >   Patience is a virtue they say. Well I tested my patience with this
> one!
> > > :)
> > >
> > >   Again, the dreaded spheres - 323 of them.
> > >
> > >   Is there a way to 'compact' the code to do this sort of thing?
> > >   I moved the spheres in increments of .01.
> >
> > You did it...by hand?!
>
>     Well, 'cut and pasting', but yes it's one long code! :)
>
>
> >
> > Povray has macros and loops structures. I've not used them yet (I'm
> > still trying to keep track of a few dozen primitives), but that's what
> > they're there for.
>
>     Ah, that's what they're for. Thanks. I haven't a clue how to use them
> though, can anyone explain?
>
>   ~Steve~
>
>
> >
> > Derek Stark
>
>


Post a reply to this message

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