POV-Ray: 繰り返し


繰り返し loop1.pov


loop1.pov
#include "colors.inc"
#include "shapes.inc"
#include "komuro.inc"

camera {
  location <10,5,-10>
  look_at <0,0,0>
  angle 20
}

light_source {
  <-3,10,-10>
 color 1.5 * White
}

object { XYZaxis }

#declare Kara = -2;
#declare Made = 2;

#declare T = Kara;
#while (T < Made)
  #declare X = T;
  #declare Y = -1/2 + X * X;
  object {
    Sphere
    pigment { color Green }
    scale 0.15
    translate <X,Y,0>
  }
  #declare T = T + 0.02;
#end

繰り返し loop2.pov


loop2.pov
#include "colors.inc"
#include "shapes.inc"
#include "komuro.inc"

camera {
  location <10,5,-10>
  look_at <0,0,0>
  angle 20
}

light_source {
  <-3,10,-10>
 color 1.5 * White
}

object { XYZaxis }

#declare Kara = -6;
#declare Made = 6;

#declare T = Kara;
#while (T < Made)
  #declare X = cos(T*pi);
  #declare Y = sin(T*pi);
  #declare Z = T / 3;
  object {
    Sphere
    pigment { color Green }
    scale 0.15
    translate <X,Y,Z>
  }
  #declare T = T + 0.02;
#end