POV-Ray : Newsgroups : povray.binaries.images : Not a Sphere (91K) : Re: Not a Sphere (91K) Server Time
20 Nov 2024 06:32:06 EST (-0500)
  Re: Not a Sphere (91K)  
From: Tor Olav Kristensen
Date: 1 Oct 2001 19:49:20
Message: <3BB900F2.768C633C@hotmail.com>
Tor Olav Kristensen wrote:
> 
> Lovely shape !
> 
> Here's a way to make a sphere with your boxes:
> 
> #version 3.1;
> 
> #include "colors.inc"
> #include "golds.inc"
> 
> #declare Cx = -pi;
> #declare Step = pi/30;
> #while(Cx < pi)
>  #declare Cy = -pi;
>  #while(Cy < pi)
>    box {
>      -<1, 1, 1>, <1, 1, 1>
>      scale 0.04
>      translate -y
>      rotate <degrees(Cx), degrees(Cy), 0>
>      texture { T_Gold_3C }
>    }
>    #declare Cy = Cy + Step;
>  #end // while
>  #declare Cx = Cx + Step;
> #end // while
> 
> light_source { <-2, 1, -2> color White }
> 
> background { color Blue/2 }
> 
> camera {
>   location -3*z
>   look_at <0, 0, 0>
> }


Hmmm... That will make the boxes double up.

You better change the loop part to this:

#declare Step = pi/30;
#declare Cx = 0;
#while(Cx < pi)
  #declare Cy = -pi;
  #while(Cy < pi)
    box {
      -<1, 1, 1>, <1, 1, 1>
      scale 0.04
      translate y
      rotate <degrees(Cx), degrees(Cy), 0>
      texture { T_Gold_3C }
    }
    #declare Cy = Cy + Step;
  #end // while
  #declare Cx = Cx + Step;
#end // while


Tor Olav


Post a reply to this message

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