POV-Ray : Newsgroups : povray.general : Spiraling objects. : Re: Spiraling objects. Server Time
10 Aug 2024 01:24:15 EDT (-0400)
  Re: Spiraling objects.  
From: Marc Schimmler
Date: 31 Mar 2000 14:53:18
Message: <38E5049D.63ABD291@ica.uni-stuttgart.de>
Wil Hale wrote:
> 
> I thinks this is too advanced to put in new users so here it is.
> 
> Been trying to figure out how to do a spiral of spheres (or boxes or
> anything)  Starting with a close sphere and generating the other spheres at
> appropriate xyz locations depending on whether i wanted the spiral to move
> away or closer.
> 
> It seems I could do this with a #while statement but the coding eludes me.
> 
> Thanks in advance...
> wil hale
> whh### [at] nvlarmymil

Hi Wil!

You are right about the #while statement.

Example


camera {location <0,0,0>
         look_at <0,0,10>  // look along the z axis}

light_source {<10,10,10> rgb 1}

#declare spiral_rad = 3.0;
#declare ax_step = 1/10;

#declare count = 0;
#while (count < 100)
 sphere {0,1 pigment{rgb <1,0,0>}  // sphere in origin radius 1
  translate <spiral_rad,0,0>       // spiral radius 
  rotate <0,count*10,0>            // eache sphere is rotate 10 degrees
  translate <0,0,ax_step>}         // per count move sphere 1/10 along 
                                   //the axis
 #declare count = count + 1;
#end 

I hope this one helps (and that I made no typos ...).

Marc
--
Marc Schimmler


Post a reply to this message

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