POV-Ray : Newsgroups : povray.general : Question : Re: Question Server Time
16 Nov 2024 03:22:17 EST (-0500)
  Re: Question  
From: coste
Date: 1 Feb 2001 17:57:30
Message: <3A79E967.F851B3E5@noos.fr>
#macro cercle(nbsph)

 #declare fin=1
 #declare pas=fin/nbsph;
 #declare dim=2.5
 #declare compt=0

object{union{
  #while (compt<=fin)
      #if (compt<(fin/2))
                 #declare bleu=(2*compt)/fin
                 #declare rouge=1-(2*compt)/fin
      #else
                 #declare bleu=2-(2*compt)/fin
                 #declare rouge=(2*compt)/fin-1
      #end
      sphere  {  <dim*cos(2*pi*compt/fin), dim*sin(2*pi*compt/fin), 0> 0.125
pigment {rgb<rouge,0,bleu>}}

      #declare compt=compt+pas;
  #end //---------- de While

 } // de union
 } // de object
#end //------------ de Macro plante









object {cercle(100) rotate <0,0,-90>}

//-------------------------------- fin


it's better like this...




> Try this...
>
> Replace:
> >         #if(Count <= 18)
> >              color < (1-.027*(2*Count)), 0, ((2*Count)*.027)>
> >         #else
> >              color < abs(1-((2*Count)*.027)), 0, ((Count)*.027) >
>
> With:
>           #if(Count <= 18)
>                 color <1-(0.0556*Count), 0, 0.0556*Count>
>           #else
>                 color <0.0556*(Count-18), 0, 1-(0.0556*(Count-18))>
>
> To get things more accurate, you could also try replacing the "0.0556" with
> "(1/18)".
> Hope that helps,
>
> Matt


Post a reply to this message

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