POV-Ray : Newsgroups : povray.general : Repeating a sphere over 360 degrees? Server Time
10 Aug 2024 07:16:54 EDT (-0400)
  Repeating a sphere over 360 degrees? (Message 1 to 2 of 2)  
From: Paul
Subject: Repeating a sphere over 360 degrees?
Date: 27 Feb 2000 11:59:48
Message: <38b95804@news.povray.org>
How can I create a scene where an object (like a sphere) is repeated over
360 degrees in a circular pattern? I basically want to produce a scene with
multiple reflective spheres and several colored light sources, so that when
I produce an animation the camera rotates to reveal spheres that reflect
differing colors as the camera rotates.

Please e-mail me any useful source code.

Thanks


Post a reply to this message

From: Chris Huff
Subject: Re: Repeating a sphere over 360 degrees?
Date: 27 Feb 2000 12:50:25
Message: <chrishuff_99-73402E.12515427022000@news.povray.org>
In article <38b95804@news.povray.org>, "Paul" <ran### [at] freenetcouk> 
wrote:

> How can I create a scene where an object (like a sphere) is repeated 
> over 360 degrees in a circular pattern? I basically want to produce a 
> scene with multiple reflective spheres and several colored light 
> sources, so that when I produce an animation the camera rotates to 
> reveal spheres that reflect differing colors as the camera rotates.

You need to use a #while() loop to do this efficiently, it is documented 
in the manual which comes with POV-Ray. Try something like this:

#declare Cntr = 0;// the counter variable
#while(Cntr < 18)// Repeat everything between this and it's 
                 // matching #end while the variable Cntr is
                 // less than 18.
    sphere {< 5, 0, 0>, 1
        texture {...}
        rotate < 0, Cntr*360/18, 0>
              //rotate by an amount depending on Cntr
    }
    
    #declare Cntr = Cntr + 1;// Add 1 to the value of Cntr.
             // If this is not done, it will try to loop forever.
#end

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

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