POV-Ray : Newsgroups : povray.newusers : Repetition of an object : Re: Repetition of an object Server Time
5 Sep 2024 00:16:23 EDT (-0400)
  Re: Repetition of an object  
From: Peter Popov
Date: 10 Mar 2002 05:55:38
Message: <ieem8u0t8idha84hopud7dounirvola9kr@4ax.com>
On Sat, 9 Mar 2002 21:19:30 -0500, "Parasonic"
<par### [at] parasonicpar> wrote:

>I'm making a wall of boxes (yes, boxes). I have made a set that I could tile
>(like bricks). What do I need to do to repeat this group of objects sevreal
>times?

Use a #while loop. For example, here's your box 5 times along the x
axis.

#declare Brick = box { -1, 1 }

#declare i=0;
#while (i<5)
  object { Box translate 2.1*i*x }
  #declare i=i+1;
#end

If you want to repeat along two axes, for example along a plane, use
nested loops.

>Also, how does the sky sphere work? Someone told me how to get a two-color
>sky sphere:

A sky sphere is nothing but a pigmented background. If there's nothing
else to see, POV will show the sky sphere, if any. If there is no sky
sphere, the background color will be what fills in.

The sky sphere is not an object, so it won't cast shadows and such. It
is also infinitely distant, so nothing will fall behind it.

>Why is the scale 2? Why is the sphere *translated* on y (not rotated, etc)?

Look carefully at the code you posted. You're scaling and translating
the pigment, not the sky sphere itself, and it's perfectly legal to do
so.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

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