POV-Ray : Newsgroups : povray.binaries.images : Spiral wrapped around a sphere. How? : Re: Spiral wrapped around a sphere. How? Server Time
16 Aug 2024 12:21:08 EDT (-0400)
  Re: Spiral wrapped around a sphere. How?  
From: Tor Olav Kristensen
Date: 3 Feb 2002 22:09:40
Message: <3C5DFAD7.DE3572E7@hotmail.com>
Shay wrote:
> 
> I'm sorry. 3*pi/4 should have been 3*pi/2
> You don't need to translate the spiral any along the y-axis. Setting x and y
> to the cos and sin of the angle will do that for you.
> The formula itself zill make a half-moon arc. Rotating each sphere some will
> give you the twist.
> Like this:
> #declare MinRad = pi/2;
> #declare MaxRad = (3*pi/2);
> #declare Test =
> union {
>    #while (MinRad < MaxRad)
>       object {sphere {<0,0,0>, 0.01 translate <cos(MinRad)*1, sin(MinRad)*1,
> 0> rotate y*degrees(MinRad)*20 pigment {rgb <1,0,0>}}}
>    #declare MinRad = MinRad + 0.0001;
>    #end
> }
> 
> object {Test /*rotate x * -90 translate <0,-2,0>*/}
> 
> #declare MinRad = pi/2;
> #declare MaxRad = (3*pi/2);
> #declare Test =
> union {
>    #while (MinRad < MaxRad)
>       object {sphere {<0,0,0>, 0.01 translate <cos(MinRad)*1, sin(MinRad)*1,
> 0> rotate y*degrees(MinRad)*20 pigment {rgb <1,0,0>}}}
>    #declare MinRad = MinRad + 0.0001;
>    #end
> }


Also try this:


#declare SphereRadius = 1.5;
#declare SpiralRadius = 0.05;
#declare NrOfTurns = 5;
#declare NrOfSpheres = 1000;

#declare dAngle = 180/NrOfSpheres;

#declare SphereSpiral =
union {
  #declare Cnt = 0;
  #while (Cnt < NrOfSpheres)
    sphere {
      -SphereRadius*y, SpiralRadius
      rotate Cnt*dAngle*<1, 2*NrOfTurns, 0>
    }
    #declare Cnt = Cnt + 1;
  #end // while
}

object {
  SphereSpiral
  pigment { color rgb <1, 1, 1> }
}

light_source { <-2, 2, -3>*10 color rgb <1, 1, 1> }

camera {
  location <0, 1, -2>*2
  look_at <0, 0, 0>
}


Tor Olav


Post a reply to this message

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