POV-Ray : Newsgroups : povray.general : Question : Question Server Time
16 Nov 2024 03:25:02 EST (-0500)
  Question  
From: portelli
Date: 21 Oct 1998 12:41:20
Message: <362D820B.E2082522@pilot.msu.edu>
I'm fairly new to Povray.  Well I'm just actually trying to learn
it.  I'm trying to create a circle of spheres that change color.  I want
it to go from red to blue at the bottom of the loop.  Then from blue to
red.  So it all blends together.  Here is the code i came up with to do
this.  Is there an easier way?  This does not work completely yet I
can't get it to go back to red.

#declare Count = 0 ;
  #while(Count < 36)
      object {YellowSphere
                pigment{
                   #if(Count <= 18)
                        color < (1-.027*(2*Count)), 0, ((2*Count)*.027)>

                   #else

                        color < abs(1-((2*Count)*.027)), 0,
((Count)*.027) >

                   #end}
                rotate z*10*Count

                translate <0, 0, 2>

             }
      #declare Count = Count + 1 ;

  #end


Post a reply to this message

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