|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Okay all, just a little bit of help.. I've been trying to come
up with this formula for a while loop to create a round
set of small cylinders.
I start out with one small cylinder at:
x = 0, y=0, z=-4.5
I know that 1/4 of the way through it should be at
x=4.5, y=0, z=0
1/2 the way through:
x=0, y=0, z=4.5
and 3/4 of the way:
x=-4.5, y=0, z=0
and then back again to:
x=0, y=0, z=-4.5 (However I don't want to go this far
Now I've been trying something like:
(where Offset is the spacing between Cylinders)
#declare X = X + (Offset + .25); (.25 is the circ of the cylinder)
#declare Z = Z + (Offset)
But it doesn't go around, it just makes a bee-ling down the Z axis..
Any help would be lovely.'
Thanks
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
dav### [at] intrepidvoygrcom wrote:
>
> Okay all, just a little bit of help.. I've been trying to come
> up with this formula for a while loop to create a round
> set of small cylinders.
>
> [...]
How about:
#declare Angle=0;
#while (Angle < 2*pi)
#declare Point=<cos(Angle), sin(Angle), 0>;
#declare Angle=Angle+(2*pi/50);
#declare Point2=<cos(Angle), sin(Angle), 0>;
cylinder { Point, Point2, 0.05 }
#end
Note that you can also use 'rotate' instead of trigonometry.
Christoph
--
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other
things on: http://www.schunter.etc.tu-bs.de/~chris/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Wasn't it who wrote:
>Okay all, just a little bit of help.. I've been trying to come
>up with this formula for a while loop to create a round
>set of small cylinders.
>
>I start out with one small cylinder at:
>x = 0, y=0, z=-4.5
>
>I know that 1/4 of the way through it should be at
>x=4.5, y=0, z=0
>
>1/2 the way through:
>x=0, y=0, z=4.5
>
>and 3/4 of the way:
>x=-4.5, y=0, z=0
>
>and then back again to:
>x=0, y=0, z=-4.5 (However I don't want to go this far
>
>Now I've been trying something like:
>(where Offset is the spacing between Cylinders)
>
>#declare X = X + (Offset + .25); (.25 is the circ of the cylinder)
>#declare Z = Z + (Offset)
>
>But it doesn't go around, it just makes a bee-ling down the Z axis..
>
I'd do it like this: Move each cylinder to -4.5*z and then rotate them
around the origin by different amounts.
#declare Height = 1; // Length of each cylinder
#declare Radius = 0.2; // Radius of each cylinder
#declare Separation = 10; // degrees
#declare A=0;
#while (A<360)
cylinder {<0,0,0>,<0,Height,0>,Radius
pigment {rgb 1}
translate -4.5*z
rotate y*A
}
#declare A=A+Separation;
#end
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
DuH!..
Is see now.. I wasn't even think cos, and sin..
And I didn't EVER think of rotate, rotate might be nicer on the loop.
Thanks all
Christoph Hormann <chr### [at] gmxde> wrote:
> dav### [at] intrepidvoygrcom wrote:
>>
>> Okay all, just a little bit of help.. I've been trying to come
>> up with this formula for a while loop to create a round
>> set of small cylinders.
>>
>> [...]
> How about:
> #declare Angle=0;
> #while (Angle < 2*pi)
> #declare Point=<cos(Angle), sin(Angle), 0>;
> #declare Angle=Angle+(2*pi/50);
> #declare Point2=<cos(Angle), sin(Angle), 0>;
> cylinder { Point, Point2, 0.05 }
> #end
> Note that you can also use 'rotate' instead of trigonometry.
> Christoph
> --
> Christoph Hormann <chr### [at] gmxde>
> IsoWood include, radiosity tutorial, TransSkin and other
> things on: http://www.schunter.etc.tu-bs.de/~chris/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|