![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Tor Olav Kristensen wrote:
>...
> #declare Step = 360/60;
>
> #declare Cx = 0;
> #while(Cx < 180)
> sphere {
> <0, 1, 0>, 0.06
> rotate Cx*x
> texture { T_Gold_3C }
> }
> #declare Cx = Cx + Step;
> #end // while
>...
I just also wanted to mention
that the code below does the same
as the above code.
#declare MySphere =
sphere {
<0, 0, 0>, 0.06
texture { T_Gold_3C }
}
#declare Cx = 0;
#while(Cx < 180)
object {
MySphere
translate y
rotate Cx*x
}
#declare Cx = Cx + 6;
#end // while
If you like, you can write
rotate <Cx, 0, 0> instead of
rotate Cx*x
(Note that when using other
textures, that are not the same
at every point in 3D-space, the
result from the two examples
above will become different.)
Tor Olav
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> "Arie L. Stavchansky" <nat### [at] hotmail com> wrote
> > I know it is alot to ask, but can you please explain this code and
> > algorithm in English? I don't have a very strong math background
> > and would like to understand how it is done. This is amazing stuff!
Bill DeWitt wrote:
>
> RTFM
>
> The short version is this.
> "#declare Cx" means create a variable
> "#while" means start a conditional loop
> "box" means make a box at the location set up by the math
> "#declare Cx = CX + Step" increments the variable
> "#end" sends it back to the #while until the condition is fulfilled
>
> Everything else is gravy.
Arie asked for help with the math, not the programming syntax.
--
Anton Sherwood
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Anton Sherwood" <bro### [at] pobox com> wrote in message
news:3BD9127D.2C0DF43A@pobox.com...
> > "Arie L. Stavchansky" <nat### [at] hotmail com> wrote
> > > I know it is alot to ask, but can you please explain this code and
> > > algorithm in English?
> Arie asked for help with the math, not the programming syntax.
Seems to me he asked for both. But since you went to such great lengths
to provide help for the math, I saw that all that was left needing was help
with the code. Together we made a great team, don't you think.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> "Anton Sherwood" <bro### [at] pobox com> wrote
> > Arie asked for help with the math, not the programming syntax.
Bill DeWitt wrote:
> Seems to me he asked for both. But since you went to such great
> lengths to provide help for the math, . . .
it must be said: that was TOK, not me
--
Anton Sherwood
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |